OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::RadioBox Class Reference

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

Inheritance diagram for Slic3r::GUI::RadioBox:
Collaboration diagram for Slic3r::GUI::RadioBox:

Public Member Functions

 RadioBox (wxWindow *parent)
void SetValue (bool value) override
void Rescale ()
bool Disable ()

Private Member Functions

void update ()

Private Attributes

ScalableBitmap m_on
ScalableBitmap m_off
ScalableBitmap m_ban

Detailed Description

Constructor & Destructor Documentation

◆ RadioBox()

Slic3r::GUI::RadioBox::RadioBox ( wxWindow * parent)
15 : wxBitmapToggleButton(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE)
16 , m_on(this, "radio_on", 18)
17 , m_off(this, "radio_off", 18)
18 , m_ban(this, "radio_ban", 18)
19{
20 // SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
21 if (parent) SetBackgroundColour(parent->GetBackgroundColour());
22 // Bind(wxEVT_TOGGLEBUTTON, [this](auto& e) { update(); e.Skip(); });
23 update();
24#ifdef __WXGTK__
25 Slic3r::GUI::RemoveButtonBorder(this);
26 wxSize bestSize = GetBestSize();
27 bestSize.IncTo(m_on.GetBmpSize());
28 SetSize(bestSize);
29 SetMinSize(bestSize);
30#else
31 SetSize(m_on.GetBmpSize());
32 SetMinSize(m_on.GetBmpSize());
33#endif
34}
void update()
Definition RadioBox.cpp:59
ScalableBitmap m_on
Definition RadioBox.hpp:29
ScalableBitmap m_ban
Definition RadioBox.hpp:31
ScalableBitmap m_off
Definition RadioBox.hpp:30

References m_ban, m_off, m_on, and update().

Here is the call graph for this function:

Member Function Documentation

◆ Disable()

bool Slic3r::GUI::RadioBox::Disable ( )
inline
21 {
22 return wxBitmapToggleButton::Disable();
23 }

Referenced by Slic3r::GUI::SendToPrinterDialog::update_storage_list().

Here is the caller graph for this function:

◆ Rescale()

void Slic3r::GUI::RadioBox::Rescale ( )
44{
45 m_on.msw_rescale();
46 m_off.msw_rescale();
47 update();
48#ifdef __WXGTK__
49 wxSize bestSize = GetBestSize();
50 bestSize.IncTo(m_on.GetBmpSize());
51 SetSize(bestSize);
52 SetMinSize(bestSize);
53#else
54 SetSize(m_on.GetBmpSize());
55 SetMinSize(m_on.GetBmpSize());
56#endif
57}

References m_off, m_on, and update().

Here is the call graph for this function:

◆ SetValue()

void Slic3r::GUI::RadioBox::SetValue ( bool value)
override
37{
38 wxBitmapToggleButton::SetValue(value);
39 update();
40}

References update().

Referenced by Slic3r::GUI::SendMultiMachinePage::on_select_radio(), Slic3r::GUI::SendMultiMachinePage::OnSelectRadio(), and Slic3r::GUI::SendToPrinterDialog::update_storage_list().

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

◆ update()

void Slic3r::GUI::RadioBox::update ( )
private
59 {
60 if (IsEnabled())
61 {
62 SetBitmap((GetValue() ? m_on : m_off).bmp());
63 } else
64 {
65 SetBitmap(m_ban.bmp());
66 }
67
68}
bool IsEnabled()
Definition dark_mode.cpp:32

References m_ban, m_off, and m_on.

Referenced by RadioBox(), Rescale(), and SetValue().

Here is the caller graph for this function:

Member Data Documentation

◆ m_ban

ScalableBitmap Slic3r::GUI::RadioBox::m_ban
private

Referenced by RadioBox(), and update().

◆ m_off

ScalableBitmap Slic3r::GUI::RadioBox::m_off
private

Referenced by RadioBox(), Rescale(), and update().

◆ m_on

ScalableBitmap Slic3r::GUI::RadioBox::m_on
private

Referenced by RadioBox(), Rescale(), and update().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/RadioBox.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/RadioBox.cpp