]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/gtk1/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__
19 #include "wx/object.h"
20 #include "wx/control.h"
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 class wxSpinButton
: public wxControl
35 DECLARE_DYNAMIC_CLASS(wxSpinButton
)
39 inline wxSpinButton( wxWindow
*parent
, wxWindowID id
= -1,
40 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
41 long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton")
43 Create(parent
, id
, pos
, size
, style
, name
);
46 bool Create( wxWindow
*parent
, wxWindowID id
= -1,
47 const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
48 long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton" );
51 void SetValue( int value
);
52 void SetRange( int minVal
, int maxVal
);
58 void OnSize( wxSizeEvent
&event
);
60 bool IsOwnGtkWindow( GdkWindow
*window
);
61 void ApplyWidgetStyle();
63 GtkAdjustment
*m_adjust
;
66 DECLARE_EVENT_TABLE();
69 //-----------------------------------------------------------------------------
71 //-----------------------------------------------------------------------------
73 class wxSpinEvent
: public wxScrollEvent
75 DECLARE_DYNAMIC_CLASS(wxSpinEvent
)
78 wxSpinEvent(wxEventType commandType
= wxEVT_NULL
, int id
= 0);
81 typedef void (wxEvtHandler::*wxSpinEventFunction
)(wxSpinEvent
&);
85 #define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
86 #define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
88 #define EVT_SPIN(id, func) \
89 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
90 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
91 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
92 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
93 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
94 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
95 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },