mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-17 03:37:54 -06:00
ConfigWizard: Finalize custom setup
This commit is contained in:
parent
e53949f2c8
commit
8422cf93c0
4 changed files with 212 additions and 77 deletions
|
@ -8,9 +8,13 @@
|
|||
#include <wx/sizer.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/choice.h>
|
||||
#include <wx/spinctrl.h>
|
||||
|
||||
#include "libslic3r/PrintConfig.hpp"
|
||||
#include "AppConfig.hpp"
|
||||
#include "PresetBundle.hpp"
|
||||
#include "BedShapeDialog.hpp"
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
@ -21,6 +25,8 @@ enum {
|
|||
DIALOG_MARGIN = 15,
|
||||
INDEX_MARGIN = 40,
|
||||
BTN_SPACING = 10,
|
||||
INDENT_SPACING = 30,
|
||||
VERTICAL_SPACING = 10,
|
||||
};
|
||||
|
||||
struct ConfigWizardPage: wxPanel
|
||||
|
@ -41,17 +47,13 @@ struct ConfigWizardPage: wxPanel
|
|||
ConfigWizardPage* page_next() const { return p_next; }
|
||||
ConfigWizardPage* chain(ConfigWizardPage *page);
|
||||
|
||||
void append_text(wxString text);
|
||||
void append_widget(wxWindow *widget, int proportion = 0, int flag = wxEXPAND|wxTOP|wxBOTTOM, int border = 10);
|
||||
|
||||
template<class T>
|
||||
void append_thing(T *thing, int proportion = 0, int flag = wxEXPAND|wxTOP|wxBOTTOM, int border = 10)
|
||||
void append(T *thing, int proportion = 0, int flag = wxEXPAND|wxTOP|wxBOTTOM, int border = 10)
|
||||
{
|
||||
content->Add(thing, proportion, flag, border);
|
||||
}
|
||||
|
||||
// TODO: remove:
|
||||
void append_sizer(wxSizer *sizer, int proportion = 0);
|
||||
void append_text(wxString text);
|
||||
void append_spacer(int space);
|
||||
|
||||
ConfigWizard::priv *wizard_p() const { return parent->p.get(); }
|
||||
|
@ -60,6 +62,7 @@ struct ConfigWizardPage: wxPanel
|
|||
virtual bool Hide() { return Show(false); }
|
||||
virtual wxPanel* extra_buttons() { return nullptr; }
|
||||
virtual void on_page_set() {}
|
||||
virtual void apply_custom_config(DynamicPrintConfig &config) {}
|
||||
|
||||
void enable_next(bool enable);
|
||||
private:
|
||||
|
@ -84,10 +87,8 @@ struct PageUpdate: ConfigWizardPage
|
|||
{
|
||||
bool version_check;
|
||||
bool preset_update;
|
||||
|
||||
PageUpdate(ConfigWizard *parent);
|
||||
|
||||
void presets_update_enable(bool enable);
|
||||
PageUpdate(ConfigWizard *parent);
|
||||
};
|
||||
|
||||
struct PageVendors: ConfigWizardPage
|
||||
|
@ -97,22 +98,37 @@ struct PageVendors: ConfigWizardPage
|
|||
|
||||
struct PageFirmware: ConfigWizardPage
|
||||
{
|
||||
const ConfigOptionDef &gcode_opt;
|
||||
wxChoice *gcode_picker;
|
||||
|
||||
PageFirmware(ConfigWizard *parent);
|
||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
||||
};
|
||||
|
||||
struct PageBedShape: ConfigWizardPage
|
||||
{
|
||||
BedShapePanel *shape_panel;
|
||||
|
||||
PageBedShape(ConfigWizard *parent);
|
||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
||||
};
|
||||
|
||||
struct PageDiameters: ConfigWizardPage
|
||||
{
|
||||
wxSpinCtrlDouble *spin_nozzle;
|
||||
wxSpinCtrlDouble *spin_filam;
|
||||
|
||||
PageDiameters(ConfigWizard *parent);
|
||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
||||
};
|
||||
|
||||
struct PageTemperatures: ConfigWizardPage
|
||||
{
|
||||
wxSpinCtrl *spin_extr;
|
||||
wxSpinCtrl *spin_bed;
|
||||
|
||||
PageTemperatures(ConfigWizard *parent);
|
||||
virtual void apply_custom_config(DynamicPrintConfig &config);
|
||||
};
|
||||
|
||||
|
||||
|
@ -133,7 +149,7 @@ private:
|
|||
std::vector<wxString> items;
|
||||
std::vector<wxString>::const_iterator item_active;
|
||||
|
||||
void on_paint(wxPaintEvent & evt);
|
||||
void on_paint(wxPaintEvent &evt);
|
||||
};
|
||||
|
||||
struct ConfigWizard::priv
|
||||
|
@ -141,6 +157,7 @@ struct ConfigWizard::priv
|
|||
ConfigWizard *q;
|
||||
AppConfig appconfig_vendors;
|
||||
PresetBundle bundle_vendors;
|
||||
DynamicPrintConfig custom_config;
|
||||
|
||||
wxBoxSizer *topsizer = nullptr;
|
||||
wxBoxSizer *btnsizer = nullptr;
|
||||
|
@ -171,7 +188,8 @@ struct ConfigWizard::priv
|
|||
|
||||
void on_other_vendors();
|
||||
void on_custom_setup();
|
||||
void on_finish();
|
||||
|
||||
void apply_config(AppConfig *app_config, PresetBundle *preset_bundle);
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue