KiCad PCB EDA Suite
ACTION_MENU Class Reference

ACTION_MENU. More...

#include <action_menu.h>

Inheritance diagram for ACTION_MENU:
BUS_UNFOLD_MENU CONDITIONAL_MENU DIFF_PAIR_MENU GRID_MENU HIGHLIGHT_MENU LOCK_CONTEXT_MENU ROUTER_TOOL_MENU SELECT_MENU SYMBOL_UNIT_MENU TRACK_WIDTH_MENU TUNER_TOOL_MENU ZONE_CONTEXT_MENU ZOOM_MENU

Public Member Functions

 ACTION_MENU (bool isContextMenu)
 

Default constructor

More...
 
 ~ACTION_MENU () override
 
 ACTION_MENU (const ACTION_MENU &aMenu)=delete
 
ACTION_MENUoperator= (const ACTION_MENU &aMenu)=delete
 
void SetTitle (const wxString &aTitle) override
 Function SetTitle() Sets title for the menu. More...
 
void DisplayTitle (bool aDisplay=true)
 Function DisplayTitle() Decides whether a title for a pop up menu should be displayed. More...
 
void SetIcon (const BITMAP_OPAQUE *aIcon)
 Function SetIcon() Assigns an icon for the entry. More...
 
wxMenuItem * Add (const wxString &aLabel, int aId, const BITMAP_OPAQUE *aIcon)
 Function Add() Adds a wxWidgets-style entry to the menu. More...
 
wxMenuItem * Add (const wxString &aLabel, const wxString &aToolTip, int aId, const BITMAP_OPAQUE *aIcon)
 
wxMenuItem * Add (const TOOL_ACTION &aAction, bool aIsCheckmarkEntry=false)
 Function Add() Adds an entry to the menu, basing on the TOOL_ACTION object. More...
 
wxMenuItem * Add (ACTION_MENU *aMenu)
 Function Add() Adds an action menu as a submenu. More...
 
void Clear ()
 Function Clear() Removes all the entries from the menu (as well as its title). More...
 
bool HasEnabledItems () const
 Function HasEnabledItems();. More...
 
int GetSelected () const
 Function GetSelected() Returns the position of selected item. More...
 
void UpdateAll ()
 Function UpdateAll() Runs update handlers for the menu and its submenus. More...
 
void ClearDirty ()
 Function ClearDirty() Clears the dirty flag on the menu and all descendants. More...
 
void SetDirty ()
 
void SetTool (TOOL_INTERACTIVE *aTool)
 Function SetTool() Sets a tool that is the creator of the menu. More...
 
ACTION_MENUClone () const
 Creates a deep, recursive copy of this ACTION_MENU. More...
 
void OnMenuEvent (wxMenuEvent &aEvent)
 
void OnIdle (wxIdleEvent &event)
 

Protected Member Functions

virtual ACTION_MENUcreate () const
 

Returns an instance of this class. It has to be overridden in inheriting classes.

More...
 
TOOL_MANAGERgetToolManager () const
 

Returns an instance of TOOL_MANAGER class.

More...
 
virtual void update ()
 Update menu state stub. More...
 
virtual OPT_TOOL_EVENT eventHandler (const wxMenuEvent &)
 Event handler stub. More...
 
void copyFrom (const ACTION_MENU &aMenu)
 Copies another menus data to this instance. More...
 
wxMenuItem * appendCopy (const wxMenuItem *aSource)
 Function appendCopy Appends a copy of wxMenuItem. More...
 
void setupEvents ()
 

Initializes handlers for events.

More...
 
void updateHotKeys ()
 

Updates hot key settings for TOOL_ACTIONs in this menu.

More...
 
void runEventHandlers (const wxMenuEvent &aMenuEvent, OPT_TOOL_EVENT &aToolEvent)
 

Traverses the submenus tree looking for a submenu capable of handling a particular menu event.

More...
 
void runOnSubmenus (std::function< void(ACTION_MENU *)> aFunction)
 

Runs a function on the menu and all its submenus.

More...
 
OPT_TOOL_EVENT findToolAction (int aId)
 

Checks if any of submenus contains a TOOL_ACTION with a specific ID.

More...
 

Static Protected Member Functions

static int getMenuId (const TOOL_ACTION &aAction)
 

Returns the corresponding wxMenuItem identifier for a TOOL_ACTION object.

More...
 

Protected Attributes

bool m_dirty
 
bool m_titleDisplayed
 
bool m_isContextMenu
 
wxString m_title
 

Menu title

More...
 
const BITMAP_OPAQUEm_icon
 

Optional icon

More...
 
int m_selected
 

Stores the id number of selected item.

More...
 
TOOL_INTERACTIVEm_tool
 

Creator of the menu

More...
 
std::map< int, const TOOL_ACTION * > m_toolActions
 

Associates tool actions with menu item IDs. Non-owning.

More...
 
std::list< ACTION_MENU * > m_submenus
 

List of submenus.

More...
 

Static Protected Attributes

static const int ACTION_ID = 20000
 

Menu items with ID higher than that are considered TOOL_ACTIONs

More...
 

Friends

class TOOL_INTERACTIVE
 

Detailed Description

ACTION_MENU.

Defines the structure of a menu based on ACTIONs.

Definition at line 43 of file action_menu.h.

Constructor & Destructor Documentation

◆ ACTION_MENU() [1/2]

ACTION_MENU::ACTION_MENU ( bool  isContextMenu)

Default constructor

Definition at line 43 of file action_menu.cpp.

43  :
44  m_dirty( true ),
45  m_titleDisplayed( false ),
46  m_isContextMenu( isContextMenu ),
47  m_icon( nullptr ),
48  m_selected( -1 ),
49  m_tool( nullptr )
50 {
51  setupEvents();
52 }
bool m_titleDisplayed
Definition: action_menu.h:214
const BITMAP_OPAQUE * m_icon
Optional icon
Definition: action_menu.h:221
bool m_isContextMenu
Definition: action_menu.h:215
int m_selected
Stores the id number of selected item.
Definition: action_menu.h:224
TOOL_INTERACTIVE * m_tool
Creator of the menu
Definition: action_menu.h:227
void setupEvents()
Initializes handlers for events.
Definition: action_menu.cpp:74

References setupEvents().

Referenced by create(), and BUS_UNFOLD_MENU::update().

◆ ~ACTION_MENU()

ACTION_MENU::~ACTION_MENU ( )
override

Definition at line 55 of file action_menu.cpp.

56 {
57  // Set parent to NULL to prevent submenus from unregistering from a notexisting object
58  for( auto menu : m_submenus )
59  menu->SetParent( nullptr );
60 
61  ACTION_MENU* parent = dynamic_cast<ACTION_MENU*>( GetParent() );
62 
63  if( parent )
64  parent->m_submenus.remove( this );
65 }
ACTION_MENU.
Definition: action_menu.h:43
std::list< ACTION_MENU * > m_submenus
List of submenus.
Definition: action_menu.h:236

References m_submenus.

◆ ACTION_MENU() [2/2]

ACTION_MENU::ACTION_MENU ( const ACTION_MENU aMenu)
delete

Member Function Documentation

◆ Add() [1/4]

wxMenuItem * ACTION_MENU::Add ( const wxString &  aLabel,
int  aId,
const BITMAP_OPAQUE aIcon 
)

Function Add() Adds a wxWidgets-style entry to the menu.

After highlighting/selecting the entry, a wxWidgets event is generated.

Definition at line 134 of file action_menu.cpp.

135 {
136  wxASSERT_MSG( FindItem( aId ) == nullptr, "Duplicate menu IDs!" );
137 
138  wxMenuItem* item = new wxMenuItem( this, aId, aLabel, wxEmptyString, wxITEM_NORMAL );
139 
140  if( aIcon )
141  AddBitmapToMenuItem( item, KiBitmap( aIcon ) );
142 
143  return Append( item );
144 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223

References AddBitmapToMenuItem(), and KiBitmap().

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), CONDITIONAL_MENU::Evaluate(), ALIGN_DISTRIBUTE_TOOL::Init(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), ROUTER_TOOL_MENU::ROUTER_TOOL_MENU(), CVPCB_MAINFRAME::setupTools(), and TUNER_TOOL_MENU::TUNER_TOOL_MENU().

◆ Add() [2/4]

wxMenuItem * ACTION_MENU::Add ( const wxString &  aLabel,
const wxString &  aToolTip,
int  aId,
const BITMAP_OPAQUE aIcon 
)

Definition at line 147 of file action_menu.cpp.

149 {
150  wxASSERT_MSG( FindItem( aId ) == nullptr, "Duplicate menu IDs!" );
151 
152  wxMenuItem* item = new wxMenuItem( this, aId, aLabel, aTooltip, wxITEM_NORMAL );
153 
154  if( aIcon )
155  AddBitmapToMenuItem( item, KiBitmap( aIcon ) );
156 
157  return Append( item );
158 }
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223

References AddBitmapToMenuItem(), and KiBitmap().

◆ Add() [3/4]

wxMenuItem * ACTION_MENU::Add ( const TOOL_ACTION aAction,
bool  aIsCheckmarkEntry = false 
)

Function Add() Adds an entry to the menu, basing on the TOOL_ACTION object.

After selecting the entry, a TOOL_EVENT command containing name of the action is sent.

Parameters
aActionis the action to be added to menu entry.

ID numbers for tool actions need to have a value higher than ACTION_ID

Definition at line 161 of file action_menu.cpp.

162 {
164  const BITMAP_OPAQUE* icon = aAction.GetIcon();
165 
166  wxMenuItem* item = new wxMenuItem( this, getMenuId( aAction ), aAction.GetMenuItem(),
167  aAction.GetDescription(),
168  aIsCheckmarkEntry ? wxITEM_CHECK : wxITEM_NORMAL );
169 
170  if( icon )
171  AddBitmapToMenuItem( item, KiBitmap( icon ) );
172 
173  m_toolActions[getMenuId( aAction )] = &aAction;
174 
175  return Append( item );
176 }
PNG memory record (file in memory).
Definition: bitmap_def.h:29
static int getMenuId(const TOOL_ACTION &aAction)
Returns the corresponding wxMenuItem identifier for a TOOL_ACTION object.
Definition: action_menu.h:161
const BITMAP_OPAQUE * GetIcon() const
Returns an icon associated with the action.
Definition: tool_action.h:149
wxString GetDescription() const
Definition: tool_action.cpp:83
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223
std::map< int, const TOOL_ACTION * > m_toolActions
Associates tool actions with menu item IDs. Non-owning.
Definition: action_menu.h:233
wxString GetMenuItem() const
Definition: tool_action.cpp:75

References AddBitmapToMenuItem(), TOOL_ACTION::GetDescription(), TOOL_ACTION::GetIcon(), getMenuId(), TOOL_ACTION::GetMenuItem(), KiBitmap(), and m_toolActions.

◆ Add() [4/4]

wxMenuItem * ACTION_MENU::Add ( ACTION_MENU aMenu)

Function Add() Adds an action menu as a submenu.

The difference between this function and wxMenu::AppendSubMenu() is the capability to handle icons.

Parameters
aMenuis the submenu to be added.

Definition at line 179 of file action_menu.cpp.

180 {
181  ACTION_MENU* menuCopy = aMenu->Clone();
182  m_submenus.push_back( menuCopy );
183 
184  wxASSERT_MSG( !menuCopy->m_title.IsEmpty(), "Set a title for ACTION_MENU using SetTitle()" );
185 
186  if( aMenu->m_icon )
187  {
188  wxMenuItem* newItem = new wxMenuItem( this, -1, menuCopy->m_title );
189  AddBitmapToMenuItem( newItem, KiBitmap( aMenu->m_icon ) );
190  newItem->SetSubMenu( menuCopy );
191  return Append( newItem );
192  }
193  else
194  {
195  return AppendSubMenu( menuCopy, menuCopy->m_title );
196  }
197 }
ACTION_MENU.
Definition: action_menu.h:43
const BITMAP_OPAQUE * m_icon
Optional icon
Definition: action_menu.h:221
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223
wxString m_title
Menu title
Definition: action_menu.h:218
std::list< ACTION_MENU * > m_submenus
List of submenus.
Definition: action_menu.h:236
ACTION_MENU * Clone() const
Creates a deep, recursive copy of this ACTION_MENU.

References AddBitmapToMenuItem(), Clone(), KiBitmap(), m_icon, m_submenus, and m_title.

◆ appendCopy()

wxMenuItem * ACTION_MENU::appendCopy ( const wxMenuItem *  aSource)
protected

Function appendCopy Appends a copy of wxMenuItem.

Definition at line 538 of file action_menu.cpp.

539 {
540  wxMenuItem* newItem = new wxMenuItem( this, aSource->GetId(), aSource->GetItemLabel(),
541  aSource->GetHelp(), aSource->GetKind() );
542 
543  // Add the source bitmap if it is not the wxNullBitmap
544  // On Windows, for Checkable Menu items, adding a null bitmap adds also
545  // our predefined checked alternate bitmap
546  const wxBitmap& src_bitmap = aSource->GetBitmap();
547 
548  if( src_bitmap.IsOk() && src_bitmap.GetHeight() > 1 ) // a null bitmap has a 0 size
549  AddBitmapToMenuItem( newItem, src_bitmap );
550 
551  if( aSource->IsSubMenu() )
552  {
553  ACTION_MENU* menu = dynamic_cast<ACTION_MENU*>( aSource->GetSubMenu() );
554  wxASSERT_MSG( menu, "Submenus are expected to be a ACTION_MENU" );
555 
556  if( menu )
557  {
558  ACTION_MENU* menuCopy = menu->Clone();
559  newItem->SetSubMenu( menuCopy );
560  m_submenus.push_back( menuCopy );
561  }
562  }
563 
564  // wxMenuItem has to be added before enabling/disabling or checking
565  Append( newItem );
566 
567  if( aSource->IsCheckable() )
568  newItem->Check( aSource->IsChecked() );
569 
570  newItem->Enable( aSource->IsEnabled() );
571 
572  return newItem;
573 }
ACTION_MENU.
Definition: action_menu.h:43
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223
std::list< ACTION_MENU * > m_submenus
List of submenus.
Definition: action_menu.h:236
ACTION_MENU * Clone() const
Creates a deep, recursive copy of this ACTION_MENU.

References AddBitmapToMenuItem(), Clone(), and m_submenus.

Referenced by copyFrom().

◆ Clear()

void ACTION_MENU::Clear ( )

Function Clear() Removes all the entries from the menu (as well as its title).

It leaves the menu in the initial state.

Definition at line 200 of file action_menu.cpp.

201 {
202  m_titleDisplayed = false;
203 
204  for( int i = GetMenuItemCount() - 1; i >= 0; --i )
205  Destroy( FindItemByPosition( i ) );
206 
207  m_toolActions.clear();
208  m_submenus.clear();
209 
210  wxASSERT( GetMenuItemCount() == 0 );
211 }
bool m_titleDisplayed
Definition: action_menu.h:214
std::list< ACTION_MENU * > m_submenus
List of submenus.
Definition: action_menu.h:236
std::map< int, const TOOL_ACTION * > m_toolActions
Associates tool actions with menu item IDs. Non-owning.
Definition: action_menu.h:233

References m_submenus, m_titleDisplayed, and m_toolActions.

Referenced by Clone(), CONDITIONAL_MENU::Evaluate(), SYMBOL_UNIT_MENU::update(), BUS_UNFOLD_MENU::update(), TRACK_WIDTH_MENU::update(), and DIFF_PAIR_MENU::update().

◆ ClearDirty()

void ACTION_MENU::ClearDirty ( )

Function ClearDirty() Clears the dirty flag on the menu and all descendants.

Definition at line 251 of file action_menu.cpp.

252 {
253  m_dirty = false;
254  runOnSubmenus( std::bind( &ACTION_MENU::ClearDirty, _1 ) );
255 }
void ClearDirty()
Function ClearDirty() Clears the dirty flag on the menu and all descendants.
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.

References m_dirty, and runOnSubmenus().

Referenced by TOOL_MENU::ShowContextMenu().

◆ Clone()

ACTION_MENU * ACTION_MENU::Clone ( ) const

Creates a deep, recursive copy of this ACTION_MENU.

Definition at line 272 of file action_menu.cpp.

273 {
274  ACTION_MENU* clone = create();
275  clone->Clear();
276  clone->copyFrom( *this );
277  return clone;
278 }
ACTION_MENU.
Definition: action_menu.h:43
virtual ACTION_MENU * create() const
Returns an instance of this class. It has to be overridden in inheriting classes.
void copyFrom(const ACTION_MENU &aMenu)
Copies another menus data to this instance.
void Clear()
Function Clear() Removes all the entries from the menu (as well as its title).

References Clear(), copyFrom(), and create().

Referenced by Add(), appendCopy(), and TOOL_MANAGER::DispatchContextMenu().

◆ copyFrom()

void ACTION_MENU::copyFrom ( const ACTION_MENU aMenu)
protected

Copies another menus data to this instance.

Old entries are preserved, and ones form aMenu are copied.

Definition at line 520 of file action_menu.cpp.

521 {
522  m_icon = aMenu.m_icon;
523  m_title = aMenu.m_title;
525  m_selected = -1; // aMenu.m_selected;
526  m_tool = aMenu.m_tool;
528 
529  // Copy all menu entries
530  for( int i = 0; i < (int) aMenu.GetMenuItemCount(); ++i )
531  {
532  wxMenuItem* item = aMenu.FindItemByPosition( i );
533  appendCopy( item );
534  }
535 }
bool m_titleDisplayed
Definition: action_menu.h:214
const BITMAP_OPAQUE * m_icon
Optional icon
Definition: action_menu.h:221
wxString m_title
Menu title
Definition: action_menu.h:218
int m_selected
Stores the id number of selected item.
Definition: action_menu.h:224
TOOL_INTERACTIVE * m_tool
Creator of the menu
Definition: action_menu.h:227
wxMenuItem * appendCopy(const wxMenuItem *aSource)
Function appendCopy Appends a copy of wxMenuItem.
std::map< int, const TOOL_ACTION * > m_toolActions
Associates tool actions with menu item IDs. Non-owning.
Definition: action_menu.h:233

References appendCopy(), m_icon, m_selected, m_title, m_titleDisplayed, m_tool, and m_toolActions.

Referenced by Clone().

◆ create()

ACTION_MENU * ACTION_MENU::create ( ) const
protectedvirtual

Returns an instance of this class. It has to be overridden in inheriting classes.

Reimplemented in ROUTER_TOOL_MENU, DIFF_PAIR_MENU, TRACK_WIDTH_MENU, LOCK_CONTEXT_MENU, TUNER_TOOL_MENU, BUS_UNFOLD_MENU, HIGHLIGHT_MENU, SELECT_MENU, ZONE_CONTEXT_MENU, SYMBOL_UNIT_MENU, CONDITIONAL_MENU, GRID_MENU, and ZOOM_MENU.

Definition at line 281 of file action_menu.cpp.

282 {
283  ACTION_MENU* menu = new ACTION_MENU( false );
284 
285  wxASSERT_MSG( typeid( *this ) == typeid( *menu ),
286  wxString::Format( "You need to override create() method for class %s", typeid(*this).name() ) );
287 
288  return menu;
289 }
ACTION_MENU.
Definition: action_menu.h:43
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
ACTION_MENU(bool isContextMenu)
Default constructor
Definition: action_menu.cpp:43

References ACTION_MENU(), and Format().

Referenced by Clone().

◆ DisplayTitle()

void ACTION_MENU::DisplayTitle ( bool  aDisplay = true)

Function DisplayTitle() Decides whether a title for a pop up menu should be displayed.

Definition at line 97 of file action_menu.cpp.

98 {
99  if( ( !aDisplay || m_title.IsEmpty() ) && m_titleDisplayed )
100  {
101  // Destroy the menu entry keeping the title..
102  wxMenuItem* item = FindItemByPosition( 0 );
103  wxASSERT( item->GetItemLabelText() == GetTitle() );
104  Destroy( item );
105  // ..and separator
106  item = FindItemByPosition( 0 );
107  wxASSERT( item->IsSeparator() );
108  Destroy( item );
109  m_titleDisplayed = false;
110  }
111 
112  else if( aDisplay && !m_title.IsEmpty() )
113  {
114  if( m_titleDisplayed )
115  {
116  // Simply update the title
117  FindItemByPosition( 0 )->SetItemLabel( m_title );
118  }
119  else
120  {
121  // Add a separator and a menu entry to display the title
122  InsertSeparator( 0 );
123  Insert( 0, new wxMenuItem( this, wxID_NONE, m_title, wxEmptyString, wxITEM_NORMAL ) );
124 
125  if( m_icon )
126  AddBitmapToMenuItem( FindItemByPosition( 0 ), KiBitmap( m_icon ) );
127 
128  m_titleDisplayed = true;
129  }
130  }
131 }
bool m_titleDisplayed
Definition: action_menu.h:214
const BITMAP_OPAQUE * m_icon
Optional icon
Definition: action_menu.h:221
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:80
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223
wxString m_title
Menu title
Definition: action_menu.h:218

References AddBitmapToMenuItem(), KiBitmap(), m_icon, m_title, and m_titleDisplayed.

Referenced by GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), SetTitle(), and TUNER_TOOL_MENU::TUNER_TOOL_MENU().

◆ eventHandler()

virtual OPT_TOOL_EVENT ACTION_MENU::eventHandler ( const wxMenuEvent &  )
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 DIFF_PAIR_MENU, TRACK_WIDTH_MENU, GRID_MENU, and ZOOM_MENU.

Definition at line 178 of file action_menu.h.

179  {
180  return OPT_TOOL_EVENT();
181  }
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:556

Referenced by OnMenuEvent(), and runEventHandlers().

◆ findToolAction()

OPT_TOOL_EVENT ACTION_MENU::findToolAction ( int  aId)
protected

Checks if any of submenus contains a TOOL_ACTION with a specific ID.

Definition at line 497 of file action_menu.cpp.

498 {
499  OPT_TOOL_EVENT evt;
500 
501  auto findFunc = [&]( ACTION_MENU* m ) {
502  if( evt )
503  return;
504 
505  const auto it = m->m_toolActions.find( aId );
506 
507  if( it != m->m_toolActions.end() )
508  evt = it->second->MakeEvent();
509  };
510 
511  findFunc( this );
512 
513  if( !evt )
514  runOnSubmenus( findFunc );
515 
516  return evt;
517 }
ACTION_MENU.
Definition: action_menu.h:43
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:556

References runOnSubmenus().

Referenced by OnMenuEvent().

◆ getMenuId()

static int ACTION_MENU::getMenuId ( const TOOL_ACTION aAction)
inlinestaticprotected

Returns the corresponding wxMenuItem identifier for a TOOL_ACTION object.

Definition at line 161 of file action_menu.h.

162  {
163  return aAction.GetId() + ACTION_ID;
164  }
static const int ACTION_ID
Menu items with ID higher than that are considered TOOL_ACTIONs
Definition: action_menu.h:230
int GetId() const
Function GetId() Returns the unique id of the TOOL_ACTION object.
Definition: tool_action.h:100

References ACTION_ID, and TOOL_ACTION::GetId().

Referenced by Add().

◆ GetSelected()

int ACTION_MENU::GetSelected ( ) const
inline

Function GetSelected() Returns the position of selected item.

If the returned value is negative, that means that menu was dismissed.

Returns
The position of selected item in the action menu.

Definition at line 120 of file action_menu.h.

121  {
122  return m_selected;
123  }
int m_selected
Stores the id number of selected item.
Definition: action_menu.h:224

References m_selected.

◆ getToolManager()

TOOL_MANAGER * ACTION_MENU::getToolManager ( ) const
protected

Returns an instance of TOOL_MANAGER class.

Definition at line 292 of file action_menu.cpp.

293 {
294  wxASSERT( m_tool );
295  return m_tool ? m_tool->GetManager() : nullptr;
296 }
TOOL_MANAGER * GetManager() const
Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:142
TOOL_INTERACTIVE * m_tool
Creator of the menu
Definition: action_menu.h:227

References TOOL_BASE::GetManager(), and m_tool.

Referenced by OnMenuEvent(), SYMBOL_UNIT_MENU::update(), BUS_UNFOLD_MENU::update(), and updateHotKeys().

◆ HasEnabledItems()

bool ACTION_MENU::HasEnabledItems ( ) const

Function HasEnabledItems();.

Returns true if the menu has any enabled items

Definition at line 214 of file action_menu.cpp.

215 {
216  bool hasEnabled = false;
217 
218  auto& items = GetMenuItems();
219 
220  for( auto item : items )
221  {
222  if( item->IsEnabled() && !item->IsSeparator() )
223  {
224  hasEnabled = true;
225  break;
226  }
227  }
228 
229  return hasEnabled;
230 }

◆ OnIdle()

void ACTION_MENU::OnIdle ( wxIdleEvent &  event)

Definition at line 347 of file action_menu.cpp.

348 {
350  g_menu_open_position.x = 0.0;
351  g_menu_open_position.y = 0.0;
352 }
static int g_last_menu_highlighted_id
static VECTOR2D g_menu_open_position

References g_last_menu_highlighted_id, g_menu_open_position, VECTOR2< T >::x, and VECTOR2< T >::y.

Referenced by setupEvents().

◆ OnMenuEvent()

void ACTION_MENU::OnMenuEvent ( wxMenuEvent &  aEvent)

Definition at line 355 of file action_menu.cpp.

356 {
357  OPT_TOOL_EVENT evt;
358  wxString menuText;
359  wxEventType type = aEvent.GetEventType();
360 
361  if( type == wxEVT_MENU_OPEN )
362  {
363  if( m_dirty && m_tool )
364  getToolManager()->RunAction( ACTIONS::updateMenu, true, this );
365 
366  wxMenu* parent = dynamic_cast<wxMenu*>( GetParent() );
367 
368  // Don't update the position if this menu has a parent
369  if( !parent && m_tool )
371 
373  }
374  else if( type == wxEVT_MENU_HIGHLIGHT )
375  {
376  if( aEvent.GetId() > 0 )
377  g_last_menu_highlighted_id = aEvent.GetId();
378 
379  evt = TOOL_EVENT( TC_COMMAND, TA_CHOICE_MENU_UPDATE, aEvent.GetId() );
380  }
381  else if( type == wxEVT_COMMAND_MENU_SELECTED )
382  {
383  // Store the selected position, so it can be checked by the tools
384  m_selected = aEvent.GetId();
385 
386  ACTION_MENU* parent = dynamic_cast<ACTION_MENU*>( GetParent() );
387 
388  while( parent )
389  {
390  parent->m_selected = m_selected;
391  parent = dynamic_cast<ACTION_MENU*>( parent->GetParent() );
392  }
393 
394  // Check if there is a TOOL_ACTION for the given ID
395  if( m_selected >= ACTION_ID )
396  evt = findToolAction( m_selected );
397 
398  if( !evt )
399  {
400 #ifdef __WINDOWS__
401  if( !evt )
402  {
403  // Try to find the submenu which holds the selected item
404  wxMenu* menu = nullptr;
405  FindItem( m_selected, &menu );
406 
407  // This conditional compilation is probably not needed.
408  // It will be removed later, for the Kicad V 6.x version.
409  // But in "old" 3.0 version, the "&& menu != this" contition was added to avoid hang
410  // This hang is no longer encountered in wxWidgets 3.0.4 version, and this condition is no longer needed.
411  // And in 3.1.2, we have to remove it, as "menu != this" never happens
412  // ("menu != this" always happens in 3.1.1 and older!).
413  #if wxCHECK_VERSION(3, 1, 2)
414  if( menu )
415  #else
416  if( menu && menu != this )
417  #endif
418  {
419  ACTION_MENU* cxmenu = static_cast<ACTION_MENU*>( menu );
420  evt = cxmenu->eventHandler( aEvent );
421  }
422  }
423 #else
424  if( !evt )
425  runEventHandlers( aEvent, evt );
426 #endif
427 
428  // Handling non-action menu entries (e.g. items in clarification list)
429  // in some context menus, that have IDs explicitly chosen between
430  // ID_POPUP_MENU_START and ID_POPUP_MENU_END
431  // Note also items in clarification list have an id >= 0 and < wxID_LOWEST
432  // in fact 0 to n-1 for n items in clarification list)
433  // id < 0 are automatically created for menuitems created with wxID_ANY
434  #define ID_CONTEXT_MENU_ID_MAX wxID_LOWEST /* = 100 should be enough and better */
435 
436  if( !evt &&
437  ( ( m_selected >= 0 && m_selected < ID_CONTEXT_MENU_ID_MAX ) ||
439  {
440  menuText = GetLabelText( aEvent.GetId() );
442  &menuText );
443  }
444  }
445  }
446 
447  // forward the action/update event to the TOOL_MANAGER
448  // clients that don't supply a tool will have to check GetSelected() themselves
449  if( evt && m_tool )
450  {
451  wxLogTrace( kicadTraceToolStack, "ACTION_MENU::OnMenuEvent %s", evt->Format() );
452 
453  // Pass the position the menu was opened from into the generated event if it is a select event
454  if( type == wxEVT_COMMAND_MENU_SELECTED )
455  evt->SetMousePosition( g_menu_open_position );
456  else
457  evt->SetMousePosition( getToolManager()->GetMousePosition() );
458 
459  if( g_last_menu_highlighted_id == aEvent.GetId() && !m_isContextMenu )
460  evt->SetHasPosition( false );
461 
462  if( m_tool->GetManager() )
463  m_tool->GetManager()->ProcessEvent( *evt );
464  }
465  else
466  {
467  aEvent.Skip();
468  }
469 }
OPT_TOOL_EVENT findToolAction(int aId)
Checks if any of submenus contains a TOOL_ACTION with a specific ID.
static int g_last_menu_highlighted_id
ACTION_MENU.
Definition: action_menu.h:43
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:139
void runEventHandlers(const wxMenuEvent &aMenuEvent, OPT_TOOL_EVENT &aToolEvent)
Traverses the submenus tree looking for a submenu capable of handling a particular menu event.
TOOL_MANAGER * GetManager() const
Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:142
virtual OPT_TOOL_EVENT eventHandler(const wxMenuEvent &)
Event handler stub.
Definition: action_menu.h:178
#define ID_CONTEXT_MENU_ID_MAX
bool m_isContextMenu
Definition: action_menu.h:215
bool ProcessEvent(const TOOL_EVENT &aEvent)
Propagates an event to tools that requested events of matching type(s).
TOOL_EVENT.
Definition: tool_event.h:171
static VECTOR2D g_menu_open_position
int m_selected
Stores the id number of selected item.
Definition: action_menu.h:224
static const int ACTION_ID
Menu items with ID higher than that are considered TOOL_ACTIONs
Definition: action_menu.h:230
static TOOL_ACTION updateMenu
Definition: actions.h:162
All active tools
Definition: tool_event.h:147
TOOL_INTERACTIVE * m_tool
Creator of the menu
Definition: action_menu.h:227
TOOL_MANAGER * getToolManager() const
Returns an instance of TOOL_MANAGER class.
const wxChar *const kicadTraceToolStack
Flag to enable tracing of the tool handling stack.
VECTOR2D GetMousePosition()
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:556

References ACTION_ID, AS_GLOBAL, eventHandler(), findToolAction(), g_last_menu_highlighted_id, g_menu_open_position, TOOL_BASE::GetManager(), TOOL_MANAGER::GetMousePosition(), getToolManager(), ID_CONTEXT_MENU_ID_MAX, ID_POPUP_MENU_END, ID_POPUP_MENU_START, kicadTraceToolStack, m_dirty, m_isContextMenu, m_selected, m_tool, TOOL_MANAGER::ProcessEvent(), TOOL_MANAGER::RunAction(), runEventHandlers(), TA_CHOICE_MENU_CHOICE, TA_CHOICE_MENU_UPDATE, TC_COMMAND, and ACTIONS::updateMenu.

Referenced by EDA_BASE_FRAME::OnMenuOpen(), and setupEvents().

◆ operator=()

ACTION_MENU& ACTION_MENU::operator= ( const ACTION_MENU aMenu)
delete

◆ runEventHandlers()

void ACTION_MENU::runEventHandlers ( const wxMenuEvent &  aMenuEvent,
OPT_TOOL_EVENT aToolEvent 
)
protected

Traverses 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 472 of file action_menu.cpp.

473 {
474  aToolEvent = eventHandler( aMenuEvent );
475 
476  if( !aToolEvent )
477  runOnSubmenus( std::bind( &ACTION_MENU::runEventHandlers, _1, aMenuEvent, aToolEvent ) );
478 }
void runEventHandlers(const wxMenuEvent &aMenuEvent, OPT_TOOL_EVENT &aToolEvent)
Traverses the submenus tree looking for a submenu capable of handling a particular menu event.
virtual OPT_TOOL_EVENT eventHandler(const wxMenuEvent &)
Event handler stub.
Definition: action_menu.h:178
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.

References eventHandler(), and runOnSubmenus().

Referenced by OnMenuEvent().

◆ runOnSubmenus()

void ACTION_MENU::runOnSubmenus ( std::function< void(ACTION_MENU *)>  aFunction)
protected

Runs a function on the menu and all its submenus.

Definition at line 481 of file action_menu.cpp.

482 {
483  try
484  {
485  std::for_each( m_submenus.begin(), m_submenus.end(), [&]( ACTION_MENU* m ) {
486  aFunction( m );
487  m->runOnSubmenus( aFunction );
488  } );
489  }
490  catch( std::exception& e )
491  {
492  wxLogDebug( wxString::Format( "ACTION_MENU runOnSubmenus exception: %s", e.what() ) );
493  }
494 }
ACTION_MENU.
Definition: action_menu.h:43
std::list< ACTION_MENU * > m_submenus
List of submenus.
Definition: action_menu.h:236
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205

References Format(), and m_submenus.

Referenced by ClearDirty(), CONDITIONAL_MENU::Evaluate(), findToolAction(), CONDITIONAL_MENU::Resolve(), runEventHandlers(), SetDirty(), SetTool(), and UpdateAll().

◆ SetDirty()

void ACTION_MENU::SetDirty ( )

Definition at line 258 of file action_menu.cpp.

259 {
260  m_dirty = true;
261  runOnSubmenus( std::bind( &ACTION_MENU::SetDirty, _1 ) );
262 }
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.
void SetDirty()

References m_dirty, and runOnSubmenus().

Referenced by TOOL_MENU::ShowContextMenu().

◆ SetIcon()

◆ SetTitle()

void ACTION_MENU::SetTitle ( const wxString &  aTitle)
override

Function SetTitle() Sets title for the menu.

The title is shown as a text label shown on the top of the menu.

Parameters
aTitleis the new title.

Definition at line 86 of file action_menu.cpp.

87 {
88  // Unfortunately wxMenu::SetTitle() does not work very well, so this is an alternative version
89  m_title = aTitle;
90 
91  // Update the menu title
92  if( m_titleDisplayed )
93  DisplayTitle( true );
94 }
bool m_titleDisplayed
Definition: action_menu.h:214
wxString m_title
Menu title
Definition: action_menu.h:218
void DisplayTitle(bool aDisplay=true)
Function DisplayTitle() Decides whether a title for a pop up menu should be displayed.
Definition: action_menu.cpp:97

References DisplayTitle(), m_title, and m_titleDisplayed.

Referenced by AddMenuLanguageList(), BUS_UNFOLD_MENU::BUS_UNFOLD_MENU(), EDA_3D_VIEWER::CreateMenuBar(), DIFF_PAIR_MENU::DIFF_PAIR_MENU(), GERBVIEW_SELECTION_TOOL::disambiguationMenu(), EE_SELECTION_TOOL::doSelectionMenu(), SELECTION_TOOL::doSelectionMenu(), GRID_MENU::GRID_MENU(), ALIGN_DISTRIBUTE_TOOL::Init(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), ROUTER_TOOL_MENU::ROUTER_TOOL_MENU(), SYMBOL_UNIT_MENU::SYMBOL_UNIT_MENU(), TRACK_WIDTH_MENU::TRACK_WIDTH_MENU(), TUNER_TOOL_MENU::TUNER_TOOL_MENU(), and ZOOM_MENU::ZOOM_MENU().

◆ SetTool()

void ACTION_MENU::SetTool ( TOOL_INTERACTIVE aTool)

Function SetTool() Sets a tool that is the creator of the menu.

Parameters
aToolis the tool that created the menu.

Definition at line 265 of file action_menu.cpp.

266 {
267  m_tool = aTool;
268  runOnSubmenus( std::bind( &ACTION_MENU::SetTool, _1, aTool ) );
269 }
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
TOOL_INTERACTIVE * m_tool
Creator of the menu
Definition: action_menu.h:227
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.

References m_tool, and runOnSubmenus().

Referenced by ALIGN_DISTRIBUTE_TOOL::Init(), KICAD_MANAGER_FRAME::ReCreateMenuBar(), FOOTPRINT_EDIT_FRAME::ReCreateMenuBar(), LIB_EDIT_FRAME::ReCreateMenuBar(), GERBVIEW_FRAME::ReCreateMenuBar(), SCH_EDIT_FRAME::ReCreateMenuBar(), PCB_EDIT_FRAME::ReCreateMenuBar(), TOOL_INTERACTIVE::SetContextMenu(), CVPCB_MAINFRAME::setupTools(), SCH_LINE_WIRE_BUS_TOOL::UnfoldBus(), and BUS_UNFOLD_MENU::update().

◆ setupEvents()

void ACTION_MENU::setupEvents ( )
protected

Initializes handlers for events.

Definition at line 74 of file action_menu.cpp.

75 {
76 // See wxWidgets hack in EDA_BASE_FRAME::OnMenuOpen().
77 // Connect( wxEVT_MENU_OPEN, wxMenuEventHandler( ACTION_MENU::OnMenuEvent ), NULL, this );
78 // Connect( wxEVT_MENU_HIGHLIGHT, wxMenuEventHandler( ACTION_MENU::OnMenuEvent ), NULL, this );
79 // Connect( wxEVT_MENU_CLOSE, wxMenuEventHandler( ACTION_MENU::OnMenuEvent ), NULL, this );
80 
81  Connect( wxEVT_COMMAND_MENU_SELECTED, wxMenuEventHandler( ACTION_MENU::OnMenuEvent ), NULL, this );
82  Connect( wxEVT_IDLE, wxIdleEventHandler( ACTION_MENU::OnIdle ), NULL, this );
83 }
#define NULL
void OnMenuEvent(wxMenuEvent &aEvent)
void OnIdle(wxIdleEvent &event)

References NULL, OnIdle(), and OnMenuEvent().

Referenced by ACTION_MENU().

◆ update()

virtual void ACTION_MENU::update ( )
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 DIFF_PAIR_MENU, TRACK_WIDTH_MENU, BUS_UNFOLD_MENU, ZONE_CONTEXT_MENU, SELECT_MENU, SYMBOL_UNIT_MENU, HIGHLIGHT_MENU, GRID_MENU, and ZOOM_MENU.

Definition at line 170 of file action_menu.h.

171  {
172  }

Referenced by UpdateAll().

◆ UpdateAll()

void ACTION_MENU::UpdateAll ( )

Function UpdateAll() Runs update handlers for the menu and its submenus.

Definition at line 233 of file action_menu.cpp.

234 {
235  try
236  {
237  update();
238  }
239  catch( std::exception& e )
240  {
241  wxLogDebug( wxString::Format( "ACTION_MENU update handler exception: %s", e.what() ) );
242  }
243 
244  if( m_tool )
245  updateHotKeys();
246 
247  runOnSubmenus( std::bind( &ACTION_MENU::UpdateAll, _1 ) );
248 }
virtual void update()
Update menu state stub.
Definition: action_menu.h:170
void UpdateAll()
Function UpdateAll() Runs update handlers for the menu and its submenus.
TOOL_INTERACTIVE * m_tool
Creator of the menu
Definition: action_menu.h:227
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, CPTREE &aTree)
Function Format outputs a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:205
void updateHotKeys()
Updates hot key settings for TOOL_ACTIONs in this menu.

References Format(), m_tool, runOnSubmenus(), update(), and updateHotKeys().

Referenced by CONDITIONAL_MENU::Resolve(), TOOL_MENU::ShowContextMenu(), EDA_3D_VIEWER_CONTROL::UpdateMenu(), KICAD_MANAGER_CONTROL::UpdateMenu(), GERBVIEW_SELECTION_TOOL::UpdateMenu(), EE_SELECTION_TOOL::UpdateMenu(), CVPCB_CONTROL::UpdateMenu(), and SELECTION_TOOL::UpdateMenu().

◆ updateHotKeys()

void ACTION_MENU::updateHotKeys ( )
protected

Updates hot key settings for TOOL_ACTIONs in this menu.

Definition at line 299 of file action_menu.cpp.

300 {
301  TOOL_MANAGER* toolMgr = getToolManager();
302 
303  for( auto& ii : m_toolActions )
304  {
305  int id = ii.first;
306  const TOOL_ACTION& action = *ii.second;
307  int key = toolMgr->GetHotKey( action ) & ~MD_MODIFIER_MASK;
308 
309  if( key )
310  {
311  int mod = toolMgr->GetHotKey( action ) & MD_MODIFIER_MASK;
312  int flags = 0;
313  wxMenuItem* item = FindChildItem( id );
314 
315  if( item )
316  {
317  flags |= ( mod & MD_ALT ) ? wxACCEL_ALT : 0;
318  flags |= ( mod & MD_CTRL ) ? wxACCEL_CTRL : 0;
319  flags |= ( mod & MD_SHIFT ) ? wxACCEL_SHIFT : 0;
320 
321  if( !flags )
322  flags = wxACCEL_NORMAL;
323 
324  wxAcceleratorEntry accel( flags, key, id, item );
325  item->SetAccel( &accel );
326  }
327  }
328  }
329 }
int GetHotKey(const TOOL_ACTION &aAction)
TOOL_MANAGER.
Definition: tool_manager.h:50
std::map< int, const TOOL_ACTION * > m_toolActions
Associates tool actions with menu item IDs. Non-owning.
Definition: action_menu.h:233
TOOL_MANAGER * getToolManager() const
Returns an instance of TOOL_MANAGER class.
TOOL_ACTION.
Definition: tool_action.h:46

References TOOL_MANAGER::GetHotKey(), getToolManager(), m_toolActions, MD_ALT, MD_CTRL, MD_MODIFIER_MASK, and MD_SHIFT.

Referenced by UpdateAll().

Friends And Related Function Documentation

◆ TOOL_INTERACTIVE

friend class TOOL_INTERACTIVE
friend

Definition at line 238 of file action_menu.h.

Member Data Documentation

◆ ACTION_ID

const int ACTION_MENU::ACTION_ID = 20000
staticprotected

Menu items with ID higher than that are considered TOOL_ACTIONs

Definition at line 230 of file action_menu.h.

Referenced by getMenuId(), and OnMenuEvent().

◆ m_dirty

bool ACTION_MENU::m_dirty
protected

Definition at line 212 of file action_menu.h.

Referenced by ClearDirty(), OnMenuEvent(), and SetDirty().

◆ m_icon

const BITMAP_OPAQUE* ACTION_MENU::m_icon
protected

Optional icon

Definition at line 221 of file action_menu.h.

Referenced by Add(), copyFrom(), DisplayTitle(), and SetIcon().

◆ m_isContextMenu

bool ACTION_MENU::m_isContextMenu
protected

◆ m_selected

int ACTION_MENU::m_selected
protected

Stores the id number of selected item.

Definition at line 224 of file action_menu.h.

Referenced by copyFrom(), GetSelected(), and OnMenuEvent().

◆ m_submenus

std::list<ACTION_MENU*> ACTION_MENU::m_submenus
protected

List of submenus.

Definition at line 236 of file action_menu.h.

Referenced by Add(), appendCopy(), Clear(), runOnSubmenus(), and ~ACTION_MENU().

◆ m_title

wxString ACTION_MENU::m_title
protected

Menu title

Definition at line 218 of file action_menu.h.

Referenced by Add(), copyFrom(), DisplayTitle(), and SetTitle().

◆ m_titleDisplayed

bool ACTION_MENU::m_titleDisplayed
protected

Definition at line 214 of file action_menu.h.

Referenced by Clear(), copyFrom(), DisplayTitle(), and SetTitle().

◆ m_tool

◆ m_toolActions

std::map<int, const TOOL_ACTION*> ACTION_MENU::m_toolActions
protected

Associates tool actions with menu item IDs. Non-owning.

Definition at line 233 of file action_menu.h.

Referenced by Add(), Clear(), copyFrom(), and updateHotKeys().


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