diff --git a/src/slic3r/GUI/GUI_Utils.cpp b/src/slic3r/GUI/GUI_Utils.cpp index 8fff2d208..b538718e1 100644 --- a/src/slic3r/GUI/GUI_Utils.cpp +++ b/src/slic3r/GUI/GUI_Utils.cpp @@ -48,7 +48,7 @@ CheckboxFileDialog::CheckboxFileDialog(wxWindow *parent, return panel; }; - SetExtraControlCreator(*extra_control_creator.target()); + SetExtraControlCreator(control_creator_trampoline); } bool CheckboxFileDialog::get_checkbox_value() const @@ -56,6 +56,11 @@ bool CheckboxFileDialog::get_checkbox_value() const return this->cbox != nullptr ? cbox->IsChecked() : false; } +wxWindow* CheckboxFileDialog::control_creator_trampoline(wxWindow *parent) +{ + auto *self = dynamic_cast(parent); + return self != nullptr ? self->extra_control_creator(parent) : nullptr; +} WindowMetrics WindowMetrics::from_window(wxTopLevelWindow *window) diff --git a/src/slic3r/GUI/GUI_Utils.hpp b/src/slic3r/GUI/GUI_Utils.hpp index 1c776df81..827bacfce 100644 --- a/src/slic3r/GUI/GUI_Utils.hpp +++ b/src/slic3r/GUI/GUI_Utils.hpp @@ -39,6 +39,8 @@ public: private: std::function extra_control_creator; wxCheckBox *cbox; + + static wxWindow* control_creator_trampoline(wxWindow *); };