mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-12 21:47:00 -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()));
|
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
|
// ----------------------------------------------------------------------------- : Keyboard events
|
||||||
|
|
||||||
void DataEditor::onChar(wxKeyEvent& ev) {
|
void DataEditor::onChar(wxKeyEvent& ev) {
|
||||||
@@ -351,14 +356,14 @@ void DataEditor::onChar(wxKeyEvent& ev) {
|
|||||||
if (selectNext()) return;
|
if (selectNext()) return;
|
||||||
// send a navigation event to our parent, to select another control
|
// send a navigation event to our parent, to select another control
|
||||||
wxNavigationKeyEvent evt;
|
wxNavigationKeyEvent evt;
|
||||||
GetParent()->ProcessEvent(evt);
|
GetParent()->HandleWindowEvent(evt);
|
||||||
} else {
|
} else {
|
||||||
// try to select the previos editor
|
// try to select the previos editor
|
||||||
if (selectPrevious()) return;
|
if (selectPrevious()) return;
|
||||||
// send a navigation event to our parent, to select another control
|
// send a navigation event to our parent, to select another control
|
||||||
wxNavigationKeyEvent evt;
|
wxNavigationKeyEvent evt;
|
||||||
evt.SetDirection(false);
|
evt.SetDirection(false);
|
||||||
GetParent()->ProcessEvent(evt);
|
GetParent()->HandleWindowEvent(evt);
|
||||||
}
|
}
|
||||||
} else if (current_editor) {
|
} else if (current_editor) {
|
||||||
current_editor->onChar(ev);
|
current_editor->onChar(ev);
|
||||||
@@ -427,4 +432,5 @@ BEGIN_EVENT_TABLE(DataEditor, CardViewer)
|
|||||||
EVT_CHAR (DataEditor::onChar)
|
EVT_CHAR (DataEditor::onChar)
|
||||||
EVT_SET_FOCUS (DataEditor::onFocus)
|
EVT_SET_FOCUS (DataEditor::onFocus)
|
||||||
EVT_KILL_FOCUS (DataEditor::onLoseFocus)
|
EVT_KILL_FOCUS (DataEditor::onLoseFocus)
|
||||||
|
EVT_MOUSE_CAPTURE_LOST(DataEditor::onLoseCapture)
|
||||||
END_EVENT_TABLE ()
|
END_EVENT_TABLE ()
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class FindInfo;
|
|||||||
/// An editor for data values (usually a card)
|
/// An editor for data values (usually a card)
|
||||||
class DataEditor : public CardViewer {
|
class DataEditor : public CardViewer {
|
||||||
public:
|
public:
|
||||||
DataEditor(Window* parent, int id, long style = 0);
|
DataEditor(Window* parent, int id, long style = wxBORDER_THEME);
|
||||||
|
|
||||||
// --------------------------------------------------- : Utility for ValueViewers/Editors
|
// --------------------------------------------------- : Utility for ValueViewers/Editors
|
||||||
|
|
||||||
@@ -108,6 +108,7 @@ class DataEditor : public CardViewer {
|
|||||||
void onMotion (wxMouseEvent&);
|
void onMotion (wxMouseEvent&);
|
||||||
void onMouseWheel(wxMouseEvent&);
|
void onMouseWheel(wxMouseEvent&);
|
||||||
void onMouseLeave(wxMouseEvent&);
|
void onMouseLeave(wxMouseEvent&);
|
||||||
|
void onLoseCapture(wxMouseCaptureLostEvent&);
|
||||||
|
|
||||||
void onChar (wxKeyEvent&);
|
void onChar (wxKeyEvent&);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user