scrolwin.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/generic/scrolwin.h
  3. // Purpose: generic wxScrollHelper
  4. // Author: Vadim Zeitlin
  5. // Created: 2008-12-24 (replacing old file with the same name)
  6. // Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
  7. // Licence: wxWindows licence
  8. /////////////////////////////////////////////////////////////////////////////
  9. #ifndef _WX_GENERIC_SCROLLWIN_H_
  10. #define _WX_GENERIC_SCROLLWIN_H_
  11. // ----------------------------------------------------------------------------
  12. // generic wxScrollHelper implementation
  13. // ----------------------------------------------------------------------------
  14. class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
  15. {
  16. public:
  17. wxScrollHelper(wxWindow *winToScroll);
  18. // implement base class pure virtuals
  19. virtual void AdjustScrollbars();
  20. virtual bool IsScrollbarShown(int orient) const;
  21. protected:
  22. virtual void DoScroll(int x, int y);
  23. virtual void DoShowScrollbars(wxScrollbarVisibility horz,
  24. wxScrollbarVisibility vert);
  25. private:
  26. // helper of AdjustScrollbars(): does the work for the single scrollbar
  27. //
  28. // notice that the parameters passed by non-const references are modified
  29. // by this function
  30. void DoAdjustScrollbar(int orient,
  31. int clientSize,
  32. int virtSize,
  33. int pixelsPerUnit,
  34. int& scrollUnits,
  35. int& scrollPosition,
  36. int& scrollLinesPerPage,
  37. wxScrollbarVisibility visibility);
  38. wxScrollbarVisibility m_xVisibility,
  39. m_yVisibility;
  40. wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
  41. };
  42. #endif // _WX_GENERIC_SCROLLWIN_H_