]> git.saurik.com Git - wxWidgets.git/blame_incremental - include/wx/gtk/scrolwin.h
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / include / wx / gtk / scrolwin.h
... / ...
CommitLineData
1/////////////////////////////////////////////////////////////////////////////
2// Name: wx/gtk/scrolwin.h
3// Purpose: wxScrolledWindow class
4// Author: Robert Roebling
5// Modified by: Vadim Zeitlin (2005-10-10): wxScrolledWindow is now common
6// Created: 01/02/97
7// Copyright: (c) Robert Roebling
8// Licence: wxWindows licence
9/////////////////////////////////////////////////////////////////////////////
10
11#ifndef _WX_GTK_SCROLLWIN_H_
12#define _WX_GTK_SCROLLWIN_H_
13
14// ----------------------------------------------------------------------------
15// wxScrolledWindow
16// ----------------------------------------------------------------------------
17
18class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
19{
20 typedef wxScrollHelperBase base_type;
21public:
22 // default ctor doesn't do anything
23 wxScrollHelper(wxWindow *win) : wxScrollHelperBase(win) { }
24
25 // implement the base class methods
26 virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
27 int noUnitsX, int noUnitsY,
28 int xPos = 0, int yPos = 0,
29 bool noRefresh = false);
30 virtual void AdjustScrollbars();
31
32 virtual bool IsScrollbarShown(int orient) const;
33
34protected:
35 virtual void DoScroll(int x, int y);
36 virtual void DoShowScrollbars(wxScrollbarVisibility horz,
37 wxScrollbarVisibility vert);
38
39private:
40 // this does (each) half of AdjustScrollbars() work
41 void DoAdjustScrollbar(GtkRange* range,
42 int pixelsPerLine,
43 int winSize,
44 int virtSize,
45 int *pos,
46 int *lines,
47 int *linesPerPage);
48
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
69 // and this does the same for Scroll()
70 void DoScrollOneDir(int orient,
71 int pos,
72 int pixelsPerLine,
73 int *posOld);
74
75 wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
76};
77
78#endif // _WX_GTK_SCROLLWIN_H_
79