AuiNotebook -> Notebook (mirroring change in main Slic3r)

This commit is contained in:
Joseph Lenox 2018-11-11 00:19:30 -06:00 committed by Joseph Lenox
parent b869947f9a
commit d645f669bf
2 changed files with 6 additions and 18 deletions

View File

@ -76,30 +76,18 @@ 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<PresetEditor*>(panel)->type()]);
}
wxTheApp->CallAfter([=] { this->tabpanel->SetSelection(0); });
}), panel->GetId());
this->plater = new Slic3r::GUI::Plater(panel, _("Plater"));
this->controller = new Slic3r::GUI::Controller(panel, _("Controller"));

View File

@ -5,8 +5,8 @@
#ifndef WX_PRECOMP
#include <wx/wx.h>
#endif
#include <wx/aui/auibook.h>
#include <wx/tooltip.h>
#include <wx/notebook.h>
#include <memory>
#include <map>
@ -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_t, PresetEditor*> 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;