00001 /* 00002 File : optionbutton_c.h 00003 Date : 19-Sep-02 00004 Description : Class to represent an option button toolbox gadget. 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_c_h 00025 #define optionbutton_c_h 00026 00027 // Include alexlib header files 00028 #ifndef gadget_c_h 00029 #include "gadget_c.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 00036 class optionbutton_c : public virtual gadget_b, 00037 public gadget_c, 00038 public optionbutton_b 00039 { 00040 public: 00041 00042 /* 00043 Parameters : component - The component ID of this option button. 00044 object - The object ID of this option button's parent 00045 window. 00046 Returns : - 00047 Description : Constructor function. This does not create an 00048 option button; it merely creates an object to represent 00049 the option button. 00050 */ 00051 optionbutton_c(toolbox_c component = toolbox_NULL_COMPONENT, 00052 toolbox_o object = toolbox_NULL_OBJECT); 00053 00054 /* 00055 Parameters : value - The value to set. 00056 Returns : optionbutton_c - This object. 00057 Description : Set the value of this gadget. To reduce flicker the value 00058 is not updated unless it has changed. 00059 */ 00060 optionbutton_c &operator=(bool value); 00061 00062 protected: 00063 00064 /* 00065 Parameters : value - The value to set. 00066 Returns : void 00067 Description : Gadget specific function to set the value. 00068 */ 00069 virtual void _set_value(bool value); 00070 00071 /* 00072 Parameters : void 00073 Returns : bool - The value 00074 Description : Gadget specific function to get the value. 00075 */ 00076 virtual bool _get_value() const; 00077 00078 /* 00079 Parameters : event - The toolbox event code. 00080 Returns : void 00081 Description : Gadget specific function to set the toolbox event code 00082 which will be raised for this gadget. 00083 */ 00084 virtual void _set_event(bits event); 00085 00086 /* 00087 Parameters : void 00088 Returns : bits - The toolbox event code. 00089 Description : Gadget specific function to get the toolbox event code 00090 which will be raised for this gadget. 00091 */ 00092 virtual bits _get_event() const; 00093 00094 /* 00095 Parameters : text - The text string to set. 00096 Returns : void 00097 Description : Gadget specific function to set the text. 00098 */ 00099 virtual void _set_text(const char *text); 00100 00101 /* 00102 Parameters : text - Pointer to buffer to hold the text, or NULL 00103 to read the size of buffer required. 00104 size - The size of the buffer. 00105 Returns : size_t - Number of bytes written to the buffer, or 00106 the buffer size required if NULL passed. 00107 Description : Gadget specific function to get the text or the buffer 00108 size required. 00109 */ 00110 virtual size_t _get_text(char *text, size_t size) const; 00111 }; 00112 00113 /* 00114 Parameters : component - The component ID of this option button. 00115 object - The object ID of this option button's parent 00116 window. 00117 Returns : - 00118 Description : Constructor function. This does not create an 00119 option button; it merely creates an object to represent 00120 the option button. 00121 */ 00122 inline optionbutton_c::optionbutton_c(toolbox_c component, toolbox_o object) 00123 : gadget_c(component, object) {} 00124 00125 #endif
1.3.3