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

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

Inheritance diagram for Slic3r::GUI::ObjectLayers::PlusMinusButton:
Collaboration diagram for Slic3r::GUI::ObjectLayers::PlusMinusButton:

Public Member Functions

 PlusMinusButton (wxWindow *parent, const ScalableBitmap &bitmap, std::pair< coordf_t, coordf_t > range)
void SetBitmap_ (const ScalableBitmap &bmp)
bool SetBitmap_ (const std::string &bmp_name)
void SetBitmapDisabled_ (const ScalableBitmap &bmp)
int GetBitmapHeight ()
void UseDefaultBitmapDisabled ()
void msw_rescale ()
void UpdateDarkUI ()

Public Attributes

std::pair< coordf_t, coordf_t > range

Private Attributes

wxWindow * m_parent { nullptr }
std::string m_current_icon_name
std::string m_disabled_icon_name
int m_width {-1}
int m_height {-1}
bool m_use_default_disabled_bitmap {false}
int m_px_cnt { 16 }
bool m_has_border {false}

Detailed Description

Constructor & Destructor Documentation

◆ PlusMinusButton()

Slic3r::GUI::ObjectLayers::PlusMinusButton::PlusMinusButton ( wxWindow * parent,
const ScalableBitmap & bitmap,
std::pair< coordf_t, coordf_t > range )
inline
90: ScalableButton(parent, wxID_ANY, bitmap), range(range) {}
ScalableButton()
Definition wxExtensions.hpp:251
wxWindow * parent() const
Definition GUI_ObjectSettings.hpp:37
std::pair< coordf_t, coordf_t > range
Definition GUI_ObjectLayers.hpp:92

References ScalableButton::ScalableButton(), Slic3r::GUI::OG_Settings::parent(), and range.

Here is the call graph for this function:

Member Function Documentation

◆ GetBitmapHeight()

int ScalableButton::GetBitmapHeight ( )
inherited
1100{
1101#ifdef __APPLE__
1102 return GetBitmap().GetScaledHeight();
1103#else
1104 return GetBitmap().GetHeight();
1105#endif
1106}

◆ msw_rescale()

void ScalableButton::msw_rescale ( )
inherited
1115{
1116 Slic3r::GUI::wxGetApp().UpdateDarkUI(this, m_has_border);
1117
1118 if (!m_current_icon_name.empty()) {
1120 SetBitmap(bmp);
1121 // BBS: why disappear on hover? why current HBITMAP differ from other
1122 //SetBitmapCurrent(bmp);
1123 //SetBitmapPressed(bmp);
1124 //SetBitmapFocus(bmp);
1125 if (!m_disabled_icon_name.empty())
1128 SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true));
1129 }
1130
1131 if (m_width > 0 || m_height>0)
1132 {
1133 const int em = em_unit(m_parent);
1134 wxSize size(m_width * em / 10, m_height * em / 10);
1135 SetMinSize(size);
1136 }
1137}
bool m_use_default_disabled_bitmap
Definition wxExtensions.hpp:288
std::string m_current_icon_name
Definition wxExtensions.hpp:283
std::string m_disabled_icon_name
Definition wxExtensions.hpp:284
int m_height
Definition wxExtensions.hpp:286
int m_px_cnt
Definition wxExtensions.hpp:291
wxWindow * m_parent
Definition wxExtensions.hpp:282
int m_width
Definition wxExtensions.hpp:285
bool m_has_border
Definition wxExtensions.hpp:292
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424
wxBitmap create_scaled_bitmap(const std::string &bmp_name, wxWindow *win=nullptr, const int px_cnt=16, const bool grayscale=false, const std::string &new_color=std::string(), const bool menu_bitmap=false, const bool resize=false, const bool bitmap2=false, const std::vector< std::string > &array_new_color=std::vector< std::string >())
Definition wxExtensions.cpp:448

References create_scaled_bitmap(), em_unit(), m_current_icon_name, m_disabled_icon_name, m_has_border, m_height, m_parent, m_px_cnt, m_use_default_disabled_bitmap, and m_width.

Referenced by Slic3r::GUI::ConfigOptionsGroup::msw_rescale(), and UpdateDarkUI().

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

◆ SetBitmap_() [1/2]

void ScalableButton::SetBitmap_ ( const ScalableBitmap & bmp)
inherited
1067{
1068 SetBitmap(bmp.bmp());
1069 m_current_icon_name = bmp.name();
1070}
const std::string & name() const
Definition wxExtensions.hpp:191
const wxBitmap & bmp() const
Definition wxExtensions.hpp:189

References ScalableBitmap::bmp(), m_current_icon_name, and ScalableBitmap::name().

Referenced by Slic3r::GUI::IMEXModesCtrl::refresh_reset_buttons(), Slic3r::GUI::ObjectSettings::update_settings_list(), and Slic3r::GUI::ObjectTableSettings::update_settings_list().

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

◆ SetBitmap_() [2/2]

bool ScalableButton::SetBitmap_ ( const std::string & bmp_name)
inherited
1073{
1074 if (m_current_icon_name == bmp_name)
1075 {
1076 return true;
1077 }
1078
1079 m_current_icon_name = bmp_name;
1080 if (m_current_icon_name.empty())
1081 return false;
1082
1084 SetBitmap(bmp);
1085 SetBitmapCurrent(bmp);
1086 SetBitmapPressed(bmp);
1087 SetBitmapFocus(bmp);
1089 SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true));
1090 return true;
1091}

References create_scaled_bitmap(), m_current_icon_name, m_parent, m_px_cnt, and m_use_default_disabled_bitmap.

Here is the call graph for this function:

◆ SetBitmapDisabled_()

void ScalableButton::SetBitmapDisabled_ ( const ScalableBitmap & bmp)
inherited
1094{
1095 SetBitmapDisabled(bmp.bmp());
1096 m_disabled_icon_name = bmp.name();
1097}

References ScalableBitmap::bmp(), m_disabled_icon_name, and ScalableBitmap::name().

Here is the call graph for this function:

◆ UpdateDarkUI()

void ScalableButton::UpdateDarkUI ( )
inlineinherited
279{ msw_rescale(); };
void msw_rescale()
Definition wxExtensions.cpp:1114

References msw_rescale().

Here is the call graph for this function:

◆ UseDefaultBitmapDisabled()

void ScalableButton::UseDefaultBitmapDisabled ( )
inherited
1109{
1111 SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true));
1112}

References create_scaled_bitmap(), m_current_icon_name, m_parent, m_px_cnt, and m_use_default_disabled_bitmap.

Here is the call graph for this function:

Member Data Documentation

◆ m_current_icon_name

std::string ScalableButton::m_current_icon_name
privateinherited

◆ m_disabled_icon_name

std::string ScalableButton::m_disabled_icon_name
privateinherited

Referenced by msw_rescale(), and SetBitmapDisabled_().

◆ m_has_border

bool ScalableButton::m_has_border {false}
privateinherited
292{false};

Referenced by ScalableButton(), ScalableButton(), and msw_rescale().

◆ m_height

int ScalableButton::m_height {-1}
privateinherited
286{-1}; // should be multiplied to em_unit

Referenced by ScalableButton(), and msw_rescale().

◆ m_parent

wxWindow* ScalableButton::m_parent { nullptr }
privateinherited

◆ m_px_cnt

int ScalableButton::m_px_cnt { 16 }
privateinherited

◆ m_use_default_disabled_bitmap

bool ScalableButton::m_use_default_disabled_bitmap {false}
privateinherited

◆ m_width

int ScalableButton::m_width {-1}
privateinherited
285{-1}; // should be multiplied to em_unit

Referenced by ScalableButton(), and msw_rescale().

◆ range

std::pair<coordf_t, coordf_t> Slic3r::GUI::ObjectLayers::PlusMinusButton::range

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