#include <src/slic3r/GUI/wxExtensions.hpp>
|
| | ScalableButton () |
| |
| | ScalableButton (wxWindow *parent, wxWindowID id, const std::string &icon_name="", const wxString &label=wxEmptyString, const wxSize &size=wxDefaultSize, const wxPoint &pos=wxDefaultPosition, long style=wxBU_EXACTFIT|wxNO_BORDER, int bmp_px_cnt=16) |
| |
| | ScalableButton (wxWindow *parent, wxWindowID id, const ScalableBitmap &bitmap, const wxString &label=wxEmptyString, long style=wxBU_EXACTFIT|wxNO_BORDER) |
| |
| | ~ScalableButton () |
| |
| void | SetBitmap_ (const ScalableBitmap &bmp) |
| |
| bool | SetBitmap_ (const std::string &bmp_name) |
| |
| void | SetBitmapDisabled_ (const ScalableBitmap &bmp) |
| |
| int | GetBitmapHeight () |
| |
| virtual void | sys_color_changed () |
| |
◆ ScalableButton() [1/3]
| ScalableButton::ScalableButton |
( |
| ) |
|
|
inline |
◆ ScalableButton() [2/3]
| ScalableButton::ScalableButton |
( |
wxWindow * |
parent, |
|
|
wxWindowID |
id, |
|
|
const std::string & |
icon_name = "", |
|
|
const wxString & |
label = wxEmptyString, |
|
|
const wxSize & |
size = wxDefaultSize, |
|
|
const wxPoint & |
pos = wxDefaultPosition, |
|
|
long |
style = wxBU_EXACTFIT | wxNO_BORDER, |
|
|
int |
bmp_px_cnt = 16 |
|
) |
| |
809 :
814{
815 Create(parent,
id, label, pos, size,
style);
816 Slic3r::GUI::wxGetApp().UpdateDarkUI(this);
817
818 if (!icon_name.empty()) {
820 if (!label.empty())
821 SetBitmapMargins(
int(0.5*
em_unit(parent)), 0);
822 }
823
824 if (size != wxDefaultSize)
825 {
826 const int em =
em_unit(parent);
829 }
830}
#define style
Definition WipeTowerDialog.cpp:68
constexpr auto size(const C &c) -> decltype(c.size())
Definition span.hpp:183
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:388
wxBitmapBundle * get_bmp_bundle(const std::string &bmp_name, int px_cnt=16, const std::string &new_color_rgb=std::string())
Definition wxExtensions.cpp:420
References em_unit(), get_bmp_bundle(), m_height, m_px_cnt, m_width, and style.
◆ ScalableButton() [3/3]
| ScalableButton::ScalableButton |
( |
wxWindow * |
parent, |
|
|
wxWindowID |
id, |
|
|
const ScalableBitmap & |
bitmap, |
|
|
const wxString & |
label = wxEmptyString, |
|
|
long |
style = wxBU_EXACTFIT | wxNO_BORDER |
|
) |
| |
837 :
842{
843 Create(parent,
id, label, wxDefaultPosition, wxDefaultSize,
style);
844 Slic3r::GUI::wxGetApp().UpdateDarkUI(this);
845
846 SetBitmap(bitmap.
bmp());
847}
const std::string & name() const
Definition wxExtensions.hpp:151
const wxBitmapBundle & bmp() const
Definition wxExtensions.hpp:148
int px_cnt() const
Definition wxExtensions.hpp:152
References ScalableBitmap::bmp(), and style.
◆ ~ScalableButton()
| ScalableButton::~ScalableButton |
( |
| ) |
|
|
inline |
◆ GetBitmapHeight()
| int ScalableButton::GetBitmapHeight |
( |
| ) |
|
877{
878#ifdef __APPLE__
879 return GetBitmap().GetScaledHeight();
880#else
881 return GetBitmap().GetHeight();
882#endif
883}
◆ SetBitmap_() [1/2]
◆ SetBitmap_() [2/2]
| bool ScalableButton::SetBitmap_ |
( |
const std::string & |
bmp_name | ) |
|
856{
859 return false;
860
862 SetBitmap(bmp);
863 SetBitmapCurrent(bmp);
864 SetBitmapPressed(bmp);
865 SetBitmapFocus(bmp);
866 SetBitmapDisabled(bmp);
867 return true;
868}
References get_bmp_bundle(), m_current_icon_name, and m_px_cnt.
◆ SetBitmapDisabled_()
◆ sys_color_changed()
| void ScalableButton::sys_color_changed |
( |
| ) |
|
|
virtual |
Reimplemented in ModeButton.
886{
887 Slic3r::GUI::wxGetApp().UpdateDarkUI(
this,
m_has_border);
888
890 SetBitmap(bmp);
891 SetBitmapCurrent(bmp);
892 SetBitmapPressed(bmp);
893 SetBitmapFocus(bmp);
896 if (!GetLabelText().IsEmpty())
898}
References em_unit(), get_bmp_bundle(), m_current_icon_name, m_disabled_icon_name, m_has_border, m_parent, and m_px_cnt.
Referenced by Slic3r::GUI::PresetForPrinter::on_sys_color_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_sys_color_changed(), Slic3r::GUI::ObjectManipulation::sys_color_changed(), and Slic3r::GUI::PlaterPresetComboBox::sys_color_changed().
◆ m_current_icon_name
| std::string ScalableButton::m_current_icon_name |
|
private |
◆ m_disabled_icon_name
| std::string ScalableButton::m_disabled_icon_name |
|
private |
◆ m_has_border
| bool ScalableButton::m_has_border {false} |
|
protected |
◆ m_height
| int ScalableButton::m_height {-1} |
|
private |
◆ m_parent
| wxWindow* ScalableButton::m_parent { nullptr } |
|
private |
◆ m_px_cnt
| int ScalableButton::m_px_cnt { 16 } |
|
protected |
◆ m_width
| int ScalableButton::m_width {-1} |
|
private |
The documentation for this class was generated from the following files: