vdk 2.4.0
radiobtngroup.h
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 
28 #ifndef RADIOBTNGROUP_H
29 #define RADIOBTNGROUP_H
30 #include <vdk/widcontain.h>
31 #include <vdk/checkbutton.h>
32 #include <vdk/eventbox.h>
33 #include <vdk/vdkprops.h>
34 class VDKRadioButton;
35 
38 
50 {
51  protected:
52  VDKEventBox *box;
53  GSList* gs_group;
54  public:
55 
56  // properties
63  VDKReadWriteValueProp<VDKRadioButtonGroup,int> Selected;
64 
65 
80  VDKReadOnlyValueProp<VDKRadioButtonGroup, RadioButtonList*> ButtonList;
86  VDKRadioButtonGroup(VDKForm* owner,int mode = v_box);
96  void SetDefault(int buttonNumber);
97  void SetSelected(int index);
98  int GetSelected() { return Selected; }
99  void Add(VDKObject* obj, int j = l_justify,
100  int e = false, int f = false, int p = false);
105  void RemoveButton(VDKRadioButton* button);
106  GSList* GsGroup(GSList* gs = NULL)
107  { if(gs) gs_group = gs; return gs_group; }
111  VDKEventBox* GBox() { return box; }
112  static void ToggleEvent(GtkWidget *wid, gpointer bn);
113 };
114 
130 {
131 protected:
132  int buttonId;
133  VDKRadioButtonGroup *rbgroup;
134  friend class VDKRadioButtonGroup;
135 public:
141  VDKRadioButton(VDKRadioButtonGroup* group, char* label = NULL);
145  VDKRadioButton(VDKForm* owner,char* label);
149  virtual ~VDKRadioButton() {}
154  { if(g) rbgroup = g; return rbgroup; }
155 
156 };
157 
158 #endif
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
VDKEventBox
Definition: eventbox.h:36
VDKObject
Definition: vdkobj.h:137
VDKRadioButtonGroup::Add
void Add(VDKObject *obj, int j=l_justify, int e=false, int f=false, int p=false)
Definition: radiobtngroup.cc:114
VDKCheckButton
this calls provides a check button widget
Definition: checkbutton.h:44
VDKRadioButton::Group
VDKRadioButtonGroup * Group(VDKRadioButtonGroup *g=NULL)
Definition: radiobtngroup.h:153
VDKObjectContainer
Containers base class.
Definition: widcontain.h:39
VDKRadioButton
Provides a radio button.
Definition: radiobtngroup.h:129
VDKRadioButtonGroup::GBox
VDKEventBox * GBox()
Definition: radiobtngroup.h:111
VDKRadioButton::VDKRadioButton
VDKRadioButton(VDKRadioButtonGroup *group, char *label=NULL)
Definition: radiobtngroup.cc:70
VDKRadioButtonGroup::SetDefault
void SetDefault(int buttonNumber)
Definition: radiobtngroup.cc:170
VDKRadioButtonGroup::ButtonList
VDKReadOnlyValueProp< VDKRadioButtonGroup, RadioButtonList * > ButtonList
Definition: radiobtngroup.h:80
VDKRadioButtonGroup
Providesa radio button group.
Definition: radiobtngroup.h:49
VDKList< VDKRadioButton >
VDKForm
VDKForm widgets, generally the outermost widget container.
Definition: forms.h:68
VDKRadioButtonGroup::VDKRadioButtonGroup
VDKRadioButtonGroup(VDKForm *owner, int mode=v_box)
Definition: radiobtngroup.cc:137
VDKRadioButtonGroup::Selected
VDKReadWriteValueProp< VDKRadioButtonGroup, int > Selected
Definition: radiobtngroup.h:63
VDKRadioButtonGroup::~VDKRadioButtonGroup
~VDKRadioButtonGroup()
Definition: radiobtngroup.h:90
VDKRadioButtonGroup::RemoveButton
void RemoveButton(VDKRadioButton *button)
Definition: radiobtngroup.cc:157
VDKRadioButton::~VDKRadioButton
virtual ~VDKRadioButton()
Definition: radiobtngroup.h:149
VDKRadioButtonGroup::Buttons
RadioButtonList Buttons
Definition: radiobtngroup.h:76
VDKListiterator
Provides a VDKList iterator.
Definition: dlist.h:200