Need to convert from physical to logical units inside HitTest

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39921 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2006-07-01 16:43:54 +00:00
parent 6fd54d582d
commit 563d25babe

View File

@@ -1627,8 +1627,12 @@ wxRichTextCtrl::HitTest(const wxPoint& pt,
{ {
wxClientDC dc((wxRichTextCtrl*) this); wxClientDC dc((wxRichTextCtrl*) this);
((wxRichTextCtrl*)this)->PrepareDC(dc); ((wxRichTextCtrl*)this)->PrepareDC(dc);
// Buffer uses logical position (relative to start of buffer)
// so convert
wxPoint pt2 = GetLogicalPoint(pt);
int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt, *pos); int hit = ((wxRichTextCtrl*)this)->GetBuffer().HitTest(dc, pt2, *pos);
switch ( hit ) switch ( hit )
{ {
@@ -2017,10 +2021,10 @@ bool wxRichTextCtrl::CanRedo() const
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// implemenation details // implementation details
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
void wxRichTextCtrl::Command(wxCommandEvent & event) void wxRichTextCtrl::Command(wxCommandEvent& event)
{ {
SetValue(event.GetString()); SetValue(event.GetString());
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);