]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk/spinbutt.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSpinButton class
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef __GTKSPINPUTTH__
12 #define __GTKSPINBUTTH__
22 #include "wx/object.h"
23 #include "wx/control.h"
25 //-----------------------------------------------------------------------------
27 //-----------------------------------------------------------------------------
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 class wxSpinButton
: public wxControl
38 DECLARE_DYNAMIC_CLASS(wxSpinButton
)
42 inline wxSpinButton( wxWindow
*parent
, wxWindowID id
= -1,
43 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
44 long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton")
46 Create(parent
, id
, pos
, size
, style
, name
);
49 bool Create( wxWindow
*parent
, wxWindowID id
= -1,
50 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
51 long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton" );
54 void SetValue( int value
);
55 void SetRange( int minVal
, int maxVal
);
61 void OnSize( wxSizeEvent
&event
);
63 bool IsOwnGtkWindow( GdkWindow
*window
);
64 void ApplyWidgetStyle();
66 GtkAdjustment
*m_adjust
;
72 //-----------------------------------------------------------------------------
74 //-----------------------------------------------------------------------------
76 class wxSpinEvent
: public wxScrollEvent
78 DECLARE_DYNAMIC_CLASS(wxSpinEvent
)
81 wxSpinEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
84 typedef void (wxEvtHandler::*wxSpinEventFunction
)(wxSpinEvent
&);
88 #define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
89 #define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
91 #define EVT_SPIN(id, func) \
92 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
93 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
94 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
95 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
96 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
97 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
98 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },