Follow-up of 86d7e1fb90 -> Custom gcode validation in Printer settings tab

This commit is contained in:
enricoturri1966 2021-02-22 08:13:48 +01:00
parent ac97572cfe
commit 9b0b0f5e27
3 changed files with 137 additions and 1 deletions

View file

@ -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();