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

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

Inheritance diagram for Slic3r::GUI::DevIconLabel:
Collaboration diagram for Slic3r::GUI::DevIconLabel:

Public Member Functions

 DevIconLabel (wxWindow *parent, const wxString &icon, const wxString &label)
void SetAllBackgroundColor (const wxColour &color)
Label * GetLabelItem () const
void SetLabel (const wxString &label)
void SetIcon (const wxString &icon)
void Rescale ()

Private Member Functions

void CreateGui ()

Private Attributes

Label * m_label { nullptr }
wxString m_icon_str
wxStaticBitmap * m_icon { nullptr }

Detailed Description

Constructor & Destructor Documentation

◆ DevIconLabel()

Slic3r::GUI::DevIconLabel::DevIconLabel ( wxWindow * parent,
const wxString & icon,
const wxString & label )
2711 : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize)
2712{
2713 CreateGui();
2714
2715 SetIcon(icon);
2716 SetLabel(label);
2717}
void SetLabel(const wxString &label)
Definition AmsMappingPopup.cpp:2736
void SetIcon(const wxString &icon)
Definition AmsMappingPopup.cpp:2741
void CreateGui()
Definition AmsMappingPopup.cpp:2719

References CreateGui(), SetIcon(), and SetLabel().

Here is the call graph for this function:

Member Function Documentation

◆ CreateGui()

void Slic3r::GUI::DevIconLabel::CreateGui ( )
private
2720{
2721 wxSizer* sizer_main = new wxBoxSizer(wxHORIZONTAL);
2722 m_icon = new wxStaticBitmap(this, wxID_ANY, wxNullBitmap);
2723 m_icon->SetBackgroundColour(*wxWHITE);
2724
2725 m_label = new Label(this);
2726 m_label->SetFont(::Label::Body_13);
2727 m_label->SetBackgroundColour(*wxWHITE);
2728
2729 sizer_main->Add(m_icon, 0, wxALIGN_CENTER_VERTICAL, 0);
2730 sizer_main->Add(m_label, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(8));
2731 SetSizer(sizer_main);
2732 Layout();
2733 Fit();
2734}
static wxFont Body_13
Definition Label.hpp:54
wxStaticBitmap * m_icon
Definition AmsMappingPopup.hpp:277
Label * m_label
Definition AmsMappingPopup.hpp:275

References Label::Body_13, m_icon, and m_label.

Referenced by DevIconLabel().

Here is the caller graph for this function:

◆ GetLabelItem()

Label * Slic3r::GUI::DevIconLabel::GetLabelItem ( ) const
inline
265{ return m_label; }

References m_label.

◆ Rescale()

void Slic3r::GUI::DevIconLabel::Rescale ( )
2758{
2759 m_icon->SetBitmap(create_scaled_bitmap(m_icon_str.ToStdString(), this, 20));
2760 Refresh();
2761}
wxString m_icon_str
Definition AmsMappingPopup.hpp:276
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References create_scaled_bitmap(), m_icon, and m_icon_str.

Here is the call graph for this function:

◆ SetAllBackgroundColor()

void Slic3r::GUI::DevIconLabel::SetAllBackgroundColor ( const wxColour & color)
2751{
2752 SetBackgroundColour(color);
2753 m_icon->SetBackgroundColour(color);
2754 m_label->SetBackgroundColour(color);
2755}

References m_icon, and m_label.

◆ SetIcon()

void Slic3r::GUI::DevIconLabel::SetIcon ( const wxString & icon)
2742{
2743 if (m_icon_str != icon) {
2744 m_icon_str = icon;
2745 m_icon->SetBitmap(create_scaled_bitmap(icon.ToStdString(), this, 20));
2746 Refresh();
2747 }
2748}

References create_scaled_bitmap(), m_icon, and m_icon_str.

Referenced by DevIconLabel().

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

◆ SetLabel()

void Slic3r::GUI::DevIconLabel::SetLabel ( const wxString & label)
2737{
2738 m_label->SetLabel(label);
2739}

References m_label.

Referenced by DevIconLabel().

Here is the caller graph for this function:

Member Data Documentation

◆ m_icon

wxStaticBitmap* Slic3r::GUI::DevIconLabel::m_icon { nullptr }
private
277{ nullptr };

Referenced by CreateGui(), Rescale(), SetAllBackgroundColor(), and SetIcon().

◆ m_icon_str

wxString Slic3r::GUI::DevIconLabel::m_icon_str
private

Referenced by Rescale(), and SetIcon().

◆ m_label

Label* Slic3r::GUI::DevIconLabel::m_label { nullptr }
private
275{ nullptr };

Referenced by CreateGui(), GetLabelItem(), SetAllBackgroundColor(), and SetLabel().


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