implement HitTest(pos) variant and not HitTest(x, y) one as this is what Windows gives us
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -103,9 +103,7 @@ public:
|
|||||||
virtual bool PositionToXY(long pos, long *x, long *y) const;
|
virtual bool PositionToXY(long pos, long *x, long *y) const;
|
||||||
|
|
||||||
virtual void ShowPosition(long pos);
|
virtual void ShowPosition(long pos);
|
||||||
virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt,
|
virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const;
|
||||||
wxTextCoord *col,
|
|
||||||
wxTextCoord *row) const;
|
|
||||||
|
|
||||||
// Clipboard operations
|
// Clipboard operations
|
||||||
virtual void Copy();
|
virtual void Copy();
|
||||||
|
@@ -1361,7 +1361,7 @@ bool wxTextCtrl::PositionToXY(long pos, long *x, long *y) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
wxTextCtrlHitTestResult
|
wxTextCtrlHitTestResult
|
||||||
wxTextCtrl::HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const
|
wxTextCtrl::HitTest(const wxPoint& pt, long *posOut) const
|
||||||
{
|
{
|
||||||
// first get the position from Windows
|
// first get the position from Windows
|
||||||
LPARAM lParam;
|
LPARAM lParam;
|
||||||
@@ -1440,11 +1440,8 @@ wxTextCtrl::HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const
|
|||||||
else
|
else
|
||||||
rc = wxTE_HT_ON_TEXT;
|
rc = wxTE_HT_ON_TEXT;
|
||||||
|
|
||||||
// finally translate to column/row
|
if ( posOut )
|
||||||
if ( !PositionToXY(pos, col, row) )
|
*posOut = pos;
|
||||||
{
|
|
||||||
wxFAIL_MSG( _T("PositionToXY() not expected to fail in HitTest()") );
|
|
||||||
}
|
|
||||||
|
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user