00001 /* 00002 File : optionbutton_t.h 00003 Date : 19-Sep-02 00004 Description : Class to represent an option 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 optionbutton_t_h 00025 #define optionbutton_t_h 00026 00027 // Include alexlib header files 00028 #ifndef gadget_t_h 00029 #include "gadget_t.h" 00030 #endif 00031 #ifndef optionbutton_b_h 00032 #include "optionbutton_b.h" 00033 #endif 00034 00035 // A class to represent an option button gadget template 00036 class optionbutton_t : public virtual gadget_b, 00037 public gadget_t, 00038 public optionbutton_b 00039 { 00040 public: 00041 00042 /* 00043 Parameters : void 00044 Returns : - 00045 Description : Constructor function. 00046 */ 00047 optionbutton_t(); 00048 00049 /* 00050 Parameters : value - The value to set. 00051 Returns : optionbutton_t - This object. 00052 Description : Set the value of this gadget. To reduce flicker the value 00053 is not updated unless it has changed. 00054 */ 00055 optionbutton_t &operator=(bool value); 00056 00057 protected: 00058 00059 /* 00060 Parameters : value - The value to set. 00061 Returns : void 00062 Description : Gadget specific function to set the value. 00063 */ 00064 virtual void _set_value(bool value); 00065 00066 /* 00067 Parameters : void 00068 Returns : bool - The value 00069 Description : Gadget specific function to get the value. 00070 */ 00071 virtual bool _get_value() const; 00072 00073 /* 00074 Parameters : event - The toolbox event code. 00075 Returns : void 00076 Description : Gadget specific function to set the toolbox event code 00077 which will be raised for this gadget. 00078 */ 00079 virtual void _set_event(bits event); 00080 00081 /* 00082 Parameters : void 00083 Returns : bits - The toolbox event code. 00084 Description : Gadget specific function to get the toolbox event code 00085 which will be raised for this gadget. 00086 */ 00087 virtual bits _get_event() const; 00088 00089 /* 00090 Parameters : text - The text string to set. 00091 Returns : void 00092 Description : Gadget specific function to set the text. 00093 */ 00094 virtual void _set_text(const char *text); 00095 00096 /* 00097 Parameters : text - Pointer to buffer to hold the text, or NULL 00098 to read the size of buffer required. 00099 size - The size of the buffer. 00100 Returns : size_t - Number of bytes written to the buffer, or 00101 the buffer size required if NULL passed. 00102 Description : Gadget specific function to get the text or the buffer 00103 size required. 00104 */ 00105 virtual size_t _get_text(char *text, size_t size) const; 00106 }; 00107 00108 #endif
1.3.3