]>
Commit | Line | Data |
---|---|---|
30954328 | 1 | ///////////////////////////////////////////////////////////////////////////// |
566d84a7 | 2 | // Name: wx/gtk/scrolwin.h |
30954328 RR |
3 | // Purpose: wxScrolledWindow class |
4 | // Author: Robert Roebling | |
d32e78bd | 5 | // Modified by: Vadim Zeitlin (2005-10-10): wxScrolledWindow is now common |
30954328 | 6 | // Created: 01/02/97 |
30954328 | 7 | // Copyright: (c) Robert Roebling |
65571936 | 8 | // Licence: wxWindows licence |
30954328 RR |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_GTK_SCROLLWIN_H_ | |
12 | #define _WX_GTK_SCROLLWIN_H_ | |
13 | ||
30954328 RR |
14 | // ---------------------------------------------------------------------------- |
15 | // wxScrolledWindow | |
16 | // ---------------------------------------------------------------------------- | |
17 | ||
29e1398f | 18 | class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase |
30954328 | 19 | { |
8aa40b04 | 20 | typedef wxScrollHelperBase base_type; |
30954328 | 21 | public: |
d32e78bd | 22 | // default ctor doesn't do anything |
29e1398f | 23 | wxScrollHelper(wxWindow *win) : wxScrollHelperBase(win) { } |
30954328 | 24 | |
bc448be3 | 25 | // implement the base class methods |
30954328 | 26 | virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, |
d32e78bd VZ |
27 | int noUnitsX, int noUnitsY, |
28 | int xPos = 0, int yPos = 0, | |
29 | bool noRefresh = false); | |
30954328 | 30 | virtual void AdjustScrollbars(); |
5de9f492 | 31 | |
029a401d VZ |
32 | virtual bool IsScrollbarShown(int orient) const; |
33 | ||
30954328 | 34 | protected: |
bc448be3 VZ |
35 | virtual void DoScroll(int x, int y); |
36 | virtual void DoShowScrollbars(wxScrollbarVisibility horz, | |
37 | wxScrollbarVisibility vert); | |
38 | ||
39 | private: | |
d32e78bd | 40 | // this does (each) half of AdjustScrollbars() work |
add7cadd | 41 | void DoAdjustScrollbar(GtkRange* range, |
d32e78bd VZ |
42 | int pixelsPerLine, |
43 | int winSize, | |
44 | int virtSize, | |
9ec927f8 | 45 | int *pos, |
d32e78bd VZ |
46 | int *lines, |
47 | int *linesPerPage); | |
48 | ||
9ec927f8 VZ |
49 | void DoAdjustHScrollbar(int winSize, int virtSize) |
50 | { | |
51 | DoAdjustScrollbar | |
52 | ( | |
53 | m_win->m_scrollBar[wxWindow::ScrollDir_Horz], | |
54 | m_xScrollPixelsPerLine, winSize, virtSize, | |
55 | &m_xScrollPosition, &m_xScrollLines, &m_xScrollLinesPerPage | |
56 | ); | |
57 | } | |
58 | ||
59 | void DoAdjustVScrollbar(int winSize, int virtSize) | |
60 | { | |
61 | DoAdjustScrollbar | |
62 | ( | |
63 | m_win->m_scrollBar[wxWindow::ScrollDir_Vert], | |
64 | m_yScrollPixelsPerLine, winSize, virtSize, | |
65 | &m_yScrollPosition, &m_yScrollLines, &m_yScrollLinesPerPage | |
66 | ); | |
67 | } | |
68 | ||
d32e78bd | 69 | // and this does the same for Scroll() |
0b0f6f87 VZ |
70 | void DoScrollOneDir(int orient, |
71 | int pos, | |
72 | int pixelsPerLine, | |
73 | int *posOld); | |
74 | ||
c0c133e1 | 75 | wxDECLARE_NO_COPY_CLASS(wxScrollHelper); |
30954328 RR |
76 | }; |
77 | ||
d32e78bd | 78 | #endif // _WX_GTK_SCROLLWIN_H_ |
566d84a7 | 79 |