spinbutt.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/osx/spinbutt.h
  3. // Purpose: wxSpinButton class
  4. // Author: Stefan Csomor
  5. // Modified by:
  6. // Created: 1998-01-01
  7. // Copyright: (c) Stefan Csomor
  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. /*
  15. The wxSpinButton is like a small scrollbar than is often placed next
  16. to a text control.
  17. wxSP_HORIZONTAL: horizontal spin button
  18. wxSP_VERTICAL: vertical spin button (the default)
  19. wxSP_ARROW_KEYS: arrow keys increment/decrement value
  20. wxSP_WRAP: value wraps at either end
  21. */
  22. class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
  23. {
  24. public:
  25. // construction
  26. wxSpinButton();
  27. wxSpinButton(wxWindow *parent,
  28. wxWindowID id = -1,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
  32. const wxString& name = wxT("wxSpinButton"))
  33. {
  34. Create(parent, id, pos, size, style, name);
  35. }
  36. virtual ~wxSpinButton();
  37. bool Create(wxWindow *parent,
  38. wxWindowID id = -1,
  39. const wxPoint& pos = wxDefaultPosition,
  40. const wxSize& size = wxDefaultSize,
  41. long style = wxSP_VERTICAL | wxSP_ARROW_KEYS,
  42. const wxString& name = wxT("wxSpinButton"));
  43. // accessors
  44. virtual void SetRange(int minVal, int maxVal);
  45. virtual int GetValue() const ;
  46. virtual void SetValue(int val);
  47. // implementation
  48. virtual void TriggerScrollEvent( wxEventType scrollEvent ) ;
  49. // osx specific event handling common for all osx-ports
  50. virtual bool OSXHandleClicked( double timestampsec );
  51. protected:
  52. void SendThumbTrackEvent() ;
  53. virtual wxSize DoGetBestSize() const;
  54. private:
  55. DECLARE_DYNAMIC_CLASS(wxSpinButton)
  56. };
  57. #endif
  58. // _WX_SPINBUTT_H_