From 407f50a66f4cd28e322807f52be95be13bfaa54c Mon Sep 17 00:00:00 2001 From: YuSanka Date: Tue, 6 Feb 2018 14:53:38 +0100 Subject: [PATCH] Deleted on more EVT_NOTEBOOK_PAGE_CHANGE hangling of TabPanel --- xs/src/slic3r/GUI/GUI.cpp | 12 ++++++------ xs/src/slic3r/GUI/TabIface.cpp | 1 + xs/src/slic3r/GUI/TabIface.hpp | 1 + xs/xsp/GUI_Tab.xsp | 3 ++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/xs/src/slic3r/GUI/GUI.cpp b/xs/src/slic3r/GUI/GUI.cpp index 934ff5fbd..87bae567f 100644 --- a/xs/src/slic3r/GUI/GUI.cpp +++ b/xs/src/slic3r/GUI/GUI.cpp @@ -195,12 +195,12 @@ void create_preset_tabs(PresetBundle *preset_bundle, AppConfig *app_config, add_created_tab(new TabFilament (g_wxTabPanel, no_controller), preset_bundle, app_config); add_created_tab(new TabPrinter (g_wxTabPanel, no_controller, is_disabled_button_browse, is_user_agent), preset_bundle, app_config); - g_wxTabPanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, ([](wxCommandEvent e){ - Tab* panel = (Tab*)g_wxTabPanel->GetCurrentPage(); - if (panel->GetName().compare("Print Settings")==0 || - panel->GetName().compare("Filament Settings") == 0) - panel->OnActivate(); - }), g_wxTabPanel->GetId() ); +// g_wxTabPanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, ([](wxCommandEvent e){ +// Tab* panel = (Tab*)g_wxTabPanel->GetCurrentPage(); +// if (panel->GetName().compare("Print Settings")==0 || +// panel->GetName().compare("Filament Settings") == 0) +// panel->OnActivate(); +// }), g_wxTabPanel->GetId() ); for (size_t i = 0; i < g_wxTabPanel->GetPageCount(); ++ i) { Tab *tab = dynamic_cast(g_wxTabPanel->GetPage(i)); if (! tab) diff --git a/xs/src/slic3r/GUI/TabIface.cpp b/xs/src/slic3r/GUI/TabIface.cpp index c4e41a41c..27d62b044 100644 --- a/xs/src/slic3r/GUI/TabIface.cpp +++ b/xs/src/slic3r/GUI/TabIface.cpp @@ -11,6 +11,7 @@ char* TabIface::title() { return (char*)m_tab->title().ToStdString().data(); void TabIface::load_config(DynamicPrintConfig* config) { m_tab->load_config(*config);} void TabIface::load_key_value(char* opt_key, char* value){ m_tab->load_key_value(opt_key, static_cast(value)); } bool TabIface::current_preset_is_dirty() { return m_tab->current_preset_is_dirty();} +void TabIface::OnActivate() { return m_tab->OnActivate();} DynamicPrintConfig* TabIface::get_config() { return m_tab->get_config(); } PresetCollection* TabIface::get_presets() { return m_tab->get_presets(); } std::vector TabIface::get_dependent_tabs() { return m_tab->get_dependent_tabs(); } diff --git a/xs/src/slic3r/GUI/TabIface.hpp b/xs/src/slic3r/GUI/TabIface.hpp index 8c07ba90a..cba2c2ed1 100644 --- a/xs/src/slic3r/GUI/TabIface.hpp +++ b/xs/src/slic3r/GUI/TabIface.hpp @@ -23,6 +23,7 @@ public: void load_config(DynamicPrintConfig* config); void load_key_value(char* opt_key, char* value); bool current_preset_is_dirty(); + void OnActivate(); DynamicPrintConfig* get_config(); PresetCollection* get_presets(); std::vector get_dependent_tabs(); diff --git a/xs/xsp/GUI_Tab.xsp b/xs/xsp/GUI_Tab.xsp index 7dddbbff2..35e1cb9e6 100644 --- a/xs/xsp/GUI_Tab.xsp +++ b/xs/xsp/GUI_Tab.xsp @@ -15,7 +15,8 @@ void load_config(DynamicPrintConfig* config); bool current_preset_is_dirty(); void load_key_value(char* opt_key, char* value); - char* title(); + char* title(); + void OnActivate(); Ref get_config(); Ref get_presets(); std::vector get_dependent_tabs();