added Calc(Un)ScrolledPosition taking wxPoint
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14657 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -98,8 +98,27 @@ public:
|
|||||||
// Actual size in pixels when scrolling is taken into account
|
// Actual size in pixels when scrolling is taken into account
|
||||||
virtual void GetVirtualSize(int *x, int *y) const;
|
virtual void GetVirtualSize(int *x, int *y) const;
|
||||||
|
|
||||||
virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
// translate between scrolled and unscrolled coordinates
|
||||||
virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
|
{ DoCalcScrolledPosition(x, y, xx, yy); }
|
||||||
|
wxPoint CalcScrolledPosition(const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
wxPoint p2;
|
||||||
|
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
|
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
|
||||||
|
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
wxPoint p2;
|
||||||
|
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||||
|
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||||
|
|
||||||
// Override this function to draw the graphic (or just process EVT_PAINT)
|
// Override this function to draw the graphic (or just process EVT_PAINT)
|
||||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
|
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
|
||||||
|
@@ -98,8 +98,27 @@ public:
|
|||||||
// Actual size in pixels when scrolling is taken into account
|
// Actual size in pixels when scrolling is taken into account
|
||||||
virtual void GetVirtualSize(int *x, int *y) const;
|
virtual void GetVirtualSize(int *x, int *y) const;
|
||||||
|
|
||||||
virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
// translate between scrolled and unscrolled coordinates
|
||||||
virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
|
{ DoCalcScrolledPosition(x, y, xx, yy); }
|
||||||
|
wxPoint CalcScrolledPosition(const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
wxPoint p2;
|
||||||
|
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
|
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
|
||||||
|
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
wxPoint p2;
|
||||||
|
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||||
|
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||||
|
|
||||||
// Override this function to draw the graphic (or just process EVT_PAINT)
|
// Override this function to draw the graphic (or just process EVT_PAINT)
|
||||||
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
|
virtual void OnDraw(wxDC& WXUNUSED(dc)) {}
|
||||||
|
@@ -67,8 +67,26 @@ public:
|
|||||||
double GetScaleY() const { return m_scaleY; }
|
double GetScaleY() const { return m_scaleY; }
|
||||||
|
|
||||||
// translate between scrolled and unscrolled coordinates
|
// translate between scrolled and unscrolled coordinates
|
||||||
virtual void CalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
virtual void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
{ DoCalcScrolledPosition(x, y, xx, yy); }
|
||||||
|
wxPoint CalcScrolledPosition(const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
wxPoint p2;
|
||||||
|
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
|
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
|
||||||
|
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
|
||||||
|
{
|
||||||
|
wxPoint p2;
|
||||||
|
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
|
||||||
|
return p2;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||||
|
virtual void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
|
||||||
|
|
||||||
// Adjust the scrollbars
|
// Adjust the scrollbars
|
||||||
virtual void AdjustScrollbars(void);
|
virtual void AdjustScrollbars(void);
|
||||||
|
@@ -814,7 +814,7 @@ void wxScrollHelper::GetViewStart (int *x, int *y) const
|
|||||||
*y = m_yScrollPosition;
|
*y = m_yScrollPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrollHelper::CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
void wxScrollHelper::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
{
|
{
|
||||||
if ( xx )
|
if ( xx )
|
||||||
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||||
@@ -822,7 +822,7 @@ void wxScrollHelper::CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
|||||||
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrollHelper::CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
void wxScrollHelper::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
{
|
{
|
||||||
if ( xx )
|
if ( xx )
|
||||||
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||||
|
@@ -588,7 +588,7 @@ void wxScrolledWindow::GetViewStart (int *x, int *y) const
|
|||||||
*y = m_yScrollPosition;
|
*y = m_yScrollPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrolledWindow::CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
void wxScrolledWindow::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
{
|
{
|
||||||
if ( xx )
|
if ( xx )
|
||||||
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||||
@@ -596,7 +596,7 @@ void wxScrolledWindow::CalcScrolledPosition(int x, int y, int *xx, int *yy) cons
|
|||||||
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrolledWindow::CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
void wxScrolledWindow::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
{
|
{
|
||||||
if ( xx )
|
if ( xx )
|
||||||
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||||
|
@@ -588,7 +588,7 @@ void wxScrolledWindow::GetViewStart (int *x, int *y) const
|
|||||||
*y = m_yScrollPosition;
|
*y = m_yScrollPosition;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrolledWindow::CalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
void wxScrolledWindow::DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
{
|
{
|
||||||
if ( xx )
|
if ( xx )
|
||||||
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
*xx = x - m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||||
@@ -596,7 +596,7 @@ void wxScrolledWindow::CalcScrolledPosition(int x, int y, int *xx, int *yy) cons
|
|||||||
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
*yy = y - m_yScrollPosition * m_yScrollPixelsPerLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxScrolledWindow::CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
void wxScrolledWindow::DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
|
||||||
{
|
{
|
||||||
if ( xx )
|
if ( xx )
|
||||||
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
*xx = x + m_xScrollPosition * m_xScrollPixelsPerLine;
|
||||||
|
Reference in New Issue
Block a user