From d645f669bf86dea94ca693815e90e31eeaaea5da Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 11 Nov 2018 00:19:30 -0600 Subject: [PATCH] AuiNotebook -> Notebook (mirroring change in main Slic3r) --- src/GUI/MainFrame.cpp | 18 +++--------------- src/GUI/MainFrame.hpp | 6 +++--- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/GUI/MainFrame.cpp b/src/GUI/MainFrame.cpp index 9cc5cba6b..541a8dc14 100644 --- a/src/GUI/MainFrame.cpp +++ b/src/GUI/MainFrame.cpp @@ -76,28 +76,16 @@ MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& si /// Private initialization function for the main frame tab panel. void MainFrame::init_tabpanel() { - this->tabpanel = new wxAuiNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP); + this->tabpanel = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_TOP); auto panel = this->tabpanel; - panel->Bind(wxEVT_AUINOTEBOOK_PAGE_CHANGED, ([=](wxAuiNotebookEvent& e) + panel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, ([=](wxNotebookEvent& e) { auto tabpanel = this->tabpanel; // TODO: trigger processing for activation event if (tabpanel->GetSelection() > 1) { tabpanel->SetWindowStyle(tabpanel->GetWindowStyleFlag()); - } else if (ui_settings->show_host == false && tabpanel->GetSelection() == 1) { - tabpanel->SetWindowStyle(tabpanel->GetWindowStyleFlag() | wxAUI_NB_CLOSE_ON_ACTIVE_TAB); - } else { - tabpanel->SetWindowStyle(tabpanel->GetWindowStyleFlag() | ~wxAUI_NB_CLOSE_ON_ACTIVE_TAB); - } - }), panel->GetId()); - - panel->Bind(wxEVT_AUINOTEBOOK_PAGE_CLOSE, ([=](wxAuiNotebookEvent& e) - { - if (typeid(panel) == typeid(Slic3r::GUI::PresetEditor)) { - wxDELETE(this->preset_editor_tabs[dynamic_cast(panel)->type()]); - } - wxTheApp->CallAfter([=] { this->tabpanel->SetSelection(0); }); + } }), panel->GetId()); this->plater = new Slic3r::GUI::Plater(panel, _("Plater")); diff --git a/src/GUI/MainFrame.hpp b/src/GUI/MainFrame.hpp index 1d8272231..d062c9c14 100644 --- a/src/GUI/MainFrame.hpp +++ b/src/GUI/MainFrame.hpp @@ -5,8 +5,8 @@ #ifndef WX_PRECOMP #include #endif -#include #include +#include #include #include @@ -33,7 +33,7 @@ public: bool has_plater_menu() { return this->plater_menu != nullptr; } wxMenu* plater_select_menu {nullptr}; - wxAuiNotebook* tabs() { return tabpanel; } + wxNotebook* tabs() { return tabpanel; } std::map preset_editor_tabs; private: @@ -46,7 +46,7 @@ private: // STUB: preset editor tabs storage // STUB: Statusbar reference - wxAuiNotebook* tabpanel; + wxNotebook* tabpanel; Controller* controller; Plater* plater;