class WXDLLEXPORT wxSpinButtonBase : public wxControl
{
public:
- wxSpinButtonBase() { InitBase(); }
+ // ctor intiializes the range with the default (0..100) values
+ wxSpinButtonBase() { m_min = 0; m_max = 100; }
// accessors
virtual int GetValue() const = 0;
// operations
virtual void SetValue(int val) = 0;
+ virtual void SetMin(int minVal) { SetRange ( minVal , m_max ) ; }
+ virtual void SetMax(int maxVal) { SetRange ( m_min , maxVal ) ; }
virtual void SetRange(int minVal, int maxVal)
{
m_min = minVal;
bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; }
protected:
- // init the base part of the control
- void InitBase()
- {
- m_min = 0;
- m_max = 100;
- }
-
// the range value
int m_min;
int m_max;
// macros for handling spin events
#define EVT_SPIN_UP(winid, func) \
- DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEUP, winid, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEUP, winid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
#define EVT_SPIN_DOWN(winid, func) \
- DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEDOWN, winid, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_LINEDOWN, winid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
#define EVT_SPIN(winid, func) \
- DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_THUMBTRACK, winid, -1, (wxObjectEventFunction) (wxEventFunction) (wxSpinEventFunction) & func, NULL ),
+ DECLARE_EVENT_TABLE_ENTRY( wxEVT_SCROLL_THUMBTRACK, winid, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxSpinEventFunction, & func ), NULL ),
#endif // wxUSE_SPINBTN