Fixed crash on BedShapeDialog creation
This commit is contained in:
parent
d5bd76776f
commit
5243d3e53c
2 changed files with 11 additions and 4 deletions
|
@ -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));
|
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::RectSize);
|
||||||
BedShape::append_option_line(optgroup, BedShape::Parameter::RectOrigin);
|
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));
|
optgroup = init_shape_options_page(BedShape::get_name(BedShape::Type::Circular));
|
||||||
BedShape::append_option_line(optgroup, BedShape::Parameter::Diameter);
|
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));
|
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;
|
return sizer;
|
||||||
};
|
};
|
||||||
optgroup->append_line(line);
|
optgroup->append_line(line);
|
||||||
optgroup->activate();
|
activate_options_page(optgroup);
|
||||||
|
|
||||||
wxPanel* texture_panel = init_texture_panel();
|
wxPanel* texture_panel = init_texture_panel();
|
||||||
wxPanel* model_panel = init_model_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);
|
m_optgroups.push_back(optgroup);
|
||||||
panel->SetSizerAndFit(optgroup->sizer);
|
// panel->SetSizerAndFit(optgroup->sizer);
|
||||||
m_shape_options_book->AddPage(panel, title);
|
m_shape_options_book->AddPage(panel, title);
|
||||||
|
|
||||||
return optgroup;
|
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* BedShapePanel::init_texture_panel()
|
||||||
{
|
{
|
||||||
wxPanel* panel = new wxPanel(this);
|
wxPanel* panel = new wxPanel(this);
|
||||||
|
|
|
@ -75,6 +75,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ConfigOptionsGroupShp init_shape_options_page(const wxString& title);
|
ConfigOptionsGroupShp init_shape_options_page(const wxString& title);
|
||||||
|
void activate_options_page(ConfigOptionsGroupShp options_group);
|
||||||
wxPanel* init_texture_panel();
|
wxPanel* init_texture_panel();
|
||||||
wxPanel* init_model_panel();
|
wxPanel* init_model_panel();
|
||||||
void set_shape(const ConfigOptionPoints& points);
|
void set_shape(const ConfigOptionPoints& points);
|
||||||
|
|
Loading…
Reference in a new issue