KiCad PCB EDA Suite
action_menu.cpp
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2013-2019 CERN
5  * Copyright (C) 2013-2019 KiCad Developers, see AUTHORS.txt for contributors.
6  * @author Tomasz Wlostowski <tomasz.wlostowski@cern.ch>
7  * @author Maciej Suminski <maciej.suminski@cern.ch>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, you may find one here:
21  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
22  * or you may search the http://www.gnu.org website for the version 2 license,
23  * or you may write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
25  */
26 
27 #include <eda_base_frame.h>
28 #include <functional>
29 #include <id.h>
30 #include <menus_helpers.h>
31 #include <tool/action_menu.h>
32 #include <tool/actions.h>
33 #include <tool/tool_event.h>
34 #include <tool/tool_interactive.h>
35 #include <tool/tool_manager.h>
36 #include <trace_helpers.h>
37 #include <wx/log.h>
38 
39 
40 using namespace std::placeholders;
41 
42 
43 ACTION_MENU::ACTION_MENU( bool isContextMenu ) :
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 }
53 
54 
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 }
66 
67 
68 void ACTION_MENU::SetIcon( const BITMAP_OPAQUE* aIcon )
69 {
70  m_icon = aIcon;
71 }
72 
73 
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 }
84 
85 
86 void ACTION_MENU::SetTitle( const wxString& aTitle )
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 }
95 
96 
97 void ACTION_MENU::DisplayTitle( bool aDisplay )
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 }
132 
133 
134 wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, int aId, const BITMAP_OPAQUE* aIcon )
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 }
145 
146 
147 wxMenuItem* ACTION_MENU::Add( const wxString& aLabel, const wxString& aTooltip, int aId,
148  const BITMAP_OPAQUE* aIcon )
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 }
159 
160 
161 wxMenuItem* ACTION_MENU::Add( const TOOL_ACTION& aAction, bool aIsCheckmarkEntry )
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  wxMenuItem* i = Append( item );
176  return i;
177 }
178 
179 
180 wxMenuItem* ACTION_MENU::Add( ACTION_MENU* aMenu )
181 {
182  ACTION_MENU* menuCopy = aMenu->Clone();
183  m_submenus.push_back( menuCopy );
184 
185  wxASSERT_MSG( !menuCopy->m_title.IsEmpty(), "Set a title for ACTION_MENU using SetTitle()" );
186 
187  if( aMenu->m_icon )
188  {
189  wxMenuItem* newItem = new wxMenuItem( this, -1, menuCopy->m_title );
190  AddBitmapToMenuItem( newItem, KiBitmap( aMenu->m_icon ) );
191  newItem->SetSubMenu( menuCopy );
192  return Append( newItem );
193  }
194  else
195  {
196  return AppendSubMenu( menuCopy, menuCopy->m_title );
197  }
198 }
199 
200 
202 {
203  m_titleDisplayed = false;
204 
205  for( int i = GetMenuItemCount() - 1; i >= 0; --i )
206  Destroy( FindItemByPosition( i ) );
207 
208  m_toolActions.clear();
209  m_submenus.clear();
210 
211  wxASSERT( GetMenuItemCount() == 0 );
212 }
213 
214 
216 {
217  bool hasEnabled = false;
218 
219  auto& items = GetMenuItems();
220 
221  for( auto item : items )
222  {
223  if( item->IsEnabled() && !item->IsSeparator() )
224  {
225  hasEnabled = true;
226  break;
227  }
228  }
229 
230  return hasEnabled;
231 }
232 
233 
235 {
236  try
237  {
238  update();
239  }
240  catch( std::exception& e )
241  {
242  wxLogDebug( wxString::Format( "ACTION_MENU update handler exception: %s", e.what() ) );
243  }
244 
245  if( m_tool )
246  updateHotKeys();
247 
248  runOnSubmenus( std::bind( &ACTION_MENU::UpdateAll, _1 ) );
249 }
250 
251 
253 {
254  m_dirty = false;
255  runOnSubmenus( std::bind( &ACTION_MENU::ClearDirty, _1 ) );
256 }
257 
258 
260 {
261  m_dirty = true;
262  runOnSubmenus( std::bind( &ACTION_MENU::SetDirty, _1 ) );
263 }
264 
265 
267 {
268  m_tool = aTool;
269  runOnSubmenus( std::bind( &ACTION_MENU::SetTool, _1, aTool ) );
270 }
271 
272 
274 {
275  ACTION_MENU* clone = create();
276  clone->Clear();
277  clone->copyFrom( *this );
278  return clone;
279 }
280 
281 
283 {
284  ACTION_MENU* menu = new ACTION_MENU( false );
285 
286  wxASSERT_MSG( typeid( *this ) == typeid( *menu ),
287  wxString::Format( "You need to override create() method for class %s", typeid(*this).name() ) );
288 
289  return menu;
290 }
291 
292 
294 {
295  wxASSERT( m_tool );
296  return m_tool ? m_tool->GetManager() : nullptr;
297 }
298 
299 
301 {
302  TOOL_MANAGER* toolMgr = getToolManager();
303 
304  for( auto& ii : m_toolActions )
305  {
306  int id = ii.first;
307  const TOOL_ACTION& action = *ii.second;
308  int key = toolMgr->GetHotKey( action ) & ~MD_MODIFIER_MASK;
309 
310  if( key )
311  {
312  int mod = toolMgr->GetHotKey( action ) & MD_MODIFIER_MASK;
313  int flags = 0;
314  wxMenuItem* item = FindChildItem( id );
315 
316  if( item )
317  {
318  flags |= ( mod & MD_ALT ) ? wxACCEL_ALT : 0;
319  flags |= ( mod & MD_CTRL ) ? wxACCEL_CTRL : 0;
320  flags |= ( mod & MD_SHIFT ) ? wxACCEL_SHIFT : 0;
321 
322  if( !flags )
323  flags = wxACCEL_NORMAL;
324 
325  wxAcceleratorEntry accel( flags, key, id, item );
326  item->SetAccel( &accel );
327  }
328  }
329  }
330 }
331 
332 
333 // wxWidgets doesn't tell us when a menu command was generated from a hotkey or from
334 // a menu selection. It's important to us because a hotkey can be an immediate action
335 // while the menu selection can not (as it has no associated position).
336 //
337 // We get around this by storing the last highlighted menuId. If it matches the command
338 // id then we know this is a menu selection. (You might think we could use the menuOpen
339 // menuClose events, but these are actually generated for hotkeys as well.)
340 
342 
343 
344 void ACTION_MENU::OnIdle( wxIdleEvent& event )
345 {
347 }
348 
349 
350 void ACTION_MENU::OnMenuEvent( wxMenuEvent& aEvent )
351 {
352  OPT_TOOL_EVENT evt;
353  wxString menuText;
354  wxEventType type = aEvent.GetEventType();
355 
356  if( type == wxEVT_MENU_OPEN )
357  {
358  if( m_dirty && m_tool )
359  getToolManager()->RunAction( ACTIONS::updateMenu, true, this );
360 
362  }
363  else if( type == wxEVT_MENU_HIGHLIGHT )
364  {
365  if( aEvent.GetId() > 0 )
366  g_last_menu_highlighted_id = aEvent.GetId();
367 
368  evt = TOOL_EVENT( TC_COMMAND, TA_CHOICE_MENU_UPDATE, aEvent.GetId() );
369  }
370  else if( type == wxEVT_COMMAND_MENU_SELECTED )
371  {
372  // Store the selected position, so it can be checked by the tools
373  m_selected = aEvent.GetId();
374 
375  ACTION_MENU* parent = dynamic_cast<ACTION_MENU*>( GetParent() );
376 
377  while( parent )
378  {
379  parent->m_selected = m_selected;
380  parent = dynamic_cast<ACTION_MENU*>( parent->GetParent() );
381  }
382 
383  // Check if there is a TOOL_ACTION for the given ID
384  if( m_selected >= ACTION_ID )
385  evt = findToolAction( m_selected );
386 
387  if( !evt )
388  {
389 #ifdef __WINDOWS__
390  if( !evt )
391  {
392  // Try to find the submenu which holds the selected item
393  wxMenu* menu = nullptr;
394  FindItem( m_selected, &menu );
395 
396  // This conditional compilation is probably not needed.
397  // It will be removed later, for the Kicad V 6.x version.
398  // But in "old" 3.0 version, the "&& menu != this" contition was added to avoid hang
399  // This hang is no longer encountered in wxWidgets 3.0.4 version, and this condition is no longer needed.
400  // And in 3.1.2, we have to remove it, as "menu != this" never happens
401  // ("menu != this" always happens in 3.1.1 and older!).
402  #if wxCHECK_VERSION(3, 1, 2)
403  if( menu )
404  #else
405  if( menu && menu != this )
406  #endif
407  {
408  ACTION_MENU* cxmenu = static_cast<ACTION_MENU*>( menu );
409  evt = cxmenu->eventHandler( aEvent );
410  }
411  }
412 #else
413  if( !evt )
414  runEventHandlers( aEvent, evt );
415 #endif
416 
417  // Handling non-action menu entries (e.g. items in clarification list)
418  // in some context menus, that have IDs explicitly chosen between
419  // ID_POPUP_MENU_START and ID_POPUP_MENU_END
420  // Note also items in clarification list have an id >= 0 and < wxID_LOWEST
421  // in fact 0 to n-1 for n items in clarification list)
422  // id < 0 are automatically created for menuitems created with wxID_ANY
423  #define ID_CONTEXT_MENU_ID_MAX wxID_LOWEST /* = 100 should be enough and better */
424 
425  if( !evt &&
426  ( ( m_selected >= 0 && m_selected < ID_CONTEXT_MENU_ID_MAX ) ||
428  {
429  menuText = GetLabelText( aEvent.GetId() );
431  &menuText );
432  }
433  }
434  }
435 
436  // forward the action/update event to the TOOL_MANAGER
437  // clients that don't supply a tool will have to check GetSelected() themselves
438  if( evt && m_tool )
439  {
440 
441  wxLogTrace( kicadTraceToolStack, "ACTION_MENU::OnMenuEvent %s", evt->Format() );
442 
443  TOOL_MANAGER* toolMgr = m_tool->GetManager();
444 
445  if( g_last_menu_highlighted_id == aEvent.GetId() && !m_isContextMenu )
446  evt->SetHasPosition( false );
447 
448  if( toolMgr->GetEditFrame() && !toolMgr->GetEditFrame()->GetDoImmediateActions() )
449  {
450  // An tool-selection-event has no position
451  if( evt->GetCommandStr().is_initialized()
452  && evt->GetCommandStr().get() != toolMgr->GetEditFrame()->CurrentToolName() )
453  {
454  evt->SetHasPosition( false );
455  }
456  }
457 
458  if( m_tool->GetManager() )
459  m_tool->GetManager()->ProcessEvent( *evt );
460  }
461  else
462  {
463  aEvent.Skip();
464  }
465 }
466 
467 
468 void ACTION_MENU::runEventHandlers( const wxMenuEvent& aMenuEvent, OPT_TOOL_EVENT& aToolEvent )
469 {
470  aToolEvent = eventHandler( aMenuEvent );
471 
472  if( !aToolEvent )
473  runOnSubmenus( std::bind( &ACTION_MENU::runEventHandlers, _1, aMenuEvent, aToolEvent ) );
474 }
475 
476 
477 void ACTION_MENU::runOnSubmenus( std::function<void(ACTION_MENU*)> aFunction )
478 {
479  try
480  {
481  std::for_each( m_submenus.begin(), m_submenus.end(), [&]( ACTION_MENU* m ) {
482  aFunction( m );
483  m->runOnSubmenus( aFunction );
484  } );
485  }
486  catch( std::exception& e )
487  {
488  wxLogDebug( wxString::Format( "ACTION_MENU runOnSubmenus exception: %s", e.what() ) );
489  }
490 }
491 
492 
494 {
495  OPT_TOOL_EVENT evt;
496 
497  auto findFunc = [&]( ACTION_MENU* m ) {
498  if( evt )
499  return;
500 
501  const auto it = m->m_toolActions.find( aId );
502 
503  if( it != m->m_toolActions.end() )
504  evt = it->second->MakeEvent();
505  };
506 
507  findFunc( this );
508 
509  if( !evt )
510  runOnSubmenus( findFunc );
511 
512  return evt;
513 }
514 
515 
516 void ACTION_MENU::copyFrom( const ACTION_MENU& aMenu )
517 {
518  m_icon = aMenu.m_icon;
519  m_title = aMenu.m_title;
521  m_selected = -1; // aMenu.m_selected;
522  m_tool = aMenu.m_tool;
524 
525  // Copy all menu entries
526  for( int i = 0; i < (int) aMenu.GetMenuItemCount(); ++i )
527  {
528  wxMenuItem* item = aMenu.FindItemByPosition( i );
529  appendCopy( item );
530  }
531 }
532 
533 
534 wxMenuItem* ACTION_MENU::appendCopy( const wxMenuItem* aSource )
535 {
536  wxMenuItem* newItem = new wxMenuItem( this, aSource->GetId(), aSource->GetItemLabel(),
537  aSource->GetHelp(), aSource->GetKind() );
538 
539  // Add the source bitmap if it is not the wxNullBitmap
540  // On Windows, for Checkable Menu items, adding a null bitmap adds also
541  // our predefined checked alternate bitmap
542  const wxBitmap& src_bitmap = aSource->GetBitmap();
543 
544  if( src_bitmap.IsOk() && src_bitmap.GetHeight() > 1 ) // a null bitmap has a 0 size
545  AddBitmapToMenuItem( newItem, src_bitmap );
546 
547  if( aSource->IsSubMenu() )
548  {
549  ACTION_MENU* menu = dynamic_cast<ACTION_MENU*>( aSource->GetSubMenu() );
550  wxASSERT_MSG( menu, "Submenus are expected to be a ACTION_MENU" );
551 
552  if( menu )
553  {
554  ACTION_MENU* menuCopy = menu->Clone();
555  newItem->SetSubMenu( menuCopy );
556  m_submenus.push_back( menuCopy );
557  }
558  }
559 
560  // wxMenuItem has to be added before enabling/disabling or checking
561  Append( newItem );
562 
563  if( aSource->IsCheckable() )
564  newItem->Check( aSource->IsChecked() );
565 
566  newItem->Enable( aSource->IsEnabled() );
567 
568  return newItem;
569 }
wxMenuItem * Add(const wxString &aLabel, int aId, const BITMAP_OPAQUE *aIcon)
Function Add() Adds a wxWidgets-style entry to the menu.
virtual void update()
Update menu state stub.
Definition: action_menu.h:170
bool m_titleDisplayed
Definition: action_menu.h:214
OPT_TOOL_EVENT findToolAction(int aId)
Checks if any of submenus contains a TOOL_ACTION with a specific ID.
int GetHotKey(const TOOL_ACTION &aAction)
static int g_last_menu_highlighted_id
static int getMenuId(const TOOL_ACTION &aAction)
Returns the corresponding wxMenuItem identifier for a TOOL_ACTION object.
Definition: action_menu.h:161
Class ACTION_MENU.
Definition: action_menu.h:43
const BITMAP_OPAQUE * m_icon
Optional icon
Definition: action_menu.h:221
bool RunAction(const std::string &aActionName, bool aNow=false, T aParam=NULL)
Function RunAction() Runs the specified action.
Definition: tool_manager.h:109
void runEventHandlers(const wxMenuEvent &aMenuEvent, OPT_TOOL_EVENT &aToolEvent)
Traverses the submenus tree looking for a submenu capable of handling a particular menu event.
void ClearDirty()
Function ClearDirty() Clears the dirty flag on the menu and all descendants.
void UpdateAll()
Function UpdateAll() Runs update handlers for the menu and its submenus.
virtual ACTION_MENU * create() const
Returns an instance of this class. It has to be overridden in inheriting classes.
const BITMAP_OPAQUE * GetIcon() const
Returns an icon associated with the action.
Definition: tool_action.h:149
void SetTool(TOOL_INTERACTIVE *aTool)
Function SetTool() Sets a tool that is the creator of the menu.
TOOL_MANAGER * GetManager() const
Function GetManager() Returns the instance of TOOL_MANAGER that takes care of the tool.
Definition: tool_base.h:143
virtual OPT_TOOL_EVENT eventHandler(const wxMenuEvent &)
Event handler stub.
Definition: action_menu.h:178
wxString GetDescription() const
Definition: tool_action.cpp:83
Class TOOL_MANAGER.
Definition: tool_manager.h:50
wxBitmap KiBitmap(BITMAP_DEF aBitmap)
Construct a wxBitmap from a memory record, held in a BITMAP_DEF.
Definition: bitmap.cpp:79
#define ID_CONTEXT_MENU_ID_MAX
void copyFrom(const ACTION_MENU &aMenu)
Copies another menus data to this instance.
void AddBitmapToMenuItem(wxMenuItem *aMenu, const wxBitmap &aImage)
Add a bitmap to a menuitem.
Definition: bitmap.cpp:223
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).
wxString m_title
Menu title
Definition: action_menu.h:218
std::list< ACTION_MENU * > m_submenus
List of submenus.
Definition: action_menu.h:236
void SetIcon(const BITMAP_OPAQUE *aIcon)
Function SetIcon() Assigns an icon for the entry.
Definition: action_menu.cpp:68
Class TOOL_EVENT.
Definition: tool_event.h:168
Base window classes and related definitions.
int m_selected
Stores the id number of selected item.
Definition: action_menu.h:224
wxLogTrace helper definitions.
ACTION_MENU * Clone() const
Creates a deep, recursive copy of this ACTION_MENU.
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:157
All active tools
Definition: tool_event.h:144
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.
void runOnSubmenus(std::function< void(ACTION_MENU *)> aFunction)
Runs a function on the menu and all its submenus.
std::map< int, const TOOL_ACTION * > m_toolActions
Associates tool actions with menu item IDs. Non-owning.
Definition: action_menu.h:233
void OnMenuEvent(wxMenuEvent &aEvent)
void SetTitle(const wxString &aTitle) override
Function SetTitle() Sets title for the menu.
Definition: action_menu.cpp:86
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
TOOL_MANAGER * getToolManager() const
Returns an instance of TOOL_MANAGER class.
Class TOOL_ACTION.
Definition: tool_action.h:46
size_t i
Definition: json11.cpp:597
void setupEvents()
Initializes handlers for events.
Definition: action_menu.cpp:74
void Clear()
Function Clear() Removes all the entries from the menu (as well as its title).
const wxChar *const kicadTraceToolStack
Flag to enable tracing of the tool handling stack.
bool HasEnabledItems() const
Function HasEnabledItems();.
void OnIdle(wxIdleEvent &event)
ACTION_MENU(bool isContextMenu)
Default constructor
Definition: action_menu.cpp:43
void updateHotKeys()
Updates hot key settings for TOOL_ACTIONs in this menu.
wxString GetMenuItem() const
Definition: tool_action.cpp:75
~ACTION_MENU() override
Definition: action_menu.cpp:55
void SetDirty()
#define mod(a, n)
Definition: greymap.cpp:24
OPT< TOOL_EVENT > OPT_TOOL_EVENT
Definition: tool_event.h:548
void DisplayTitle(bool aDisplay=true)
Function DisplayTitle() Decides whether a title for a pop up menu should be displayed.
Definition: action_menu.cpp:97