OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PageCustom Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/ConfigWizard_private.hpp>

Inheritance diagram for Slic3r::GUI::PageCustom:
Collaboration diagram for Slic3r::GUI::PageCustom:

Public Member Functions

 PageCustom (ConfigWizard *parent)
bool custom_wanted () const
std::string profile_name () const
template<class T>
T * append (T *thing, int proportion=0, int flag=wxEXPAND|wxTOP|wxBOTTOM, int border=10)
wxStaticText * append_text (wxString text)
void append_spacer (int space)
ConfigWizard::priv * wizard_p () const
virtual void apply_custom_config (DynamicPrintConfig &config)
virtual void set_run_reason (ConfigWizard::RunReason run_reason)
virtual void on_activate ()

Public Attributes

ConfigWizard * parent
const wxString shortname
wxBoxSizer * content
const unsigned indent

Private Attributes

wxCheckBox * cb_custom
wxTextCtrl * tc_profile_name
wxString profile_name_prev

Static Private Attributes

static const char * default_profile_name = L("My Settings")

Detailed Description

Constructor & Destructor Documentation

◆ PageCustom()

Slic3r::GUI::PageCustom::PageCustom ( ConfigWizard * parent)
1216 : ConfigWizardPage(parent, _L("Custom Printer Setup"), _L("Custom Printer"))
1217{
1218 cb_custom = new wxCheckBox(this, wxID_ANY, _L("Define a custom printer profile"));
1219 tc_profile_name = new wxTextCtrl(this, wxID_ANY, _L(default_profile_name));
1220 auto *label = new wxStaticText(this, wxID_ANY, _L("Custom profile name:"));
1221
1222 wxGetApp().UpdateDarkUI(tc_profile_name);
1223
1224 tc_profile_name->Enable(false);
1225 tc_profile_name->Bind(wxEVT_KILL_FOCUS, [this](wxFocusEvent &evt) {
1226 if (tc_profile_name->GetValue().IsEmpty()) {
1227 if (profile_name_prev.IsEmpty()) { tc_profile_name->SetValue(_L(default_profile_name)); }
1228 else { tc_profile_name->SetValue(profile_name_prev); }
1229 } else {
1230 profile_name_prev = tc_profile_name->GetValue();
1231 }
1232 evt.Skip();
1233 });
1234
1235 cb_custom->Bind(wxEVT_CHECKBOX, [this](wxCommandEvent &event) {
1236 tc_profile_name->Enable(custom_wanted());
1238
1239 });
1240
1242 append(label);
1244 wxGetApp().UpdateDarkUI(this);
1245}
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
T * append(T *thing, int proportion=0, int flag=wxEXPAND|wxTOP|wxBOTTOM, int border=10)
Definition ConfigWizard_private.hpp:227
ConfigWizard::priv * wizard_p() const
Definition ConfigWizard_private.hpp:236
ConfigWizard * parent
Definition ConfigWizard_private.hpp:218
ConfigWizardPage(ConfigWizard *parent, wxString title, wxString shortname, unsigned indent=0)
Definition ConfigWizard.cpp:477
void on_custom_setup(const bool custom_wanted)
Definition ConfigWizard.cpp:2124
wxTextCtrl * tc_profile_name
Definition ConfigWizard_private.hpp:398
wxCheckBox * cb_custom
Definition ConfigWizard_private.hpp:397
bool custom_wanted() const
Definition ConfigWizard_private.hpp:391
static const char * default_profile_name
Definition ConfigWizard_private.hpp:395
wxString profile_name_prev
Definition ConfigWizard_private.hpp:399

References Slic3r::GUI::ConfigWizardPage::ConfigWizardPage(), _L, Slic3r::GUI::ConfigWizardPage::append(), cb_custom, custom_wanted(), default_profile_name, Slic3r::GUI::ConfigWizard::priv::on_custom_setup(), Slic3r::GUI::ConfigWizardPage::parent, profile_name_prev, tc_profile_name, Slic3r::GUI::ConfigWizardPage::wizard_p(), and wxStaticText.

Here is the call graph for this function:

Member Function Documentation

◆ append()

template<class T>
T * Slic3r::GUI::ConfigWizardPage::append ( T * thing,
int proportion = 0,
int flag = wxEXPAND|wxTOP|wxBOTTOM,
int border = 10 )
inlineinherited
228 {
229 content->Add(thing, proportion, flag, border);
230 return thing;
231 }
wxBoxSizer * content
Definition ConfigWizard_private.hpp:220

References content.

Referenced by Slic3r::GUI::PageBedShape::PageBedShape(), Slic3r::GUI::PageCustom::PageCustom(), Slic3r::GUI::PageDiameters::PageDiameters(), Slic3r::GUI::PageFirmware::PageFirmware(), Slic3r::GUI::PageMaterials::PageMaterials(), Slic3r::GUI::PagePrinters::PagePrinters(), Slic3r::GUI::PageTemperatures::PageTemperatures(), Slic3r::GUI::PageWelcome::PageWelcome(), and append_text().

Here is the caller graph for this function:

◆ append_spacer()

void Slic3r::GUI::ConfigWizardPage::append_spacer ( int space)
inherited
522{
523 // FIXME: scaling
524 content->AddSpacer(space);
525}

References content.

Referenced by Slic3r::GUI::PageDiameters::PageDiameters(), Slic3r::GUI::PageMaterials::PageMaterials(), and Slic3r::GUI::PageTemperatures::PageTemperatures().

Here is the caller graph for this function:

◆ append_text()

wxStaticText * Slic3r::GUI::ConfigWizardPage::append_text ( wxString text)
inherited
513{
514 auto *widget = new wxStaticText(this, wxID_ANY, text, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
515 widget->Wrap(WRAP_WIDTH);
516 widget->SetMinSize(wxSize(WRAP_WIDTH, -1));
517 append(widget);
518 return widget;
519}
@ WRAP_WIDTH
Definition ConfigWizard_private.hpp:50

References append(), Slic3r::GUI::WRAP_WIDTH, and wxStaticText.

Referenced by Slic3r::GUI::PageBedShape::PageBedShape(), Slic3r::GUI::PageDiameters::PageDiameters(), Slic3r::GUI::PageFirmware::PageFirmware(), Slic3r::GUI::PageTemperatures::PageTemperatures(), and Slic3r::GUI::PageWelcome::PageWelcome().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_custom_config()

virtual void Slic3r::GUI::ConfigWizardPage::apply_custom_config ( DynamicPrintConfig & config)
inlinevirtualinherited

◆ custom_wanted()

bool Slic3r::GUI::PageCustom::custom_wanted ( ) const
inline
391{ return cb_custom->GetValue(); }

References cb_custom.

Referenced by PageCustom().

Here is the caller graph for this function:

◆ on_activate()

virtual void Slic3r::GUI::ConfigWizardPage::on_activate ( )
inlinevirtualinherited

Reimplemented in Slic3r::GUI::PageMaterials.

240{}

◆ profile_name()

std::string Slic3r::GUI::PageCustom::profile_name ( ) const
inline
392{ return into_u8(tc_profile_name->GetValue()); }
std::string into_u8(const wxString &str)
Definition GUI.cpp:549

References Slic3r::GUI::into_u8(), and tc_profile_name.

Here is the call graph for this function:

◆ set_run_reason()

virtual void Slic3r::GUI::ConfigWizardPage::set_run_reason ( ConfigWizard::RunReason run_reason)
inlinevirtualinherited

◆ wizard_p()

ConfigWizard::priv * Slic3r::GUI::ConfigWizardPage::wizard_p ( ) const
inlineinherited
236{ return parent->p.get(); }

References parent.

Referenced by Slic3r::GUI::PageBedShape::PageBedShape(), Slic3r::GUI::PageCustom::PageCustom(), Slic3r::GUI::PagePrinters::PagePrinters(), Slic3r::GUI::PageMaterials::on_activate(), Slic3r::GUI::PageMaterials::select_material(), and Slic3r::GUI::PageMaterials::update_lists().

Here is the caller graph for this function:

Member Data Documentation

◆ cb_custom

wxCheckBox* Slic3r::GUI::PageCustom::cb_custom
private

Referenced by PageCustom(), and custom_wanted().

◆ content

wxBoxSizer* Slic3r::GUI::ConfigWizardPage::content
inherited

◆ default_profile_name

const char * Slic3r::GUI::PageCustom::default_profile_name = L("My Settings")
staticprivate

Referenced by PageCustom().

◆ indent

const unsigned Slic3r::GUI::ConfigWizardPage::indent
inherited

◆ parent

◆ profile_name_prev

wxString Slic3r::GUI::PageCustom::profile_name_prev
private

Referenced by PageCustom().

◆ shortname

◆ tc_profile_name

wxTextCtrl* Slic3r::GUI::PageCustom::tc_profile_name
private

Referenced by PageCustom(), and profile_name().


The documentation for this struct was generated from the following files: