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

#include <src/slic3r/GUI/wxExtensions.hpp>

+ Collaboration diagram for ScalableBitmap:

Public Member Functions

 ScalableBitmap ()
 
 ScalableBitmap (wxWindow *parent, const std::string &icon_name="", const int px_cnt=16, const bool grayscale=false)
 
 ~ScalableBitmap ()
 
void sys_color_changed ()
 
const wxBitmapBundle & bmp () const
 
wxBitmap get_bitmap ()
 
wxWindow * parent () const
 
const std::string & name () const
 
int px_cnt () const
 
wxSize GetSize () const
 
int GetWidth () const
 
int GetHeight () const
 

Private Attributes

wxWindow * m_parent { nullptr }
 
wxBitmapBundle m_bmp = wxBitmapBundle()
 
wxBitmap m_bitmap = wxBitmap()
 
std::string m_icon_name = ""
 
int m_px_cnt {16}
 

Detailed Description

Constructor & Destructor Documentation

◆ ScalableBitmap() [1/2]

ScalableBitmap::ScalableBitmap ( )
inline
138{};

◆ ScalableBitmap() [2/2]

ScalableBitmap::ScalableBitmap ( wxWindow *  parent,
const std::string &  icon_name = "",
const int  px_cnt = 16,
const bool  grayscale = false 
)
785 :
786 m_parent(parent), m_icon_name(icon_name),
788{
789 m_bmp = *get_bmp_bundle(icon_name, px_cnt);
790 m_bitmap = m_bmp.GetBitmapFor(m_parent);
791}
int m_px_cnt
Definition wxExtensions.hpp:169
wxWindow * parent() const
Definition wxExtensions.hpp:150
std::string m_icon_name
Definition wxExtensions.hpp:168
int px_cnt() const
Definition wxExtensions.hpp:152
wxWindow * m_parent
Definition wxExtensions.hpp:165
wxBitmap m_bitmap
Definition wxExtensions.hpp:167
wxBitmapBundle m_bmp
Definition wxExtensions.hpp:166
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(), m_bitmap, m_bmp, m_parent, and px_cnt().

+ Here is the call graph for this function:

◆ ~ScalableBitmap()

ScalableBitmap::~ScalableBitmap ( )
inline
144{}

Member Function Documentation

◆ bmp()

◆ get_bitmap()

wxBitmap ScalableBitmap::get_bitmap ( )
inline
149{ return m_bmp.GetBitmapFor(m_parent); }

References m_bmp, and m_parent.

Referenced by Slic3r::DoubleSlider::Control::draw_cog_icon(), Slic3r::DoubleSlider::Control::draw_revert_icon(), Slic3r::DoubleSlider::Control::draw_thumb_item(), and Slic3r::GUI::ConfigWizardIndex::on_paint().

+ Here is the caller graph for this function:

◆ GetHeight()

int ScalableBitmap::GetHeight ( ) const
inline
162{ return GetSize().GetHeight(); }
wxSize GetSize() const
Definition wxExtensions.hpp:154

References GetSize().

Referenced by Slic3r::GUI::ConfigWizardIndex::item_height(), and Slic3r::GUI::ConfigWizardIndex::on_paint().

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

◆ GetSize()

wxSize ScalableBitmap::GetSize ( ) const
inline
154 {
155#ifdef __WIN32__
156 return m_bmp.GetPreferredBitmapSizeFor(m_parent);
157#else
158 return m_bmp.GetDefaultSize();
159#endif
160 }

References m_bmp, and m_parent.

Referenced by Slic3r::DoubleSlider::Control::Control(), GetHeight(), GetWidth(), Slic3r::DoubleSlider::Control::msw_rescale(), Slic3r::GUI::ObjectManipulation::msw_rescale(), Slic3r::GUI::ObjectManipulation::update_reset_buttons_visibility(), and Slic3r::GUI::ObjectManipulation::update_warning_icon_state().

+ Here is the caller graph for this function:

◆ GetWidth()

int ScalableBitmap::GetWidth ( ) const
inline
161{ return GetSize().GetWidth(); }

References GetSize().

Referenced by Slic3r::DoubleSlider::Control::Control(), Slic3r::DoubleSlider::Control::msw_rescale(), and Slic3r::GUI::ConfigWizardIndex::on_paint().

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

◆ name()

const std::string & ScalableBitmap::name ( ) const
inline
151{ return m_icon_name; }

References m_icon_name.

Referenced by Slic3r::GUI::Tab::create_preset_tab(), ScalableButton::SetBitmap_(), and ScalableButton::SetBitmapDisabled_().

+ Here is the caller graph for this function:

◆ parent()

wxWindow * ScalableBitmap::parent ( ) const
inline
150{ return m_parent;}

References m_parent.

Referenced by Slic3r::Search::SearchListModel::GetValueByRow().

+ Here is the caller graph for this function:

◆ px_cnt()

int ScalableBitmap::px_cnt ( ) const
inline
152{ return m_px_cnt;}

References m_px_cnt.

Referenced by ScalableBitmap().

+ Here is the caller graph for this function:

◆ sys_color_changed()

void ScalableBitmap::sys_color_changed ( )

References get_bmp_bundle(), m_bmp, m_icon_name, and m_px_cnt.

Referenced by Slic3r::DoubleSlider::Control::sys_color_changed(), Slic3r::GUI::ObjectManipulation::sys_color_changed(), and LockButton::sys_color_changed().

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

Member Data Documentation

◆ m_bitmap

wxBitmap ScalableBitmap::m_bitmap = wxBitmap()
private

Referenced by ScalableBitmap().

◆ m_bmp

wxBitmapBundle ScalableBitmap::m_bmp = wxBitmapBundle()
private

◆ m_icon_name

std::string ScalableBitmap::m_icon_name = ""
private

Referenced by name(), and sys_color_changed().

◆ m_parent

wxWindow* ScalableBitmap::m_parent { nullptr }
private

◆ m_px_cnt

int ScalableBitmap::m_px_cnt {16}
private

Referenced by px_cnt(), and sys_color_changed().


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