From: Vadim Zeitlin Date: Fri, 19 Sep 2008 07:38:24 +0000 (+0000) Subject: cancel the current operation if mouse capture is lost (#9979) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e2074948cbcb52c0882a85df43ab8014f4451363 cancel the current operation if mouse capture is lost (#9979) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/aui/framemanager.h b/include/wx/aui/framemanager.h index 8b80a6d0bc..966b26f7cf 100644 --- a/include/wx/aui/framemanager.h +++ b/include/wx/aui/framemanager.h @@ -575,6 +575,7 @@ protected: void OnLeftDown(wxMouseEvent& evt); void OnLeftUp(wxMouseEvent& evt); void OnMotion(wxMouseEvent& evt); + void OnCaptureLost(wxMouseCaptureLostEvent& evt); void OnLeaveWindow(wxMouseEvent& evt); void OnChildFocus(wxChildFocusEvent& evt); void OnHintFadeTimer(wxTimerEvent& evt); diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index fb46813dba..c2861cf84c 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -572,6 +572,7 @@ BEGIN_EVENT_TABLE(wxAuiManager, wxEvtHandler) EVT_LEFT_UP(wxAuiManager::OnLeftUp) EVT_MOTION(wxAuiManager::OnMotion) EVT_LEAVE_WINDOW(wxAuiManager::OnLeaveWindow) + EVT_MOUSE_CAPTURE_LOST(wxAuiManager::OnCaptureLost) EVT_CHILD_FOCUS(wxAuiManager::OnChildFocus) EVT_AUI_FIND_MANAGER(wxAuiManager::OnFindManager) EVT_TIMER(101, wxAuiManager::OnHintFadeTimer) @@ -4441,6 +4442,16 @@ void wxAuiManager::OnLeaveWindow(wxMouseEvent& WXUNUSED(event)) } } +void wxAuiManager::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event)) +{ + // cancel the operation in progress, if any + if ( m_action != actionNone ) + { + m_action = actionNone; + HideHint(); + } +} + void wxAuiManager::OnChildFocus(wxChildFocusEvent& event) { // when a child pane has it's focus set, we should change the