OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
LockButton Class Reference

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

Inheritance diagram for LockButton:
Collaboration diagram for LockButton:

Public Member Functions

 LockButton (wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 ~LockButton ()
void OnButton (wxCommandEvent &event)
bool IsLocked () const
void SetLock (bool lock)
void enable ()
void disable ()
void msw_rescale ()

Protected Member Functions

void update_button_bitmaps ()

Private Attributes

bool m_is_pushed = false
bool m_disabled = false
ScalableBitmap m_bmp_lock_closed
ScalableBitmap m_bmp_lock_closed_f
ScalableBitmap m_bmp_lock_open
ScalableBitmap m_bmp_lock_open_f

Detailed Description

Constructor & Destructor Documentation

◆ LockButton()

LockButton::LockButton ( wxWindow * parent,
wxWindowID id,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize )
854 :
855 wxButton(parent, id, wxEmptyString, pos, size, wxBU_EXACTFIT | wxNO_BORDER)
856{
857 m_bmp_lock_closed = ScalableBitmap(this, "lock_normal");
858 m_bmp_lock_closed_f = ScalableBitmap(this, "lock_hover");
859 m_bmp_lock_open = ScalableBitmap(this, "unlock_normal");
860 m_bmp_lock_open_f = ScalableBitmap(this, "unlock_hover");
861
862 Slic3r::GUI::wxGetApp().UpdateDarkUI(this);
863 SetBitmap(m_bmp_lock_open.bmp());
864 SetBitmapDisabled(m_bmp_lock_open.bmp());
865 SetBitmapHover(m_bmp_lock_closed_f.bmp());
866
867 //button events
868 Bind(wxEVT_BUTTON, &LockButton::OnButton, this);
869}
class WXDLLIMPEXP_FWD_CORE wxButton
Definition ProgressDialog.hpp:27
ScalableBitmap m_bmp_lock_closed_f
Definition wxExtensions.hpp:238
ScalableBitmap m_bmp_lock_open_f
Definition wxExtensions.hpp:240
ScalableBitmap m_bmp_lock_closed
Definition wxExtensions.hpp:237
ScalableBitmap m_bmp_lock_open
Definition wxExtensions.hpp:239
void OnButton(wxCommandEvent &event)
Definition wxExtensions.cpp:871

References m_bmp_lock_closed, m_bmp_lock_closed_f, m_bmp_lock_open, m_bmp_lock_open_f, OnButton(), and wxButton.

Here is the call graph for this function:

◆ ~LockButton()

LockButton::~LockButton ( )
inline
217{}

Member Function Documentation

◆ disable()

void LockButton::disable ( )
inline
226{ m_disabled = true; }
bool m_disabled
Definition wxExtensions.hpp:235

References m_disabled.

◆ enable()

void LockButton::enable ( )
inline
225{ m_disabled = false; }

References m_disabled.

◆ IsLocked()

bool LockButton::IsLocked ( ) const
inline
221{ return m_is_pushed; }
bool m_is_pushed
Definition wxExtensions.hpp:234

References m_is_pushed.

◆ msw_rescale()

void LockButton::msw_rescale ( )
889{
890 m_bmp_lock_closed.msw_rescale();
891 m_bmp_lock_closed_f.msw_rescale();
892 m_bmp_lock_open.msw_rescale();
893 m_bmp_lock_open_f.msw_rescale();
894
896}
void update_button_bitmaps()
Definition wxExtensions.cpp:898

References m_bmp_lock_closed, m_bmp_lock_closed_f, m_bmp_lock_open, m_bmp_lock_open_f, and update_button_bitmaps().

Here is the call graph for this function:

◆ OnButton()

void LockButton::OnButton ( wxCommandEvent & event)
872{
873 if (m_disabled)
874 return;
875
878
879 event.Skip();
880}

References m_disabled, m_is_pushed, and update_button_bitmaps().

Referenced by LockButton().

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

◆ SetLock()

void LockButton::SetLock ( bool lock)
883{
886}
@ lock
Definition GLGizmoEmboss.cpp:209

References m_is_pushed, and update_button_bitmaps().

Here is the call graph for this function:

◆ update_button_bitmaps()

void LockButton::update_button_bitmaps ( )
protected
899{
900 Slic3r::GUI::wxGetApp().UpdateDarkUI(this);
901 SetBitmap(m_is_pushed ? m_bmp_lock_closed.bmp() : m_bmp_lock_open.bmp());
902 SetBitmapHover(m_is_pushed ? m_bmp_lock_closed_f.bmp() : m_bmp_lock_open_f.bmp());
903
904 Refresh();
905 Update();
906}

References m_bmp_lock_closed, m_bmp_lock_closed_f, m_bmp_lock_open, m_bmp_lock_open_f, and m_is_pushed.

Referenced by msw_rescale(), OnButton(), and SetLock().

Here is the caller graph for this function:

Member Data Documentation

◆ m_bmp_lock_closed

ScalableBitmap LockButton::m_bmp_lock_closed
private

◆ m_bmp_lock_closed_f

ScalableBitmap LockButton::m_bmp_lock_closed_f
private

◆ m_bmp_lock_open

ScalableBitmap LockButton::m_bmp_lock_open
private

◆ m_bmp_lock_open_f

ScalableBitmap LockButton::m_bmp_lock_open_f
private

◆ m_disabled

bool LockButton::m_disabled = false
private

Referenced by disable(), enable(), and OnButton().

◆ m_is_pushed

bool LockButton::m_is_pushed = false
private

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