spinbutt.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/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. // implementation
  41. void OnSize( wxSizeEvent &event );
  42. bool IsOwnGtkWindow( GdkWindow *window );
  43. GtkAdjustment *m_adjust;
  44. float m_oldPos;
  45. protected:
  46. virtual wxSize DoGetBestSize() const;
  47. private:
  48. DECLARE_EVENT_TABLE()
  49. DECLARE_DYNAMIC_CLASS(wxSpinButton)
  50. };
  51. #endif
  52. // _WX_GTK_SPINBUTT_H_