mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Follow-up of 86d7e1fb90 -> Custom gcode validation in Printer settings tab
This commit is contained in:
@@ -544,6 +544,20 @@ 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) {
|
||||
TabPrinter* printer_tab = dynamic_cast<TabPrinter*>(panel);
|
||||
if (printer_tab != nullptr) {
|
||||
if (!printer_tab->validate_custom_gcodes())
|
||||
evt.Veto();
|
||||
}
|
||||
}
|
||||
});
|
||||
#endif // ENABLE_VALIDATE_CUSTOM_GCODE
|
||||
|
||||
|
||||
m_plater = new Plater(this, this);
|
||||
m_plater->Hide();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user