]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/spinctrl.h
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     wxSpinCtrl class 
   4 // Author:      Robert Roebling 
   7 // Copyright:   (c) Robert Roebling 
   8 // Licence:     wxWindows licence 
   9 ///////////////////////////////////////////////////////////////////////////// 
  11 #ifndef __GTKSPINCTRLH__ 
  12 #define __GTKSPINCTRLH__ 
  14 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 
  22 #include "wx/control.h" 
  24 //----------------------------------------------------------------------------- 
  26 //----------------------------------------------------------------------------- 
  28 class wxSpinCtrl 
: public wxControl
 
  32     wxSpinCtrl(wxWindow 
*parent
, 
  34                const wxString
& value 
= wxEmptyString
, 
  35                const wxPoint
& pos 
= wxDefaultPosition
, 
  36                const wxSize
& size 
= wxDefaultSize
, 
  37                long style 
= wxSP_ARROW_KEYS
, 
  38                int min 
= 0, int max 
= 100, int initial 
= 0, 
  39                const wxString
& name 
= _T("wxSpinCtrl")) 
  41         Create(parent
, id
, value
, pos
, size
, style
, min
, max
, initial
, name
); 
  44     bool Create(wxWindow 
*parent
, 
  46                 const wxString
& value 
= wxEmptyString
, 
  47                 const wxPoint
& pos 
= wxDefaultPosition
, 
  48                 const wxSize
& size 
= wxDefaultSize
, 
  49                 long style 
= wxSP_ARROW_KEYS
, 
  50                 int min 
= 0, int max 
= 100, int initial 
= 0, 
  51                 const wxString
& name 
= _T("wxSpinCtrl")); 
  53     void SetValue(const wxString
& text
); 
  54     void SetSelection(long from
, long to
); 
  56     virtual int GetValue() const; 
  57     virtual void SetValue( int value 
); 
  58     virtual void SetRange( int minVal
, int maxVal 
); 
  59     virtual int GetMin() const; 
  60     virtual int GetMax() const; 
  62     static wxVisualAttributes
 
  63     GetClassDefaultAttributes(wxWindowVariant variant 
= wxWINDOW_VARIANT_NORMAL
); 
  66     void OnChar( wxKeyEvent 
&event 
); 
  68     bool IsOwnGtkWindow( GdkWindow 
*window 
); 
  69     void GtkDisableEvents(); 
  70     void GtkEnableEvents(); 
  72     GtkAdjustment  
*m_adjust
; 
  76     virtual wxSize 
DoGetBestSize() const; 
  78     // Widgets that use the style->base colour for the BG colour should 
  79     // override this and return true. 
  80     virtual bool UseGTKStyleBase() const { return true; } 
  83     DECLARE_DYNAMIC_CLASS(wxSpinCtrl
)