Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

radiobtngroup.h

00001 /* 00002 * =========================== 00003 * VDK Visual Development Kit 00004 * Version 0.4 00005 * October 1998 00006 * =========================== 00007 * 00008 * Copyright (C) 1998, Mario Motta 00009 * Developed by Mario Motta <mmotta@guest.net> 00010 * 00011 * This library is free software; you can redistribute it and/or 00012 * modify it under the terms of the GNU Library General Public 00013 * License as published by the Free Software Foundation; either 00014 * version 2 of the License, or (at your option) any later version. 00015 * 00016 * This library is distributed in the hope that it will be useful, 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00019 * Library General Public License for more details. 00020 * 00021 * You should have received a copy of the GNU Library General Public 00022 * License along with this library; if not, write to the Free Software 00023 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00024 * 02111-1307, USA. 00025 */ 00026 00027 00028 #ifndef RADIOBTNGROUP_H 00029 #define RADIOBTNGROUP_H 00030 #include <vdk/widcontain.h> 00031 #include <vdk/checkbutton.h> 00032 #include <vdk/eventbox.h> 00033 #include <vdk/vdkprops.h> 00034 class VDKRadioButton; 00035 00036 typedef VDKList<VDKRadioButton> RadioButtonList; 00037 typedef VDKListiterator<VDKRadioButton> RadioButtonListIterator; 00038 00039 class VDKRadioButtonGroup; 00049 class VDKRadioButtonGroup: public VDKObjectContainer 00050 { 00051 protected: 00052 VDKEventBox *box; 00053 GSList* gs_group; 00054 public: 00055 00056 // properties 00063 VDKReadWriteValueProp<VDKRadioButtonGroup,int> Selected; 00064 00065 00076 RadioButtonList Buttons; 00080 VDKReadOnlyValueProp<VDKRadioButtonGroup, RadioButtonList*> ButtonList; 00086 VDKRadioButtonGroup(VDKForm* owner,int mode = v_box); 00090 ~VDKRadioButtonGroup(){} 00096 void SetDefault(int buttonNumber); 00097 void SetSelected(int index); 00098 int GetSelected() { return Selected; } 00099 void Add(VDKObject* obj, int j = l_justify, 00100 int e = false, int f = false, int p = false); 00105 void RemoveButton(VDKRadioButton* button); 00106 GSList* GsGroup(GSList* gs = NULL) 00107 { if(gs) gs_group = gs; return gs_group; } 00111 VDKEventBox* GBox() { return box; } 00112 static void ToggleEvent(GtkWidget *wid, gpointer bn); 00113 }; 00114 00129 class VDKRadioButton: public VDKCheckButton 00130 { 00131 protected: 00132 int buttonId; 00133 VDKRadioButtonGroup *rbgroup; 00134 friend class VDKRadioButtonGroup; 00135 public: 00141 VDKRadioButton(VDKRadioButtonGroup* group, char* label = NULL); 00145 VDKRadioButton(VDKForm* owner,char* label); 00149 virtual ~VDKRadioButton() {} 00153 VDKRadioButtonGroup* Group(VDKRadioButtonGroup* g = NULL) 00154 { if(g) rbgroup = g; return rbgroup; } 00155 00156 }; 00157 00158 #endif 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168

Generated on Tue Aug 17 12:39:50 2004 for vdk 2.4.0 by doxygen 1.3.7