Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
LockButton Class Reference

#include <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 sys_color_changed ()
 

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 
)
534 :
535 wxButton(parent, id, wxEmptyString, pos, size, wxBU_EXACTFIT | wxNO_BORDER)
536{
537 m_bmp_lock_closed = ScalableBitmap(this, "lock_closed");
538 m_bmp_lock_closed_f = ScalableBitmap(this, "lock_closed_f");
539 m_bmp_lock_open = ScalableBitmap(this, "lock_open");
540 m_bmp_lock_open_f = ScalableBitmap(this, "lock_open_f");
541
542 Slic3r::GUI::wxGetApp().UpdateDarkUI(this);
543 SetBitmap(m_bmp_lock_open.bmp());
544 SetBitmapDisabled(m_bmp_lock_open.bmp());
545 SetBitmapCurrent(m_bmp_lock_closed_f.bmp());
546
547 //button events
549}
ScalableBitmap m_bmp_lock_closed_f
Definition wxExtensions.hpp:206
ScalableBitmap m_bmp_lock_open_f
Definition wxExtensions.hpp:208
ScalableBitmap m_bmp_lock_closed
Definition wxExtensions.hpp:205
ScalableBitmap m_bmp_lock_open
Definition wxExtensions.hpp:207
void OnButton(wxCommandEvent &event)
Definition wxExtensions.cpp:551
Definition wxExtensions.hpp:136
const wxBitmapBundle & bmp() const
Definition wxExtensions.hpp:148
#define wxEVT_BUTTON
Definition wxinit.h:18

References ScalableBitmap::bmp(), m_bmp_lock_closed, m_bmp_lock_closed_f, m_bmp_lock_open, m_bmp_lock_open_f, OnButton(), and wxEVT_BUTTON.

+ Here is the call graph for this function:

◆ ~LockButton()

LockButton::~LockButton ( )
inline
185{}

Member Function Documentation

◆ disable()

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

References m_disabled.

◆ enable()

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

References m_disabled.

Referenced by Slic3r::GUI::ObjectManipulation::update_if_dirty().

+ Here is the caller graph for this function:

◆ IsLocked()

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

References m_is_pushed.

Referenced by Slic3r::GUI::ObjectManipulation::ObjectManipulation().

+ Here is the caller graph for this function:

◆ OnButton()

void LockButton::OnButton ( wxCommandEvent &  event)
552{
553 if (m_disabled)
554 return;
555
557 event.Skip();
558}
void SetLock(bool lock)
Definition wxExtensions.cpp:560

References m_disabled, m_is_pushed, and SetLock().

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)
561{
562 if (m_is_pushed != lock) {
565 }
566}
void update_button_bitmaps()
Definition wxExtensions.cpp:580

References m_is_pushed, and update_button_bitmaps().

Referenced by OnButton(), and Slic3r::GUI::ObjectManipulation::update_if_dirty().

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

◆ sys_color_changed()

void LockButton::sys_color_changed ( )
569{
570 Slic3r::GUI::wxGetApp().UpdateDarkUI(this);
571
576
578}
void sys_color_changed()
Definition wxExtensions.cpp:793

References m_bmp_lock_closed, m_bmp_lock_closed_f, m_bmp_lock_open, m_bmp_lock_open_f, ScalableBitmap::sys_color_changed(), and update_button_bitmaps().

Referenced by Slic3r::GUI::ObjectManipulation::sys_color_changed().

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

◆ update_button_bitmaps()

void LockButton::update_button_bitmaps ( )
protected
581{
582 SetBitmap(m_is_pushed ? m_bmp_lock_closed.bmp() : m_bmp_lock_open.bmp());
583 SetBitmapCurrent(m_is_pushed ? m_bmp_lock_closed_f.bmp() : m_bmp_lock_open_f.bmp());
584
585 Refresh();
586 Update();
587}

References ScalableBitmap::bmp(), m_bmp_lock_closed, m_bmp_lock_closed_f, m_bmp_lock_open, m_bmp_lock_open_f, and m_is_pushed.

Referenced by SetLock(), and sys_color_changed().

+ Here is the call graph for this function:
+ 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: