]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/spinbutt.h
3b76035ae8a9d371d51277e72660c0c6de68986c
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxSpinButton class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart and Markus Holzem
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "spinbutt.h"
19 #include "wx/control.h"
22 #if defined(__WIN95__)
25 The wxSpinButton is like a small scrollbar than is often placed next
28 wxSP_HORIZONTAL: horizontal spin button
29 wxSP_VERTICAL: vertical spin button (the default)
30 wxSP_ARROW_KEYS: arrow keys increment/decrement value
31 wxSP_WRAP: value wraps at either end
34 class WXDLLEXPORT wxSpinButton
: public wxControl
36 DECLARE_DYNAMIC_CLASS(wxSpinButton
)
44 inline wxSpinButton(wxWindow
*parent
, const wxWindowID id
= -1, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
45 const long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton")
47 Create(parent
, id
, pos
, size
, style
, name
);
51 bool Create(wxWindow
*parent
, const wxWindowID id
= -1, const wxPoint
& pos
= wxDefaultPosition
, const wxSize
& size
= wxDefaultSize
,
52 const long style
= wxSP_VERTICAL
, const wxString
& name
= "wxSpinButton");
56 ////////////////////////////////////////////////////////////////////////////
58 int GetValue(void) const ;
59 void SetValue(const int val
) ;
60 void SetRange(const int minVal
, const int maxVal
) ;
61 inline int GetMin(void) const { return m_min
; }
62 inline int GetMax(void) const { return m_max
; }
65 ////////////////////////////////////////////////////////////////////////////
67 void Command(wxCommandEvent
& event
) { ProcessCommand(event
); };
70 bool MSWCommand(const WXUINT param
, const WXWORD id
);
71 bool MSWNotify(const WXWPARAM wParam
, const WXLPARAM lParam
);
72 void MSWOnVScroll(const WXWORD wParam
, const WXWORD pos
, const WXHWND control
);
73 void MSWOnHScroll(const WXWORD wParam
, const WXWORD pos
, const WXHWND control
);
80 class WXDLLEXPORT wxSpinEvent
: public wxScrollEvent
82 DECLARE_DYNAMIC_CLASS(wxSpinEvent
)
85 wxSpinEvent(WXTYPE commandType
= 0, int id
= 0);
88 typedef void (wxEvtHandler::*wxSpinEventFunction
)(wxSpinEvent
&);
92 #define EVT_SPIN_UP(id, func) { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
93 #define EVT_SPIN_DOWN(id, func) { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func }
95 #define EVT_SPIN(id, func) \
96 { wxEVT_SCROLL_TOP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
97 { wxEVT_SCROLL_BOTTOM, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
98 { wxEVT_SCROLL_LINEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
99 { wxEVT_SCROLL_LINEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
100 { wxEVT_SCROLL_PAGEUP, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
101 { wxEVT_SCROLL_PAGEDOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },\
102 { wxEVT_SCROLL_THUMBTRACK, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func },