KiCad PCB EDA Suite
Loading...
Searching...
No Matches
STD_BITMAP_BUTTON Class Reference

A bitmap button widget that behaves like a standard dialog button except with an icon. More...

#include <std_bitmap_button.h>

Inheritance diagram for STD_BITMAP_BUTTON:

Public Member Functions

 STD_BITMAP_BUTTON (wxWindow *aParent, wxWindowID aId, const wxBitmap &aDummyBitmap, const wxPoint &aPos=wxDefaultPosition, const wxSize &aSize=wxDefaultSize, int aStyle=0)
 
 ~STD_BITMAP_BUTTON ()
 
void SetBitmap (const wxBitmapBundle &aBmp)
 
bool Enable (bool aEnable=true) override
 

Protected Member Functions

void OnKillFocus (wxFocusEvent &aEvent)
 
void OnMouseLeave (wxMouseEvent &aEvent)
 
void OnMouseEnter (wxMouseEvent &aEvent)
 
void OnLeftButtonUp (wxMouseEvent &aEvent)
 
void OnLeftButtonDown (wxMouseEvent &aEvent)
 
void OnPaint (wxPaintEvent &WXUNUSED(aEvent))
 
void onThemeChanged (wxSysColourChangedEvent &aEvent)
 

Private Attributes

int m_stateButton = 0
 
bool m_bIsEnable = true
 
wxBitmapBundle m_bitmap
 

Detailed Description

A bitmap button widget that behaves like a standard dialog button except with an icon.

Specifically:

  • It has a border
  • It has no hover/focused state

In wxWidgets 3.2 the native button control is used on Mac for wxBitmapButton with or without text. Said widget has margins that are more than twice what previous versions had. This class allows our bitmap buttons to match the layout of our SPLIT_BUTTON.

Definition at line 45 of file std_bitmap_button.h.

Constructor & Destructor Documentation

◆ STD_BITMAP_BUTTON()

STD_BITMAP_BUTTON::STD_BITMAP_BUTTON ( wxWindow *  aParent,
wxWindowID  aId,
const wxBitmap &  aDummyBitmap,
const wxPoint &  aPos = wxDefaultPosition,
const wxSize &  aSize = wxDefaultSize,
int  aStyle = 0 
)

◆ ~STD_BITMAP_BUTTON()

STD_BITMAP_BUTTON::~STD_BITMAP_BUTTON ( )

Definition at line 74 of file std_bitmap_button.cpp.

Member Function Documentation

◆ Enable()

◆ OnKillFocus()

void STD_BITMAP_BUTTON::OnKillFocus ( wxFocusEvent &  aEvent)
protected

Definition at line 114 of file std_bitmap_button.cpp.

References m_stateButton, and Refresh().

Referenced by STD_BITMAP_BUTTON().

◆ OnLeftButtonDown()

void STD_BITMAP_BUTTON::OnLeftButtonDown ( wxMouseEvent &  aEvent)
protected

Definition at line 171 of file std_bitmap_button.cpp.

References m_stateButton, and Refresh().

Referenced by STD_BITMAP_BUTTON().

◆ OnLeftButtonUp()

void STD_BITMAP_BUTTON::OnLeftButtonUp ( wxMouseEvent &  aEvent)
protected

Definition at line 150 of file std_bitmap_button.cpp.

References m_stateButton, and Refresh().

Referenced by STD_BITMAP_BUTTON().

◆ OnMouseEnter()

void STD_BITMAP_BUTTON::OnMouseEnter ( wxMouseEvent &  aEvent)
protected

Definition at line 138 of file std_bitmap_button.cpp.

References m_stateButton, and Refresh().

Referenced by STD_BITMAP_BUTTON().

◆ OnMouseLeave()

void STD_BITMAP_BUTTON::OnMouseLeave ( wxMouseEvent &  aEvent)
protected

Definition at line 126 of file std_bitmap_button.cpp.

References m_stateButton, and Refresh().

Referenced by STD_BITMAP_BUTTON().

◆ OnPaint()

void STD_BITMAP_BUTTON::OnPaint ( wxPaintEvent &  WXUNUSEDaEvent)
protected

Definition at line 180 of file std_bitmap_button.cpp.

References KIPLATFORM::UI::IsDarkTheme(), m_bIsEnable, m_bitmap, and m_stateButton.

Referenced by STD_BITMAP_BUTTON().

◆ onThemeChanged()

void STD_BITMAP_BUTTON::onThemeChanged ( wxSysColourChangedEvent &  aEvent)
protected

Definition at line 79 of file std_bitmap_button.cpp.

References Refresh().

Referenced by STD_BITMAP_BUTTON().

◆ SetBitmap()

void STD_BITMAP_BUTTON::SetBitmap ( const wxBitmapBundle &  aBmp)

Definition at line 85 of file std_bitmap_button.cpp.

References m_bitmap, and minSize.

Referenced by DIALOG_BOM::DIALOG_BOM(), DIALOG_CHANGE_SYMBOLS::DIALOG_CHANGE_SYMBOLS(), DIALOG_CONFIG_EQUFILES::DIALOG_CONFIG_EQUFILES(), DIALOG_CONFIGURE_PATHS::DIALOG_CONFIGURE_PATHS(), DIALOG_EXCHANGE_FOOTPRINTS::DIALOG_EXCHANGE_FOOTPRINTS(), DIALOG_EXPORT_2581::DIALOG_EXPORT_2581(), DIALOG_EXPORT_STEP::DIALOG_EXPORT_STEP(), DIALOG_EXPORT_SVG::DIALOG_EXPORT_SVG(), DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES(), DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(), DIALOG_GROUP_PROPERTIES::DIALOG_GROUP_PROPERTIES(), DIALOG_IMPORT_GFX_SCH::DIALOG_IMPORT_GFX_SCH(), DIALOG_IMPORT_GRAPHICS::DIALOG_IMPORT_GRAPHICS(), DIALOG_IMPORT_NETLIST::DIALOG_IMPORT_NETLIST(), DIALOG_IMPORT_SETTINGS::DIALOG_IMPORT_SETTINGS(), DIALOG_LABEL_PROPERTIES::DIALOG_LABEL_PROPERTIES(), DIALOG_LIB_EDIT_PIN_TABLE::DIALOG_LIB_EDIT_PIN_TABLE(), DIALOG_LIB_SYMBOL_PROPERTIES::DIALOG_LIB_SYMBOL_PROPERTIES(), DIALOG_MANAGE_REPOSITORIES::DIALOG_MANAGE_REPOSITORIES(), DIALOG_MIGRATE_SETTINGS::DIALOG_MIGRATE_SETTINGS(), DIALOG_NET_INSPECTOR::DIALOG_NET_INSPECTOR(), DIALOG_PAGES_SETTINGS::DIALOG_PAGES_SETTINGS(), DIALOG_PIN_PROPERTIES::DIALOG_PIN_PROPERTIES(), DIALOG_PLOT::DIALOG_PLOT(), DIALOG_PLOT_SCHEMATIC::DIALOG_PLOT_SCHEMATIC(), DIALOG_PLUGIN_OPTIONS::DIALOG_PLUGIN_OPTIONS(), DIALOG_SCH_IMPORT_SETTINGS::DIALOG_SCH_IMPORT_SETTINGS(), DIALOG_SHEET_PROPERTIES::DIALOG_SHEET_PROPERTIES(), DIALOG_SIM_MODEL< T_symbol, T_field >::DIALOG_SIM_MODEL(), DIALOG_SYMBOL_FIELDS_TABLE::DIALOG_SYMBOL_FIELDS_TABLE(), DIALOG_SYMBOL_PROPERTIES::DIALOG_SYMBOL_PROPERTIES(), DIALOG_TEMPLATE_SELECTOR::DIALOG_TEMPLATE_SELECTOR(), DIALOG_USER_DEFINED_SIGNALS::DIALOG_USER_DEFINED_SIGNALS(), EDA_REORDERABLE_LIST_DIALOG::EDA_REORDERABLE_LIST_DIALOG(), DIALOG_FIELD_PROPERTIES::init(), DIALOG_PLOT::init_Dialog(), DIALOG_GEN_FOOTPRINT_POSITION::initDialog(), DIALOG_GENDRILL::InitDisplayParams(), LIB_TREE::LIB_TREE(), PANEL_BOM_PRESETS::PANEL_BOM_PRESETS(), PANEL_COMMON_SETTINGS::PANEL_COMMON_SETTINGS(), PANEL_FP_LIB_TABLE::PANEL_FP_LIB_TABLE(), PANEL_FP_PROPERTIES_3D_MODEL::PANEL_FP_PROPERTIES_3D_MODEL(), PANEL_GIT_REPOS::PANEL_GIT_REPOS(), PANEL_GRID_SETTINGS::PANEL_GRID_SETTINGS(), PANEL_PCBNEW_ACTION_PLUGINS::PANEL_PCBNEW_ACTION_PLUGINS(), PANEL_RF_ATTENUATORS::PANEL_RF_ATTENUATORS(), PANEL_SETUP_BUSES::PANEL_SETUP_BUSES(), PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES(), PANEL_SETUP_RULES::PANEL_SETUP_RULES(), PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS(), PANEL_SYM_LIB_TABLE::PANEL_SYM_LIB_TABLE(), PANEL_TEMPLATE_FIELDNAMES::PANEL_TEMPLATE_FIELDNAMES(), PANEL_TEXT_VARIABLES::PANEL_TEXT_VARIABLES(), PANEL_TRANSLINE::PANEL_TRANSLINE(), PANEL_FP_EDITOR_DEFAULTS::Show(), PANEL_RF_ATTENUATORS::ThemeChanged(), PANEL_TRANSLINE::ThemeChanged(), and TUNER_SLIDER::TUNER_SLIDER().

Member Data Documentation

◆ m_bIsEnable

bool STD_BITMAP_BUTTON::m_bIsEnable = true
private

Definition at line 69 of file std_bitmap_button.h.

Referenced by Enable(), and OnPaint().

◆ m_bitmap

wxBitmapBundle STD_BITMAP_BUTTON::m_bitmap
private

Definition at line 70 of file std_bitmap_button.h.

Referenced by OnPaint(), and SetBitmap().

◆ m_stateButton

int STD_BITMAP_BUTTON::m_stateButton = 0
private

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