Add reference to Slic3r::Print to PresetChooser.

This commit is contained in:
Joseph Lenox 2018-11-18 00:41:37 -06:00 committed by Joseph Lenox
parent cfcf569a5e
commit 0a1d8f89af
2 changed files with 11 additions and 3 deletions

View File

@ -2,8 +2,11 @@
namespace Slic3r { namespace GUI {
PresetChooser::PresetChooser(wxWindow* parent) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, "")
PresetChooser::PresetChooser(wxWindow* parent, Print& print) : PresetChooser(parent, print, SLIC3RAPP->settings) {}
PresetChooser::PresetChooser(wxWindow* parent, Print& print, Settings& external) :
wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, ""),
_settings(external), _print(print)
{
for (auto group : { preset_t::Print, preset_t::Material, preset_t::Printer }) {
wxString name = "";

View File

@ -20,7 +20,10 @@ using chooser_name_map = std::array<chooser_name_list, preset_types>;
class PresetChooser : public wxPanel {
public:
PresetChooser(wxWindow* parent);
/// Build a panel to contain a sizer for dropdowns for preset selection.
PresetChooser(wxWindow* parent, Print& print);
PresetChooser(wxWindow* parent, Print& print, Settings& external);
std::array<Choosers, preset_types> preset_choosers;
@ -38,6 +41,8 @@ private:
wxSizer* local_sizer {};
void _on_change_combobox(preset_t preset, wxBitmapComboBox* choice);
chooser_name_map __chooser_names;
/// Reference to owning Plater's print
Print& _print;
};