spinbutt.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk/spinbutt.h
  3. // Purpose: wxSpinButton class
  4. // Author: Robert Roebling
  5. // Modified by:
  6. // Copyright: (c) Robert Roebling
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_GTK_SPINBUTT_H_
  10. #define _WX_GTK_SPINBUTT_H_
  11. //-----------------------------------------------------------------------------
  12. // wxSpinButton
  13. //-----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_CORE wxSpinButton : public wxSpinButtonBase
  15. {
  16. public:
  17. wxSpinButton();
  18. wxSpinButton(wxWindow *parent,
  19. wxWindowID id = -1,
  20. const wxPoint& pos = wxDefaultPosition,
  21. const wxSize& size = wxDefaultSize,
  22. long style = wxSP_VERTICAL,
  23. const wxString& name = wxSPIN_BUTTON_NAME)
  24. {
  25. Create(parent, id, pos, size, style, name);
  26. }
  27. bool Create(wxWindow *parent,
  28. wxWindowID id = -1,
  29. const wxPoint& pos = wxDefaultPosition,
  30. const wxSize& size = wxDefaultSize,
  31. long style = wxSP_VERTICAL,
  32. const wxString& name = wxSPIN_BUTTON_NAME);
  33. virtual int GetValue() const;
  34. virtual void SetValue( int value );
  35. virtual void SetRange( int minVal, int maxVal );
  36. virtual int GetMin() const;
  37. virtual int GetMax() const;
  38. static wxVisualAttributes
  39. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  40. virtual bool Enable( bool enable = true );
  41. // implementation
  42. int m_pos;
  43. protected:
  44. void GtkDisableEvents() const;
  45. void GtkEnableEvents() const;
  46. virtual wxSize DoGetBestSize() const;
  47. virtual GdkWindow *GTKGetWindow(wxArrayGdkWindows& windows) const;
  48. private:
  49. typedef wxSpinButtonBase base_type;
  50. DECLARE_DYNAMIC_CLASS(wxSpinButton)
  51. };
  52. #endif // _WX_GTK_SPINBUTT_H_