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__
18 #include "wx/control.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 class WXDLLIMPEXP_CORE wxSpinCtrl
: public wxControl
28 wxSpinCtrl(wxWindow
*parent
,
30 const wxString
& value
= wxEmptyString
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 const wxSize
& size
= wxDefaultSize
,
33 long style
= wxSP_ARROW_KEYS
,
34 int min
= 0, int max
= 100, int initial
= 0,
35 const wxString
& name
= _T("wxSpinCtrl"))
37 Create(parent
, id
, value
, pos
, size
, style
, min
, max
, initial
, name
);
40 bool Create(wxWindow
*parent
,
42 const wxString
& value
= wxEmptyString
,
43 const wxPoint
& pos
= wxDefaultPosition
,
44 const wxSize
& size
= wxDefaultSize
,
45 long style
= wxSP_ARROW_KEYS
,
46 int min
= 0, int max
= 100, int initial
= 0,
47 const wxString
& name
= _T("wxSpinCtrl"));
49 void SetValue(const wxString
& text
);
50 void SetSelection(long from
, long to
);
52 virtual int GetValue() const;
53 virtual void SetValue( int value
);
54 virtual void SetRange( int minVal
, int maxVal
);
55 virtual int GetMin() const;
56 virtual int GetMax() const;
58 static wxVisualAttributes
59 GetClassDefaultAttributes(wxWindowVariant variant
= wxWINDOW_VARIANT_NORMAL
);
62 void OnChar( wxKeyEvent
&event
);
64 void GtkDisableEvents();
65 void GtkEnableEvents();
70 virtual wxSize
DoGetBestSize() const;
71 virtual GdkWindow
*GTKGetWindow(wxArrayGdkWindows
& windows
) const;
73 // Widgets that use the style->base colour for the BG colour should
74 // override this and return true.
75 virtual bool UseGTKStyleBase() const { return true; }
78 DECLARE_DYNAMIC_CLASS(wxSpinCtrl
)