| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: wx/motif/spinbutt.h |
| 3 | // Purpose: wxSpinButton class |
| 4 | // Author: Julian Smart |
| 5 | // Modified by: |
| 6 | // Created: 17/09/98 |
| 7 | // RCS-ID: $Id$ |
| 8 | // Copyright: (c) Julian Smart |
| 9 | // Licence: wxWindows licence |
| 10 | ///////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #ifndef _WX_SPINBUTT_H_ |
| 13 | #define _WX_SPINBUTT_H_ |
| 14 | |
| 15 | class WXDLLIMPEXP_FWD_CORE wxArrowButton; // internal |
| 16 | |
| 17 | class WXDLLEXPORT wxSpinButton : public wxSpinButtonBase |
| 18 | { |
| 19 | DECLARE_DYNAMIC_CLASS(wxSpinButton) |
| 20 | |
| 21 | public: |
| 22 | wxSpinButton() : m_up( 0 ), m_down( 0 ), m_pos( 0 ) { } |
| 23 | |
| 24 | wxSpinButton(wxWindow *parent, |
| 25 | wxWindowID id = wxID_ANY, |
| 26 | const wxPoint& pos = wxDefaultPosition, |
| 27 | const wxSize& size = wxDefaultSize, |
| 28 | long style = wxSP_VERTICAL, |
| 29 | const wxString& name = "wxSpinButton") |
| 30 | : m_up( 0 ), |
| 31 | m_down( 0 ), |
| 32 | m_pos( 0 ) |
| 33 | { |
| 34 | Create(parent, id, pos, size, style, name); |
| 35 | } |
| 36 | virtual ~wxSpinButton(); |
| 37 | |
| 38 | bool Create(wxWindow *parent, |
| 39 | wxWindowID id = wxID_ANY, |
| 40 | const wxPoint& pos = wxDefaultPosition, |
| 41 | const wxSize& size = wxDefaultSize, |
| 42 | long style = wxSP_VERTICAL, |
| 43 | const wxString& name = "wxSpinButton"); |
| 44 | |
| 45 | // accessors |
| 46 | int GetValue() const; |
| 47 | int GetMin() const { return m_min; } |
| 48 | int GetMax() const { return m_max; } |
| 49 | |
| 50 | // operations |
| 51 | void SetValue(int val); |
| 52 | void SetRange(int minVal, int maxVal); |
| 53 | |
| 54 | // Implementation |
| 55 | virtual void Command(wxCommandEvent& event) |
| 56 | { (void)ProcessCommand(event); }; |
| 57 | virtual void ChangeFont(bool keepOriginalSize = true); |
| 58 | virtual void ChangeBackgroundColour(); |
| 59 | virtual void ChangeForegroundColour(); |
| 60 | public: |
| 61 | // implementation detail |
| 62 | void Increment( int delta ); |
| 63 | |
| 64 | private: |
| 65 | virtual void DoSetSize(int x, int y, int width, int height, |
| 66 | int sizeFlags = wxSIZE_AUTO); |
| 67 | virtual void DoMoveWindow(int x, int y, int width, int height); |
| 68 | virtual wxSize DoGetBestSize() const; |
| 69 | |
| 70 | wxArrowButton* m_up; |
| 71 | wxArrowButton* m_down; |
| 72 | int m_pos; |
| 73 | }; |
| 74 | |
| 75 | #endif |
| 76 | // _WX_SPINBUTT_H_ |