forked from mia/Aegisub
Handle wxMouseCaptureLostEvent in the color picker
Originally committed to SVN as r6108.
This commit is contained in:
parent
4c31490d41
commit
d02cf5c99f
1 changed files with 8 additions and 0 deletions
|
@ -255,6 +255,7 @@ class DialogColorPicker : public wxDialog {
|
||||||
void OnRecentSelect(wxCommandEvent &evt); // also handles dropper pick
|
void OnRecentSelect(wxCommandEvent &evt); // also handles dropper pick
|
||||||
void OnDropperMouse(wxMouseEvent &evt);
|
void OnDropperMouse(wxMouseEvent &evt);
|
||||||
void OnMouse(wxMouseEvent &evt);
|
void OnMouse(wxMouseEvent &evt);
|
||||||
|
void OnCaptureLost(wxMouseCaptureLostEvent&);
|
||||||
|
|
||||||
ColorCallback callback;
|
ColorCallback callback;
|
||||||
void *callbackUserdata;
|
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_MOTION, &DialogColorPicker::OnDropperMouse, this);
|
||||||
screen_dropper_icon->Bind(wxEVT_LEFT_DOWN, &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_LEFT_UP, &DialogColorPicker::OnDropperMouse, this);
|
||||||
|
screen_dropper_icon->Bind(wxEVT_MOUSE_CAPTURE_LOST, &DialogColorPicker::OnCaptureLost, this);
|
||||||
Bind(wxEVT_MOTION, &DialogColorPicker::OnMouse, this);
|
Bind(wxEVT_MOTION, &DialogColorPicker::OnMouse, this);
|
||||||
Bind(wxEVT_LEFT_DOWN, &DialogColorPicker::OnMouse, this);
|
Bind(wxEVT_LEFT_DOWN, &DialogColorPicker::OnMouse, this);
|
||||||
Bind(wxEVT_LEFT_UP, &DialogColorPicker::OnMouse, this);
|
Bind(wxEVT_LEFT_UP, &DialogColorPicker::OnMouse, this);
|
||||||
|
@ -1250,3 +1252,9 @@ void DialogColorPicker::OnMouse(wxMouseEvent &evt)
|
||||||
else
|
else
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogColorPicker::OnCaptureLost(wxMouseCaptureLostEvent&) {
|
||||||
|
eyedropper_is_grabbed = false;
|
||||||
|
screen_dropper_icon->SetCursor(wxNullCursor);
|
||||||
|
screen_dropper_icon->SetBitmap(eyedropper_bitmap);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue