diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h index f052296fb6..36c7c1d900 100644 --- a/include/wx/stc/stc.h +++ b/include/wx/stc/stc.h @@ -5439,6 +5439,7 @@ protected: void OnMenu(wxCommandEvent& evt); void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); + void OnMouseCaptureLost(wxMouseCaptureLostEvent& evt); virtual wxSize DoGetBestSize() const wxOVERRIDE; diff --git a/src/stc/ScintillaWX.cpp b/src/stc/ScintillaWX.cpp index 992f94cc64..a18796220a 100644 --- a/src/stc/ScintillaWX.cpp +++ b/src/stc/ScintillaWX.cpp @@ -1180,6 +1180,12 @@ void ScintillaWX::DoOnListBox() { } +void ScintillaWX::DoMouseCaptureLost() +{ + capturedMouse = false; +} + + void ScintillaWX::DoOnIdle(wxIdleEvent& evt) { if ( Idle() ) diff --git a/src/stc/ScintillaWX.h b/src/stc/ScintillaWX.h index 675c4a5911..6ab764c5f3 100644 --- a/src/stc/ScintillaWX.h +++ b/src/stc/ScintillaWX.h @@ -183,6 +183,7 @@ public: void DoCommand(int ID); bool DoContextMenu(Point pt); void DoOnListBox(); + void DoMouseCaptureLost(); // helpers diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp index aa08e678f2..a59504bcad 100644 --- a/src/stc/stc.cpp +++ b/src/stc/stc.cpp @@ -162,6 +162,7 @@ wxBEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground) EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu) EVT_LISTBOX_DCLICK (wxID_ANY, wxStyledTextCtrl::OnListBox) + EVT_MOUSE_CAPTURE_LOST (wxStyledTextCtrl::OnMouseCaptureLost) wxEND_EVENT_TABLE() @@ -5369,6 +5370,11 @@ void wxStyledTextCtrl::OnIdle(wxIdleEvent& evt) { } +void wxStyledTextCtrl::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(evt)) { + m_swx->DoMouseCaptureLost(); +} + + wxSize wxStyledTextCtrl::DoGetBestSize() const { // What would be the best size for a wxSTC? diff --git a/src/stc/stc.cpp.in b/src/stc/stc.cpp.in index a36991f8d1..bbf17cc1d4 100644 --- a/src/stc/stc.cpp.in +++ b/src/stc/stc.cpp.in @@ -162,6 +162,7 @@ wxBEGIN_EVENT_TABLE(wxStyledTextCtrl, wxControl) EVT_ERASE_BACKGROUND (wxStyledTextCtrl::OnEraseBackground) EVT_MENU_RANGE (10, 16, wxStyledTextCtrl::OnMenu) EVT_LISTBOX_DCLICK (wxID_ANY, wxStyledTextCtrl::OnListBox) + EVT_MOUSE_CAPTURE_LOST (wxStyledTextCtrl::OnMouseCaptureLost) wxEND_EVENT_TABLE() @@ -884,6 +885,11 @@ void wxStyledTextCtrl::OnIdle(wxIdleEvent& evt) { } +void wxStyledTextCtrl::OnMouseCaptureLost(wxMouseCaptureLostEvent& WXUNUSED(evt)) { + m_swx->DoMouseCaptureLost(); +} + + wxSize wxStyledTextCtrl::DoGetBestSize() const { // What would be the best size for a wxSTC? diff --git a/src/stc/stc.h.in b/src/stc/stc.h.in index 0ab26979b4..7baf51ada4 100644 --- a/src/stc/stc.h.in +++ b/src/stc/stc.h.in @@ -562,6 +562,7 @@ protected: void OnMenu(wxCommandEvent& evt); void OnListBox(wxCommandEvent& evt); void OnIdle(wxIdleEvent& evt); + void OnMouseCaptureLost(wxMouseCaptureLostEvent& evt); virtual wxSize DoGetBestSize() const wxOVERRIDE;