CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

csws/csspinbx.h

Go to the documentation of this file.
00001 /*
00002     Crystal Space Windowing System: spin box class
00003     Copyright (C) 1998,1999 by Andrew Zabolotny <bit@eltech.ru>
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018 */
00019 
00020 #ifndef __CS_CSSPINBX_H__
00021 #define __CS_CSSPINBX_H__
00022 
00031 #include "csextern.h"
00032  
00033 #include "cscomp.h"
00034 #include "cstimer.h"
00035 #include "csiline.h"
00036 #include "csutil/stringarray.h"
00037 
00039 struct csSpinBoxItem
00040 {
00042   char *Value;
00044   int Position;
00045 };
00046 
00050 
00051 #define CSSB_ITEM_BEFOREALL     0
00052 
00053 #define CSSB_ITEM_AFTERALL      999999
00054 
00056 
00057 struct csSpinBoxLimits
00058 {
00059   int MinValue,MaxValue;
00060   char *ValueFormat;
00061 };
00062 
00064 enum
00065 {
00072   cscmdSpinBoxQueryValue = 0x00000A00,
00079   cscmdSpinBoxSetValue,
00087   cscmdSpinBoxInsertItem,
00094   cscmdSpinBoxSetLimits,
00101   cscmdSpinBoxValueChanged
00102 };
00103 
00109 class CS_CSWS_EXPORT csSpinBox : public csInputLine
00110 {
00112   int Value;
00114   csStringArray Values;
00116   csSpinBoxLimits NumLimits;
00118   int SpinState;
00120   csTimer *SpinTimer;
00122   int SpinBoxSize;
00124   int AutoRepeats;
00125 
00126 public:
00128   csSpinBox (csComponent *iParent,
00129     csInputLineFrameStyle iFrameStyle = csifsThickRect);
00130 
00132   virtual ~csSpinBox ();
00133 
00135   virtual void Draw ();
00136 
00138   virtual bool HandleEvent (iEvent &Event);
00139 
00141   void SetLimits (int iMin, int iMax, char *iFormat = "%d");
00142 
00149   void SetValue (int iValue);
00150 
00152   int InsertItem (char *iValue, int iPosition);
00153 
00155   virtual void SetText (const char *iText);
00156 
00157 private:
00159   void Spin (int iDelta);
00161   void Spin ();
00162 };
00163 
00166 #endif // __CS_CSSPINBX_H__

Generated for Crystal Space by doxygen 1.2.18