KiCad PCB EDA Suite
|
A popup window that contains a row of toolbar-like buttons for the user to choose from. More...
#include <action_toolbar.h>
Public Member Functions | |
ACTION_TOOLBAR_PALETTE (wxWindow *aParent, bool aVertical) | |
Create the palette. | |
void | AddAction (const TOOL_ACTION &aAction) |
Add an action to the palette. | |
void | EnableAction (const TOOL_ACTION &aAction, bool aEnable=true) |
Enable the button for an action on the palette. | |
void | CheckAction (const TOOL_ACTION &aAction, bool aCheck=true) |
Check/Toggle the button for an action on the palette. | |
void | SetButtonSize (wxRect &aSize) |
Set the size all the buttons on this palette should be. | |
void | Popup (wxWindow *aFocus=nullptr) override |
Popup this window. | |
void | SetGroup (ACTION_GROUP *aGroup) |
Set the action group that this palette contains the actions for. | |
ACTION_GROUP * | GetGroup () |
Protected Member Functions | |
void | onCharHook (wxKeyEvent &aEvent) |
Protected Attributes | |
ACTION_GROUP * | m_group |
The size each button on the toolbar should be. | |
wxRect | m_buttonSize |
True if the palette uses vertical buttons, false for horizontal buttons. | |
bool | m_isVertical |
wxPanel * | m_panel |
wxBoxSizer * | m_mainSizer |
wxBoxSizer * | m_buttonSizer |
The buttons that act as the toolbar on the palette. | |
std::map< int, BITMAP_BUTTON * > | m_buttons |
A popup window that contains a row of toolbar-like buttons for the user to choose from.
Definition at line 102 of file action_toolbar.h.
ACTION_TOOLBAR_PALETTE::ACTION_TOOLBAR_PALETTE | ( | wxWindow * | aParent, |
bool | aVertical | ||
) |
Create the palette.
aParent | is the parent window |
aVertical | is true if the palette should make the buttons a vertical line, false for a horizontal line. |
Definition at line 90 of file action_toolbar.cpp.
References m_buttonSizer, m_mainSizer, m_panel, onCharHook(), and PALETTE_BORDER.
void ACTION_TOOLBAR_PALETTE::AddAction | ( | const TOOL_ACTION & | aAction | ) |
Add an action to the palette.
aAction | is the action to add |
Definition at line 115 of file action_toolbar.cpp.
References BITMAP_BUTTON::AcceptDragInAsClick(), BUTTON_BORDER, TOOL_ACTION::GetButtonTooltip(), PGM_BASE::GetCommonSettings(), TOOL_ACTION::GetIcon(), KIPLATFORM::UI::GetPixelScaleFactor(), TOOL_ACTION::GetUIId(), KiBitmapBundle(), KiDisabledBitmapBundle(), COMMON_SETTINGS::m_Appearance, m_buttons, m_buttonSize, m_buttonSizer, m_isVertical, m_panel, Pgm(), BITMAP_BUTTON::SetBitmap(), BITMAP_BUTTON::SetBitmapCentered(), BITMAP_BUTTON::SetDisabledBitmap(), BITMAP_BUTTON::SetIsToolbarButton(), BITMAP_BUTTON::SetPadding(), and COMMON_SETTINGS::APPEARANCE::toolbar_icon_size.
Referenced by ACTION_TOOLBAR::popupPalette().
void ACTION_TOOLBAR_PALETTE::CheckAction | ( | const TOOL_ACTION & | aAction, |
bool | aCheck = true |
||
) |
Check/Toggle the button for an action on the palette.
aAction | is the action who's button should be checked |
aCheck | is true to check the button, false to uncheck |
Definition at line 156 of file action_toolbar.cpp.
References TOOL_ACTION::GetUIId(), and m_buttons.
void ACTION_TOOLBAR_PALETTE::EnableAction | ( | const TOOL_ACTION & | aAction, |
bool | aEnable = true |
||
) |
Enable the button for an action on the palette.
aAction | is the action who's button should be enabled |
aEnable | is true to enable the button, false to disable |
Definition at line 147 of file action_toolbar.cpp.
References TOOL_ACTION::GetUIId(), and m_buttons.
Referenced by ACTION_TOOLBAR::popupPalette().
|
inline |
Definition at line 157 of file action_toolbar.h.
References m_group.
Referenced by ACTION_TOOLBAR::onPaletteEvent().
|
protected |
Definition at line 174 of file action_toolbar.cpp.
Referenced by ACTION_TOOLBAR_PALETTE().
|
override |
Popup this window.
aFocus | is the window to keep focus on (if supported) |
Definition at line 165 of file action_toolbar.cpp.
References m_mainSizer, and m_panel.
Referenced by ACTION_TOOLBAR::popupPalette().
|
inline |
Set the size all the buttons on this palette should be.
This function will automatically pad all button bitmaps to ensure this size is met.
aSize | is the requested size of the buttons |
Definition at line 144 of file action_toolbar.h.
References m_buttonSize.
Referenced by ACTION_TOOLBAR::popupPalette().
|
inline |
Set the action group that this palette contains the actions for.
Definition at line 156 of file action_toolbar.h.
References m_group.
Referenced by ACTION_TOOLBAR::popupPalette().
|
protected |
Definition at line 176 of file action_toolbar.h.
Referenced by AddAction(), CheckAction(), and EnableAction().
|
protected |
True if the palette uses vertical buttons, false for horizontal buttons.
Definition at line 166 of file action_toolbar.h.
Referenced by AddAction(), and SetButtonSize().
|
protected |
The buttons that act as the toolbar on the palette.
Definition at line 173 of file action_toolbar.h.
Referenced by ACTION_TOOLBAR_PALETTE(), and AddAction().
|
protected |
The size each button on the toolbar should be.
Definition at line 163 of file action_toolbar.h.
Referenced by GetGroup(), and SetGroup().
|
protected |
Definition at line 169 of file action_toolbar.h.
Referenced by AddAction().
|
protected |
Definition at line 172 of file action_toolbar.h.
Referenced by ACTION_TOOLBAR_PALETTE(), and Popup().
|
protected |
Definition at line 171 of file action_toolbar.h.
Referenced by ACTION_TOOLBAR_PALETTE(), AddAction(), and Popup().