From 61f84e2493a78236d8491ad53ea62ff401da53a0 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Fri, 29 Dec 2006 19:37:04 +0000 Subject: [PATCH] Process capture lost event to avoid assertion git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44073 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/richtext/richtextctrl.h | 1 + src/richtext/richtextctrl.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/wx/richtext/richtextctrl.h b/include/wx/richtext/richtextctrl.h index 36063e0157..1cd42ec016 100644 --- a/include/wx/richtext/richtextctrl.h +++ b/include/wx/richtext/richtextctrl.h @@ -600,6 +600,7 @@ public: void Command(wxCommandEvent& event); void OnDropFiles(wxDropFilesEvent& event); + void OnCaptureLost(wxMouseCaptureLostEvent& event); void OnCut(wxCommandEvent& event); void OnCopy(wxCommandEvent& event); diff --git a/src/richtext/richtextctrl.cpp b/src/richtext/richtextctrl.cpp index 749eba3829..5995b29fb8 100644 --- a/src/richtext/richtextctrl.cpp +++ b/src/richtext/richtextctrl.cpp @@ -74,6 +74,7 @@ BEGIN_EVENT_TABLE( wxRichTextCtrl, wxControl ) EVT_SIZE(wxRichTextCtrl::OnSize) EVT_SET_FOCUS(wxRichTextCtrl::OnSetFocus) EVT_KILL_FOCUS(wxRichTextCtrl::OnKillFocus) + EVT_MOUSE_CAPTURE_LOST(wxRichTextCtrl::OnCaptureLost) EVT_CONTEXT_MENU(wxRichTextCtrl::OnContextMenu) EVT_MENU(wxID_UNDO, wxRichTextCtrl::OnUndo) @@ -325,6 +326,11 @@ void wxRichTextCtrl::OnKillFocus(wxFocusEvent& WXUNUSED(event)) // Refresh(false); } +void wxRichTextCtrl::OnCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(event)) +{ + m_dragging = false; +} + /// Left-click void wxRichTextCtrl::OnLeftClick(wxMouseEvent& event) { -- 2.45.2