mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-10 13:06:59 -04:00
* compatibility with wxWdigets 2.9+: use HandleWindowEvent instead of ProcessEvent
* compatibility with wxWdigets 2.9+: Handle MOUSE_CAPTURE_LOST event * use wxBORDER_THEME for custom controls git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1559 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
@@ -342,6 +342,11 @@ RealPoint DataEditor::mousePoint(const wxMouseEvent& ev, const ValueViewer& view
|
||||
return rot.trInv(RealPoint(ev.GetX(), ev.GetY()));
|
||||
}
|
||||
|
||||
void DataEditor::onLoseCapture(wxMouseCaptureLostEvent&) {
|
||||
// We already test for wrong release with HasCapture()
|
||||
// but stupid wxwidget people decided to throw assertion failures
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------- : Keyboard events
|
||||
|
||||
void DataEditor::onChar(wxKeyEvent& ev) {
|
||||
@@ -351,14 +356,14 @@ void DataEditor::onChar(wxKeyEvent& ev) {
|
||||
if (selectNext()) return;
|
||||
// send a navigation event to our parent, to select another control
|
||||
wxNavigationKeyEvent evt;
|
||||
GetParent()->ProcessEvent(evt);
|
||||
GetParent()->HandleWindowEvent(evt);
|
||||
} else {
|
||||
// try to select the previos editor
|
||||
if (selectPrevious()) return;
|
||||
// send a navigation event to our parent, to select another control
|
||||
wxNavigationKeyEvent evt;
|
||||
evt.SetDirection(false);
|
||||
GetParent()->ProcessEvent(evt);
|
||||
GetParent()->HandleWindowEvent(evt);
|
||||
}
|
||||
} else if (current_editor) {
|
||||
current_editor->onChar(ev);
|
||||
@@ -427,4 +432,5 @@ BEGIN_EVENT_TABLE(DataEditor, CardViewer)
|
||||
EVT_CHAR (DataEditor::onChar)
|
||||
EVT_SET_FOCUS (DataEditor::onFocus)
|
||||
EVT_KILL_FOCUS (DataEditor::onLoseFocus)
|
||||
EVT_MOUSE_CAPTURE_LOST(DataEditor::onLoseCapture)
|
||||
END_EVENT_TABLE ()
|
||||
|
||||
Reference in New Issue
Block a user