mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-04 02:50:38 +08:00
AuiNotebook -> Notebook (mirroring change in main Slic3r)
This commit is contained in:
parent
b869947f9a
commit
d645f669bf
@ -76,28 +76,16 @@ MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& si
|
|||||||
/// Private initialization function for the main frame tab panel.
|
/// Private initialization function for the main frame tab panel.
|
||||||
void MainFrame::init_tabpanel()
|
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;
|
auto panel = this->tabpanel;
|
||||||
|
|
||||||
panel->Bind(wxEVT_AUINOTEBOOK_PAGE_CHANGED, ([=](wxAuiNotebookEvent& e)
|
panel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, ([=](wxNotebookEvent& e)
|
||||||
{
|
{
|
||||||
auto tabpanel = this->tabpanel;
|
auto tabpanel = this->tabpanel;
|
||||||
// TODO: trigger processing for activation event
|
// TODO: trigger processing for activation event
|
||||||
if (tabpanel->GetSelection() > 1) {
|
if (tabpanel->GetSelection() > 1) {
|
||||||
tabpanel->SetWindowStyle(tabpanel->GetWindowStyleFlag());
|
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());
|
}), panel->GetId());
|
||||||
|
|
||||||
this->plater = new Slic3r::GUI::Plater(panel, _("Plater"));
|
this->plater = new Slic3r::GUI::Plater(panel, _("Plater"));
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
#ifndef WX_PRECOMP
|
#ifndef WX_PRECOMP
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
#endif
|
#endif
|
||||||
#include <wx/aui/auibook.h>
|
|
||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
|
#include <wx/notebook.h>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <map>
|
#include <map>
|
||||||
@ -33,7 +33,7 @@ public:
|
|||||||
|
|
||||||
bool has_plater_menu() { return this->plater_menu != nullptr; }
|
bool has_plater_menu() { return this->plater_menu != nullptr; }
|
||||||
wxMenu* plater_select_menu {nullptr};
|
wxMenu* plater_select_menu {nullptr};
|
||||||
wxAuiNotebook* tabs() { return tabpanel; }
|
wxNotebook* tabs() { return tabpanel; }
|
||||||
|
|
||||||
std::map<preset_t, PresetEditor*> preset_editor_tabs;
|
std::map<preset_t, PresetEditor*> preset_editor_tabs;
|
||||||
private:
|
private:
|
||||||
@ -46,7 +46,7 @@ private:
|
|||||||
// STUB: preset editor tabs storage
|
// STUB: preset editor tabs storage
|
||||||
// STUB: Statusbar reference
|
// STUB: Statusbar reference
|
||||||
|
|
||||||
wxAuiNotebook* tabpanel;
|
wxNotebook* tabpanel;
|
||||||
Controller* controller;
|
Controller* controller;
|
||||||
Plater* plater;
|
Plater* plater;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user