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