00001 /* 00002 File : numberrange_t.h 00003 Date : 19-Sep-02 00004 Description : Class to represent a number range 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 numberrange_t_h 00025 #define numberrange_t_h 00026 00027 // Include alexlib header files 00028 #ifndef gadget_t_h 00029 #include "gadget_t.h" 00030 #endif 00031 #ifndef gadget_w_caret_h 00032 #include "gadget_w_caret.h" 00033 #endif 00034 #ifndef numberrange_b_h 00035 #include "numberrange_b.h" 00036 #endif 00037 00038 // A class to represent a number range gadget template 00039 class numberrange_t : public virtual gadget_b, 00040 public gadget_t, 00041 public numberrange_b, 00042 public gadget_w_caret 00043 { 00044 public: 00045 00046 /* 00047 Parameters : void 00048 Returns : - 00049 Description : Constructor function. 00050 */ 00051 numberrange_t(); 00052 00053 /* 00054 Parameters : value - The number to set. 00055 Returns : numberrange_t - This object. 00056 Description : Set the value of this gadget. To reduce flicker the value 00057 is not updated unless it has changed. 00058 */ 00059 numberrange_t &operator=(int value); 00060 00061 protected: 00062 00063 /* 00064 Parameters : value - The number to set. 00065 Returns : void 00066 Description : Gadget specific function to set the value. 00067 */ 00068 virtual void _set_value(int value); 00069 00070 /* 00071 Parameters : void 00072 Returns : int - The value 00073 Description : Gadget specific function to get the value. 00074 */ 00075 virtual int _get_value() const; 00076 00077 /* 00078 Parameters : lower - The lower bound. 00079 Returns : void 00080 Description : Gadget specific function to set the lower bound. 00081 */ 00082 virtual void _set_lower_bound(int lower); 00083 00084 /* 00085 Parameters : void 00086 Returns : int - The lower bound. 00087 Description : Gadget specific function to get the lower bound. 00088 */ 00089 virtual int _get_lower_bound() const; 00090 00091 /* 00092 Parameters : upper - The upper bound. 00093 Returns : void 00094 Description : Gadget specific function to set the upper bound. 00095 */ 00096 virtual void _set_upper_bound(int upper); 00097 00098 /* 00099 Parameters : void 00100 Returns : int - The upper bound. 00101 Description : Gadget specific function to get the upper bound. 00102 */ 00103 virtual int _get_upper_bound() const; 00104 00105 /* 00106 Parameters : step - The step size. 00107 Returns : void 00108 Description : Gadget specific function to set the step size. 00109 */ 00110 virtual void _set_step_size(int step); 00111 00112 /* 00113 Parameters : void 00114 Returns : int - The step size. 00115 Description : Gadget specific function to get the step size. 00116 */ 00117 virtual int _get_step_size() const; 00118 00119 /* 00120 Parameters : precision - The precision. 00121 Returns : void 00122 Description : Set the precision. 00123 */ 00124 virtual void _set_precision(int precision); 00125 00126 /* 00127 Parameters : void 00128 Returns : int - The precision. 00129 Description : Get the precision. 00130 */ 00131 virtual int _get_precision() const; 00132 00133 /* 00134 Parameters : component - The component ID of the previous field. 00135 Returns : void 00136 Description : Set the component ID of the writable field before this 00137 one. 00138 */ 00139 virtual void _set_before(toolbox_c component); 00140 00141 /* 00142 Parameters : void 00143 Returns : toolbox_c - The component ID of the previous field. 00144 Description : Get the component ID of the writable field before this 00145 one. 00146 */ 00147 virtual toolbox_c _get_before() const; 00148 00149 /* 00150 Parameters : component - The component ID of the next field. 00151 Returns : void 00152 Description : Set the component ID of the writable field after this 00153 one. 00154 */ 00155 virtual void _set_after(toolbox_c component); 00156 00157 /* 00158 Parameters : void 00159 Returns : toolbox_c - The component ID of the next field. 00160 Description : Get the component ID of the writable field after this 00161 one. 00162 */ 00163 virtual toolbox_c _get_after() const; 00164 }; 00165 00166 #endif
1.3.3