mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 07:41:09 -06:00
Add the full source of BambuStudio
using version 1.0.10
This commit is contained in:
parent
30bcadab3e
commit
1555904bef
3771 changed files with 1251328 additions and 0 deletions
42
src/slic3r/GUI/Widgets/RadioBox.cpp
Normal file
42
src/slic3r/GUI/Widgets/RadioBox.cpp
Normal file
|
@ -0,0 +1,42 @@
|
|||
#include "RadioBox.hpp"
|
||||
|
||||
#include "../wxExtensions.hpp"
|
||||
|
||||
namespace Slic3r {
|
||||
namespace GUI {
|
||||
RadioBox::RadioBox(wxWindow *parent)
|
||||
: wxBitmapToggleButton(parent, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE), m_on(this, "radio_on", 18), m_off(this, "radio_off", 18)
|
||||
{
|
||||
// SetBackgroundStyle(wxBG_STYLE_TRANSPARENT);
|
||||
if (parent) SetBackgroundColour(parent->GetBackgroundColour());
|
||||
// Bind(wxEVT_TOGGLEBUTTON, [this](auto& e) { update(); e.Skip(); });
|
||||
SetSize(m_on.GetBmpSize());
|
||||
SetMinSize(m_on.GetBmpSize());
|
||||
update();
|
||||
}
|
||||
|
||||
void RadioBox::SetValue(bool value)
|
||||
{
|
||||
wxBitmapToggleButton::SetValue(value);
|
||||
update();
|
||||
}
|
||||
|
||||
bool RadioBox::GetValue()
|
||||
{
|
||||
return wxBitmapToggleButton::GetValue();
|
||||
}
|
||||
|
||||
|
||||
void RadioBox::Rescale()
|
||||
{
|
||||
m_on.msw_rescale();
|
||||
m_off.msw_rescale();
|
||||
SetSize(m_on.GetBmpSize());
|
||||
update();
|
||||
}
|
||||
|
||||
void RadioBox::update() { SetBitmap((GetValue() ? m_on : m_off).bmp()); }
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue