]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/spinctrl.h
wxGTK::wxSpinCtrl API synchronised with wxMSW
[wxWidgets.git] / include / wx / gtk1 / spinctrl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: spinctrl.h
3 // Purpose: wxSpinCtrl class
4 // Author: Robert Roebling
5 // Modified by:
6 // RCS-ID: $Id$
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef __GTKSPINCTRLH__
12 #define __GTKSPINCTRLH__
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 //-----------------------------------------------------------------------------
19 // wxSpinCtrl
20 //-----------------------------------------------------------------------------
21
22 class wxSpinCtrl : public wxControl
23 {
24 public:
25 wxSpinCtrl() {}
26 wxSpinCtrl(wxWindow *parent,
27 wxWindowID id = -1,
28 const wxString& value = wxEmptyString,
29 const wxPoint& pos = wxDefaultPosition,
30 const wxSize& size = wxDefaultSize,
31 long style = wxSP_ARROW_KEYS,
32 int min = 0, int max = 100, int initial = 0,
33 const wxString& name = _T("wxSpinCtrl"))
34 {
35 Create(parent, id, value, pos, size, style, min, max, initial, name);
36 }
37
38 bool Create(wxWindow *parent,
39 wxWindowID id = -1,
40 const wxString& value = wxEmptyString,
41 const wxPoint& pos = wxDefaultPosition,
42 const wxSize& size = wxDefaultSize,
43 long style = wxSP_ARROW_KEYS,
44 int min = 0, int max = 100, int initial = 0,
45 const wxString& name = _T("wxSpinCtrl"));
46
47 void SetValue(const wxString& text);
48
49 virtual int GetValue() const;
50 virtual void SetValue( int value );
51 virtual void SetRange( int minVal, int maxVal );
52 virtual int GetMin() const;
53 virtual int GetMax() const;
54
55 // implementation
56 bool IsOwnGtkWindow( GdkWindow *window );
57 void ApplyWidgetStyle();
58
59 GtkAdjustment *m_adjust;
60 float m_oldPos;
61
62 private:
63 DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
64 };
65
66 #endif
67 // __GTKSPINCTRLH__