|
KiCad PCB EDA Suite
|
Public Member Functions | |
| PSEUDO_ACTION (const wxString &aLabel, int aHotKey, int aHotKeyAlt=0) | |
| bool | operator== (const TOOL_ACTION &aRhs) const |
| bool | operator!= (const TOOL_ACTION &aRhs) const |
| const std::string & | GetName () const |
| Return name of the action. | |
| int | GetDefaultHotKey () const |
| Return the default hotkey (if any) for the action. | |
| int | GetDefaultHotKeyAlt () const |
| int | GetHotKey () const |
| Return the hotkey keycode which initiates the action. | |
| int | GetHotKeyAlt () const |
| void | SetHotKey (int aKeycode, int aKeycodeAlt=0) |
| bool | IsHotKeyUserBound (int aMatchedHotKey) const |
| Return true if the matched hotkey slot (primary or alternate) holds a value different from its compile-time default. | |
| int | GetId () const |
| Return the unique id of the TOOL_ACTION object. | |
| bool | HasCustomUIId () const |
| Return true if this action has a custom UI ID set. | |
| int | GetUIId () const |
| Get the unique ID for this action in the user interface system. | |
| TOOL_EVENT | MakeEvent () const |
| Return the event associated with the action (i.e. | |
| wxString | GetMenuLabel () const |
| Return the translated label for the action. | |
| wxString | GetMenuItem () const |
| wxString | GetTooltip (bool aIncludeHotkey=true) const |
| wxString | GetButtonTooltip () const |
| wxString | GetDescription () const |
| wxString | GetFriendlyName () const |
| Return the translated user-friendly name of the action. | |
| TOOL_ACTION_SCOPE | GetScope () const |
| template<typename T> | |
| T | GetParam () const |
| Return a non-standard parameter assigned to the action. | |
| const std::optional< TOOL_ACTION_GROUP > | GetActionGroup () const |
| std::string | GetToolName () const |
| Return name of the tool associated with the action. | |
| bool | IsActivation () const |
| Return true if the action is intended to activate a tool. | |
| bool | IsNotification () const |
| Return true if the action is a notification. | |
| BITMAPS | GetIcon () const |
| Return an icon associated with the action. | |
| bool | CheckToolbarState (TOOLBAR_STATE aState) const |
| Check if a specific toolbar state is required for this action. | |
Static Public Member Functions | |
| static int | GetBaseUIId () |
| Get the base value used to offset the user interface IDs for the actions. | |
Protected Attributes | |
| std::string | m_name |
| Name of the action (convention is "app.tool.actionName") | |
| TOOL_ACTION_SCOPE | m_scope |
| std::optional< TOOL_ACTION_GROUP > | m_group |
| Optional group for the action to belong to. | |
| const int | m_defaultHotKey |
| Default hot key. | |
| const int | m_defaultHotKeyAlt |
| Default hot key alternate. | |
| int | m_hotKey |
| The current hotkey (post-user-settings-application). | |
| int | m_hotKeyAlt |
| The alternate hotkey (post-user-settings-application). | |
| const std::string | m_legacyName |
| Name for reading legacy hotkey settings. | |
| wxString | m_friendlyName |
| User-friendly name. | |
| std::optional< wxString > | m_menuLabel |
| Menu label. | |
| wxString | m_tooltip |
| User facing tooltip help text. | |
| std::optional< wxString > | m_description |
| Description of the action. | |
| std::optional< BITMAPS > | m_icon |
| Icon for the menu entry. | |
| int | m_id |
| Unique ID for maps. Assigned by ACTION_MANAGER. | |
| std::optional< int > | m_uiid |
| ID to use when interacting with the UI (if empty, generate one). | |
| TOOLBAR_STATE_FLAGS | m_toolbarState |
| Toolbar state behavior for the action. | |
| TOOL_ACTION_FLAGS | m_flags |
| ki::any | m_param |
| Generic parameter. | |
Static Protected Attributes | |
| static constexpr int | ACTION_BASE_UI_ID = 20000 |
| Base ID to use inside the user interface system to offset the action IDs. | |
Definition at line 28 of file hotkey_store.cpp.
|
inline |
Definition at line 31 of file hotkey_store.cpp.
References TOOL_ACTION::m_friendlyName, TOOL_ACTION::m_hotKey, and TOOL_ACTION::m_hotKeyAlt.
|
inlineinherited |
Check if a specific toolbar state is required for this action.
| aState | The state (from TOOLBAR_STATE enum) to check |
Definition at line 477 of file tool_action.h.
References m_toolbarState.
Referenced by ACTION_TOOLBAR::Add().
|
inlineinherited |
Definition at line 433 of file tool_action.h.
References m_group.
|
inlinestaticinherited |
Get the base value used to offset the user interface IDs for the actions.
Definition at line 383 of file tool_action.h.
References ACTION_BASE_UI_ID.
Referenced by ACTION_GROUP::GetUIId(), and ACTION_MANAGER::IsActionUIId().
|
inherited |
Definition at line 190 of file tool_action.cpp.
References GetFriendlyName(), GetHotKey(), GetTooltip(), and KeyNameFromKeyCode().
Referenced by ACTION_TOOLBAR::Add(), ACTION_TOOLBAR_PALETTE::AddAction(), ACTION_TOOLBAR::AddButton(), and ACTION_TOOLBAR::doSelectAction().
|
inlineinherited |
Return the default hotkey (if any) for the action.
Definition at line 338 of file tool_action.h.
References m_defaultHotKey.
Referenced by BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Definition at line 339 of file tool_action.h.
References m_defaultHotKeyAlt.
|
inherited |
Definition at line 169 of file tool_action.cpp.
References GetTooltip(), and m_description.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages(), NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages(), NL_PCBNEW_PLUGIN_IMPL::exportCommandsAndImages(), and NL_SCHEMATIC_PLUGIN_IMPL::exportCommandsAndImages().
|
inherited |
Return the translated user-friendly name of the action.
Definition at line 143 of file tool_action.cpp.
References m_friendlyName.
Referenced by PANEL_KICAD_LAUNCHER::CreateLaunchers(), GetButtonTooltip(), GetMenuLabel(), EDA_BASE_FRAME::GetRunMenuCommandDescription(), TOOLS_HOLDER::PushTool(), WIDGET_HOTKEY_LIST::resolveKeyConflicts(), and TOOLS_HOLDER::ShowChangedLanguage().
|
inlineinherited |
Return the hotkey keycode which initiates the action.
Definition at line 344 of file tool_action.h.
References m_hotKey.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), GetButtonTooltip(), PCB_ONE_LAYER_SELECTOR::getLayerHotKey(), GetTooltip(), PCB_LAYER_BOX_SELECTOR::Resync(), and ACTION_MANAGER::UpdateHotKeys().
|
inlineinherited |
Definition at line 345 of file tool_action.h.
References m_hotKeyAlt.
Referenced by ACTION_MANAGER::UpdateHotKeys().
|
inlineinherited |
Return an icon associated with the action.
It is used in context menu.
Definition at line 463 of file tool_action.h.
References m_icon.
Referenced by ACTION_MENU::Add(), ACTION_TOOLBAR::Add(), ACTION_TOOLBAR_PALETTE::AddAction(), ACTION_TOOLBAR::AddButton(), ACTION_TOOLBAR::AddGroup(), ACTION_TOOLBAR::doSelectAction(), NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages(), NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages(), NL_PCBNEW_PLUGIN_IMPL::exportCommandsAndImages(), and NL_SCHEMATIC_PLUGIN_IMPL::exportCommandsAndImages().
|
inlineinherited |
Return the unique id of the TOOL_ACTION object.
It is valid only after registering the TOOL_ACTION by ACTION_MANAGER.
Definition at line 363 of file tool_action.h.
References m_id.
Referenced by CONDITIONAL_MENU::AddCheckItem(), CONDITIONAL_MENU::AddItem(), ACTION_MANAGER::GetCondition(), ACTION_MANAGER::GetHotKey(), ACTION_TOOLBAR::onToolEvent(), ACTION_MANAGER::SetConditions(), and ACTION_MANAGER::UpdateHotKeys().
|
inherited |
Definition at line 161 of file tool_action.cpp.
References AddHotkeyName(), GetMenuLabel(), IS_HOTKEY, and m_hotKey.
Referenced by ACTION_MENU::Add().
|
inherited |
Return the translated label for the action.
Definition at line 152 of file tool_action.cpp.
References GetFriendlyName(), and m_menuLabel.
Referenced by NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages(), NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages(), NL_PCBNEW_PLUGIN_IMPL::exportCommandsAndImages(), NL_SCHEMATIC_PLUGIN_IMPL::exportCommandsAndImages(), GetMenuItem(), and EDA_BASE_FRAME::GetRunMenuCommandDescription().
|
inlineinherited |
Return name of the action.
It is the same one that is contained in TOOL_EVENT that is sent by activating the TOOL_ACTION. Convention is "app.tool.actionName".
Definition at line 333 of file tool_action.h.
References m_name.
Referenced by ACTION_TOOLBAR::Add(), TOOLBAR_GROUP_CONFIG::AddAction(), TOOLBAR_CONFIGURATION::AppendAction(), ACTION_TOOLBAR::doSelectAction(), NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages(), NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages(), NL_PCBNEW_PLUGIN_IMPL::exportCommandsAndImages(), NL_SCHEMATIC_PLUGIN_IMPL::exportCommandsAndImages(), HOTKEY_STORE::GetAppName(), PANEL_TOOLBAR_CUSTOMIZATION::isActionSupported(), TOOLS_HOLDER::IsCurrentTool(), PANEL_TOOLBAR_CUSTOMIZATION::onBtnAddAction(), ACTION_MANAGER::RegisterAction(), ACTION_MANAGER::RunHotKey(), NL_3D_VIEWER_PLUGIN_IMPL::SetActiveCommand(), NL_PCBNEW_PLUGIN_IMPL::SetActiveCommand(), NL_SCHEMATIC_PLUGIN_IMPL::SetActiveCommand(), and ACTION_MANAGER::SetConditions().
Return a non-standard parameter assigned to the action.
Definition at line 411 of file tool_action.h.
References ki::any_cast(), m_param, name, and T.
|
inlineinherited |
Definition at line 405 of file tool_action.h.
References m_scope.
Referenced by HOTKEY_STORE::CheckKeyConflicts().
|
inherited |
Return name of the tool associated with the action.
It is basically the action name stripped of the last part (e.g. for "pcbnew.InteractiveDrawing.drawCircle" it is "pcbnew.InteractiveDrawing").
Definition at line 219 of file tool_action.cpp.
References m_name.
Referenced by HOTKEY_STORE::CheckKeyConflicts(), NL_3D_VIEWER_PLUGIN_IMPL::exportCommandsAndImages(), NL_FOOTPRINT_PROPERTIES_PLUGIN_IMPL::exportCommandsAndImages(), NL_PCBNEW_PLUGIN_IMPL::exportCommandsAndImages(), and NL_SCHEMATIC_PLUGIN_IMPL::exportCommandsAndImages().
|
inherited |
Definition at line 179 of file tool_action.cpp.
References GetHotKey(), KeyNameFromKeyCode(), and m_tooltip.
Referenced by ACTION_MENU::Add(), PANEL_KICAD_LAUNCHER::CreateLaunchers(), GetButtonTooltip(), and GetDescription().
|
inlineinherited |
Get the unique ID for this action in the user interface system.
This can be either set to a specific ID during creation or computed by offsetting the action ID by ACTION_BASE_UI_ID.
Definition at line 378 of file tool_action.h.
References ACTION_BASE_UI_ID, m_id, and m_uiid.
Referenced by ACTION_MENU::Add(), ACTION_TOOLBAR::Add(), ACTION_TOOLBAR_PALETTE::AddAction(), ACTION_TOOLBAR::AddButton(), ACTION_TOOLBAR::AddToolContextMenu(), ACTION_TOOLBAR_PALETTE::CheckAction(), ACTION_TOOLBAR_PALETTE::EnableAction(), ACTION_TOOLBAR::popupPalette(), ACTION_MANAGER::RegisterAction(), TOOLS_HOLDER::RegisterUIUpdateHandler(), ACTION_TOOLBAR::SetToolBitmap(), ACTION_TOOLBAR::Toggle(), ACTION_TOOLBAR::Toggle(), and TOOLS_HOLDER::UnregisterUIUpdateHandler().
|
inlineinherited |
Return true if this action has a custom UI ID set.
Definition at line 368 of file tool_action.h.
References m_uiid.
Referenced by ACTION_MANAGER::RegisterAction().
|
inlineinherited |
Return true if the action is intended to activate a tool.
Definition at line 445 of file tool_action.h.
References AF_ACTIVATE, and m_flags.
Referenced by MakeEvent().
|
inherited |
Return true if the matched hotkey slot (primary or alternate) holds a value different from its compile-time default.
See ACTION_MANAGER::RunHotKey for how this drives same-key dispatch tiebreaking. See https://gitlab.com/kicad/code/kicad/-/issues/5916.
Definition at line 212 of file tool_action.cpp.
References m_defaultHotKey, m_defaultHotKeyAlt, m_hotKey, and m_hotKeyAlt.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
inlineinherited |
Return true if the action is a notification.
Definition at line 453 of file tool_action.h.
References AF_NOTIFY, and m_flags.
Referenced by MakeEvent().
|
inherited |
Return the event associated with the action (i.e.
the event that will be sent after activating the action).
Definition at line 120 of file tool_action.cpp.
References IsActivation(), IsNotification(), m_group, m_name, m_param, m_scope, TOOL_EVENT::SetActionGroup(), TOOL_EVENT::SetParameter(), TA_ACTION, TA_ACTIVATE, TA_NONE, TC_COMMAND, and TC_MESSAGE.
Referenced by TOOL_MANAGER::doRunAction(), TOOL_EVENT::IsAction(), PANEL_KICAD_LAUNCHER::onLauncherButtonClick(), ACTION_TOOLBAR::onPaletteEvent(), and TOOLS_HOLDER::PopTool().
|
inlineinherited |
Definition at line 320 of file tool_action.h.
References m_id, and TOOL_ACTION().
|
inlineinherited |
Definition at line 315 of file tool_action.h.
References m_id, and TOOL_ACTION().
|
inherited |
Definition at line 205 of file tool_action.cpp.
References m_hotKey, and m_hotKeyAlt.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), ACTION_MANAGER::processHotKey(), HOTKEY_STORE::SaveAllHotkeys(), TOOL_ACTION(), and TOOL_ACTION().
|
staticconstexprprotectedinherited |
Base ID to use inside the user interface system to offset the action IDs.
Definition at line 489 of file tool_action.h.
Referenced by GetBaseUIId(), and GetUIId().
|
protectedinherited |
Default hot key.
Definition at line 497 of file tool_action.h.
Referenced by GetDefaultHotKey(), IsHotKeyUserBound(), ACTION_MANAGER::processHotKey(), TOOL_ACTION(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Default hot key alternate.
Definition at line 498 of file tool_action.h.
Referenced by GetDefaultHotKeyAlt(), IsHotKeyUserBound(), TOOL_ACTION(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Description of the action.
Definition at line 508 of file tool_action.h.
Referenced by GetDescription(), and TOOL_ACTION().
|
protectedinherited |
Definition at line 517 of file tool_action.h.
Referenced by IsActivation(), IsNotification(), TOOL_ACTION(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
User-friendly name.
Definition at line 505 of file tool_action.h.
Referenced by GetFriendlyName(), PSEUDO_ACTION::PSEUDO_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Optional group for the action to belong to.
Definition at line 495 of file tool_action.h.
Referenced by GetActionGroup(), MakeEvent(), TOOL_ACTION(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
The current hotkey (post-user-settings-application).
Definition at line 499 of file tool_action.h.
Referenced by GetHotKey(), GetMenuItem(), IsHotKeyUserBound(), ACTION_MANAGER::processHotKey(), PSEUDO_ACTION::PSEUDO_ACTION(), SetHotKey(), and TOOL_ACTION().
|
protectedinherited |
The alternate hotkey (post-user-settings-application).
Definition at line 502 of file tool_action.h.
Referenced by GetHotKeyAlt(), IsHotKeyUserBound(), PSEUDO_ACTION::PSEUDO_ACTION(), SetHotKey(), and TOOL_ACTION().
|
protectedinherited |
Icon for the menu entry.
Definition at line 510 of file tool_action.h.
Referenced by GetIcon(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Unique ID for maps. Assigned by ACTION_MANAGER.
Definition at line 512 of file tool_action.h.
Referenced by GetId(), GetUIId(), operator!=(), operator==(), TOOL_ACTION(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Name for reading legacy hotkey settings.
Definition at line 503 of file tool_action.h.
Referenced by ACTION_MANAGER::processHotKey(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Menu label.
Definition at line 506 of file tool_action.h.
Referenced by GetMenuLabel(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Name of the action (convention is "app.tool.actionName")
Definition at line 492 of file tool_action.h.
Referenced by GetName(), GetToolName(), MakeEvent(), ACTION_MANAGER::processHotKey(), ACTION_MANAGER::RegisterAction(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Generic parameter.
Definition at line 518 of file tool_action.h.
Referenced by GetParam(), MakeEvent(), and TOOL_ACTION().
|
protectedinherited |
Definition at line 493 of file tool_action.h.
Referenced by GetScope(), MakeEvent(), TOOL_ACTION(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
Toolbar state behavior for the action.
Definition at line 515 of file tool_action.h.
Referenced by CheckToolbarState(), and TOOL_ACTION().
|
protectedinherited |
User facing tooltip help text.
Definition at line 507 of file tool_action.h.
Referenced by GetTooltip(), TOOL_ACTION(), and TOOL_ACTION().
|
protectedinherited |
ID to use when interacting with the UI (if empty, generate one).
Definition at line 513 of file tool_action.h.
Referenced by GetUIId(), HasCustomUIId(), and TOOL_ACTION().