Fixed crash on BedShapeDialog creation

This commit is contained in:
YuSanka 2020-09-25 10:44:22 +02:00
parent d5bd76776f
commit 5243d3e53c
2 changed files with 11 additions and 4 deletions

View File

@ -229,11 +229,11 @@ void BedShapePanel::build_panel(const ConfigOptionPoints& default_pt, const Conf
auto optgroup = init_shape_options_page(BedShape::get_name(BedShape::Type::Rectangular));
BedShape::append_option_line(optgroup, BedShape::Parameter::RectSize);
BedShape::append_option_line(optgroup, BedShape::Parameter::RectOrigin);
optgroup->activate();
activate_options_page(optgroup);
optgroup = init_shape_options_page(BedShape::get_name(BedShape::Type::Circular));
BedShape::append_option_line(optgroup, BedShape::Parameter::Diameter);
optgroup->activate();
activate_options_page(optgroup);
optgroup = init_shape_options_page(BedShape::get_name(BedShape::Type::Custom));
@ -254,7 +254,7 @@ void BedShapePanel::build_panel(const ConfigOptionPoints& default_pt, const Conf
return sizer;
};
optgroup->append_line(line);
optgroup->activate();
activate_options_page(optgroup);
wxPanel* texture_panel = init_texture_panel();
wxPanel* model_panel = init_model_panel();
@ -297,12 +297,18 @@ ConfigOptionsGroupShp BedShapePanel::init_shape_options_page(const wxString& tit
};
m_optgroups.push_back(optgroup);
panel->SetSizerAndFit(optgroup->sizer);
// panel->SetSizerAndFit(optgroup->sizer);
m_shape_options_book->AddPage(panel, title);
return optgroup;
}
void BedShapePanel::activate_options_page(ConfigOptionsGroupShp options_group)
{
options_group->activate();
options_group->parent()->SetSizerAndFit(options_group->sizer);
}
wxPanel* BedShapePanel::init_texture_panel()
{
wxPanel* panel = new wxPanel(this);

View File

@ -75,6 +75,7 @@ public:
private:
ConfigOptionsGroupShp init_shape_options_page(const wxString& title);
void activate_options_page(ConfigOptionsGroupShp options_group);
wxPanel* init_texture_panel();
wxPanel* init_model_panel();
void set_shape(const ConfigOptionPoints& points);