1 /*
2 * ===========================
3 * VDK Visual Development Kit
4 * Version 0.4
5 * October 1998
6 * ===========================
7 *
8 * Copyright (C) 1998, Mario Motta
9 * Developed by Mario Motta <mmotta@guest.net>
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24 * 02111-1307, USA.
25 */
26
27 #include "vdk/boxes.h"
28 #include "vdk/forms.h"
29
VDKBox(VDKForm * owner,int mode)30 VDKBox::VDKBox(VDKForm* owner,int mode)
31 :VDKObjectContainer(owner)
32 {
33 switch(mode)
34 {
35 case v_box:
36 widget = gtk_vbox_new(FALSE,0);
37 break;
38 case h_box:
39 widget = gtk_hbox_new(FALSE,0);
40 break;
41 default:
42 widget = gtk_vbox_new(FALSE,0);
43 }
44 }
45
46
~VDKBox()47 VDKBox::~VDKBox()
48 {
49 }
50
Add(VDKObject * obj,int justify,int expand,int fill,int padding)51 void VDKBox::Add(VDKObject* obj, int justify,
52 int expand, int fill , int padding)
53 {
54
55 switch(justify)
56 {
57 case l_justify:
58 gtk_box_pack_start(GTK_BOX(widget), obj->Widget(),expand,fill,padding);
59 break;
60 case r_justify:
61 gtk_box_pack_end(GTK_BOX(widget), obj->Widget(),expand,fill,padding);
62 break;
63 default:
64 gtk_box_pack_start(GTK_BOX(widget), obj->Widget(),expand,fill,padding);
65 }
66 // calls ancestor (B.Liskov docet...)
67 VDKObjectContainer::Add(obj,0,0,0,0);
68 }
69
70
71
72