00001 /* 00002 File : button_t.h 00003 Date : 19-Sep-02 00004 Description : Class to represent a 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 button_t_h 00025 #define button_t_h 00026 00027 // Include alexlib header files 00028 #ifndef button_b_h 00029 #include "button_b.h" 00030 #endif 00031 #ifndef gadget_t_h 00032 #include "gadget_t.h" 00033 #endif 00034 00035 // A class to represent a button gadget template 00036 class button_t : public virtual gadget_b, 00037 public gadget_t, 00038 public button_b 00039 { 00040 public: 00041 00042 /* 00043 Parameters : void 00044 Returns : - 00045 Description : Constructor function. 00046 */ 00047 button_t(); 00048 00049 /* 00050 Parameters : value - The text string to set. 00051 Returns : button_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 button_t &operator=(const char *value); 00056 00057 /* 00058 Parameters : value - The text string to set. 00059 Returns : button_t - This object. 00060 Description : Set the value of this gadget. To reduce flicker the value 00061 is not updated unless it has changed. 00062 */ 00063 button_t &operator=(const string &value); 00064 00065 protected: 00066 00067 /* 00068 Parameters : clear - Icon flags to clear. 00069 eor - Icon flags to toggle. 00070 Returns : void 00071 Description : Representation specific function to set the icon flags 00072 for this button. 00073 */ 00074 virtual void _set_icon_flags(wimp_icon_flags clear, wimp_icon_flags eor); 00075 00076 /* 00077 Parameters : void 00078 Returns : wimp_icon_flags - The current icon flags. 00079 Description : Representation specific function to get the icon flags 00080 for this button. 00081 */ 00082 virtual wimp_icon_flags _get_icon_flags() const; 00083 00084 /* 00085 Parameters : validation - The text string to set. 00086 Returns : void 00087 Description : Representation specific function to set the validation 00088 string. 00089 */ 00090 virtual void _set_validation(const char *validation); 00091 00092 /* 00093 Parameters : validation - Pointer to buffer to hold the validation 00094 string, or NULL to read the size of 00095 buffer required. 00096 size - The size of the buffer. 00097 Returns : size_t - Number of bytes written to the buffer, or 00098 the buffer size required if NULL passed. 00099 Description : Representation specific function to get the validation 00100 string or the buffer size required. 00101 */ 00102 virtual size_t _get_validation(char *validation, size_t size) const; 00103 00104 /* 00105 Parameters : value - The text string to set. 00106 Returns : void 00107 Description : Gadget specific function to set the value. 00108 */ 00109 virtual void _set_value(const char *value); 00110 00111 /* 00112 Parameters : value - Pointer to buffer to hold the value, or NULL 00113 to read the size of buffer required. 00114 size - The size of the buffer. 00115 Returns : size_t - Number of bytes written to the buffer, or 00116 the buffer size required if NULL passed. 00117 Description : Gadget specific function to get the value or the buffer 00118 size required. 00119 */ 00120 virtual size_t _get_value(char *value, size_t size) const; 00121 }; 00122 00123 #endif
1.3.3