Implement unique IDs and card linking

This commit is contained in:
GenevensiS
2025-08-11 16:17:13 +02:00
committed by GitHub
parent 13406b946c
commit 3bf9de18b1
100 changed files with 2432 additions and 1219 deletions
+23
View File
@@ -9,6 +9,7 @@
#include <util/prec.hpp>
#include <gui/control/card_editor.hpp>
#include <gui/value/editor.hpp>
#include <gui/set/cards_panel.hpp>
#include <gui/util.hpp>
#include <data/field.hpp>
#include <data/stylesheet.hpp>
@@ -360,6 +361,16 @@ void DataEditor::onMotion(wxMouseEvent& ev) {
}
}
void DataEditor::onMouseEnter(wxMouseEvent& ev) {
ev.Skip();
if (GetId() == ID_CARD_LINK_EDITOR) {
CardsPanel* panel = dynamic_cast<CardsPanel*> (GetParent());
if (panel) {
panel->refreshCard(card);
}
}
}
void DataEditor::onMouseLeave(wxMouseEvent& ev) {
// on mouse leave for editor
if (hovered_viewer) {
@@ -462,6 +473,13 @@ void DataEditor::onChar(wxKeyEvent& ev) {
} else {
ev.Skip();
}
if (GetId() == ID_CARD_LINK_EDITOR) {
CardsPanel* panel = dynamic_cast<CardsPanel*> (GetParent());
if (panel) {
panel->refreshCard(card);
}
}
}
// ----------------------------------------------------------------------------- : Menu events
@@ -503,6 +521,10 @@ void DataEditor::onFocus(wxFocusEvent& ev) {
selectFirst();
}
}
CardsPanel* panel = dynamic_cast<CardsPanel*> (GetParent());
if (panel) {
panel->setFocusedEditor(this);
}
}
void DataEditor::onLoseFocus(wxFocusEvent& ev) {
if (current_editor) {
@@ -520,6 +542,7 @@ BEGIN_EVENT_TABLE(DataEditor, CardViewer)
EVT_RIGHT_DOWN (DataEditor::onRightDown)
EVT_MOTION (DataEditor::onMotion)
EVT_MOUSEWHEEL (DataEditor::onMouseWheel)
EVT_ENTER_WINDOW (DataEditor::onMouseEnter)
EVT_LEAVE_WINDOW (DataEditor::onMouseLeave)
EVT_CONTEXT_MENU (DataEditor::onContextMenu)
EVT_MENU (wxID_ANY, DataEditor::onMenu)