Show the exact wxTextCtrlHitTestResult in the text sample too
In addition to showing the position returned by HitTest(), also show its return value which is not necessarily wxTE_HT_ON_TEXT if it is not wxTE_HT_UNKNOWN under MSW.
This commit is contained in:
parent
dd63efe986
commit
de9b6fdc9e
@ -811,11 +811,32 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev)
|
||||
|
||||
long pos;
|
||||
wxTextCtrlHitTestResult rc = HitTest(ev.GetPosition(), &pos);
|
||||
if ( rc != wxTE_HT_UNKNOWN )
|
||||
wxString where;
|
||||
switch ( rc )
|
||||
{
|
||||
msg << wxT("at position ") << pos << wxT(' ');
|
||||
case wxTE_HT_UNKNOWN:
|
||||
break;
|
||||
|
||||
case wxTE_HT_BEFORE:
|
||||
where = "before";
|
||||
break;
|
||||
|
||||
case wxTE_HT_ON_TEXT:
|
||||
where = "at";
|
||||
break;
|
||||
|
||||
case wxTE_HT_BELOW:
|
||||
where = "below";
|
||||
break;
|
||||
|
||||
case wxTE_HT_BEYOND:
|
||||
where = "beyond";
|
||||
break;
|
||||
}
|
||||
|
||||
if ( !where.empty() )
|
||||
msg << where << " position " << pos << " ";
|
||||
|
||||
msg << wxT("[Flags: ")
|
||||
<< GetChar( ev.LeftIsDown(), wxT('1') )
|
||||
<< GetChar( ev.MiddleIsDown(), wxT('2') )
|
||||
|
Loading…
Reference in New Issue
Block a user