slider.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/motif/slider.h
  3. // Purpose: wxSlider class
  4. // Author: Julian Smart
  5. // Modified by:
  6. // Created: 17/09/98
  7. // Copyright: (c) Julian Smart
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_SLIDER_H_
  11. #define _WX_SLIDER_H_
  12. #include "wx/control.h"
  13. // Slider
  14. class WXDLLIMPEXP_CORE wxSlider: public wxSliderBase
  15. {
  16. DECLARE_DYNAMIC_CLASS(wxSlider)
  17. public:
  18. wxSlider();
  19. wxSlider(wxWindow *parent, wxWindowID id,
  20. int value, int minValue, int maxValue,
  21. const wxPoint& pos = wxDefaultPosition,
  22. const wxSize& size = wxDefaultSize,
  23. long style = wxSL_HORIZONTAL,
  24. const wxValidator& validator = wxDefaultValidator,
  25. const wxString& name = wxSliderNameStr)
  26. {
  27. Create(parent, id, value, minValue, maxValue, pos, size, style, validator, name);
  28. }
  29. virtual ~wxSlider();
  30. bool Create(wxWindow *parent, 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. virtual int GetValue() const ;
  38. virtual void SetValue(int);
  39. void SetRange(int minValue, int maxValue);
  40. inline int GetMin() const { return m_rangeMin; }
  41. inline int GetMax() const { return m_rangeMax; }
  42. // For trackbars only
  43. void SetPageSize(int pageSize);
  44. int GetPageSize() const ;
  45. void SetLineSize(int lineSize);
  46. int GetLineSize() const ;
  47. void SetThumbLength(int len) ;
  48. int GetThumbLength() const ;
  49. void Command(wxCommandEvent& event);
  50. protected:
  51. int m_rangeMin;
  52. int m_rangeMax;
  53. int m_pageSize;
  54. int m_lineSize;
  55. virtual void DoSetSize(int x, int y,
  56. int width, int height,
  57. int sizeFlags = wxSIZE_AUTO);
  58. private:
  59. DECLARE_EVENT_TABLE()
  60. };
  61. #endif
  62. // _WX_SLIDER_H_