Start to set up the internal sizer as a wxFlexGridSizer

This commit is contained in:
Joseph Lenox 2018-11-18 11:39:29 -06:00 committed by Joseph Lenox
parent c5e9ee9a46
commit 378330d747
2 changed files with 7 additions and 2 deletions

View File

@ -6,8 +6,11 @@ PresetChooser::PresetChooser(wxWindow* parent, Print& print) : PresetChooser(par
PresetChooser::PresetChooser(wxWindow* parent, Print& print, Settings& external_settings, preset_store& external_presets) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, ""),
_settings(external_settings), _print(print), _presets(external_presets)
_local_sizer(new wxFlexGridSizer(3,3,1,2)), _parent(parent), _settings(external_settings), _print(print), _presets(external_presets)
{
_local_sizer->AddGrowableCol(1, 1);
_local_sizer->SetFlexibleDirection(wxHORIZONTAL);
for (auto group : { preset_t::Print, preset_t::Material, preset_t::Printer }) {
wxString name = "";
switch(group) {
@ -36,6 +39,8 @@ PresetChooser::PresetChooser(wxWindow* parent, Print& print, Settings& external_
wxTheApp->CallAfter([=]() { this->_on_change_combobox(group, choice);} );
});
}
this->SetSizer(_local_sizer);
}
void PresetChooser::load(std::array<Presets, preset_types> presets) {

View File

@ -64,7 +64,7 @@ public:
/// Cycle through active presets and prompt user to save dirty configs, if necessary.
bool prompt_unsaved_changes();
private:
wxSizer* local_sizer {};
wxFlexGridSizer* _local_sizer {};
void _on_change_combobox(preset_t preset, wxBitmapComboBox* choice);
chooser_name_map __chooser_names;