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:
Václav Slavík
2003-06-01 00:10:06 +00:00
parent 3033131651
commit 31d8b4ad24
2 changed files with 28 additions and 25 deletions

View File

@@ -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)

View File

@@ -634,6 +634,8 @@ bool wxHtmlWindow::IsSelectionEnabled() const
void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link) void wxHtmlWindow::OnLinkClicked(const wxHtmlLinkInfo& link)
{ {
const wxMouseEvent *e = link.GetEvent();
if (e == NULL || e->LeftUp())
LoadPage(link.GetHref()); LoadPage(link.GetHref());
} }
@@ -681,12 +683,13 @@ 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(); SetFocus();
if ( m_Cell ) if ( m_Cell )
{ {
@@ -707,7 +710,6 @@ void wxHtmlWindow::OnMouseEvent(wxMouseEvent& event)
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()