mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-10 00:07:52 -06:00
Follow-up of 86d7e1fb90
-> Custom gcode validation in Printer settings tab
This commit is contained in:
parent
ac97572cfe
commit
9b0b0f5e27
3 changed files with 137 additions and 1 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue