OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::ParamsViewCtrl Class Reference

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

Inheritance diagram for Slic3r::GUI::ParamsViewCtrl:
Collaboration diagram for Slic3r::GUI::ParamsViewCtrl:

Public Member Functions

 ParamsViewCtrl (wxWindow *parent, wxSize size)
 ~ParamsViewCtrl () override
wxDataViewItem AppendGroup (const wxString &group_name, const std::string &icon_name)
wxDataViewItem AppendSubGroup (wxDataViewItem parent, const wxString &sub_group_name, const std::string &icon_name)
wxDataViewItem AppendParam (wxDataViewItem parent, ParamType param_type, const std::string &param_key)
wxString GetValue (wxDataViewItem item)
wxString GetSelectedValue ()
std::string GetSelectedParamKey ()
std::string GetSelectedTopLevelCategory ()
void CheckAndDeleteIfEmpty (wxDataViewItem item)
void Clear ()
void Rescale (int em=0)
void set_em_unit (int em)

Public Attributes

ParamsModel * model { nullptr }

Private Attributes

int m_em_unit

Detailed Description

Constructor & Destructor Documentation

◆ ParamsViewCtrl()

Slic3r::GUI::ParamsViewCtrl::ParamsViewCtrl ( wxWindow * parent,
wxSize size )
843 : wxDataViewCtrl(parent, wxID_ANY, wxDefaultPosition, size, wxDV_SINGLE | wxDV_NO_HEADER// | wxDV_ROW_LINES
844#ifdef _WIN32
845 | wxBORDER_SIMPLE
846#endif
847 ),
848 m_em_unit(em_unit(parent))
849{
850 wxGetApp().UpdateDVCDarkUI(this);
851
852 model = new ParamsModel();
853 this->AssociateModel(model);
854 model->SetAssociatedControl(this);
855
856#ifdef __linux__
857 wxDataViewIconTextRenderer* rd = new wxDataViewIconTextRenderer();
858#ifdef SUPPORTS_MARKUP
859 rd->EnableMarkup(true);
860#endif
861 wxDataViewColumn* column = new wxDataViewColumn("", rd, 0, 20 * m_em_unit, wxALIGN_TOP, wxDATAVIEW_COL_RESIZABLE | wxDATAVIEW_CELL_INERT);
862#else
863 wxDataViewColumn* column = new wxDataViewColumn("", new BitmapTextRenderer(true, wxDATAVIEW_CELL_INERT), 0, 20 * m_em_unit, wxALIGN_TOP, wxDATAVIEW_COL_RESIZABLE);
864#endif //__linux__
865 this->AppendColumn(column);
866 this->SetExpanderColumn(column);
867}
int m_em_unit
Definition EditGCodeDialog.hpp:233
ParamsModel * model
Definition EditGCodeDialog.hpp:244
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424

References em_unit(), m_em_unit, and model.

Here is the call graph for this function:

◆ ~ParamsViewCtrl()

Slic3r::GUI::ParamsViewCtrl::~ParamsViewCtrl ( )
inlineoverride
237 {
238 if (model) {
239 Clear();
240 model->DecRef();
241 }
242 }
void Clear()
Definition EditGCodeDialog.cpp:916

References Clear(), and model.

Here is the call graph for this function:

Member Function Documentation

◆ AppendGroup()

wxDataViewItem Slic3r::GUI::ParamsViewCtrl::AppendGroup ( const wxString & group_name,
const std::string & icon_name )
870{
871 return model->AppendGroup(group_name, icon_name);
872}

References model.

◆ AppendParam()

wxDataViewItem Slic3r::GUI::ParamsViewCtrl::AppendParam ( wxDataViewItem parent,
ParamType param_type,
const std::string & param_key )
884{
885 return model->AppendParam(parent, param_type, param_key);
886}

References model.

◆ AppendSubGroup()

wxDataViewItem Slic3r::GUI::ParamsViewCtrl::AppendSubGroup ( wxDataViewItem parent,
const wxString & sub_group_name,
const std::string & icon_name )
877{
878 return model->AppendSubGroup(parent, sub_group_name, icon_name);
879}

References model.

◆ CheckAndDeleteIfEmpty()

void Slic3r::GUI::ParamsViewCtrl::CheckAndDeleteIfEmpty ( wxDataViewItem item)
909{
910 wxDataViewItemArray children;
911 model->GetChildren(item, children);
912 if (children.IsEmpty())
913 model->Delete(item);
914}

References model.

◆ Clear()

void Slic3r::GUI::ParamsViewCtrl::Clear ( )
917{
918 model->Clear();
919}

References model.

Referenced by ~ParamsViewCtrl().

Here is the caller graph for this function:

◆ GetSelectedParamKey()

std::string Slic3r::GUI::ParamsViewCtrl::GetSelectedParamKey ( )
899{
900 return model->GetParamKey(this->GetSelection());
901}

References model.

◆ GetSelectedTopLevelCategory()

std::string Slic3r::GUI::ParamsViewCtrl::GetSelectedTopLevelCategory ( )
904{
905 return model->GetTopLevelCategory(this->GetSelection());
906}

References model.

◆ GetSelectedValue()

wxString Slic3r::GUI::ParamsViewCtrl::GetSelectedValue ( )
894{
895 return model->GetParamName(this->GetSelection());
896}

References model.

◆ GetValue()

wxString Slic3r::GUI::ParamsViewCtrl::GetValue ( wxDataViewItem item)
889{
890 return model->GetParamName(item);
891}

References model.

◆ Rescale()

void Slic3r::GUI::ParamsViewCtrl::Rescale ( int em = 0)
922{
923// model->Rescale();
924 Refresh();
925}

◆ set_em_unit()

void Slic3r::GUI::ParamsViewCtrl::set_em_unit ( int em)
inline
267{ m_em_unit = em; }

References m_em_unit.

Member Data Documentation

◆ m_em_unit

int Slic3r::GUI::ParamsViewCtrl::m_em_unit
private

Referenced by ParamsViewCtrl(), and set_em_unit().

◆ model


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