slider.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/slider.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKSLIDERH__
  9. #define __GTKSLIDERH__
  10. // ----------------------------------------------------------------------------
  11. // wxSlider
  12. // ----------------------------------------------------------------------------
  13. class WXDLLIMPEXP_CORE wxSlider : public wxSliderBase
  14. {
  15. public:
  16. wxSlider() { }
  17. wxSlider(wxWindow *parent,
  18. wxWindowID id,
  19. int value, int minValue, int maxValue,
  20. const wxPoint& pos = wxDefaultPosition,
  21. const wxSize& size = wxDefaultSize,
  22. long style = wxSL_HORIZONTAL,
  23. const wxValidator& validator = wxDefaultValidator,
  24. const wxString& name = wxSliderNameStr)
  25. {
  26. Create( parent, id, value, minValue, maxValue,
  27. pos, size, style, validator, name );
  28. }
  29. bool Create(wxWindow *parent,
  30. wxWindowID id,
  31. int value, int minValue, int maxValue,
  32. const wxPoint& pos = wxDefaultPosition,
  33. const wxSize& size = wxDefaultSize,
  34. long style = wxSL_HORIZONTAL,
  35. const wxValidator& validator = wxDefaultValidator,
  36. const wxString& name = wxSliderNameStr);
  37. // implement the base class pure virtuals
  38. virtual int GetValue() const;
  39. virtual void SetValue(int value);
  40. virtual void SetRange(int minValue, int maxValue);
  41. virtual int GetMin() const;
  42. virtual int GetMax() const;
  43. virtual void SetLineSize(int lineSize);
  44. virtual void SetPageSize(int pageSize);
  45. virtual int GetLineSize() const;
  46. virtual int GetPageSize() const;
  47. virtual void SetThumbLength(int lenPixels);
  48. virtual int GetThumbLength() const;
  49. static wxVisualAttributes
  50. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  51. // implementation
  52. bool IsOwnGtkWindow( GdkWindow *window );
  53. void GtkDisableEvents();
  54. void GtkEnableEvents();
  55. GtkAdjustment *m_adjust;
  56. float m_oldPos;
  57. private:
  58. DECLARE_DYNAMIC_CLASS(wxSlider)
  59. };
  60. #endif // __GTKSLIDERH__