KiCad PCB EDA Suite
|
Defines the structure of a menu based on ACTIONs. More...
#include <action_menu.h>
Public Member Functions | |
ACTION_MENU (bool isContextMenu, TOOL_INTERACTIVE *aTool=nullptr) | |
< Default constructor | |
~ACTION_MENU () override | |
ACTION_MENU (const ACTION_MENU &aMenu)=delete | |
ACTION_MENU & | operator= (const ACTION_MENU &aMenu)=delete |
void | SetTitle (const wxString &aTitle) override |
Set title for the menu. | |
wxString | GetTitle () const |
void | DisplayTitle (bool aDisplay=true) |
Decide whether a title for a pop up menu should be displayed. | |
void | SetIcon (BITMAPS aIcon) |
Assign an icon for the entry. | |
wxMenuItem * | Add (const wxString &aLabel, int aId, BITMAPS aIcon) |
Add a wxWidgets-style entry to the menu. | |
wxMenuItem * | Add (const wxString &aLabel, const wxString &aToolTip, int aId, BITMAPS aIcon, bool aIsCheckmarkEntry=false) |
wxMenuItem * | Add (const TOOL_ACTION &aAction, bool aIsCheckmarkEntry=false, const wxString &aOverrideLabel=wxEmptyString) |
Add an entry to the menu based on the TOOL_ACTION object. | |
wxMenuItem * | Add (ACTION_MENU *aMenu) |
Add an action menu as a submenu. | |
void | AddClose (const wxString &aAppname="") |
Add a standard close item to the menu with the accelerator key CTRL-W. | |
void | AddQuitOrClose (KIFACE_BASE *aKiface, wxString aAppname="") |
Add either a standard Quit or Close item to the menu. | |
void | AddQuit (const wxString &aAppname="") |
Add a standard Quit item to the menu. | |
void | Clear () |
Remove all the entries from the menu (as well as its title). | |
bool | HasEnabledItems () const |
Returns true if the menu has any enabled items. | |
int | GetSelected () const |
Return the position of selected item. | |
void | UpdateAll () |
Run update handlers for the menu and its submenus. | |
virtual void | UpdateTitle () |
Used by some menus to just-in-time translate their titles. | |
void | ClearDirty () |
Clear the dirty flag on the menu and all descendants. | |
void | SetDirty () |
void | SetTool (TOOL_INTERACTIVE *aTool) |
Set a tool that is the creator of the menu. | |
ACTION_MENU * | Clone () const |
Create a deep, recursive copy of this ACTION_MENU. | |
void | OnMenuEvent (wxMenuEvent &aEvent) |
void | OnIdle (wxIdleEvent &event) |
virtual bool | PassHelpTextToHandler () |
Static Public Attributes | |
static constexpr bool | NORMAL = false |
static constexpr bool | CHECK = true |
Protected Member Functions | |
virtual ACTION_MENU * | create () const |
< Return an instance of this class. It has to be overridden in inheriting classes. | |
TOOL_MANAGER * | getToolManager () const |
virtual void | update () |
Update menu state stub. | |
virtual OPT_TOOL_EVENT | eventHandler (const wxMenuEvent &) |
Event handler stub. | |
void | copyFrom (const ACTION_MENU &aMenu) |
Copy another menus data to this instance. | |
wxMenuItem * | appendCopy (const wxMenuItem *aSource) |
Append a copy of wxMenuItem. | |
void | setupEvents () |
Update hot key settings for TOOL_ACTIONs in this menu. | |
void | updateHotKeys () |
Traverse the submenus tree looking for a submenu capable of handling a particular menu event. | |
void | runEventHandlers (const wxMenuEvent &aMenuEvent, OPT_TOOL_EVENT &aToolEvent) |
Run a function on the menu and all its submenus. | |
void | runOnSubmenus (std::function< void(ACTION_MENU *)> aFunction) |
Check if any of submenus contains a TOOL_ACTION with a specific ID. | |
OPT_TOOL_EVENT | findToolAction (int aId) |
Protected Attributes | |
bool | m_isForcedPosition |
wxPoint | m_forcedPosition |
bool | m_dirty |
bool | m_titleDisplayed |
bool | m_isContextMenu |
Menu title. | |
wxString | m_title |
Optional icon. | |
BITMAPS | m_icon |
Stores the id number of selected item. | |
int | m_selected |
Creator of the menu. | |
TOOL_INTERACTIVE * | m_tool |
Associates tool actions with menu item IDs. Non-owning. | |
std::map< int, const TOOL_ACTION * > | m_toolActions |
List of submenus. | |
std::list< ACTION_MENU * > | m_submenus |
Friends | |
class | TOOL_INTERACTIVE |
Defines the structure of a menu based on ACTIONs.
Definition at line 48 of file action_menu.h.
ACTION_MENU::ACTION_MENU | ( | bool | isContextMenu, |
TOOL_INTERACTIVE * | aTool = nullptr |
||
) |
|
override |
Definition at line 61 of file action_menu.cpp.
References m_submenus, OnIdle(), and OnMenuEvent().
|
delete |
wxMenuItem * ACTION_MENU::Add | ( | ACTION_MENU * | aMenu | ) |
Add an action menu as a submenu.
The difference between this function and wxMenu::AppendSubMenu() is the capability to handle icons.
aMenu | is the submenu to be added. This should be a new instance (use Clone()) if required as the menu is destructed after use. |
Definition at line 189 of file action_menu.cpp.
References KIUI::AddBitmapToMenuItem(), KiBitmap(), m_icon, m_submenus, and m_title.
wxMenuItem * ACTION_MENU::Add | ( | const TOOL_ACTION & | aAction, |
bool | aIsCheckmarkEntry = false , |
||
const wxString & | aOverrideLabel = wxEmptyString |
||
) |
Add an entry to the menu based on the TOOL_ACTION object.
After selecting the entry, a TOOL_EVENT command containing name of the action is sent.
aAction | is the action to be added to menu entry. |
aIsCheckmarkEntry | is true to indicate a check menu entry, false for normal menu entry |
aOverrideLabel | is the label to show in the menu (overriding the action's menu text) when non-empty |
ID numbers for tool actions are assigned above ACTION_BASE_UI_ID inside TOOL_EVENT
Definition at line 168 of file action_menu.cpp.
References KIUI::AddBitmapToMenuItem(), TOOL_ACTION::GetIcon(), TOOL_ACTION::GetMenuItem(), TOOL_ACTION::GetTooltip(), TOOL_ACTION::GetUIId(), KiBitmap(), and m_toolActions.
wxMenuItem * ACTION_MENU::Add | ( | const wxString & | aLabel, |
const wxString & | aToolTip, | ||
int | aId, | ||
BITMAPS | aIcon, | ||
bool | aIsCheckmarkEntry = false |
||
) |
Definition at line 153 of file action_menu.cpp.
References KIUI::AddBitmapToMenuItem(), and KiBitmap().
wxMenuItem * ACTION_MENU::Add | ( | const wxString & | aLabel, |
int | aId, | ||
BITMAPS | aIcon | ||
) |
Add a wxWidgets-style entry to the menu.
After highlighting/selecting the entry, a wxWidgets event is generated.
Definition at line 140 of file action_menu.cpp.
References KIUI::AddBitmapToMenuItem(), and KiBitmap().
Referenced by AddClose(), EDA_BASE_FRAME::AddMenuLanguageList(), AddQuit(), AddQuitOrClose(), EDA_3D_VIEWER_FRAME::doReCreateMenuBar(), BITMAP2CMP_FRAME::doReCreateMenuBar(), CVPCB_MAINFRAME::doReCreateMenuBar(), SCH_EDIT_FRAME::doReCreateMenuBar(), SIMULATOR_FRAME::doReCreateMenuBar(), SYMBOL_EDIT_FRAME::doReCreateMenuBar(), SYMBOL_VIEWER_FRAME::doReCreateMenuBar(), GERBVIEW_FRAME::doReCreateMenuBar(), KICAD_MANAGER_FRAME::doReCreateMenuBar(), PL_EDITOR_FRAME::doReCreateMenuBar(), PCB_CALCULATOR_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::doReCreateMenuBar(), FOOTPRINT_VIEWER_FRAME::doReCreateMenuBar(), PCB_EDIT_FRAME::doReCreateMenuBar(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::DrawVia(), CONDITIONAL_MENU::Evaluate(), GROUP_CONTEXT_MENU::GROUP_CONTEXT_MENU(), NET_CONTEXT_MENU::NET_CONTEXT_MENU(), LIB_TREE::onHeaderContextMenu(), LIB_TREE::onItemContextMenu(), SEARCH_PANE_MENU::SEARCH_PANE_MENU(), SELECT_MENU::SELECT_MENU(), CVPCB_MAINFRAME::setupTools(), SYMBOL_UNIT_MENU::update(), PIN_TRICKS_MENU::update(), HIGHLIGHT_MENU::update(), GRID_MENU::update(), and ZONE_CONTEXT_MENU::ZONE_CONTEXT_MENU().
void ACTION_MENU::AddClose | ( | const wxString & | aAppname = "" | ) |
Add a standard close item to the menu with the accelerator key CTRL-W.
Emits the wxID_CLOSE event.
aAppname | is the application name to append to the tooltip. |
Definition at line 209 of file action_menu.cpp.
Referenced by AddQuitOrClose(), EDA_3D_VIEWER_FRAME::doReCreateMenuBar(), CVPCB_MAINFRAME::doReCreateMenuBar(), SIMULATOR_FRAME::doReCreateMenuBar(), SYMBOL_EDIT_FRAME::doReCreateMenuBar(), SYMBOL_VIEWER_FRAME::doReCreateMenuBar(), PL_EDITOR_FRAME::doReCreateMenuBar(), PCB_CALCULATOR_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::doReCreateMenuBar(), and FOOTPRINT_VIEWER_FRAME::doReCreateMenuBar().
void ACTION_MENU::AddQuit | ( | const wxString & | aAppname = "" | ) |
Add a standard Quit item to the menu.
Emits the wxID_EXIT event.
aAppname | is the application name to append to the tooltip. |
Definition at line 243 of file action_menu.cpp.
Referenced by BITMAP2CMP_FRAME::doReCreateMenuBar(), PL_EDITOR_FRAME::doReCreateMenuBar(), and PCB_CALCULATOR_FRAME::doReCreateMenuBar().
void ACTION_MENU::AddQuitOrClose | ( | KIFACE_BASE * | aKiface, |
wxString | aAppname = "" |
||
) |
Add either a standard Quit or Close item to the menu.
If aKiface is NULL or in single-instance then quit (wxID_EXIT) is used, otherwise close (wxID_CLOSE) is used.
aAppname | is the application name to append to the tooltip. |
Definition at line 225 of file action_menu.cpp.
References _, Add(), AddClose(), and KIFACE_BASE::IsSingle().
Referenced by SCH_EDIT_FRAME::doReCreateMenuBar(), GERBVIEW_FRAME::doReCreateMenuBar(), KICAD_MANAGER_FRAME::doReCreateMenuBar(), and PCB_EDIT_FRAME::doReCreateMenuBar().
|
protected |
Append a copy of wxMenuItem.
Initialize handlers for events.
Definition at line 647 of file action_menu.cpp.
References KIUI::AddBitmapToMenuItem(), Clone(), and m_submenus.
Referenced by copyFrom().
void ACTION_MENU::Clear | ( | ) |
Remove all the entries from the menu (as well as its title).
It leaves the menu in the initial state.
Definition at line 254 of file action_menu.cpp.
References m_submenus, m_titleDisplayed, and m_toolActions.
Referenced by Clone(), CONDITIONAL_MENU::Evaluate(), SYMBOL_UNIT_MENU::update(), BODY_STYLE_MENU::update(), ALT_PIN_FUNCTION_MENU::update(), PIN_TRICKS_MENU::update(), BUS_UNFOLD_MENU::update(), HIGHLIGHT_MENU::update(), ZOOM_MENU::update(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), and VIA_SIZE_MENU::update().
void ACTION_MENU::ClearDirty | ( | ) |
Clear the dirty flag on the menu and all descendants.
Definition at line 297 of file action_menu.cpp.
References ClearDirty(), m_dirty, and runOnSubmenus().
Referenced by ClearDirty(), and TOOL_MENU::ShowContextMenu().
ACTION_MENU * ACTION_MENU::Clone | ( | ) | const |
Create a deep, recursive copy of this ACTION_MENU.
Definition at line 318 of file action_menu.cpp.
References Clear(), copyFrom(), and create().
Referenced by appendCopy(), TOOL_MANAGER::DispatchContextMenu(), BITMAP2CMP_FRAME::doReCreateMenuBar(), SCH_EDIT_FRAME::doReCreateMenuBar(), GERBVIEW_FRAME::doReCreateMenuBar(), KICAD_MANAGER_FRAME::doReCreateMenuBar(), PL_EDITOR_FRAME::doReCreateMenuBar(), and PCB_EDIT_FRAME::doReCreateMenuBar().
|
protected |
Copy another menus data to this instance.
Old entries are preserved and ones form aMenu are copied.
Definition at line 629 of file action_menu.cpp.
References appendCopy(), m_icon, m_selected, m_title, m_titleDisplayed, m_tool, and m_toolActions.
Referenced by Clone().
|
protectedvirtual |
< Return an instance of this class. It has to be overridden in inheriting classes.
Returns an instance of TOOL_MANAGER class.
Reimplemented in SYMBOL_UNIT_MENU, BODY_STYLE_MENU, ALT_PIN_FUNCTION_MENU, PIN_TRICKS_MENU, BUS_UNFOLD_MENU, HIGHLIGHT_MENU, CONDITIONAL_MENU, GRID_MENU, ZOOM_MENU, TRACK_WIDTH_MENU, DIFF_PAIR_MENU, ZONE_CONTEXT_MENU, LOCK_CONTEXT_MENU, NET_CONTEXT_MENU, VIA_SIZE_MENU, GROUP_CONTEXT_MENU, and SELECT_MENU.
Definition at line 327 of file action_menu.cpp.
Referenced by Clone().
void ACTION_MENU::DisplayTitle | ( | bool | aDisplay = true | ) |
Decide whether a title for a pop up menu should be displayed.
Definition at line 103 of file action_menu.cpp.
References KIUI::AddBitmapToMenuItem(), GetTitle(), KiBitmap(), m_icon, m_title, and m_titleDisplayed.
Referenced by SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::DrawVia(), and SetTitle().
|
inlineprotectedvirtual |
Event handler stub.
It should be used if you want to generate a TOOL_EVENT from a wxMenuEvent. It will be called when a menu entry is clicked.
Reimplemented in SEARCH_PANE_MENU, GRID_MENU, ZOOM_MENU, TRACK_WIDTH_MENU, DIFF_PAIR_MENU, and VIA_SIZE_MENU.
Definition at line 226 of file action_menu.h.
Referenced by OnMenuEvent(), and runEventHandlers().
|
protected |
Definition at line 604 of file action_menu.cpp.
References runOnSubmenus().
Referenced by OnMenuEvent().
|
inline |
Return the position of selected item.
If the returned value is negative, that means that menu was dismissed.
Definition at line 162 of file action_menu.h.
References m_selected.
|
inline |
|
protected |
Definition at line 339 of file action_menu.cpp.
References TOOL_BASE::GetManager(), and m_tool.
Referenced by VIA_SIZE_MENU::eventHandler(), OnMenuEvent(), SYMBOL_UNIT_MENU::update(), BODY_STYLE_MENU::update(), ALT_PIN_FUNCTION_MENU::update(), PIN_TRICKS_MENU::update(), HIGHLIGHT_MENU::update(), VIA_SIZE_MENU::update(), GROUP_CONTEXT_MENU::update(), and updateHotKeys().
bool ACTION_MENU::HasEnabledItems | ( | ) | const |
Returns true if the menu has any enabled items.
Definition at line 268 of file action_menu.cpp.
void ACTION_MENU::OnIdle | ( | wxIdleEvent & | event | ) |
Definition at line 396 of file action_menu.cpp.
References g_last_menu_highlighted_id, g_menu_open_position, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by setupEvents(), and ~ACTION_MENU().
void ACTION_MENU::OnMenuEvent | ( | wxMenuEvent & | aEvent | ) |
Definition at line 404 of file action_menu.cpp.
References AS_GLOBAL, eventHandler(), findToolAction(), g_last_menu_highlighted_id, g_menu_open_position, TOOL_MANAGER::GetActionManager(), TOOL_MANAGER::GetMousePosition(), getToolManager(), ID_CONTEXT_MENU_ID_MAX, ID_POPUP_MENU_END, ID_POPUP_MENU_START, ACTION_MANAGER::IsActionUIId(), kicadTraceToolStack, m_dirty, m_isContextMenu, m_selected, TEXTENTRY_TRICKS::OnCharHook(), PassHelpTextToHandler(), TOOL_MANAGER::ProcessEvent(), TOOL_MANAGER::RunAction(), runEventHandlers(), TA_CHOICE_MENU_CHOICE, TA_CHOICE_MENU_UPDATE, TC_COMMAND, and ACTIONS::updateMenu.
Referenced by TOOL_DISPATCHER::DispatchWxEvent(), setupEvents(), and ~ACTION_MENU().
|
delete |
|
inlinevirtual |
Reimplemented in BUS_UNFOLD_MENU.
Definition at line 198 of file action_menu.h.
Referenced by OnMenuEvent().
|
protected |
Run a function on the menu and all its submenus.
Definition at line 578 of file action_menu.cpp.
References eventHandler(), runEventHandlers(), and runOnSubmenus().
Referenced by OnMenuEvent(), and runEventHandlers().
|
protected |
Check if any of submenus contains a TOOL_ACTION with a specific ID.
Definition at line 587 of file action_menu.cpp.
References m_submenus.
Referenced by ClearDirty(), CONDITIONAL_MENU::Evaluate(), findToolAction(), CONDITIONAL_MENU::Resolve(), runEventHandlers(), SetDirty(), SetTool(), and UpdateAll().
void ACTION_MENU::SetDirty | ( | ) |
Definition at line 304 of file action_menu.cpp.
References m_dirty, runOnSubmenus(), and SetDirty().
Referenced by SetDirty(), and TOOL_MENU::ShowContextMenu().
void ACTION_MENU::SetIcon | ( | BITMAPS | aIcon | ) |
Assign an icon for the entry.
aIcon | is the icon to be assigned. NULL is used to remove icon. |
Definition at line 78 of file action_menu.cpp.
References m_icon.
Referenced by EDA_BASE_FRAME::AddMenuLanguageList(), ALT_PIN_FUNCTION_MENU::ALT_PIN_FUNCTION_MENU(), BODY_STYLE_MENU::BODY_STYLE_MENU(), BUS_UNFOLD_MENU::BUS_UNFOLD_MENU(), DIFF_PAIR_MENU::DIFF_PAIR_MENU(), EDA_3D_VIEWER_FRAME::doReCreateMenuBar(), BITMAP2CMP_FRAME::doReCreateMenuBar(), SCH_EDIT_FRAME::doReCreateMenuBar(), SYMBOL_EDIT_FRAME::doReCreateMenuBar(), GERBVIEW_FRAME::doReCreateMenuBar(), KICAD_MANAGER_FRAME::doReCreateMenuBar(), PL_EDITOR_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::doReCreateMenuBar(), PCB_EDIT_FRAME::doReCreateMenuBar(), SELECTION_TOOL::doSelectionMenu(), GRID_MENU::GRID_MENU(), GROUP_CONTEXT_MENU::GROUP_CONTEXT_MENU(), HIGHLIGHT_MENU::HIGHLIGHT_MENU(), SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), LOCK_CONTEXT_MENU::LOCK_CONTEXT_MENU(), NET_CONTEXT_MENU::NET_CONTEXT_MENU(), PIN_TRICKS_MENU::PIN_TRICKS_MENU(), SYMBOL_UNIT_MENU::SYMBOL_UNIT_MENU(), TRACK_WIDTH_MENU::TRACK_WIDTH_MENU(), VIA_SIZE_MENU::VIA_SIZE_MENU(), ZONE_CONTEXT_MENU::ZONE_CONTEXT_MENU(), and ZOOM_MENU::ZOOM_MENU().
|
override |
Set title for the menu.
The title is shown as a text label shown on the top of the menu.
aTitle | is the new title. |
Definition at line 92 of file action_menu.cpp.
References DisplayTitle(), m_title, and m_titleDisplayed.
Referenced by EDA_BASE_FRAME::AddMenuLanguageList(), ALT_PIN_FUNCTION_MENU::ALT_PIN_FUNCTION_MENU(), BODY_STYLE_MENU::BODY_STYLE_MENU(), BUS_UNFOLD_MENU::BUS_UNFOLD_MENU(), DIFF_PAIR_MENU::DIFF_PAIR_MENU(), EDA_3D_VIEWER_FRAME::doReCreateMenuBar(), BITMAP2CMP_FRAME::doReCreateMenuBar(), SCH_EDIT_FRAME::doReCreateMenuBar(), SYMBOL_EDIT_FRAME::doReCreateMenuBar(), GERBVIEW_FRAME::doReCreateMenuBar(), KICAD_MANAGER_FRAME::doReCreateMenuBar(), PL_EDITOR_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::doReCreateMenuBar(), PCB_EDIT_FRAME::doReCreateMenuBar(), SELECTION_TOOL::doSelectionMenu(), DRAWING_TOOL::DrawVia(), GROUP_CONTEXT_MENU::GROUP_CONTEXT_MENU(), HIGHLIGHT_MENU::HIGHLIGHT_MENU(), SCH_EDIT_TOOL::Init(), CONVERT_TOOL::Init(), ALIGN_DISTRIBUTE_TOOL::Init(), LOCK_CONTEXT_MENU::LOCK_CONTEXT_MENU(), NET_CONTEXT_MENU::NET_CONTEXT_MENU(), PIN_TRICKS_MENU::PIN_TRICKS_MENU(), SELECT_MENU::SELECT_MENU(), SYMBOL_UNIT_MENU::SYMBOL_UNIT_MENU(), TRACK_WIDTH_MENU::TRACK_WIDTH_MENU(), GRID_MENU::UpdateTitle(), ZOOM_MENU::UpdateTitle(), VIA_SIZE_MENU::VIA_SIZE_MENU(), and ZONE_CONTEXT_MENU::ZONE_CONTEXT_MENU().
void ACTION_MENU::SetTool | ( | TOOL_INTERACTIVE * | aTool | ) |
Set a tool that is the creator of the menu.
aTool | is the tool that created the menu. |
Definition at line 311 of file action_menu.cpp.
References m_tool, runOnSubmenus(), and SetTool().
Referenced by TOOL_INTERACTIVE::SetContextMenu(), SetTool(), and SCH_LINE_WIRE_BUS_TOOL::UnfoldBus().
|
protected |
Update hot key settings for TOOL_ACTIONs in this menu.
Definition at line 84 of file action_menu.cpp.
References OnIdle(), and OnMenuEvent().
Referenced by ACTION_MENU().
|
inlineprotectedvirtual |
Update menu state stub.
It is called before a menu is shown, in order to update its state. Here you can tick current settings, enable/disable entries, etc.
Reimplemented in SYMBOL_UNIT_MENU, BODY_STYLE_MENU, ALT_PIN_FUNCTION_MENU, PIN_TRICKS_MENU, BUS_UNFOLD_MENU, HIGHLIGHT_MENU, GRID_MENU, ZOOM_MENU, TRACK_WIDTH_MENU, DIFF_PAIR_MENU, VIA_SIZE_MENU, and GROUP_CONTEXT_MENU.
Definition at line 216 of file action_menu.h.
Referenced by UpdateAll().
void ACTION_MENU::UpdateAll | ( | ) |
Run update handlers for the menu and its submenus.
Definition at line 280 of file action_menu.cpp.
References m_tool, runOnSubmenus(), update(), UpdateAll(), and updateHotKeys().
Referenced by ACTION_TOOLBAR::onToolRightClick(), CONDITIONAL_MENU::Resolve(), TOOL_MENU::ShowContextMenu(), UpdateAll(), EDA_3D_CONTROLLER::UpdateMenu(), CVPCB_CONTROL::UpdateMenu(), CVPCB_FOOTPRINT_VIEWER_SELECTION_TOOL::UpdateMenu(), SELECTION_TOOL::UpdateMenu(), and KICAD_MANAGER_CONTROL::UpdateMenu().
|
protected |
Traverse the submenus tree looking for a submenu capable of handling a particular menu event.
In case it is handled, it is returned the aToolEvent parameter.
Definition at line 345 of file action_menu.cpp.
References TOOL_MANAGER::GetHotKey(), getToolManager(), m_toolActions, MD_ALT, MD_CTRL, MD_MODIFIER_MASK, and MD_SHIFT.
Referenced by UpdateAll().
|
inlinevirtual |
Used by some menus to just-in-time translate their titles.
Reimplemented in GRID_MENU, and ZOOM_MENU.
Definition at line 175 of file action_menu.h.
|
friend |
Definition at line 286 of file action_menu.h.
|
staticconstexpr |
Definition at line 201 of file action_menu.h.
Referenced by EDA_3D_VIEWER_FRAME::doReCreateMenuBar(), SCH_EDIT_FRAME::doReCreateMenuBar(), SIMULATOR_FRAME::doReCreateMenuBar(), SYMBOL_EDIT_FRAME::doReCreateMenuBar(), SYMBOL_VIEWER_FRAME::doReCreateMenuBar(), GERBVIEW_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::doReCreateMenuBar(), PCB_EDIT_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateVToolbar(), and PCB_EDIT_FRAME::ReCreateVToolbar().
|
protected |
Definition at line 263 of file action_menu.h.
Referenced by ClearDirty(), OnMenuEvent(), and SetDirty().
|
protected |
Definition at line 261 of file action_menu.h.
|
protected |
Stores the id number of selected item.
Definition at line 272 of file action_menu.h.
Referenced by Add(), copyFrom(), DisplayTitle(), and SetIcon().
|
protected |
|
protected |
Definition at line 260 of file action_menu.h.
|
protected |
Creator of the menu.
Definition at line 275 of file action_menu.h.
Referenced by copyFrom(), GetSelected(), and OnMenuEvent().
|
protected |
Definition at line 284 of file action_menu.h.
Referenced by Add(), appendCopy(), Clear(), runOnSubmenus(), and ~ACTION_MENU().
|
protected |
Optional icon.
Definition at line 269 of file action_menu.h.
Referenced by Add(), copyFrom(), DisplayTitle(), GetTitle(), and SetTitle().
|
protected |
Definition at line 265 of file action_menu.h.
Referenced by Clear(), copyFrom(), DisplayTitle(), and SetTitle().
|
protected |
Associates tool actions with menu item IDs. Non-owning.
Definition at line 278 of file action_menu.h.
Referenced by copyFrom(), CONDITIONAL_MENU::create(), LOCK_CONTEXT_MENU::create(), getToolManager(), SetTool(), BUS_UNFOLD_MENU::update(), and UpdateAll().
|
protected |
List of submenus.
Definition at line 281 of file action_menu.h.
Referenced by Add(), Clear(), copyFrom(), and updateHotKeys().
|
staticconstexpr |
Definition at line 200 of file action_menu.h.
Referenced by SCH_EDIT_FRAME::doReCreateMenuBar(), SYMBOL_EDIT_FRAME::doReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::doReCreateMenuBar(), and PCB_EDIT_FRAME::doReCreateMenuBar().