Use virtual functions to help splittree work

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19800 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2003-03-25 18:49:34 +00:00
parent 26b8693ba5
commit 1adff2f56f
2 changed files with 30 additions and 12 deletions

View File

@ -340,8 +340,11 @@ void wxScrolledWindow::SetScrollbars( int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY, int noUnitsX, int noUnitsY,
int xPos, int yPos, bool noRefresh ) int xPos, int yPos, bool noRefresh )
{ {
int old_x = m_xScrollPixelsPerLine * m_xScrollPosition; int xs, ys;
int old_y = m_yScrollPixelsPerLine * m_yScrollPosition; GetViewStart (& xs, & ys);
int old_x = m_xScrollPixelsPerLine * xs;
int old_y = m_yScrollPixelsPerLine * ys;
m_xScrollPixelsPerLine = pixelsPerUnitX; m_xScrollPixelsPerLine = pixelsPerUnitX;
m_yScrollPixelsPerLine = pixelsPerUnitY; m_yScrollPixelsPerLine = pixelsPerUnitY;
@ -638,18 +641,24 @@ void wxScrolledWindow::GetViewStart (int *x, int *y) const
void wxScrolledWindow::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const void wxScrolledWindow::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ {
int xs, ys;
GetViewStart (& xs, & ys);
if ( xx ) if ( xx )
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine; *xx = x - xs * m_xScrollPixelsPerLine;
if ( yy ) if ( yy )
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine; *yy = y - ys * m_yScrollPixelsPerLine;
} }
void wxScrolledWindow::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const void wxScrolledWindow::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ {
int xs, ys;
GetViewStart (& xs, & ys);
if ( xx ) if ( xx )
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine; *xx = x + xs * m_xScrollPixelsPerLine;
if ( yy ) if ( yy )
*yy = y + m_yScrollPosition * m_yScrollPixelsPerLine; *yy = y + ys * m_yScrollPixelsPerLine;
} }
int wxScrolledWindow::CalcScrollInc(wxScrollWinEvent& event) int wxScrolledWindow::CalcScrollInc(wxScrollWinEvent& event)

View File

@ -340,8 +340,11 @@ void wxScrolledWindow::SetScrollbars( int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY, int noUnitsX, int noUnitsY,
int xPos, int yPos, bool noRefresh ) int xPos, int yPos, bool noRefresh )
{ {
int old_x = m_xScrollPixelsPerLine * m_xScrollPosition; int xs, ys;
int old_y = m_yScrollPixelsPerLine * m_yScrollPosition; GetViewStart (& xs, & ys);
int old_x = m_xScrollPixelsPerLine * xs;
int old_y = m_yScrollPixelsPerLine * ys;
m_xScrollPixelsPerLine = pixelsPerUnitX; m_xScrollPixelsPerLine = pixelsPerUnitX;
m_yScrollPixelsPerLine = pixelsPerUnitY; m_yScrollPixelsPerLine = pixelsPerUnitY;
@ -638,18 +641,24 @@ void wxScrolledWindow::GetViewStart (int *x, int *y) const
void wxScrolledWindow::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const void wxScrolledWindow::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ {
int xs, ys;
GetViewStart (& xs, & ys);
if ( xx ) if ( xx )
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine; *xx = x - xs * m_xScrollPixelsPerLine;
if ( yy ) if ( yy )
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine; *yy = y - ys * m_yScrollPixelsPerLine;
} }
void wxScrolledWindow::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const void wxScrolledWindow::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ {
int xs, ys;
GetViewStart (& xs, & ys);
if ( xx ) if ( xx )
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine; *xx = x + xs * m_xScrollPixelsPerLine;
if ( yy ) if ( yy )
*yy = y + m_yScrollPosition * m_yScrollPixelsPerLine; *yy = y + ys * m_yScrollPixelsPerLine;
} }
int wxScrolledWindow::CalcScrollInc(wxScrollWinEvent& event) int wxScrolledWindow::CalcScrollInc(wxScrollWinEvent& event)