]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/spinbutt.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSpinButton class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_SPINBUTT_H_
13 #define _WX_SPINBUTT_H_
16 #pragma interface "spinbutt.h"
19 #include "wx/control.h"
23 The wxSpinButton is like a small scrollbar than is often placed next
26 wxSP_HORIZONTAL: horizontal spin button
27 wxSP_VERTICAL: vertical spin button (the default)
28 wxSP_ARROW_KEYS: arrow keys increment/decrement value
29 wxSP_WRAP: value wraps at either end
32 class WXDLLEXPORT wxSpinButton
: public wxControl
34 DECLARE_DYNAMIC_CLASS(wxSpinButton
)
42 inline wxSpinButton(wxWindow
*parent
, wxWindowID id
= -1, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
43 long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton")
45 Create(parent
, id
, pos
, size
, style
, name
);
49 bool Create(wxWindow
*parent
, wxWindowID id
= -1, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
50 long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton");
54 ////////////////////////////////////////////////////////////////////////////
56 int GetValue() const ;
57 void SetValue(int val
) ;
58 void SetRange(int minVal
, int maxVal
) ;
59 inline int GetMin() const { return m_min
; }
60 inline int GetMax() const { return m_max
; }
63 ////////////////////////////////////////////////////////////////////////////
65 void Command(wxCommandEvent
& event
) { ProcessCommand(event
); };
74 #define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
75 #define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
77 #define EVT_SPIN(id, func) \
78 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
79 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
80 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
81 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
82 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
83 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
84 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },