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

A popup window that contains a row of toolbar-like buttons for the user to choose from. More...

#include <action_toolbar.h>

Inheritance diagram for ACTION_TOOLBAR_PALETTE:

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_GROUPGetGroup ()
 

Protected Member Functions

void onCharHook (wxKeyEvent &aEvent)
 

Protected Attributes

ACTION_GROUPm_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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ACTION_TOOLBAR_PALETTE()

ACTION_TOOLBAR_PALETTE::ACTION_TOOLBAR_PALETTE ( wxWindow *  aParent,
bool  aVertical 
)

Create the palette.

Parameters
aParentis the parent window
aVerticalis 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.

Member Function Documentation

◆ AddAction()

◆ CheckAction()

void ACTION_TOOLBAR_PALETTE::CheckAction ( const TOOL_ACTION aAction,
bool  aCheck = true 
)

Check/Toggle the button for an action on the palette.

Parameters
aActionis the action who's button should be checked
aCheckis true to check the button, false to uncheck

Definition at line 156 of file action_toolbar.cpp.

References TOOL_ACTION::GetUIId(), and m_buttons.

◆ EnableAction()

void ACTION_TOOLBAR_PALETTE::EnableAction ( const TOOL_ACTION aAction,
bool  aEnable = true 
)

Enable the button for an action on the palette.

Parameters
aActionis the action who's button should be enabled
aEnableis 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().

◆ GetGroup()

ACTION_GROUP * ACTION_TOOLBAR_PALETTE::GetGroup ( )
inline

Definition at line 157 of file action_toolbar.h.

References m_group.

Referenced by ACTION_TOOLBAR::onPaletteEvent().

◆ onCharHook()

void ACTION_TOOLBAR_PALETTE::onCharHook ( wxKeyEvent &  aEvent)
protected

Definition at line 174 of file action_toolbar.cpp.

Referenced by ACTION_TOOLBAR_PALETTE().

◆ Popup()

void ACTION_TOOLBAR_PALETTE::Popup ( wxWindow *  aFocus = nullptr)
override

Popup this window.

Parameters
aFocusis 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().

◆ SetButtonSize()

void ACTION_TOOLBAR_PALETTE::SetButtonSize ( wxRect &  aSize)
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.

Parameters
aSizeis the requested size of the buttons

Definition at line 144 of file action_toolbar.h.

References m_buttonSize.

Referenced by ACTION_TOOLBAR::popupPalette().

◆ SetGroup()

void ACTION_TOOLBAR_PALETTE::SetGroup ( ACTION_GROUP aGroup)
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().

Member Data Documentation

◆ m_buttons

std::map<int, BITMAP_BUTTON*> ACTION_TOOLBAR_PALETTE::m_buttons
protected

Definition at line 176 of file action_toolbar.h.

Referenced by AddAction(), CheckAction(), and EnableAction().

◆ m_buttonSize

wxRect ACTION_TOOLBAR_PALETTE::m_buttonSize
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().

◆ m_buttonSizer

wxBoxSizer* ACTION_TOOLBAR_PALETTE::m_buttonSizer
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().

◆ m_group

ACTION_GROUP* ACTION_TOOLBAR_PALETTE::m_group
protected

The size each button on the toolbar should be.

Definition at line 163 of file action_toolbar.h.

Referenced by GetGroup(), and SetGroup().

◆ m_isVertical

bool ACTION_TOOLBAR_PALETTE::m_isVertical
protected

Definition at line 169 of file action_toolbar.h.

Referenced by AddAction().

◆ m_mainSizer

wxBoxSizer* ACTION_TOOLBAR_PALETTE::m_mainSizer
protected

Definition at line 172 of file action_toolbar.h.

Referenced by ACTION_TOOLBAR_PALETTE(), and Popup().

◆ m_panel

wxPanel* ACTION_TOOLBAR_PALETTE::m_panel
protected

Definition at line 171 of file action_toolbar.h.

Referenced by ACTION_TOOLBAR_PALETTE(), AddAction(), and Popup().


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