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:
twanvl
2010-12-07 21:20:54 +00:00
parent cbb47ff265
commit 3df48aa489
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -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
+1
View File
@@ -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&);