scrolbar.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/os2/scrolbar.h
  3. // Purpose: wxScrollBar class
  4. // Author: David Webster
  5. // Modified by:
  6. // Created: 10/15/99
  7. // Copyright: (c) David Webster
  8. // Licence: wxWindows licence
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_SCROLBAR_H_
  11. #define _WX_SCROLBAR_H_
  12. #include "wx/scrolbar.h"
  13. // Scrollbar item
  14. class WXDLLIMPEXP_CORE wxScrollBar : public wxScrollBarBase
  15. {
  16. public:
  17. inline wxScrollBar()
  18. {
  19. m_nPageSize = 0;
  20. m_nViewSize = 0;
  21. m_nObjectSize = 0;
  22. }
  23. inline wxScrollBar( wxWindow* pParent
  24. ,wxWindowID vId
  25. ,const wxPoint& rPos = wxDefaultPosition
  26. ,const wxSize& rSize = wxDefaultSize
  27. ,long lStyle = wxSB_HORIZONTAL
  28. #if wxUSE_VALIDATORS
  29. ,const wxValidator& rValidator = wxDefaultValidator
  30. #endif
  31. ,const wxString& rsName = wxScrollBarNameStr
  32. )
  33. {
  34. Create( pParent
  35. ,vId
  36. ,rPos
  37. ,rSize
  38. ,lStyle
  39. #if wxUSE_VALIDATORS
  40. ,rValidator
  41. #endif
  42. ,rsName
  43. );
  44. }
  45. virtual ~wxScrollBar();
  46. bool Create( wxWindow* pParent
  47. ,wxWindowID vId
  48. ,const wxPoint& rPos = wxDefaultPosition
  49. ,const wxSize& rSize = wxDefaultSize
  50. ,long lStyle = wxSB_HORIZONTAL
  51. #if wxUSE_VALIDATORS
  52. ,const wxValidator& rValidator = wxDefaultValidator
  53. #endif
  54. ,const wxString& rsName = wxScrollBarNameStr
  55. );
  56. int GetThumbPosition(void) const ;
  57. inline int GetThumbSize(void) const { return m_nPageSize; }
  58. inline int GetPageSize(void) const { return m_nViewSize; }
  59. inline int GetRange(void) const { return m_nObjectSize; }
  60. virtual void SetThumbPosition(int nViewStart);
  61. virtual void SetScrollbar( int nPosition
  62. ,int nThumbSize
  63. ,int nRange
  64. ,int nPageSize
  65. ,bool bRefresh = TRUE
  66. );
  67. void Command(wxCommandEvent& rEvent);
  68. virtual WXHBRUSH OnCtlColor( WXHDC hDC
  69. ,WXHWND hWnd
  70. ,WXUINT uCtlColor
  71. ,WXUINT uMessage
  72. ,WXWPARAM wParam
  73. ,WXLPARAM lParam
  74. );
  75. virtual bool OS2OnScroll( int nOrientation
  76. ,WXWORD wParam
  77. ,WXWORD wPos
  78. ,WXHWND hControl
  79. );
  80. protected:
  81. int m_nPageSize;
  82. int m_nViewSize;
  83. int m_nObjectSize;
  84. private:
  85. DECLARE_DYNAMIC_CLASS(wxScrollBar)
  86. }; // end of CLASS wxScrollBar
  87. #endif
  88. // _WX_SCROLBAR_H_