scrolbar.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/gtk1/scrolbar.h
  3. // Purpose:
  4. // Author: Robert Roebling
  5. // Copyright: (c) 1998 Robert Roebling
  6. // Licence: wxWindows licence
  7. /////////////////////////////////////////////////////////////////////////////
  8. #ifndef __GTKSCROLLBARH__
  9. #define __GTKSCROLLBARH__
  10. #include "wx/defs.h"
  11. //-----------------------------------------------------------------------------
  12. // classes
  13. //-----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_FWD_CORE wxScrollBar;
  15. //-----------------------------------------------------------------------------
  16. // wxScrollBar
  17. //-----------------------------------------------------------------------------
  18. class WXDLLIMPEXP_CORE wxScrollBar: public wxScrollBarBase
  19. {
  20. public:
  21. wxScrollBar()
  22. { m_adjust = NULL; m_oldPos = 0.0; }
  23. inline wxScrollBar( wxWindow *parent, wxWindowID id,
  24. const wxPoint& pos = wxDefaultPosition,
  25. const wxSize& size = wxDefaultSize,
  26. long style = wxSB_HORIZONTAL,
  27. const wxValidator& validator = wxDefaultValidator,
  28. const wxString& name = wxScrollBarNameStr )
  29. {
  30. Create( parent, id, pos, size, style, validator, name );
  31. }
  32. bool Create( wxWindow *parent, wxWindowID id,
  33. const wxPoint& pos = wxDefaultPosition,
  34. const wxSize& size = wxDefaultSize,
  35. long style = wxSB_HORIZONTAL,
  36. const wxValidator& validator = wxDefaultValidator,
  37. const wxString& name = wxScrollBarNameStr );
  38. virtual ~wxScrollBar();
  39. int GetThumbPosition() const;
  40. int GetThumbSize() const;
  41. int GetPageSize() const;
  42. int GetRange() const;
  43. virtual void SetThumbPosition( int viewStart );
  44. virtual void SetScrollbar( int position, int thumbSize, int range, int pageSize,
  45. bool refresh = TRUE );
  46. // Backward compatibility
  47. // ----------------------
  48. int GetValue(void) const;
  49. void SetValue( int viewStart );
  50. void GetValues( int *viewStart, int *viewLength, int *objectLength, int *pageLength) const;
  51. int GetViewLength() const;
  52. int GetObjectLength() const;
  53. void SetPageSize( int pageLength );
  54. void SetObjectLength( int objectLength );
  55. void SetViewLength( int viewLength );
  56. static wxVisualAttributes
  57. GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
  58. // implementation
  59. // --------------
  60. bool IsOwnGtkWindow( GdkWindow *window );
  61. GtkAdjustment *m_adjust;
  62. float m_oldPos;
  63. protected:
  64. virtual wxSize DoGetBestSize() const;
  65. private:
  66. DECLARE_DYNAMIC_CLASS(wxScrollBar)
  67. };
  68. #endif
  69. // __GTKSCROLLBARH__