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 
10 #ifndef _WX_GENERIC_SCROLLWIN_H_
11 #define _WX_GENERIC_SCROLLWIN_H_
12 
13 #include "wx/recguard.h"
14 
15 // ----------------------------------------------------------------------------
16 // generic wxScrollHelper implementation
17 // ----------------------------------------------------------------------------
18 
19 class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
20 {
21 public:
22     wxScrollHelper(wxWindow *winToScroll);
23 
24     // implement base class pure virtuals
25     virtual void AdjustScrollbars() wxOVERRIDE;
26     virtual bool IsScrollbarShown(int orient) const wxOVERRIDE;
27 
28 protected:
29     virtual void DoScroll(int x, int y) wxOVERRIDE;
30     virtual void DoShowScrollbars(wxScrollbarVisibility horz,
31                                   wxScrollbarVisibility vert) wxOVERRIDE;
32 
33 private:
34     // helper of AdjustScrollbars(): does the work for the single scrollbar
35     //
36     // notice that the parameters passed by non-const references are modified
37     // by this function
38     void DoAdjustScrollbar(int orient,
39                            int clientSize,
40                            int virtSize,
41                            int pixelsPerUnit,
42                            int& scrollUnits,
43                            int& scrollPosition,
44                            int& scrollLinesPerPage,
45                            wxScrollbarVisibility visibility);
46 
47 
48     wxScrollbarVisibility m_xVisibility,
49                           m_yVisibility;
50     wxRecursionGuardFlag m_adjustScrollFlagReentrancy;
51 
52     wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
53 };
54 
55 #endif // _WX_GENERIC_SCROLLWIN_H_
56 
57