spinbutt.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/spinbutt.h
  3. // Purpose: wxSpinButton class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 01/02/97
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_SPINBUTT_H_
  11. #define _WX_SPINBUTT_H_
  12. #include "wx/control.h"
  13. #include "wx/event.h"
  14. #if wxUSE_SPINBTN
  15. class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
  16. {
  17. public:
  18. // construction
  19. wxSpinButton() { }
  20. wxSpinButton(wxWindow *parent,
  21. wxWindowID id = wxID_ANY,
  22. const wxPoint& pos = wxDefaultPosition,
  23. const wxSize& size = wxDefaultSize,
  24. long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
  25. const wxString& name = wxSPIN_BUTTON_NAME)
  26. {
  27. Create(parent, id, pos, size, style, name);
  28. }
  29. virtual ~wxSpinButton();
  30. bool Create(wxWindow *parent,
  31. wxWindowID id = wxID_ANY,
  32. const wxPoint& pos = wxDefaultPosition,
  33. const wxSize& size = wxDefaultSize,
  34. long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
  35. const wxString& name = wxSPIN_BUTTON_NAME);
  36. // accessors
  37. virtual int GetValue() const;
  38. virtual void SetValue(int val);
  39. virtual void SetRange(int minVal, int maxVal);
  40. // implementation
  41. virtual bool MSWCommand(WXUINT param, WXWORD id);
  42. virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
  43. virtual bool MSWOnScroll(int orientation, WXWORD wParam,
  44. WXWORD pos, WXHWND control);
  45. // a wxSpinButton can't do anything useful with focus, only wxSpinCtrl can
  46. virtual bool AcceptsFocus() const { return false; }
  47. // returns true if the platform should explicitly apply a theme border
  48. virtual bool CanApplyThemeBorder() const { return false; }
  49. protected:
  50. virtual wxSize DoGetBestSize() const;
  51. // ensure that the control displays a value in the current range
  52. virtual void NormalizeValue();
  53. private:
  54. DECLARE_DYNAMIC_CLASS_NO_COPY(wxSpinButton)
  55. };
  56. #endif // wxUSE_SPINBTN
  57. #endif // _WX_SPINBUTT_H_