mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 04:57:00 -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();
|
||||
}
|
||||
}
|
||||
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) {
|
||||
int code = ev.GetKeyCode();
|
||||
if (code == WXK_RETURN || code == WXK_SPACE) {
|
||||
@@ -147,6 +151,7 @@ BEGIN_EVENT_TABLE(HoverButtonBase, wxControl)
|
||||
EVT_LEFT_UP (HoverButtonBase::onLeftUp)
|
||||
EVT_KEY_DOWN (HoverButtonBase::onKeyDown)
|
||||
EVT_KEY_UP (HoverButtonBase::onKeyUp)
|
||||
EVT_MOUSE_CAPTURE_LOST(HoverButtonBase::onLoseCapture)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
// ----------------------------------------------------------------------------- : Button with image and hover effect
|
||||
|
||||
@@ -50,6 +50,7 @@ class HoverButtonBase : public wxControl {
|
||||
void onKillFocus (wxFocusEvent& ev);
|
||||
void onLeftUp (wxMouseEvent&);
|
||||
void onLeftDown (wxMouseEvent&);
|
||||
void onLoseCapture(wxMouseCaptureLostEvent&);
|
||||
void onKeyDown (wxKeyEvent&);
|
||||
void onKeyUp (wxKeyEvent&);
|
||||
void onPaint (wxPaintEvent&);
|
||||
|
||||
Reference in New Issue
Block a user