00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CSSPINBX_H__
00021 #define __CSSPINBX_H__
00022
00023 #include "cscomp.h"
00024 #include "cstimer.h"
00025 #include "csiline.h"
00026 #include "csutil/csstrvec.h"
00027
00029 struct csSpinBoxItem
00030 {
00032 char *Value;
00034 int Position;
00035 };
00036
00039 #define CSSB_ITEM_BEFOREALL 0
00040
00041 #define CSSB_ITEM_AFTERALL 999999
00042
00043 struct csSpinBoxLimits
00044 {
00045 int MinValue,MaxValue;
00046 char *ValueFormat;
00047 };
00048
00049 enum
00050 {
00057 cscmdSpinBoxQueryValue = 0x00000A00,
00064 cscmdSpinBoxSetValue,
00072 cscmdSpinBoxInsertItem,
00079 cscmdSpinBoxSetLimits,
00086 cscmdSpinBoxValueChanged
00087 };
00088
00094 class csSpinBox : public csInputLine
00095 {
00096
00097 int Value;
00098
00099 csStrVector Values;
00100
00101 csSpinBoxLimits NumLimits;
00102
00103 int SpinState;
00104
00105 csTicksr *SpinTimer;
00106
00107 int SpinBoxSize;
00108
00109 int AutoRepeats;
00110
00111 public:
00113 csSpinBox (csComponent *iParent,
00114 csInputLineFrameStyle iFrameStyle = csifsThickRect);
00115
00117 virtual ~csSpinBox ();
00118
00120 virtual void Draw ();
00121
00123 virtual bool HandleEvent (iEvent &Event);
00124
00126 void SetLimits (int iMin, int iMax, char *iFormat = "%d");
00127
00134 void SetValue (int iValue);
00135
00137 int InsertItem (char *iValue, int iPosition);
00138
00140 virtual void SetText (const char *iText);
00141
00142 private:
00143
00144 void Spin (int iDelta);
00145
00146 void Spin ();
00147 };
00148
00149 #endif // __CSSPINBX_H__