mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 05:36:59 -04:00
compatibility with wxWdigets 2.9+: Handle MOUSE_CAPTURE_LOST event
git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1551 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -100,6 +100,10 @@ void HoverButtonBase::onLeftUp(wxMouseEvent&) {
|
|||||||
onClick();
|
onClick();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
void HoverButtonBase::onLoseCapture(wxMouseCaptureLostEvent&) {
|
||||||
|
// We already test for wrong release with HasCapture()
|
||||||
|
// but stupid wxWidget people decided to throw assertion failures
|
||||||
|
}
|
||||||
void HoverButtonBase::onKeyDown(wxKeyEvent& ev) {
|
void HoverButtonBase::onKeyDown(wxKeyEvent& ev) {
|
||||||
int code = ev.GetKeyCode();
|
int code = ev.GetKeyCode();
|
||||||
if (code == WXK_RETURN || code == WXK_SPACE) {
|
if (code == WXK_RETURN || code == WXK_SPACE) {
|
||||||
@@ -147,6 +151,7 @@ BEGIN_EVENT_TABLE(HoverButtonBase, wxControl)
|
|||||||
EVT_LEFT_UP (HoverButtonBase::onLeftUp)
|
EVT_LEFT_UP (HoverButtonBase::onLeftUp)
|
||||||
EVT_KEY_DOWN (HoverButtonBase::onKeyDown)
|
EVT_KEY_DOWN (HoverButtonBase::onKeyDown)
|
||||||
EVT_KEY_UP (HoverButtonBase::onKeyUp)
|
EVT_KEY_UP (HoverButtonBase::onKeyUp)
|
||||||
|
EVT_MOUSE_CAPTURE_LOST(HoverButtonBase::onLoseCapture)
|
||||||
END_EVENT_TABLE ()
|
END_EVENT_TABLE ()
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------- : Button with image and hover effect
|
// ----------------------------------------------------------------------------- : Button with image and hover effect
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ class HoverButtonBase : public wxControl {
|
|||||||
void onKillFocus (wxFocusEvent& ev);
|
void onKillFocus (wxFocusEvent& ev);
|
||||||
void onLeftUp (wxMouseEvent&);
|
void onLeftUp (wxMouseEvent&);
|
||||||
void onLeftDown (wxMouseEvent&);
|
void onLeftDown (wxMouseEvent&);
|
||||||
|
void onLoseCapture(wxMouseCaptureLostEvent&);
|
||||||
void onKeyDown (wxKeyEvent&);
|
void onKeyDown (wxKeyEvent&);
|
||||||
void onKeyUp (wxKeyEvent&);
|
void onKeyUp (wxKeyEvent&);
|
||||||
void onPaint (wxPaintEvent&);
|
void onPaint (wxPaintEvent&);
|
||||||
|
|||||||
Reference in New Issue
Block a user