#include <src/slic3r/GUI/wxExtensions.hpp>
|
| | ModeButton (wxWindow *parent, wxWindowID id, const std::string &icon_name="", const wxString &mode=wxEmptyString, const wxSize &size=wxDefaultSize, const wxPoint &pos=wxDefaultPosition) |
| |
| | ModeButton (wxWindow *parent, const wxString &mode=wxEmptyString, const std::string &icon_name="", int px_cnt=16) |
| |
| | ModeButton (wxWindow *parent, int mode_id, const wxString &mode=wxEmptyString, int px_cnt=16) |
| |
| | ~ModeButton () |
| |
| void | Init (const wxString &mode) |
| |
| void | OnButton (wxCommandEvent &event) |
| |
| void | OnEnterBtn (wxMouseEvent &event) |
| |
| void | OnLeaveBtn (wxMouseEvent &event) |
| |
| void | SetState (const bool state) |
| |
| void | update_bitmap () |
| |
| bool | is_selected () |
| |
| void | sys_color_changed () override |
| |
| void | SetBitmap_ (const ScalableBitmap &bmp) |
| |
| bool | SetBitmap_ (const std::string &bmp_name) |
| |
| void | SetBitmapDisabled_ (const ScalableBitmap &bmp) |
| |
| int | GetBitmapHeight () |
| |
◆ ModeButton() [1/3]
| ModeButton::ModeButton |
( |
wxWindow * |
parent, |
|
|
wxWindowID |
id, |
|
|
const std::string & |
icon_name = "", |
|
|
const wxString & |
mode = wxEmptyString, |
|
|
const wxSize & |
size = wxDefaultSize, |
|
|
const wxPoint & |
pos = wxDefaultPosition |
|
) |
| |
600 :
601 ScalableButton(parent,
id, icon_name, mode, size, pos, wxBU_EXACTFIT)
602{
604}
References Init().
◆ ModeButton() [2/3]
| ModeButton::ModeButton |
( |
wxWindow * |
parent, |
|
|
const wxString & |
mode = wxEmptyString, |
|
|
const std::string & |
icon_name = "", |
|
|
int |
px_cnt = 16 |
|
) |
| |
609 :
610 ScalableButton(parent, wxID_ANY, icon_name, mode, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT, px_cnt)
611{
613}
References Init().
◆ ModeButton() [3/3]
| ModeButton::ModeButton |
( |
wxWindow * |
parent, |
|
|
int |
mode_id, |
|
|
const wxString & |
mode = wxEmptyString, |
|
|
int |
px_cnt = 16 |
|
) |
| |
◆ ~ModeButton()
| ModeButton::~ModeButton |
( |
| ) |
|
|
inline |
◆ focus_button()
| void ModeButton::focus_button |
( |
const bool |
focus | ) |
|
|
protected |
664{
665 const wxFont& new_font = focus ?
666 Slic3r::GUI::wxGetApp().bold_font() :
667 Slic3r::GUI::wxGetApp().normal_font();
668
669 SetFont(new_font);
670#ifdef _WIN32
671 GetParent()->Refresh();
672#else
673 SetForegroundColour(wxSystemSettings::GetColour(focus ? wxSYS_COLOUR_BTNTEXT :
674#
if defined (__linux__) && defined (__WXGTK3__)
675 wxSYS_COLOUR_GRAYTEXT
676#elif defined (__linux__) && defined (__WXGTK2__)
677 wxSYS_COLOUR_BTNTEXT
678#else
679 wxSYS_COLOUR_BTNSHADOW
680#endif
681 ));
682#endif
683
684 Refresh();
685 Update();
686}
if(!(yy_init))
Definition lexer.c:1190
Referenced by OnButton(), OnEnterBtn(), OnLeaveBtn(), and SetState().
◆ GetBitmapHeight()
| int ScalableButton::GetBitmapHeight |
( |
| ) |
|
|
inherited |
877{
878#ifdef __APPLE__
879 return GetBitmap().GetScaledHeight();
880#else
881 return GetBitmap().GetHeight();
882#endif
883}
◆ Init()
| void ModeButton::Init |
( |
const wxString & |
mode | ) |
|
627{
630
631 SetBitmapMargins(3, 0);
632
633
637}
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:42
#define _L(s)
Definition I18N.hpp:3
#define wxEVT_BUTTON
Definition wxinit.h:18
References _L, Slic3r::GUI::format_wxstr(), m_tt_focused, m_tt_selected, OnButton(), OnEnterBtn(), OnLeaveBtn(), and wxEVT_BUTTON.
Referenced by ModeButton(), ModeButton(), and ModeButton().
◆ is_selected()
| bool ModeButton::is_selected |
( |
| ) |
|
|
inline |
◆ OnButton()
| void ModeButton::OnButton |
( |
wxCommandEvent & |
event | ) |
|
◆ OnEnterBtn()
| void ModeButton::OnEnterBtn |
( |
wxMouseEvent & |
event | ) |
|
|
inline |
◆ OnLeaveBtn()
| void ModeButton::OnLeaveBtn |
( |
wxMouseEvent & |
event | ) |
|
|
inline |
◆ SetBitmap_() [1/2]
◆ SetBitmap_() [2/2]
| bool ScalableButton::SetBitmap_ |
( |
const std::string & |
bmp_name | ) |
|
|
inherited |
856{
859 return false;
860
862 SetBitmap(bmp);
863 SetBitmapCurrent(bmp);
864 SetBitmapPressed(bmp);
865 SetBitmapFocus(bmp);
866 SetBitmapDisabled(bmp);
867 return true;
868}
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 get_bmp_bundle(), ScalableButton::m_current_icon_name, and ScalableButton::m_px_cnt.
◆ SetBitmapDisabled_()
◆ SetState()
| void ModeButton::SetState |
( |
const bool |
state | ) |
|
◆ sys_color_changed()
| void ModeButton::sys_color_changed |
( |
| ) |
|
|
overridevirtual |
◆ update_bitmap()
| void ModeButton::update_bitmap |
( |
| ) |
|
◆ m_bmp
| wxBitmapBundle ModeButton::m_bmp |
|
private |
◆ m_current_icon_name
| std::string ScalableButton::m_current_icon_name |
|
privateinherited |
◆ m_disabled_icon_name
| std::string ScalableButton::m_disabled_icon_name |
|
privateinherited |
◆ m_has_border
| bool ScalableButton::m_has_border {false} |
|
protectedinherited |
◆ m_height
| int ScalableButton::m_height {-1} |
|
privateinherited |
◆ m_is_selected
| bool ModeButton::m_is_selected {false} |
|
private |
◆ m_mode_id
| int ModeButton::m_mode_id {-1} |
|
private |
◆ m_parent
| wxWindow* ScalableButton::m_parent { nullptr } |
|
privateinherited |
◆ m_px_cnt
| int ScalableButton::m_px_cnt { 16 } |
|
protectedinherited |
◆ m_tt_focused
| wxString ModeButton::m_tt_focused |
|
private |
◆ m_tt_selected
| wxString ModeButton::m_tt_selected |
|
private |
◆ m_width
| int ScalableButton::m_width {-1} |
|
privateinherited |
The documentation for this class was generated from the following files: