2001-04-29 15:27:57 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2002-04-19 22:12:38 +00:00
|
|
|
// Name: wx/gtk/scrolwin.h
|
2001-04-29 15:27:57 +00:00
|
|
|
// Purpose: wxScrolledWindow class
|
|
|
|
// Author: Robert Roebling
|
2005-10-10 18:24:27 +00:00
|
|
|
// Modified by: Vadim Zeitlin (2005-10-10): wxScrolledWindow is now common
|
2001-04-29 15:27:57 +00:00
|
|
|
// Created: 01/02/97
|
|
|
|
// Copyright: (c) Robert Roebling
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-04-29 15:27:57 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_GTK_SCROLLWIN_H_
|
|
|
|
#define _WX_GTK_SCROLLWIN_H_
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxScrolledWindow
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
2008-12-24 16:43:30 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxScrollHelper : public wxScrollHelperBase
|
2001-04-29 15:27:57 +00:00
|
|
|
{
|
2009-02-08 20:51:44 +00:00
|
|
|
typedef wxScrollHelperBase base_type;
|
2001-04-29 15:27:57 +00:00
|
|
|
public:
|
2005-10-10 18:24:27 +00:00
|
|
|
// default ctor doesn't do anything
|
2008-12-24 16:43:30 +00:00
|
|
|
wxScrollHelper(wxWindow *win) : wxScrollHelperBase(win) { }
|
2001-04-29 15:27:57 +00:00
|
|
|
|
2008-12-25 12:27:20 +00:00
|
|
|
// implement the base class methods
|
2001-04-29 15:27:57 +00:00
|
|
|
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
|
2005-10-10 18:24:27 +00:00
|
|
|
int noUnitsX, int noUnitsY,
|
|
|
|
int xPos = 0, int yPos = 0,
|
2016-12-14 21:23:04 +00:00
|
|
|
bool noRefresh = false) wxOVERRIDE;
|
|
|
|
virtual void AdjustScrollbars() wxOVERRIDE;
|
2004-07-20 16:30:22 +00:00
|
|
|
|
2016-12-14 21:23:04 +00:00
|
|
|
virtual bool IsScrollbarShown(int orient) const wxOVERRIDE;
|
2013-08-27 13:12:38 +00:00
|
|
|
|
2001-04-29 15:27:57 +00:00
|
|
|
protected:
|
2016-12-14 21:23:04 +00:00
|
|
|
virtual void DoScroll(int x, int y) wxOVERRIDE;
|
2008-12-25 12:27:20 +00:00
|
|
|
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
|
2016-12-14 21:23:04 +00:00
|
|
|
wxScrollbarVisibility vert) wxOVERRIDE;
|
2008-12-25 12:27:20 +00:00
|
|
|
|
|
|
|
private:
|
2005-10-10 18:24:27 +00:00
|
|
|
// this does (each) half of AdjustScrollbars() work
|
2006-05-17 04:54:13 +00:00
|
|
|
void DoAdjustScrollbar(GtkRange* range,
|
2005-10-10 18:24:27 +00:00
|
|
|
int pixelsPerLine,
|
|
|
|
int winSize,
|
|
|
|
int virtSize,
|
2006-12-04 11:05:59 +00:00
|
|
|
int *pos,
|
2005-10-10 18:24:27 +00:00
|
|
|
int *lines,
|
|
|
|
int *linesPerPage);
|
|
|
|
|
2006-12-04 11:05:59 +00:00
|
|
|
void DoAdjustHScrollbar(int winSize, int virtSize)
|
|
|
|
{
|
|
|
|
DoAdjustScrollbar
|
|
|
|
(
|
|
|
|
m_win->m_scrollBar[wxWindow::ScrollDir_Horz],
|
|
|
|
m_xScrollPixelsPerLine, winSize, virtSize,
|
|
|
|
&m_xScrollPosition, &m_xScrollLines, &m_xScrollLinesPerPage
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
void DoAdjustVScrollbar(int winSize, int virtSize)
|
|
|
|
{
|
|
|
|
DoAdjustScrollbar
|
|
|
|
(
|
|
|
|
m_win->m_scrollBar[wxWindow::ScrollDir_Vert],
|
|
|
|
m_yScrollPixelsPerLine, winSize, virtSize,
|
|
|
|
&m_yScrollPosition, &m_yScrollLines, &m_yScrollLinesPerPage
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2005-10-10 18:24:27 +00:00
|
|
|
// and this does the same for Scroll()
|
2008-12-24 15:11:00 +00:00
|
|
|
void DoScrollOneDir(int orient,
|
|
|
|
int pos,
|
|
|
|
int pixelsPerLine,
|
|
|
|
int *posOld);
|
|
|
|
|
2009-02-08 11:45:59 +00:00
|
|
|
wxDECLARE_NO_COPY_CLASS(wxScrollHelper);
|
2001-04-29 15:27:57 +00:00
|
|
|
};
|
|
|
|
|
2005-10-10 18:24:27 +00:00
|
|
|
#endif // _WX_GTK_SCROLLWIN_H_
|
2002-04-19 22:12:38 +00:00
|
|
|
|