1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/menucmn.cpp
3 // Purpose: wxMenu and wxMenuBar methods common to all ports
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWindows team
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
21 #pragma implementation "menubase.h"
24 // For compilers that support precompilation, includes "wx.h".
25 #include "wx/wxprec.h"
41 // ----------------------------------------------------------------------------
43 // ----------------------------------------------------------------------------
45 #include "wx/listimpl.cpp"
47 WX_DEFINE_LIST(wxMenuList
);
48 WX_DEFINE_LIST(wxMenuItemList
);
50 // ============================================================================
52 // ============================================================================
54 // ----------------------------------------------------------------------------
56 // ----------------------------------------------------------------------------
58 wxMenuItemBase::wxMenuItemBase(wxMenu
*parentMenu
,
67 wxASSERT_MSG( parentMenu
!= NULL
, wxT("menuitem should have a menu") );
69 m_parentMenu
= parentMenu
;
77 if (m_id
== wxID_SEPARATOR
)
78 m_kind
= wxITEM_SEPARATOR
;
81 wxMenuItemBase::~wxMenuItemBase()
88 static inline bool CompareAccelString(const wxString
& str
, const wxChar
*accel
)
91 return str
== accel
|| str
== wxGetTranslation(accel
);
97 // return wxAcceleratorEntry for the given menu string or NULL if none
99 wxAcceleratorEntry
*wxGetAccelFromString(const wxString
& label
)
101 // wxPrintf( wxT("label %s\n"), label.c_str() );
103 // check for accelerators: they are given after '\t'
104 int posTab
= label
.Find(wxT('\t'));
105 if ( posTab
!= wxNOT_FOUND
) {
106 // parse the accelerator string
108 int accelFlags
= wxACCEL_NORMAL
;
110 for ( size_t n
= (size_t)posTab
+ 1; n
< label
.Len(); n
++ ) {
111 if ( (label
[n
] == '+') || (label
[n
] == '-') ) {
112 if ( CompareAccelString(current
, wxTRANSLATE("ctrl")) )
113 accelFlags
|= wxACCEL_CTRL
;
114 else if ( CompareAccelString(current
, wxTRANSLATE("alt")) )
115 accelFlags
|= wxACCEL_ALT
;
116 else if ( CompareAccelString(current
, wxTRANSLATE("shift")) )
117 accelFlags
|= wxACCEL_SHIFT
;
119 // we may have "Ctrl-+", for example, but we still want to
120 // catch typos like "Crtl-A" so only give the warning if we
121 // have something before the current '+' or '-', else take
122 // it as a literal symbol
123 if ( current
.empty() )
127 // skip clearing it below
132 wxLogDebug(wxT("Unknown accel modifier: '%s'"),
140 current
+= (wxChar
) wxTolower(label
[n
]);
144 if ( current
.IsEmpty() ) {
145 wxLogDebug(wxT("No accel key found, accel string ignored."));
148 if ( current
.Len() == 1 ) {
150 keyCode
= current
[0U];
152 // Only call wxToupper if control, alt, or shift is held down,
153 // otherwise lower case accelerators won't work.
154 if (accelFlags
!= wxACCEL_NORMAL
) {
155 keyCode
= wxToupper(keyCode
);
159 // is it a function key?
160 if ( current
[0U] == 'f' && wxIsdigit(current
[1U]) &&
161 (current
.Len() == 2 ||
162 (current
.Len() == 3 && wxIsdigit(current
[2U]))) ) {
164 wxSscanf(current
.c_str() + 1, wxT("%d"), &n
);
166 keyCode
= WXK_F1
+ n
- 1;
169 // several special cases
171 if ( current
== wxT("DEL") )
172 keyCode
= WXK_DELETE
;
173 else if ( current
== wxT("DELETE") )
174 keyCode
= WXK_DELETE
;
175 else if ( current
== wxT("BACK") )
177 else if ( current
== wxT("INS") )
178 keyCode
= WXK_INSERT
;
179 else if ( current
== wxT("INSERT") )
180 keyCode
= WXK_INSERT
;
181 else if ( current
== wxT("ENTER") || current
== wxT("RETURN") )
182 keyCode
= WXK_RETURN
;
183 else if ( current
== wxT("PGUP") )
185 else if ( current
== wxT("PGDN") )
187 else if ( current
== wxT("LEFT") )
189 else if ( current
== wxT("RIGHT") )
191 else if ( current
== wxT("UP") )
193 else if ( current
== wxT("DOWN") )
195 else if ( current
== wxT("HOME") )
197 else if ( current
== wxT("END") )
199 else if ( current
== wxT("SPACE") )
201 else if ( current
== wxT("TAB") )
203 else if ( current
== wxT("ESC") || current
== wxT("ESCAPE") )
204 keyCode
= WXK_ESCAPE
;
207 wxLogDebug(wxT("Unrecognized accel key '%s', accel string ignored."),
215 // we do have something
216 return new wxAcceleratorEntry(accelFlags
, keyCode
);
220 return (wxAcceleratorEntry
*)NULL
;
223 wxAcceleratorEntry
*wxMenuItemBase::GetAccel() const
225 return wxGetAccelFromString(GetText());
228 void wxMenuItemBase::SetAccel(wxAcceleratorEntry
*accel
)
230 wxString text
= m_text
.BeforeFirst(wxT('\t'));
235 int flags
= accel
->GetFlags();
236 if ( flags
& wxACCEL_ALT
)
238 if ( flags
& wxACCEL_CTRL
)
239 text
+= wxT("Ctrl-");
240 if ( flags
& wxACCEL_SHIFT
)
241 text
+= wxT("Shift-");
243 int code
= accel
->GetKeyCode();
258 text
<< wxT('F') << code
- WXK_F1
+ 1;
261 // if there are any other keys wxGetAccelFromString() may return,
262 // we should process them here
265 if ( wxIsalnum(code
) )
267 text
<< (wxChar
)code
;
272 wxFAIL_MSG( wxT("unknown keyboard accel") );
279 #endif // wxUSE_ACCEL
281 bool wxMenuBase::ms_locked
= true;
283 // ----------------------------------------------------------------------------
284 // wxMenu ctor and dtor
285 // ----------------------------------------------------------------------------
287 void wxMenuBase::Init(long style
)
289 m_menuBar
= (wxMenuBar
*)NULL
;
290 m_menuParent
= (wxMenu
*)NULL
;
292 m_invokingWindow
= (wxWindow
*)NULL
;
294 m_clientData
= (void *)NULL
;
295 m_eventHandler
= this;
298 wxMenuBase::~wxMenuBase()
300 WX_CLEAR_LIST(wxMenuItemList
, m_items
);
302 // Actually, in GTK, the submenus have to get deleted first.
305 // ----------------------------------------------------------------------------
306 // wxMenu item adding/removing
307 // ----------------------------------------------------------------------------
309 void wxMenuBase::AddSubMenu(wxMenu
*submenu
)
311 wxCHECK_RET( submenu
, _T("can't add a NULL submenu") );
315 submenu
->Attach(m_menuBar
);
318 submenu
->SetParent((wxMenu
*)this);
321 wxMenuItem
* wxMenuBase::DoAppend(wxMenuItem
*item
)
323 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Append()") );
325 m_items
.Append(item
);
326 item
->SetMenu((wxMenu
*)this);
327 if ( item
->IsSubMenu() )
329 AddSubMenu(item
->GetSubMenu());
335 wxMenuItem
* wxMenuBase::Insert(size_t pos
, wxMenuItem
*item
)
337 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Insert") );
339 if ( pos
== GetMenuItemCount() )
341 return DoAppend(item
);
345 wxCHECK_MSG( pos
< GetMenuItemCount(), FALSE
,
346 wxT("invalid index in wxMenu::Insert") );
348 return DoInsert(pos
, item
);
352 wxMenuItem
* wxMenuBase::DoInsert(size_t pos
, wxMenuItem
*item
)
354 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Insert()") );
356 wxMenuItemList::compatibility_iterator node
= m_items
.Item(pos
);
357 wxCHECK_MSG( node
, FALSE
, wxT("invalid index in wxMenu::Insert()") );
359 m_items
.Insert(node
, item
);
360 item
->SetMenu((wxMenu
*)this);
361 if ( item
->IsSubMenu() )
363 AddSubMenu(item
->GetSubMenu());
369 wxMenuItem
*wxMenuBase::Remove(wxMenuItem
*item
)
371 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Remove") );
373 return DoRemove(item
);
376 wxMenuItem
*wxMenuBase::DoRemove(wxMenuItem
*item
)
378 wxMenuItemList::compatibility_iterator node
= m_items
.Find(item
);
380 // if we get here, the item is valid or one of Remove() functions is broken
381 wxCHECK_MSG( node
, NULL
, wxT("bug in wxMenu::Remove logic") );
383 // we detach the item, but we do delete the list node (i.e. don't call
384 // DetachNode() here!)
387 // item isn't attached to anything any more
388 item
->SetMenu((wxMenu
*)NULL
);
389 wxMenu
*submenu
= item
->GetSubMenu();
392 submenu
->SetParent((wxMenu
*)NULL
);
398 bool wxMenuBase::Delete(wxMenuItem
*item
)
400 wxCHECK_MSG( item
, FALSE
, wxT("invalid item in wxMenu::Delete") );
402 return DoDelete(item
);
405 bool wxMenuBase::DoDelete(wxMenuItem
*item
)
407 wxMenuItem
*item2
= DoRemove(item
);
408 wxCHECK_MSG( item2
, FALSE
, wxT("failed to delete menu item") );
410 // don't delete the submenu
411 item2
->SetSubMenu((wxMenu
*)NULL
);
418 bool wxMenuBase::Destroy(wxMenuItem
*item
)
420 wxCHECK_MSG( item
, FALSE
, wxT("invalid item in wxMenu::Destroy") );
422 return DoDestroy(item
);
425 bool wxMenuBase::DoDestroy(wxMenuItem
*item
)
427 wxMenuItem
*item2
= DoRemove(item
);
428 wxCHECK_MSG( item2
, FALSE
, wxT("failed to delete menu item") );
435 // ----------------------------------------------------------------------------
436 // wxMenu searching for items
437 // ----------------------------------------------------------------------------
439 // Finds the item id matching the given string, -1 if not found.
440 int wxMenuBase::FindItem(const wxString
& text
) const
442 wxString label
= wxMenuItem::GetLabelFromText(text
);
443 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
445 node
= node
->GetNext() )
447 wxMenuItem
*item
= node
->GetData();
448 if ( item
->IsSubMenu() )
450 int rc
= item
->GetSubMenu()->FindItem(label
);
451 if ( rc
!= wxNOT_FOUND
)
455 // we execute this code for submenus as well to alllow finding them by
456 // name just like the ordinary items
457 if ( !item
->IsSeparator() )
459 if ( item
->GetLabel() == label
)
460 return item
->GetId();
467 // recursive search for item by id
468 wxMenuItem
*wxMenuBase::FindItem(int itemId
, wxMenu
**itemMenu
) const
473 wxMenuItem
*item
= NULL
;
474 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
476 node
= node
->GetNext() )
478 item
= node
->GetData();
480 if ( item
->GetId() == itemId
)
483 *itemMenu
= (wxMenu
*)this;
485 else if ( item
->IsSubMenu() )
487 item
= item
->GetSubMenu()->FindItem(itemId
, itemMenu
);
491 // don't exit the loop
499 // non recursive search
500 wxMenuItem
*wxMenuBase::FindChildItem(int id
, size_t *ppos
) const
502 wxMenuItem
*item
= (wxMenuItem
*)NULL
;
503 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
506 for ( pos
= 0; node
; pos
++ )
508 if ( node
->GetData()->GetId() == id
)
510 item
= node
->GetData();
515 node
= node
->GetNext();
520 *ppos
= item
? pos
: (size_t)wxNOT_FOUND
;
527 wxMenuItem
* wxMenuBase::FindItemByPosition(size_t position
) const
529 wxCHECK_MSG( position
< m_items
.GetCount(), NULL
,
530 _T("wxMenu::FindItemByPosition(): invalid menu index") );
532 return m_items
.Item( position
)->GetData();
535 // ----------------------------------------------------------------------------
536 // wxMenu helpers used by derived classes
537 // ----------------------------------------------------------------------------
539 // Update a menu and all submenus recursively. source is the object that has
540 // the update event handlers defined for it. If NULL, the menu or associated
541 // window will be used.
542 void wxMenuBase::UpdateUI(wxEvtHandler
* source
)
544 if (GetInvokingWindow())
546 // Don't update menus if the parent
547 // frame is about to get deleted
548 wxWindow
*tlw
= wxGetTopLevelParent( GetInvokingWindow() );
549 if (tlw
&& wxPendingDelete
.Member(tlw
))
553 if ( !source
&& GetInvokingWindow() )
554 source
= GetInvokingWindow()->GetEventHandler();
556 source
= GetEventHandler();
560 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
563 wxMenuItem
* item
= node
->GetData();
564 if ( !item
->IsSeparator() )
566 wxWindowID id
= item
->GetId();
567 wxUpdateUIEvent
event(id
);
568 event
.SetEventObject( source
);
570 if ( source
->ProcessEvent(event
) )
572 // if anything changed, update the changed attribute
573 if (event
.GetSetText())
574 SetLabel(id
, event
.GetText());
575 if (event
.GetSetChecked())
576 Check(id
, event
.GetChecked());
577 if (event
.GetSetEnabled())
578 Enable(id
, event
.GetEnabled());
581 // recurse to the submenus
582 if ( item
->GetSubMenu() )
583 item
->GetSubMenu()->UpdateUI(source
);
585 //else: item is a separator (which doesn't process update UI events)
587 node
= node
->GetNext();
591 bool wxMenuBase::SendEvent(int id
, int checked
)
593 wxCommandEvent
event(wxEVT_COMMAND_MENU_SELECTED
, id
);
594 event
.SetEventObject(this);
595 event
.SetInt(checked
);
597 bool processed
= FALSE
;
599 // Try the menu's event handler
602 wxEvtHandler
*handler
= GetEventHandler();
604 processed
= handler
->ProcessEvent(event
);
607 // Try the window the menu was popped up from (and up through the
611 const wxMenuBase
*menu
= this;
614 wxWindow
*win
= menu
->GetInvokingWindow();
617 processed
= win
->GetEventHandler()->ProcessEvent(event
);
621 menu
= menu
->GetParent();
628 // ----------------------------------------------------------------------------
629 // wxMenu attaching/detaching to/from menu bar
630 // ----------------------------------------------------------------------------
632 void wxMenuBase::Attach(wxMenuBarBase
*menubar
)
634 // use Detach() instead!
635 wxASSERT_MSG( menubar
, _T("menu can't be attached to NULL menubar") );
637 // use IsAttached() to prevent this from happening
638 wxASSERT_MSG( !m_menuBar
, _T("attaching menu twice?") );
640 m_menuBar
= (wxMenuBar
*)menubar
;
643 void wxMenuBase::Detach()
645 // use IsAttached() to prevent this from happening
646 wxASSERT_MSG( m_menuBar
, _T("detaching unattached menu?") );
651 // ----------------------------------------------------------------------------
652 // wxMenu functions forwarded to wxMenuItem
653 // ----------------------------------------------------------------------------
655 void wxMenuBase::Enable( int id
, bool enable
)
657 wxMenuItem
*item
= FindItem(id
);
659 wxCHECK_RET( item
, wxT("wxMenu::Enable: no such item") );
661 item
->Enable(enable
);
664 bool wxMenuBase::IsEnabled( int id
) const
666 wxMenuItem
*item
= FindItem(id
);
668 wxCHECK_MSG( item
, FALSE
, wxT("wxMenu::IsEnabled: no such item") );
670 return item
->IsEnabled();
673 void wxMenuBase::Check( int id
, bool enable
)
675 wxMenuItem
*item
= FindItem(id
);
677 wxCHECK_RET( item
, wxT("wxMenu::Check: no such item") );
682 bool wxMenuBase::IsChecked( int id
) const
684 wxMenuItem
*item
= FindItem(id
);
686 wxCHECK_MSG( item
, FALSE
, wxT("wxMenu::IsChecked: no such item") );
688 return item
->IsChecked();
691 void wxMenuBase::SetLabel( int id
, const wxString
&label
)
693 wxMenuItem
*item
= FindItem(id
);
695 wxCHECK_RET( item
, wxT("wxMenu::SetLabel: no such item") );
697 item
->SetText(label
);
700 wxString
wxMenuBase::GetLabel( int id
) const
702 wxMenuItem
*item
= FindItem(id
);
704 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetLabel: no such item") );
706 return item
->GetText();
709 void wxMenuBase::SetHelpString( int id
, const wxString
& helpString
)
711 wxMenuItem
*item
= FindItem(id
);
713 wxCHECK_RET( item
, wxT("wxMenu::SetHelpString: no such item") );
715 item
->SetHelp( helpString
);
718 wxString
wxMenuBase::GetHelpString( int id
) const
720 wxMenuItem
*item
= FindItem(id
);
722 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
724 return item
->GetHelp();
727 // ----------------------------------------------------------------------------
728 // wxMenuBarBase ctor and dtor
729 // ----------------------------------------------------------------------------
731 wxMenuBarBase::wxMenuBarBase()
734 m_menuBarFrame
= NULL
;
737 wxMenuBarBase::~wxMenuBarBase()
739 WX_CLEAR_LIST(wxMenuList
, m_menus
);
742 // ----------------------------------------------------------------------------
743 // wxMenuBar item access: the base class versions manage m_menus list, the
744 // derived class should reflect the changes in the real menubar
745 // ----------------------------------------------------------------------------
747 wxMenu
*wxMenuBarBase::GetMenu(size_t pos
) const
749 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
750 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::GetMenu()") );
752 return node
->GetData();
755 bool wxMenuBarBase::Append(wxMenu
*menu
, const wxString
& WXUNUSED(title
))
757 wxCHECK_MSG( menu
, FALSE
, wxT("can't append NULL menu") );
759 m_menus
.Append(menu
);
765 bool wxMenuBarBase::Insert(size_t pos
, wxMenu
*menu
,
766 const wxString
& title
)
768 if ( pos
== m_menus
.GetCount() )
770 return wxMenuBarBase::Append(menu
, title
);
772 else // not at the end
774 wxCHECK_MSG( menu
, FALSE
, wxT("can't insert NULL menu") );
776 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
777 wxCHECK_MSG( node
, FALSE
, wxT("bad index in wxMenuBar::Insert()") );
779 m_menus
.Insert(node
, menu
);
786 wxMenu
*wxMenuBarBase::Replace(size_t pos
, wxMenu
*menu
,
787 const wxString
& WXUNUSED(title
))
789 wxCHECK_MSG( menu
, NULL
, wxT("can't insert NULL menu") );
791 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
792 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Replace()") );
794 wxMenu
*menuOld
= node
->GetData();
803 wxMenu
*wxMenuBarBase::Remove(size_t pos
)
805 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
806 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Remove()") );
808 wxMenu
*menu
= node
->GetData();
815 int wxMenuBarBase::FindMenu(const wxString
& title
) const
817 wxString label
= wxMenuItem::GetLabelFromText(title
);
819 size_t count
= GetMenuCount();
820 for ( size_t i
= 0; i
< count
; i
++ )
822 wxString title2
= GetLabelTop(i
);
823 if ( (title2
== title
) ||
824 (wxMenuItem::GetLabelFromText(title2
) == label
) )
835 // ----------------------------------------------------------------------------
836 // wxMenuBar attaching/detaching to/from the frame
837 // ----------------------------------------------------------------------------
839 void wxMenuBarBase::Attach(wxFrame
*frame
)
841 wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
843 m_menuBarFrame
= frame
;
846 void wxMenuBarBase::Detach()
848 wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
850 m_menuBarFrame
= NULL
;
853 // ----------------------------------------------------------------------------
854 // wxMenuBar searching for items
855 // ----------------------------------------------------------------------------
857 wxMenuItem
*wxMenuBarBase::FindItem(int id
, wxMenu
**menu
) const
862 wxMenuItem
*item
= NULL
;
863 size_t count
= GetMenuCount(), i
;
864 wxMenuList::const_iterator it
;
865 for ( i
= 0, it
= m_menus
.begin(); !item
&& (i
< count
); i
++, it
++ )
867 item
= (*it
)->FindItem(id
, menu
);
873 int wxMenuBarBase::FindMenuItem(const wxString
& menu
, const wxString
& item
) const
875 wxString label
= wxMenuItem::GetLabelFromText(menu
);
878 wxMenuList::compatibility_iterator node
;
879 for ( node
= m_menus
.GetFirst(); node
; node
= node
->GetNext(), i
++ )
881 if ( label
== wxMenuItem::GetLabelFromText(GetLabelTop(i
)) )
882 return node
->GetData()->FindItem(item
);
888 // ---------------------------------------------------------------------------
889 // wxMenuBar functions forwarded to wxMenuItem
890 // ---------------------------------------------------------------------------
892 void wxMenuBarBase::Enable(int id
, bool enable
)
894 wxMenuItem
*item
= FindItem(id
);
896 wxCHECK_RET( item
, wxT("attempt to enable an item which doesn't exist") );
898 item
->Enable(enable
);
901 void wxMenuBarBase::Check(int id
, bool check
)
903 wxMenuItem
*item
= FindItem(id
);
905 wxCHECK_RET( item
, wxT("attempt to check an item which doesn't exist") );
906 wxCHECK_RET( item
->IsCheckable(), wxT("attempt to check an uncheckable item") );
911 bool wxMenuBarBase::IsChecked(int id
) const
913 wxMenuItem
*item
= FindItem(id
);
915 wxCHECK_MSG( item
, FALSE
, wxT("wxMenuBar::IsChecked(): no such item") );
917 return item
->IsChecked();
920 bool wxMenuBarBase::IsEnabled(int id
) const
922 wxMenuItem
*item
= FindItem(id
);
924 wxCHECK_MSG( item
, FALSE
, wxT("wxMenuBar::IsEnabled(): no such item") );
926 return item
->IsEnabled();
929 void wxMenuBarBase::SetLabel(int id
, const wxString
& label
)
931 wxMenuItem
*item
= FindItem(id
);
933 wxCHECK_RET( item
, wxT("wxMenuBar::SetLabel(): no such item") );
935 item
->SetText(label
);
938 wxString
wxMenuBarBase::GetLabel(int id
) const
940 wxMenuItem
*item
= FindItem(id
);
942 wxCHECK_MSG( item
, wxEmptyString
,
943 wxT("wxMenuBar::GetLabel(): no such item") );
945 return item
->GetText();
948 void wxMenuBarBase::SetHelpString(int id
, const wxString
& helpString
)
950 wxMenuItem
*item
= FindItem(id
);
952 wxCHECK_RET( item
, wxT("wxMenuBar::SetHelpString(): no such item") );
954 item
->SetHelp(helpString
);
957 wxString
wxMenuBarBase::GetHelpString(int id
) const
959 wxMenuItem
*item
= FindItem(id
);
961 wxCHECK_MSG( item
, wxEmptyString
,
962 wxT("wxMenuBar::GetHelpString(): no such item") );
964 return item
->GetHelp();
967 #endif // wxUSE_MENUS