mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-14 04:36:10 +08:00
Start to set up the internal sizer as a wxFlexGridSizer
This commit is contained in:
parent
c5e9ee9a46
commit
378330d747
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user