1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: common/menucmn.cpp
3 // Purpose: wxMenu and wxMenuBar methods common to all ports
4 // Author: Vadim Zeitlin
8 // Copyright: (c) wxWidgets 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") );
313 submenu
->SetParent((wxMenu
*)this);
316 wxMenuItem
* wxMenuBase::DoAppend(wxMenuItem
*item
)
318 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Append()") );
320 m_items
.Append(item
);
321 item
->SetMenu((wxMenu
*)this);
322 if ( item
->IsSubMenu() )
324 AddSubMenu(item
->GetSubMenu());
330 wxMenuItem
* wxMenuBase::Insert(size_t pos
, wxMenuItem
*item
)
332 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Insert") );
334 if ( pos
== GetMenuItemCount() )
336 return DoAppend(item
);
340 wxCHECK_MSG( pos
< GetMenuItemCount(), NULL
,
341 wxT("invalid index in wxMenu::Insert") );
343 return DoInsert(pos
, item
);
347 wxMenuItem
* wxMenuBase::DoInsert(size_t pos
, wxMenuItem
*item
)
349 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Insert()") );
351 wxMenuItemList::compatibility_iterator node
= m_items
.Item(pos
);
352 wxCHECK_MSG( node
, NULL
, wxT("invalid index in wxMenu::Insert()") );
354 m_items
.Insert(node
, item
);
355 item
->SetMenu((wxMenu
*)this);
356 if ( item
->IsSubMenu() )
358 AddSubMenu(item
->GetSubMenu());
364 wxMenuItem
*wxMenuBase::Remove(wxMenuItem
*item
)
366 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Remove") );
368 return DoRemove(item
);
371 wxMenuItem
*wxMenuBase::DoRemove(wxMenuItem
*item
)
373 wxMenuItemList::compatibility_iterator node
= m_items
.Find(item
);
375 // if we get here, the item is valid or one of Remove() functions is broken
376 wxCHECK_MSG( node
, NULL
, wxT("bug in wxMenu::Remove logic") );
378 // we detach the item, but we do delete the list node (i.e. don't call
379 // DetachNode() here!)
382 // item isn't attached to anything any more
383 item
->SetMenu((wxMenu
*)NULL
);
384 wxMenu
*submenu
= item
->GetSubMenu();
387 submenu
->SetParent((wxMenu
*)NULL
);
388 if ( submenu
->IsAttached() )
395 bool wxMenuBase::Delete(wxMenuItem
*item
)
397 wxCHECK_MSG( item
, false, wxT("invalid item in wxMenu::Delete") );
399 return DoDelete(item
);
402 bool wxMenuBase::DoDelete(wxMenuItem
*item
)
404 wxMenuItem
*item2
= DoRemove(item
);
405 wxCHECK_MSG( item2
, false, wxT("failed to delete menu item") );
407 // don't delete the submenu
408 item2
->SetSubMenu((wxMenu
*)NULL
);
415 bool wxMenuBase::Destroy(wxMenuItem
*item
)
417 wxCHECK_MSG( item
, false, wxT("invalid item in wxMenu::Destroy") );
419 return DoDestroy(item
);
422 bool wxMenuBase::DoDestroy(wxMenuItem
*item
)
424 wxMenuItem
*item2
= DoRemove(item
);
425 wxCHECK_MSG( item2
, false, wxT("failed to delete menu item") );
432 // ----------------------------------------------------------------------------
433 // wxMenu searching for items
434 // ----------------------------------------------------------------------------
436 // Finds the item id matching the given string, wxNOT_FOUND if not found.
437 int wxMenuBase::FindItem(const wxString
& text
) const
439 wxString label
= wxMenuItem::GetLabelFromText(text
);
440 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
442 node
= node
->GetNext() )
444 wxMenuItem
*item
= node
->GetData();
445 if ( item
->IsSubMenu() )
447 int rc
= item
->GetSubMenu()->FindItem(label
);
448 if ( rc
!= wxNOT_FOUND
)
452 // we execute this code for submenus as well to alllow finding them by
453 // name just like the ordinary items
454 if ( !item
->IsSeparator() )
456 if ( item
->GetLabel() == label
)
457 return item
->GetId();
464 // recursive search for item by id
465 wxMenuItem
*wxMenuBase::FindItem(int itemId
, wxMenu
**itemMenu
) const
470 wxMenuItem
*item
= NULL
;
471 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
473 node
= node
->GetNext() )
475 item
= node
->GetData();
477 if ( item
->GetId() == itemId
)
480 *itemMenu
= (wxMenu
*)this;
482 else if ( item
->IsSubMenu() )
484 item
= item
->GetSubMenu()->FindItem(itemId
, itemMenu
);
488 // don't exit the loop
496 // non recursive search
497 wxMenuItem
*wxMenuBase::FindChildItem(int id
, size_t *ppos
) const
499 wxMenuItem
*item
= (wxMenuItem
*)NULL
;
500 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
503 for ( pos
= 0; node
; pos
++ )
505 if ( node
->GetData()->GetId() == id
)
507 item
= node
->GetData();
512 node
= node
->GetNext();
517 *ppos
= item
? pos
: (size_t)wxNOT_FOUND
;
524 wxMenuItem
* wxMenuBase::FindItemByPosition(size_t position
) const
526 wxCHECK_MSG( position
< m_items
.GetCount(), NULL
,
527 _T("wxMenu::FindItemByPosition(): invalid menu index") );
529 return m_items
.Item( position
)->GetData();
532 // ----------------------------------------------------------------------------
533 // wxMenu helpers used by derived classes
534 // ----------------------------------------------------------------------------
536 // Update a menu and all submenus recursively. source is the object that has
537 // the update event handlers defined for it. If NULL, the menu or associated
538 // window will be used.
539 void wxMenuBase::UpdateUI(wxEvtHandler
* source
)
541 if (GetInvokingWindow())
543 // Don't update menus if the parent
544 // frame is about to get deleted
545 wxWindow
*tlw
= wxGetTopLevelParent( GetInvokingWindow() );
546 if (tlw
&& wxPendingDelete
.Member(tlw
))
550 if ( !source
&& GetInvokingWindow() )
551 source
= GetInvokingWindow()->GetEventHandler();
553 source
= GetEventHandler();
557 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
560 wxMenuItem
* item
= node
->GetData();
561 if ( !item
->IsSeparator() )
563 wxWindowID id
= item
->GetId();
564 wxUpdateUIEvent
event(id
);
565 event
.SetEventObject( source
);
567 if ( source
->ProcessEvent(event
) )
569 // if anything changed, update the changed attribute
570 if (event
.GetSetText())
571 SetLabel(id
, event
.GetText());
572 if (event
.GetSetChecked())
573 Check(id
, event
.GetChecked());
574 if (event
.GetSetEnabled())
575 Enable(id
, event
.GetEnabled());
578 // recurse to the submenus
579 if ( item
->GetSubMenu() )
580 item
->GetSubMenu()->UpdateUI(source
);
582 //else: item is a separator (which doesn't process update UI events)
584 node
= node
->GetNext();
588 bool wxMenuBase::SendEvent(int id
, int checked
)
590 wxCommandEvent
event(wxEVT_COMMAND_MENU_SELECTED
, id
);
591 event
.SetEventObject(this);
592 event
.SetInt(checked
);
594 bool processed
= false;
596 // Try the menu's event handler
599 wxEvtHandler
*handler
= GetEventHandler();
601 processed
= handler
->ProcessEvent(event
);
604 // Try the window the menu was popped up from (and up through the
608 const wxMenuBase
*menu
= this;
611 wxWindow
*win
= menu
->GetInvokingWindow();
614 processed
= win
->GetEventHandler()->ProcessEvent(event
);
618 menu
= menu
->GetParent();
625 // ----------------------------------------------------------------------------
626 // wxMenu attaching/detaching to/from menu bar
627 // ----------------------------------------------------------------------------
629 wxMenuBar
* wxMenuBase::GetMenuBar() const
632 return GetParent()->GetMenuBar();
636 void wxMenuBase::Attach(wxMenuBarBase
*menubar
)
638 // use Detach() instead!
639 wxASSERT_MSG( menubar
, _T("menu can't be attached to NULL menubar") );
641 // use IsAttached() to prevent this from happening
642 wxASSERT_MSG( !m_menuBar
, _T("attaching menu twice?") );
644 m_menuBar
= (wxMenuBar
*)menubar
;
647 void wxMenuBase::Detach()
649 // use IsAttached() to prevent this from happening
650 wxASSERT_MSG( m_menuBar
, _T("detaching unattached menu?") );
655 // ----------------------------------------------------------------------------
656 // wxMenu functions forwarded to wxMenuItem
657 // ----------------------------------------------------------------------------
659 void wxMenuBase::Enable( int id
, bool enable
)
661 wxMenuItem
*item
= FindItem(id
);
663 wxCHECK_RET( item
, wxT("wxMenu::Enable: no such item") );
665 item
->Enable(enable
);
668 bool wxMenuBase::IsEnabled( int id
) const
670 wxMenuItem
*item
= FindItem(id
);
672 wxCHECK_MSG( item
, false, wxT("wxMenu::IsEnabled: no such item") );
674 return item
->IsEnabled();
677 void wxMenuBase::Check( int id
, bool enable
)
679 wxMenuItem
*item
= FindItem(id
);
681 wxCHECK_RET( item
, wxT("wxMenu::Check: no such item") );
686 bool wxMenuBase::IsChecked( int id
) const
688 wxMenuItem
*item
= FindItem(id
);
690 wxCHECK_MSG( item
, false, wxT("wxMenu::IsChecked: no such item") );
692 return item
->IsChecked();
695 void wxMenuBase::SetLabel( int id
, const wxString
&label
)
697 wxMenuItem
*item
= FindItem(id
);
699 wxCHECK_RET( item
, wxT("wxMenu::SetLabel: no such item") );
701 item
->SetText(label
);
704 wxString
wxMenuBase::GetLabel( int id
) const
706 wxMenuItem
*item
= FindItem(id
);
708 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetLabel: no such item") );
710 return item
->GetText();
713 void wxMenuBase::SetHelpString( int id
, const wxString
& helpString
)
715 wxMenuItem
*item
= FindItem(id
);
717 wxCHECK_RET( item
, wxT("wxMenu::SetHelpString: no such item") );
719 item
->SetHelp( helpString
);
722 wxString
wxMenuBase::GetHelpString( int id
) const
724 wxMenuItem
*item
= FindItem(id
);
726 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
728 return item
->GetHelp();
731 // ----------------------------------------------------------------------------
732 // wxMenuBarBase ctor and dtor
733 // ----------------------------------------------------------------------------
735 wxMenuBarBase::wxMenuBarBase()
738 m_menuBarFrame
= NULL
;
741 wxMenuBarBase::~wxMenuBarBase()
743 WX_CLEAR_LIST(wxMenuList
, m_menus
);
746 // ----------------------------------------------------------------------------
747 // wxMenuBar item access: the base class versions manage m_menus list, the
748 // derived class should reflect the changes in the real menubar
749 // ----------------------------------------------------------------------------
751 wxMenu
*wxMenuBarBase::GetMenu(size_t pos
) const
753 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
754 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::GetMenu()") );
756 return node
->GetData();
759 bool wxMenuBarBase::Append(wxMenu
*menu
, const wxString
& WXUNUSED(title
))
761 wxCHECK_MSG( menu
, false, wxT("can't append NULL menu") );
763 m_menus
.Append(menu
);
769 bool wxMenuBarBase::Insert(size_t pos
, wxMenu
*menu
,
770 const wxString
& title
)
772 if ( pos
== m_menus
.GetCount() )
774 return wxMenuBarBase::Append(menu
, title
);
776 else // not at the end
778 wxCHECK_MSG( menu
, false, wxT("can't insert NULL menu") );
780 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
781 wxCHECK_MSG( node
, false, wxT("bad index in wxMenuBar::Insert()") );
783 m_menus
.Insert(node
, menu
);
790 wxMenu
*wxMenuBarBase::Replace(size_t pos
, wxMenu
*menu
,
791 const wxString
& WXUNUSED(title
))
793 wxCHECK_MSG( menu
, NULL
, wxT("can't insert NULL menu") );
795 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
796 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Replace()") );
798 wxMenu
*menuOld
= node
->GetData();
807 wxMenu
*wxMenuBarBase::Remove(size_t pos
)
809 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
810 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Remove()") );
812 wxMenu
*menu
= node
->GetData();
819 int wxMenuBarBase::FindMenu(const wxString
& title
) const
821 wxString label
= wxMenuItem::GetLabelFromText(title
);
823 size_t count
= GetMenuCount();
824 for ( size_t i
= 0; i
< count
; i
++ )
826 wxString title2
= GetLabelTop(i
);
827 if ( (title2
== title
) ||
828 (wxMenuItem::GetLabelFromText(title2
) == label
) )
839 // ----------------------------------------------------------------------------
840 // wxMenuBar attaching/detaching to/from the frame
841 // ----------------------------------------------------------------------------
843 void wxMenuBarBase::Attach(wxFrame
*frame
)
845 wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
847 m_menuBarFrame
= frame
;
850 void wxMenuBarBase::Detach()
852 wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
854 m_menuBarFrame
= NULL
;
857 // ----------------------------------------------------------------------------
858 // wxMenuBar searching for items
859 // ----------------------------------------------------------------------------
861 wxMenuItem
*wxMenuBarBase::FindItem(int id
, wxMenu
**menu
) const
866 wxMenuItem
*item
= NULL
;
867 size_t count
= GetMenuCount(), i
;
868 wxMenuList::const_iterator it
;
869 for ( i
= 0, it
= m_menus
.begin(); !item
&& (i
< count
); i
++, it
++ )
871 item
= (*it
)->FindItem(id
, menu
);
877 int wxMenuBarBase::FindMenuItem(const wxString
& menu
, const wxString
& item
) const
879 wxString label
= wxMenuItem::GetLabelFromText(menu
);
882 wxMenuList::compatibility_iterator node
;
883 for ( node
= m_menus
.GetFirst(); node
; node
= node
->GetNext(), i
++ )
885 if ( label
== wxMenuItem::GetLabelFromText(GetLabelTop(i
)) )
886 return node
->GetData()->FindItem(item
);
892 // ---------------------------------------------------------------------------
893 // wxMenuBar functions forwarded to wxMenuItem
894 // ---------------------------------------------------------------------------
896 void wxMenuBarBase::Enable(int id
, bool enable
)
898 wxMenuItem
*item
= FindItem(id
);
900 wxCHECK_RET( item
, wxT("attempt to enable an item which doesn't exist") );
902 item
->Enable(enable
);
905 void wxMenuBarBase::Check(int id
, bool check
)
907 wxMenuItem
*item
= FindItem(id
);
909 wxCHECK_RET( item
, wxT("attempt to check an item which doesn't exist") );
910 wxCHECK_RET( item
->IsCheckable(), wxT("attempt to check an uncheckable item") );
915 bool wxMenuBarBase::IsChecked(int id
) const
917 wxMenuItem
*item
= FindItem(id
);
919 wxCHECK_MSG( item
, false, wxT("wxMenuBar::IsChecked(): no such item") );
921 return item
->IsChecked();
924 bool wxMenuBarBase::IsEnabled(int id
) const
926 wxMenuItem
*item
= FindItem(id
);
928 wxCHECK_MSG( item
, false, wxT("wxMenuBar::IsEnabled(): no such item") );
930 return item
->IsEnabled();
933 void wxMenuBarBase::SetLabel(int id
, const wxString
& label
)
935 wxMenuItem
*item
= FindItem(id
);
937 wxCHECK_RET( item
, wxT("wxMenuBar::SetLabel(): no such item") );
939 item
->SetText(label
);
942 wxString
wxMenuBarBase::GetLabel(int id
) const
944 wxMenuItem
*item
= FindItem(id
);
946 wxCHECK_MSG( item
, wxEmptyString
,
947 wxT("wxMenuBar::GetLabel(): no such item") );
949 return item
->GetText();
952 void wxMenuBarBase::SetHelpString(int id
, const wxString
& helpString
)
954 wxMenuItem
*item
= FindItem(id
);
956 wxCHECK_RET( item
, wxT("wxMenuBar::SetHelpString(): no such item") );
958 item
->SetHelp(helpString
);
961 wxString
wxMenuBarBase::GetHelpString(int id
) const
963 wxMenuItem
*item
= FindItem(id
);
965 wxCHECK_MSG( item
, wxEmptyString
,
966 wxT("wxMenuBar::GetHelpString(): no such item") );
968 return item
->GetHelp();
971 #endif // wxUSE_MENUS