00001 /* 00002 File : radiobutton_t.h 00003 Date : 19-Sep-02 00004 Description : Class to represent a radio button toolbox gadget template. 00005 00006 Copyright © 1995-2002 Alexander Thoukydides 00007 00008 This program is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU General Public License 00010 as published by the Free Software Foundation; either version 2 00011 of the License, or (at your option) any later version. 00012 00013 This program is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 GNU General Public License for more details. 00017 00018 You should have received a copy of the GNU General Public License 00019 along with this program; if not, write to the Free Software 00020 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00021 */ 00022 00023 // Only include header file once 00024 #ifndef radiobutton_t_h 00025 #define radiobutton_t_h 00026 00027 // Include alexlib header files 00028 #ifndef gadget_t_h 00029 #include "gadget_t.h" 00030 #endif 00031 #ifndef radiobutton_b_h 00032 #include "radiobutton_b.h" 00033 #endif 00034 00035 // A class to represent a radio button gadget template 00036 class radiobutton_t : public virtual gadget_b, 00037 public gadget_t, 00038 public radiobutton_b 00039 { 00040 public: 00041 00042 /* 00043 Parameters : void 00044 Returns : - 00045 Description : Constructor function. 00046 */ 00047 radiobutton_t(); 00048 00049 /* 00050 Parameters : group - The group to which this radio button belongs. 00051 Returns : void 00052 Description : Set the group for this radio button. 00053 */ 00054 void set_group(int group); 00055 00056 /* 00057 Parameters : void 00058 Returns : int - The group to which this radio button belongs. 00059 Description : Get the group for this radio button. 00060 */ 00061 int get_group() const; 00062 00063 /* 00064 Parameters : value - The value to set. 00065 Returns : radiobutton_t - This object. 00066 Description : Set the value of this gadget. To reduce flicker the value 00067 is not updated unless it has changed. 00068 */ 00069 radiobutton_t &operator=(bool value); 00070 00071 protected: 00072 00073 /* 00074 Parameters : value - The value to set. 00075 Returns : void 00076 Description : Gadget specific function to set the value. 00077 */ 00078 virtual void _set_value(bool value); 00079 00080 /* 00081 Parameters : void 00082 Returns : bool - The value 00083 Description : Gadget specific function to get the value. 00084 */ 00085 virtual bool _get_value() const; 00086 00087 /* 00088 Parameters : event - The toolbox event code. 00089 Returns : void 00090 Description : Gadget specific function to set the toolbox event code 00091 which will be raised for this gadget. 00092 */ 00093 virtual void _set_event(bits event); 00094 00095 /* 00096 Parameters : void 00097 Returns : bits - The toolbox event code. 00098 Description : Gadget specific function to get the toolbox event code 00099 which will be raised for this gadget. 00100 */ 00101 virtual bits _get_event() const; 00102 00103 /* 00104 Parameters : text - The text string to set. 00105 Returns : void 00106 Description : Gadget specific function to set the text. 00107 */ 00108 virtual void _set_text(const char *text); 00109 00110 /* 00111 Parameters : text - Pointer to buffer to hold the text, or NULL 00112 to read the size of buffer required. 00113 size - The size of the buffer. 00114 Returns : size_t - Number of bytes written to the buffer, or 00115 the buffer size required if NULL passed. 00116 Description : Gadget specific function to get the text or the buffer 00117 size required. 00118 */ 00119 virtual size_t _get_text(char *text, size_t size) const; 00120 }; 00121 00122 #endif
1.3.3