#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Widgets/Button.hpp>
Public Member Functions | |
| Button () | |
| Button (wxWindow *parent, wxString text, wxString icon="", long style=0, int iconSize=0, wxWindowID btn_id=wxID_ANY) | |
| bool | Create (wxWindow *parent, wxString text, wxString icon="", long style=0, int iconSize=0, wxWindowID btn_id=wxID_ANY) |
| void | SetLabel (const wxString &label) override |
| bool | SetFont (const wxFont &font) override |
| void | SetIcon (const wxString &icon) |
| void | SetIcon (const wxBitmap &icon) |
| void | SetMinSize (const wxSize &size) override |
| void | SetMaxSize (const wxSize &size) override |
| void | SetPaddingSize (const wxSize &size) |
| void | SetIconSpacing (int spacing) |
| void | SetStyle (const ButtonStyle style, const ButtonType type) |
| void | SetTextColor (StateColor const &color) |
| void | SetTextColorNormal (wxColor const &color) |
| void | SetSelected (bool selected=true) |
| void | SetIndicator (bool on) |
| ButtonStyle | GetStyle () const |
| ButtonType | GetType () const |
| bool | IsSelected () const |
| bool | Enable (bool enable=true) override |
| void | EnableTooltipEvenDisabled () |
| void | SetCanFocus (bool canFocus) override |
| void | SetValue (bool state) |
| bool | GetValue () const |
| void | SetCenter (bool isCenter) |
| void | SetVertical (bool vertical=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 | SetBackgroundColor (StateColor const &color) |
| 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 | |
| bool | AcceptsFocus () const override |
| void | eraseEvent (wxEraseEvent &evt) |
| void | sizeEvent (wxSizeEvent &evt) |
| 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 | |
| void | paintEvent (wxPaintEvent &evt) |
| void | render (wxDC &dc) |
| void | messureSize () |
| void | mouseDown (wxMouseEvent &event) |
| void | mouseReleased (wxMouseEvent &event) |
| void | mouseCaptureLost (wxMouseCaptureLostEvent &event) |
| void | keyDownUp (wxKeyEvent &event) |
| void | sendButtonEvent () |
| void | OnParentMotion (wxMouseEvent &event) |
| void | OnParentLeave (wxMouseEvent &event) |
Private Attributes | |
| wxTipWindow::Ref | tipWindow |
| wxRect | textSize |
| wxSize | minSize |
| wxSize | paddingSize |
| int | m_icon_spacing = 5 |
| ScalableBitmap | active_icon |
| StateColor | text_color |
| bool | pressedDown = false |
| bool | m_selected = true |
| bool | canFocus = true |
| bool | isCenter = true |
| bool | vertical = false |
| bool | m_show_indicator = false |
| wxColour | m_indicator_color = wxColour("#009688") |
| bool | m_has_style = false |
| ButtonStyle | m_style |
| ButtonType | m_type |
Static Private Attributes | |
| static const int | buttonWidth = 200 |
| static const int | buttonHeight = 50 |
| Button::Button | ( | ) |
References Button(), StaticBox::background_color, StateColor::Checked, StateColor::Disabled, StateColor::Hovered, StateColor::Normal, paddingSize, and text_color.
Referenced by Button(), Button(), and Slic3r::GUI::CaliPageButton::CaliPageButton().
| Button::Button | ( | wxWindow * | parent, |
| wxString | text, | ||
| wxString | icon = "", | ||
| long | style = 0, | ||
| int | iconSize = 0, | ||
| wxWindowID | btn_id = wxID_ANY ) |
|
overrideprotected |
References canFocus.
| bool Button::Create | ( | wxWindow * | parent, |
| wxString | text, | ||
| wxString | icon = "", | ||
| long | style = 0, | ||
| int | iconSize = 0, | ||
| wxWindowID | btn_id = wxID_ANY ) |
References active_icon, Label::Body_14, StaticBox::Create(), messureSize(), SetFont(), StaticBox::state_handler, style, and text_color.
Referenced by Button(), TabCtrl::AppendItem(), and MultiSwitchButton::AppendOption().
|
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().
|
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().
|
override |
Referenced by Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::Tab::compatible_widget_create(), and Slic3r::GUI::Tab::compatible_widget_reload().
| void Button::EnableTooltipEvenDisabled | ( | ) |
References OnParentLeave(), and OnParentMotion().
|
protectedinherited |
|
staticinherited |
References StaticBox().
Referenced by Label::Label(), ModeSwitchButton::ModeSwitchButton(), ScalableButton::ScalableButton(), SwitchButton::SwitchButton(), Create(), and SwitchButton::Rescale().
|
inline |
References m_style.
Referenced by CustomWidgetsPlugin::addButtonProps().
|
inline |
References m_type.
Referenced by CustomWidgetsPlugin::addButtonProps().
| bool Button::GetValue | ( | ) | const |
References StateHandler::Checked, and StaticBox::state_handler.
Referenced by SetValue().
|
inline |
References m_selected.
Referenced by CustomWidgetsPlugin::addButtonProps().
|
private |
|
private |
References active_icon, m_icon_spacing, m_show_indicator, minSize, paddingSize, textSize, and vertical.
Referenced by Create(), Rescale(), SetFont(), SetIcon(), SetIconSpacing(), SetIndicator(), SetLabel(), SetMaxSize(), SetMinSize(), SetPaddingSize(), and SetVertical().
|
private |
References mouseReleased().
|
private |
References canFocus, and pressedDown.
|
private |
References pressedDown, and sendButtonEvent().
Referenced by mouseCaptureLost().
|
private |
References tipWindow.
Referenced by EnableTooltipEvenDisabled().
|
private |
References tipWindow.
Referenced by EnableTooltipEvenDisabled().
|
private |
|
private |
References active_icon, ScalableBitmap::bmp(), StateColor::darkModeColorFor(), ScalableBitmap::GetBmpSize(), isCenter, m_icon_spacing, m_indicator_color, m_show_indicator, paddingSize, StaticBox::render(), Label::split_lines(), StaticBox::state_handler, text_color, textSize, and vertical.
Referenced by paintEvent().
| void Button::Rescale | ( | ) |
References active_icon, m_has_style, m_style, m_type, messureSize(), and SetStyle().
Referenced by Slic3r::GUI::CaliPageButton::msw_rescale().
|
private |
Referenced by mouseReleased().
|
inherited |
References background_color, and state_handler.
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), TabCtrl::AppendItem(), MultiSwitchButton::AppendOption(), Slic3r::GUI::KBShortcutsDialog::create_page(), Slic3r::GUI::wgtDeviceNozzleRackNozzleItem::CreateGui(), Slic3r::GUI::wgtDeviceNozzleRackArea::CreateNozzleBox(), Slic3r::GUI::DeviceErrorDialog::init_button(), ButtonsListCtrl::InsertPage(), TabButtonsListCtrl::InsertPage(), ButtonsListCtrl::OnPaint(), TabButtonsListCtrl::OnPaint(), Slic3r::GUI::s_set_bg_style(), Slic3r::GUI::wgtDeviceNozzleRackNozzleItem::SetDisable(), Button::SetStyle(), and Slic3r::GUI::style_sidebar_icon_btn().
|
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().
|
override |
|
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().
|
override |
References messureSize().
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), TabCtrl::AppendItem(), MultiSwitchButton::AppendOption(), Create(), Slic3r::GUI::DeviceErrorDialog::init_button(), Slic3r::GUI::MediaFilePanel::modeChanged(), and SetStyle().
| void Button::SetIcon | ( | const wxBitmap & | icon | ) |
References active_icon, and messureSize().
| void Button::SetIcon | ( | const wxString & | icon | ) |
References active_icon.
Referenced by ButtonsListCtrl::InsertPage().
| void Button::SetIconSpacing | ( | int | spacing | ) |
References m_icon_spacing, and messureSize().
Referenced by ButtonsListCtrl::InsertPage().
| void Button::SetIndicator | ( | bool | on | ) |
References m_show_indicator, and messureSize().
|
override |
References messureSize().
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::EditCalibrationHistoryDialog::EditCalibrationHistoryDialog(), Slic3r::GUI::PurgeModeDialog::PurgeModeDialog(), Slic3r::GUI::RecenterDialog::RecenterDialog(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), ButtonsListCtrl::SetCompact(), and ButtonsListCtrl::SetPageText().
|
override |
References messureSize().
Referenced by Slic3r::GUI::DeviceErrorDialog::init_button(), Slic3r::GUI::PrintErrorDialog::init_button(), and SetStyle().
|
override |
References messureSize(), and minSize.
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), Slic3r::GUI::DeviceErrorDialog::init_button(), Slic3r::GUI::PrintErrorDialog::init_button(), ButtonsListCtrl::InsertPage(), Slic3r::GUI::CaliPageButton::msw_rescale(), ButtonsListCtrl::SetCompact(), SetStyle(), and Slic3r::GUI::style_sidebar_icon_btn().
| void Button::SetPaddingSize | ( | const wxSize & | size | ) |
References messureSize(), and paddingSize.
Referenced by TabCtrl::AppendItem(), MultiSwitchButton::AppendOption(), SetStyle(), and Slic3r::GUI::style_sidebar_icon_btn().
|
inline |
References m_selected.
Referenced by CustomWidgetsPlugin::addButtonProps().
| void Button::SetStyle | ( | const ButtonStyle | style, |
| const ButtonType | type ) |
References Alert, Label::Body_10, Label::Body_12, Label::Body_14, StaticBox::border_color, btn_alert, btn_confirm, btn_disabled, btn_regular, Choice, Circle, Compact, Confirm, StateColor::darkModeColorFor(), Disabled, StateColor::Disabled, StateColor::Enabled, Expanded, StateColor::Focused, StateColor::Hovered, Icon, is_dark(), m_has_style, m_style, m_type, StateColor::Normal, Parameter, StateColor::Pressed, Regular, StaticBox::SetBackgroundColor(), StaticBox::SetBorderColor(), StaticBox::SetBorderWidth(), StaticBox::SetCornerRadius(), SetFont(), SetMaxSize(), SetMinSize(), SetPaddingSize(), SetTextColor(), style, and Window.
Referenced by Slic3r::GUI::AboutDialog::AboutDialog(), Slic3r::GUI::HistoryWindow::HistoryWindow(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::BedShapePanel::build_panel(), Slic3r::GUI::PhysicalPrinterDialog::build_printhost_settings(), Slic3r::GUI::Tab::compatible_widget_create(), Slic3r::GUI::TabPrinter::create_bed_shape_widget(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::PreferencesDialog::create_debug_page(), Slic3r::GUI::PresetTree::get_child_item(), Slic3r::GUI::TextureImportDialog::highlight_view_button(), Slic3r::GUI::PrintErrorDialog::init_button(), Slic3r::GUI::BedShapePanel::init_model_panel(), Slic3r::GUI::BedShapePanel::init_texture_panel(), Rescale(), Slic3r::GUI::DialogButtons::SetAlertButton(), and Slic3r::GUI::DialogButtons::SetPrimaryButton().
| void Button::SetTextColor | ( | StateColor const & | color | ) |
References StaticBox::state_handler, and text_color.
Referenced by Slic3r::GUI::CaliPageButton::CaliPageButton(), TabCtrl::AppendItem(), MultiSwitchButton::AppendOption(), ButtonsListCtrl::InsertPage(), and SetStyle().
| void Button::SetTextColorNormal | ( | wxColor const & | color | ) |
References text_color.
|
inherited |
References top_margin.
Referenced by Slic3r::GUI::ExtruderGroup::ExtruderGroup().
| void Button::SetValue | ( | bool | state | ) |
References StateHandler::Checked, GetValue(), and StaticBox::state_handler.
Referenced by Slic3r::GUI::MediaFilePanel::MediaFilePanel().
| void Button::SetVertical | ( | bool | vertical = true | ) |
|
inherited |
References badge.
Referenced by Slic3r::GUI::ExtruderGroup::ExtruderGroup().
|
protectedinherited |
|
private |
|
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 |
|
staticprivate |
|
staticprivate |
|
private |
Referenced by AcceptsFocus(), mouseDown(), and SetCanFocus().
|
private |
Referenced by render(), and SetCenter().
|
private |
Referenced by Rescale(), and SetStyle().
|
private |
Referenced by messureSize(), render(), and SetIconSpacing().
|
private |
Referenced by render().
|
private |
Referenced by IsSelected(), and SetSelected().
|
private |
Referenced by messureSize(), render(), and SetIndicator().
|
private |
Referenced by GetStyle(), Rescale(), and SetStyle().
|
private |
Referenced by GetType(), Rescale(), and SetStyle().
|
private |
Referenced by messureSize(), and SetMinSize().
|
private |
Referenced by Button(), messureSize(), render(), and SetPaddingSize().
|
private |
Referenced by mouseDown(), and mouseReleased().
|
protectedinherited |
|
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().
|
private |
Referenced by Button(), Create(), render(), SetTextColor(), and SetTextColorNormal().
|
private |
Referenced by messureSize(), and render().
|
private |
Referenced by OnParentLeave(), and OnParentMotion().
|
protectedinherited |
Referenced by doRender(), and SetTopMargin().
|
private |
Referenced by messureSize(), render(), and SetVertical().