implemented HitTest() for GTK2; test it in the sample

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2004-07-23 18:07:40 +00:00
parent e38c6b5fc7
commit 692c9b8696
9 changed files with 109 additions and 9 deletions

View File

@@ -662,15 +662,24 @@ void MyTextCtrl::OnMouseEvent(wxMouseEvent& ev)
msg = GetMouseEventDesc(ev);
}
msg << _T(" at (") << ev.GetX() << _T(", ") << ev.GetY() << _T(") ")
<< _T("Flags: ")
msg << _T(" at (") << ev.GetX() << _T(", ") << ev.GetY() << _T(") ");
long pos;
wxTextCtrlHitTestResult rc = HitTest(ev.GetPosition(), &pos);
if ( rc != wxTE_HT_UNKNOWN )
{
msg << _T("at position ") << pos;
}
msg << _T("[Flags: ")
<< GetChar( ev.LeftIsDown(), _T('1') )
<< GetChar( ev.MiddleIsDown(), _T('2') )
<< GetChar( ev.RightIsDown(), _T('3') )
<< GetChar( ev.ControlDown(), _T('C') )
<< GetChar( ev.AltDown(), _T('A') )
<< GetChar( ev.ShiftDown(), _T('S') )
<< GetChar( ev.MetaDown(), _T('M') );
<< GetChar( ev.MetaDown(), _T('M') )
<< _T(']');
wxLogMessage(msg);
}