1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSpinCtrl class
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_GTK_SPINCTRL_H_
12 #define _WX_GTK_SPINCTRL_H_
14 //-----------------------------------------------------------------------------
16 //-----------------------------------------------------------------------------
18 class WXDLLIMPEXP_CORE wxSpinCtrl
: public wxControl
22 wxSpinCtrl(wxWindow
*parent
,
24 const wxString
& value
= wxEmptyString
,
25 const wxPoint
& pos
= wxDefaultPosition
,
26 const wxSize
& size
= wxDefaultSize
,
27 long style
= wxSP_ARROW_KEYS
,
28 int min
= 0, int max
= 100, int initial
= 0,
29 const wxString
& name
= _T("wxSpinCtrl"))
31 Create(parent
, id
, value
, pos
, size
, style
, min
, max
, initial
, name
);
34 bool Create(wxWindow
*parent
,
36 const wxString
& value
= wxEmptyString
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
39 long style
= wxSP_ARROW_KEYS
,
40 int min
= 0, int max
= 100, int initial
= 0,
41 const wxString
& name
= _T("wxSpinCtrl"));
43 void SetValue(const wxString
& text
);
44 void SetSelection(long from
, long to
);
46 virtual int GetValue() const;
47 virtual void SetValue( int value
);
48 virtual void SetRange( int minVal
, int maxVal
);
49 virtual int GetMin() const;
50 virtual int GetMax() const;
52 static wxVisualAttributes
53 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
56 void OnChar( wxKeyEvent
&event
);
58 void GtkDisableEvents();
59 void GtkEnableEvents();
64 virtual wxSize
DoGetBestSize() const;
65 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
67 // Widgets that use the style->base colour for the BG colour should
68 // override this and return true.
69 virtual bool UseGTKStyleBase() const { return true; }
72 DECLARE_DYNAMIC_CLASS(wxSpinCtrl
)
76 #endif // _WX_GTK_SPINCTRL_H_