diff --git a/src/gui/set/console_panel.cpp b/src/gui/set/console_panel.cpp index 84b9f64f..89c10a17 100644 --- a/src/gui/set/console_panel.cpp +++ b/src/gui/set/console_panel.cpp @@ -321,7 +321,11 @@ ConsolePanel::ConsolePanel(Window* parent, int id) } void ConsolePanel::onChangeSet() { - // TODO + card = CardP(); +} + +void ConsolePanel::selectCard(const CardP& card) { + this->card = card; } // ----------------------------------------------------------------------------- : UI @@ -397,7 +401,7 @@ void ConsolePanel::exec(String const& command) { } // execute command //WITH_DYNAMIC_ARG(export_info, &ei); // TODO: allow image export - Context& ctx = set->getContext(); + Context& ctx = set->getContext(card); ScriptValueP result = ctx.eval(*script,false); get_pending_errors(); // show result diff --git a/src/gui/set/console_panel.hpp b/src/gui/set/console_panel.hpp index a727e0d9..233127c2 100644 --- a/src/gui/set/console_panel.hpp +++ b/src/gui/set/console_panel.hpp @@ -19,7 +19,7 @@ class TextCtrl; // ----------------------------------------------------------------------------- : ConsolePanel class ConsolePanel : public SetWindowPanel { - public: +public: ConsolePanel(Window* parent, int id); // --------------------------------------------------- : UI @@ -37,12 +37,15 @@ class ConsolePanel : public SetWindowPanel { virtual bool canCopy() const; virtual void doCopy(); - protected: - virtual void onChangeSet(); +protected: + void onChangeSet() override; + void selectCard(const CardP& card) override; - private: +private: DECLARE_EVENT_TABLE(); + CardP card; + wxSplitterWindow* splitter; MessageCtrl* messages; wxPanel* entry_panel;