]> git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/spinctrl.h
wxTimer/timercmn.cpp change
[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 void OnChar( wxKeyEvent &event );
57
58 bool IsOwnGtkWindow( GdkWindow *window );
59 void ApplyWidgetStyle();
60
61 GtkAdjustment *m_adjust;
62 float m_oldPos;
63
64 private:
65 DECLARE_DYNAMIC_CLASS(wxSpinCtrl)
66 DECLARE_EVENT_TABLE()
67 };
68
69 #endif
70 // __GTKSPINCTRLH__