From d02cf5c99f05aea4299485b80413cfc7daccb06f Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:26:30 +0000 Subject: [PATCH] Handle wxMouseCaptureLostEvent in the color picker Originally committed to SVN as r6108. --- aegisub/src/dialog_colorpicker.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aegisub/src/dialog_colorpicker.cpp b/aegisub/src/dialog_colorpicker.cpp index 026e1d7a5..0c44a8063 100644 --- a/aegisub/src/dialog_colorpicker.cpp +++ b/aegisub/src/dialog_colorpicker.cpp @@ -255,6 +255,7 @@ class DialogColorPicker : public wxDialog { void OnRecentSelect(wxCommandEvent &evt); // also handles dropper pick void OnDropperMouse(wxMouseEvent &evt); void OnMouse(wxMouseEvent &evt); + void OnCaptureLost(wxMouseCaptureLostEvent&); ColorCallback callback; void *callbackUserdata; @@ -786,6 +787,7 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color, C screen_dropper_icon->Bind(wxEVT_MOTION, &DialogColorPicker::OnDropperMouse, this); screen_dropper_icon->Bind(wxEVT_LEFT_DOWN, &DialogColorPicker::OnDropperMouse, this); screen_dropper_icon->Bind(wxEVT_LEFT_UP, &DialogColorPicker::OnDropperMouse, this); + screen_dropper_icon->Bind(wxEVT_MOUSE_CAPTURE_LOST, &DialogColorPicker::OnCaptureLost, this); Bind(wxEVT_MOTION, &DialogColorPicker::OnMouse, this); Bind(wxEVT_LEFT_DOWN, &DialogColorPicker::OnMouse, this); Bind(wxEVT_LEFT_UP, &DialogColorPicker::OnMouse, this); @@ -1250,3 +1252,9 @@ void DialogColorPicker::OnMouse(wxMouseEvent &evt) else evt.Skip(); } + +void DialogColorPicker::OnCaptureLost(wxMouseCaptureLostEvent&) { + eyedropper_is_grabbed = false; + screen_dropper_icon->SetCursor(wxNullCursor); + screen_dropper_icon->SetBitmap(eyedropper_bitmap); +}