#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/SwitchButton.hpp>
Public Member Functions | |
| MultiSwitchButton (wxWindow *parent=nullptr, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) | |
| ~MultiSwitchButton () | |
| int | AppendOption (const wxString &option, void *clientData=nullptr) |
| void | SetOptions (const std::vector< wxString > &options) |
| void | DeleteAllOptions () |
| unsigned int | GetCount () const |
| int | GetSelection () const |
| void | SetSelection (int index) |
| wxString | GetSelectedText () const |
| Button * | GetButton (unsigned int index) const |
| wxString | GetOptionText (unsigned int index) const |
| void | SetOptionText (unsigned int index, const wxString &text) |
| void * | GetOptionData (unsigned int index) const |
| void | SetOptionData (unsigned int index, void *clientData) |
| void | SetBackgroundColor (const StateColor &color) |
| void | SetTextColor (const StateColor &color) |
| void | SetButtonTextColor (int index, const StateColor &color) |
| void | SetModified (int index, bool modified) |
| void | SetButtonCornerRadius (double radius) |
| void | SetButtonPadding (const wxSize &padding) |
| void | SetFitToOptions (bool fit=true) |
| void | Rescale () |
| bool | Create (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=0) |
| void | SetCornerRadius (double radius) |
| void | SetBorderWidth (int width) |
| void | SetTopMargin (int margin) |
| void | SetBorderColor (StateColor const &color) |
| void | SetBorderColorNormal (wxColor const &color) |
| void | SetBorderStyle (wxPenStyle style) |
| void | SetBackgroundColorNormal (wxColor const &color) |
| void | SetBackgroundColor2 (StateColor const &color) |
| void | ShowBadge (bool show) |
Static Public Member Functions | |
| static wxColor | GetParentBackgroundColor (wxWindow *parent) |
Protected Member Functions | |
| void | button_clicked (wxCommandEvent &event) |
| void | update_button_styles () |
| bool | send_selection_event () |
| void | eraseEvent (wxEraseEvent &evt) |
| void | sizeEvent (wxSizeEvent &evt) |
| void | paintEvent (wxPaintEvent &evt) |
| void | render (wxDC &dc) |
| virtual void | doRender (wxDC &dc) |
Protected Attributes | |
| double | radius |
| int | border_width = 1 |
| int | top_margin = 0 |
| wxPenStyle | border_style = wxPENSTYLE_SOLID |
| StateHandler | state_handler |
| StateColor | border_color |
| StateColor | background_color |
| StateColor | background_color2 |
| ScalableBitmap | badge |
Private Member Functions | |
| int | options_height () const |
| void | update_scroll_range () |
| int | scrollbar_height (int options_width) const |
| void | scroll_option_into_view (Button *btn) |
| void | on_size (wxSizeEvent &evt) |
Private Attributes | |
| std::vector< Button * > | btns |
| std::vector< bool > | btns_modified |
| wxScrolledWindow * | m_scroll = nullptr |
| wxBoxSizer * | sizer = nullptr |
| bool | m_fit_to_options = false |
| int | sel = -1 |
| StateColor | m_bg_color |
| StateColor | m_text_color |
| StateColor | m_br_color_modified |
| StateColor | m_fg_color_modified |
| double | m_button_radius |
| wxSize | m_button_padding |
| MultiSwitchButton::MultiSwitchButton | ( | wxWindow * | parent = nullptr, |
| wxWindowID | id = wxID_ANY, | ||
| const wxPoint & | pos = wxDefaultPosition, | ||
| const wxSize & | size = wxDefaultSize, | ||
| long | style = 0 ) |
References StaticBox::StaticBox(), Label::Body_10, button_clicked(), m_bg_color, m_br_color_modified, m_button_padding, m_button_radius, m_fg_color_modified, m_scroll, m_text_color, on_size(), options_height(), StaticBox::SetBorderWidth(), StaticBox::SetCornerRadius(), sizer, and style.
| MultiSwitchButton::~MultiSwitchButton | ( | ) |
References DeleteAllOptions().
| int MultiSwitchButton::AppendOption | ( | const wxString & | option, |
| void * | clientData = nullptr ) |
References btns, btns_modified, Button::Create(), m_bg_color, m_button_padding, m_button_radius, m_scroll, m_text_color, StaticBox::SetBackgroundColor(), StaticBox::SetBorderColor(), StaticBox::SetCornerRadius(), Button::SetFont(), Button::SetPaddingSize(), Button::SetTextColor(), and sizer.
Referenced by SetOptions().
|
protected |
References btns, and SetSelection().
Referenced by MultiSwitchButton().
|
inherited |
References background_color, background_color2, border_color, border_width, GetParentBackgroundColor(), state_handler, and style.
Referenced by FanSwitchButton::FanSwitchButton(), ImageSwitchButton::ImageSwitchButton(), ModeSwitchButton::ModeSwitchButton(), StaticBox(), Button::Create(), SpinInput::Create(), TabButton::Create(), TempInput::Create(), and TextInput::Create().
| void MultiSwitchButton::DeleteAllOptions | ( | ) |
References btns, btns_modified, sel, and sizer.
Referenced by ~MultiSwitchButton(), and SetOptions().
|
protectedvirtualinherited |
Reimplemented in FilamentStepIndicator, ModeSwitchButton, StepCtrl, StepIndicator, and TabCtrl.
References background_color, background_color2, badge, border_color, border_style, border_width, radius, scale(), state_handler, and top_margin.
Referenced by FilamentStepIndicator::doRender(), StepCtrl::doRender(), StepIndicator::doRender(), and render().
|
protectedinherited |
|
inline |
| unsigned int MultiSwitchButton::GetCount | ( | ) | const |
| void * MultiSwitchButton::GetOptionData | ( | unsigned int | index | ) | const |
| wxString MultiSwitchButton::GetOptionText | ( | unsigned int | index | ) | const |
References btns.
Referenced by Slic3r::GUI::PublishSettingsDialog::refresh_tab_indicators().
|
staticinherited |
References StaticBox().
Referenced by Label::Label(), ModeSwitchButton::ModeSwitchButton(), ScalableButton::ScalableButton(), SwitchButton::SwitchButton(), Create(), and SwitchButton::Rescale().
| wxString MultiSwitchButton::GetSelectedText | ( | ) | const |
|
private |
References options_height(), scrollbar_height(), and sizer.
Referenced by MultiSwitchButton().
|
private |
References btns.
Referenced by MultiSwitchButton(), on_size(), and update_scroll_range().
|
protectedinherited |
|
protectedinherited |
References doRender(), and radius.
Referenced by paintEvent(), Button::render(), FanSwitchButton::render(), ImageSwitchButton::render(), SpinInput::render(), TabButton::render(), TempInput::render(), and TextInput::render().
| void MultiSwitchButton::Rescale | ( | ) |
References btns, m_button_padding, and update_scroll_range().
Referenced by Slic3r::GUI::PublishSettingsDialog::on_dpi_changed().
|
private |
References m_scroll.
Referenced by SetSelection().
|
private |
Referenced by on_size(), and update_scroll_range().
|
protected |
References GetSelectedText(), and sel.
Referenced by SetSelection().
| void MultiSwitchButton::SetBackgroundColor | ( | const StateColor & | color | ) |
References m_bg_color, and update_button_styles().
|
inherited |
References background_color2, and state_handler.
|
inherited |
References background_color.
Referenced by Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), and Slic3r::GUI::HotEndTable::CreateNozzleBox().
|
inherited |
References border_color, and state_handler.
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), Slic3r::GUI::ExtruderGroup::ExtruderGroup(), TabCtrl::TabCtrl(), Slic3r::GUI::wgtDeviceNozzleRackTitle::wgtDeviceNozzleRackTitle(), MultiSwitchButton::AppendOption(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::CreateGui(), Slic3r::GUI::wgtDeviceNozzleRackArea::CreateNozzleBox(), Slic3r::GUI::DeviceErrorDialog::init_button(), Slic3r::GUI::s_set_bg_style(), Slic3r::GUI::wgtDeviceNozzleRackNozzleItem::SetSelected(), Button::SetStyle(), and Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::UpdateColourStyle().
|
inherited |
References border_color.
Referenced by Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), and Slic3r::GUI::HotEndTable::CreateNozzleBox().
|
inherited |
References border_style, and style.
|
inherited |
References border_width.
Referenced by MultiSwitchButton::MultiSwitchButton(), Slic3r::GUI::KBShortcutsDialog::create_page(), and Button::SetStyle().
| void MultiSwitchButton::SetButtonCornerRadius | ( | double | radius | ) |
References btns, m_button_radius, StaticBox::radius, and StaticBox::SetCornerRadius().
| void MultiSwitchButton::SetButtonPadding | ( | const wxSize & | padding | ) |
References btns, m_button_padding, and update_scroll_range().
|
inline |
|
inherited |
References radius.
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), Slic3r::GUI::ExtruderGroup::ExtruderGroup(), MultiSwitchButton::MultiSwitchButton(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::wgtDeviceNozzleRackTitle::wgtDeviceNozzleRackTitle(), TabCtrl::AppendItem(), MultiSwitchButton::AppendOption(), Slic3r::GUI::KBShortcutsDialog::create_page(), Slic3r::GUI::wgtDeviceNozzleRackHotendUpdate::CreateGui(), Slic3r::GUI::wgtDeviceNozzleRackNozzleItem::CreateGui(), Slic3r::GUI::HotEndTable::CreateNozzleBox(), Slic3r::GUI::wgtDeviceNozzleRackArea::CreateNozzleBox(), Slic3r::GUI::DeviceErrorDialog::init_button(), ButtonsListCtrl::InsertPage(), TabButtonsListCtrl::InsertPage(), Slic3r::GUI::CaliPageButton::msw_rescale(), ModeSwitchButton::Rescale(), MultiSwitchButton::SetButtonCornerRadius(), Button::SetStyle(), and Slic3r::GUI::style_sidebar_icon_btn().
|
inline |
References m_fit_to_options, and update_scroll_range().
Referenced by Slic3r::GUI::PublishSettingsDialog::setup_variant_switch().
| void MultiSwitchButton::SetModified | ( | int | index, |
| bool | modified ) |
References btns_modified, and update_button_styles().
| void MultiSwitchButton::SetOptionData | ( | unsigned int | index, |
| void * | clientData ) |
| void MultiSwitchButton::SetOptions | ( | const std::vector< wxString > & | options | ) |
References AppendOption(), DeleteAllOptions(), and update_scroll_range().
Referenced by Slic3r::GUI::PublishSettingsDialog::setup_variant_switch().
| void MultiSwitchButton::SetOptionText | ( | unsigned int | index, |
| const wxString & | text ) |
References btns, and update_scroll_range().
Referenced by Slic3r::GUI::PublishSettingsDialog::refresh_tab_indicators().
| void MultiSwitchButton::SetSelection | ( | int | index | ) |
References btns, scroll_option_into_view(), sel, send_selection_event(), and update_button_styles().
Referenced by button_clicked(), Slic3r::GUI::PublishSettingsDialog::setup_variant_switch(), and Slic3r::GUI::PublishSettingsDialog::show_inner_page().
| void MultiSwitchButton::SetTextColor | ( | const StateColor & | color | ) |
|
inherited |
References top_margin.
Referenced by Slic3r::GUI::ExtruderGroup::ExtruderGroup().
|
inherited |
References badge.
Referenced by Slic3r::GUI::ExtruderGroup::ExtruderGroup().
|
protectedinherited |
|
protected |
References btns, btns_modified, m_bg_color, m_br_color_modified, m_fg_color_modified, m_text_color, and sel.
Referenced by SetBackgroundColor(), SetModified(), SetSelection(), and SetTextColor().
|
private |
References m_fit_to_options, m_scroll, options_height(), scrollbar_height(), and sizer.
Referenced by Rescale(), SetButtonPadding(), SetFitToOptions(), SetOptions(), and SetOptionText().
|
protectedinherited |
Referenced by Button::Button(), FanSwitchButton::FanSwitchButton(), ImageSwitchButton::ImageSwitchButton(), ModeSwitchButton::ModeSwitchButton(), TabButton::TabButton(), Create(), ModeSwitchButton::doRender(), doRender(), SetBackgroundColor(), SetBackgroundColorNormal(), and TabButton::SetBGColor().
|
protectedinherited |
Referenced by Create(), doRender(), and SetBackgroundColor2().
|
protectedinherited |
Referenced by doRender(), and ShowBadge().
|
protectedinherited |
Referenced by FanSwitchButton::FanSwitchButton(), ImageSwitchButton::ImageSwitchButton(), ModeSwitchButton::ModeSwitchButton(), StaticBox(), StepCtrlBase::StepCtrlBase(), Create(), ModeSwitchButton::doRender(), doRender(), TabCtrl::doRender(), SetBorderColor(), SetBorderColorNormal(), and Button::SetStyle().
|
protectedinherited |
Referenced by doRender(), and SetBorderStyle().
|
protectedinherited |
|
private |
Referenced by AppendOption(), button_clicked(), DeleteAllOptions(), GetButton(), GetCount(), GetOptionData(), GetOptionText(), GetSelectedText(), options_height(), Rescale(), SetButtonCornerRadius(), SetButtonPadding(), SetButtonTextColor(), SetOptionData(), SetOptionText(), SetSelection(), and update_button_styles().
|
private |
Referenced by AppendOption(), DeleteAllOptions(), SetModified(), and update_button_styles().
|
private |
Referenced by MultiSwitchButton(), AppendOption(), SetBackgroundColor(), and update_button_styles().
|
private |
Referenced by MultiSwitchButton(), and update_button_styles().
|
private |
Referenced by MultiSwitchButton(), AppendOption(), Rescale(), and SetButtonPadding().
|
private |
Referenced by MultiSwitchButton(), AppendOption(), and SetButtonCornerRadius().
|
private |
Referenced by MultiSwitchButton(), and update_button_styles().
|
private |
Referenced by SetFitToOptions(), and update_scroll_range().
|
private |
Referenced by MultiSwitchButton(), AppendOption(), scroll_option_into_view(), and update_scroll_range().
|
private |
Referenced by MultiSwitchButton(), AppendOption(), SetTextColor(), and update_button_styles().
|
protectedinherited |
|
private |
Referenced by DeleteAllOptions(), GetSelectedText(), GetSelection(), send_selection_event(), SetSelection(), and update_button_styles().
|
private |
Referenced by MultiSwitchButton(), AppendOption(), DeleteAllOptions(), on_size(), and update_scroll_range().
|
protectedinherited |
Referenced by ModeSwitchButton::ModeSwitchButton(), StaticBox(), Button::Create(), Create(), TabButton::Create(), FilamentStepIndicator::doRender(), ModeSwitchButton::doRender(), doRender(), StepCtrl::doRender(), StepIndicator::doRender(), TabCtrl::doRender(), Button::GetValue(), Button::render(), FanSwitchButton::render(), ImageSwitchButton::render(), TabButton::render(), SetBackgroundColor(), SetBackgroundColor2(), TabButton::SetBGColor(), SetBorderColor(), TabButton::SetBorderColor(), Button::SetTextColor(), FanSwitchButton::SetTextColor(), ImageSwitchButton::SetTextColor(), TabButton::SetTextColor(), and Button::SetValue().
|
protectedinherited |
Referenced by doRender(), and SetTopMargin().