00001 /* 00002 File : displayfield_c.h 00003 Date : 19-Sep-02 00004 Description : Class to represent a display field 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 displayfield_c_h 00025 #define displayfield_c_h 00026 00027 // Include alexlib header files 00028 #ifndef displayfield_b_h 00029 #include "displayfield_b.h" 00030 #endif 00031 #ifndef gadget_t_h 00032 #include "gadget_t.h" 00033 #endif 00034 00035 // A class to represent a display field gadget template 00036 class displayfield_t : public virtual gadget_b, 00037 public gadget_t, 00038 public displayfield_b 00039 { 00040 public: 00041 00042 /* 00043 Parameters : void 00044 Returns : - 00045 Description : Constructor function. 00046 */ 00047 displayfield_t(); 00048 00049 /* 00050 Parameters : value - The text string to set. 00051 Returns : displayfield_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 displayfield_t &operator=(const char *value); 00056 00057 /* 00058 Parameters : value - The text string to set. 00059 Returns : displayfield_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 displayfield_t &operator=(const string &value); 00064 00065 protected: 00066 00067 /* 00068 Parameters : value - The text string to set. 00069 Returns : void 00070 Description : Gadget specific function to set the value. 00071 */ 00072 virtual void _set_value(const char *value); 00073 00074 /* 00075 Parameters : value - Pointer to buffer to hold the value, or NULL 00076 to read the size of buffer required. 00077 size - The size of the buffer. 00078 Returns : size_t - Number of bytes written to the buffer, or 00079 the buffer size required if NULL passed. 00080 Description : Gadget specific function to get the value or the buffer 00081 size required. 00082 */ 00083 virtual size_t _get_value(char *value, size_t size) const; 00084 }; 00085 00086 #endif
1.3.3