react on mouse up, not mouse down
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20789 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -209,7 +209,8 @@ protected:
|
|||||||
|
|
||||||
void OnDraw(wxDC& dc);
|
void OnDraw(wxDC& dc);
|
||||||
void OnSize(wxSizeEvent& event);
|
void OnSize(wxSizeEvent& event);
|
||||||
void OnMouseEvent(wxMouseEvent& event);
|
void OnMouseMove(wxMouseEvent& event);
|
||||||
|
void OnMouseButton(wxMouseEvent& event);
|
||||||
void OnIdle(wxIdleEvent& event);
|
void OnIdle(wxIdleEvent& event);
|
||||||
|
|
||||||
// Returns new filter (will be stored into m_DefaultFilter variable)
|
// Returns new filter (will be stored into m_DefaultFilter variable)
|
||||||
|
@@ -634,7 +634,9 @@ bool wxHtmlWindow::IsSelectionEnabled() const
|
|||||||
|
|
||||||
void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
|
void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
|
||||||
{
|
{
|
||||||
LoadPage(link.GetHref());
|
const wxMouseEvent *e = link.GetEvent();
|
||||||
|
if (e == NULL || e->LeftUp())
|
||||||
|
LoadPage(link.GetHref());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxHtmlWindow::OnCellClicked(wxHtmlCell *cell,
|
void wxHtmlWindow::OnCellClicked(wxHtmlCell *cell,
|
||||||
@@ -681,32 +683,32 @@ void wxHtmlWindow::OnSize(wxSizeEvent& event)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event)
|
void wxHtmlWindow::OnMouseMove(wxMouseEvent& event)
|
||||||
{
|
{
|
||||||
m_tmpMouseMoved = TRUE;
|
m_tmpMouseMoved = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (event.ButtonDown())
|
void wxHtmlWindow::OnMouseButton(wxMouseEvent& event)
|
||||||
|
{
|
||||||
|
SetFocus();
|
||||||
|
if ( m_Cell )
|
||||||
{
|
{
|
||||||
SetFocus();
|
int sx, sy;
|
||||||
if ( m_Cell )
|
GetViewStart(&sx, &sy);
|
||||||
{
|
sx *= wxHTML_SCROLL_STEP;
|
||||||
int sx, sy;
|
sy *= wxHTML_SCROLL_STEP;
|
||||||
GetViewStart(&sx, &sy);
|
|
||||||
sx *= wxHTML_SCROLL_STEP;
|
|
||||||
sy *= wxHTML_SCROLL_STEP;
|
|
||||||
|
|
||||||
wxPoint pos = event.GetPosition();
|
wxPoint pos = event.GetPosition();
|
||||||
pos.x += sx;
|
pos.x += sx;
|
||||||
pos.y += sy;
|
pos.y += sy;
|
||||||
|
|
||||||
wxHtmlCell *cell = m_Cell->FindCellByPos(pos.x, pos.y);
|
wxHtmlCell *cell = m_Cell->FindCellByPos(pos.x, pos.y);
|
||||||
|
|
||||||
// VZ: is it possible that we don't find anything at all?
|
// VZ: is it possible that we don't find anything at all?
|
||||||
// VS: yes. FindCellByPos returns terminal cell and
|
// VS: yes. FindCellByPos returns terminal cell and
|
||||||
// containers may have empty borders
|
// containers may have empty borders
|
||||||
if ( cell )
|
if ( cell )
|
||||||
OnCellClicked(cell, pos.x, pos.y, event);
|
OnCellClicked(cell, pos.x, pos.y, event);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -774,9 +776,9 @@ IMPLEMENT_DYNAMIC_CLASS(wxHtmlWindow,wxScrolledWindow)
|
|||||||
|
|
||||||
BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
|
BEGIN_EVENT_TABLE(wxHtmlWindow, wxScrolledWindow)
|
||||||
EVT_SIZE(wxHtmlWindow::OnSize)
|
EVT_SIZE(wxHtmlWindow::OnSize)
|
||||||
EVT_LEFT_DOWN(wxHtmlWindow::OnMouseEvent)
|
EVT_LEFT_UP(wxHtmlWindow::OnMouseButton)
|
||||||
EVT_RIGHT_DOWN(wxHtmlWindow::OnMouseEvent)
|
EVT_RIGHT_UP(wxHtmlWindow::OnMouseButton)
|
||||||
EVT_MOTION(wxHtmlWindow::OnMouseEvent)
|
EVT_MOTION(wxHtmlWindow::OnMouseMove)
|
||||||
EVT_IDLE(wxHtmlWindow::OnIdle)
|
EVT_IDLE(wxHtmlWindow::OnIdle)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user