mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
Follow-up of 908c48ae6a
-> Fixed update after switching tab after editing custom g-code in settings tabs (#6258)
This commit is contained in:
parent
991fa67fd1
commit
4496e2a8ce
3 changed files with 17 additions and 32 deletions
|
@ -525,7 +525,13 @@ void MainFrame::init_tabpanel()
|
|||
m_tabpanel->Hide();
|
||||
m_settings_dialog.set_tabpanel(m_tabpanel);
|
||||
|
||||
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxEvent&) {
|
||||
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGED, [this](wxBookCtrlEvent& e) {
|
||||
#if ENABLE_VALIDATE_CUSTOM_GCODE
|
||||
Tab* old_tab = dynamic_cast<Tab*>(m_tabpanel->GetPage(e.GetOldSelection()));
|
||||
if (old_tab)
|
||||
old_tab->validate_custom_gcodes();
|
||||
#endif // ENABLE_VALIDATE_CUSTOM_GCODE
|
||||
|
||||
wxWindow* panel = m_tabpanel->GetCurrentPage();
|
||||
Tab* tab = dynamic_cast<Tab*>(panel);
|
||||
|
||||
|
@ -544,19 +550,6 @@ void MainFrame::init_tabpanel()
|
|||
select_tab(size_t(0)); // select Plater
|
||||
});
|
||||
|
||||
#if ENABLE_VALIDATE_CUSTOM_GCODE
|
||||
m_tabpanel->Bind(wxEVT_NOTEBOOK_PAGE_CHANGING, [this](wxBookCtrlEvent& evt) {
|
||||
wxWindow* panel = m_tabpanel->GetCurrentPage();
|
||||
if (panel != nullptr) {
|
||||
Tab* tab = dynamic_cast<Tab*>(panel);
|
||||
if (tab != nullptr)
|
||||
tab->validate_custom_gcodes();
|
||||
// if (tab != nullptr && !tab->validate_custom_gcodes())
|
||||
// evt.Veto();
|
||||
}
|
||||
});
|
||||
#endif // ENABLE_VALIDATE_CUSTOM_GCODE
|
||||
|
||||
m_plater = new Plater(this, this);
|
||||
m_plater->Hide();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue