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."),
216 // we do have something
217 return new wxAcceleratorEntry(accelFlags
, keyCode
);
221 return (wxAcceleratorEntry
*)NULL
;
224 wxAcceleratorEntry
*wxMenuItemBase::GetAccel() const
226 return wxGetAccelFromString(GetText());
229 void wxMenuItemBase::SetAccel(wxAcceleratorEntry
*accel
)
231 wxString text
= m_text
.BeforeFirst(wxT('\t'));
236 int flags
= accel
->GetFlags();
237 if ( flags
& wxACCEL_ALT
)
239 if ( flags
& wxACCEL_CTRL
)
240 text
+= wxT("Ctrl-");
241 if ( flags
& wxACCEL_SHIFT
)
242 text
+= wxT("Shift-");
244 int code
= accel
->GetKeyCode();
259 text
<< wxT('F') << code
- WXK_F1
+ 1;
262 // if there are any other keys wxGetAccelFromString() may return,
263 // we should process them here
266 if ( wxIsalnum(code
) )
268 text
<< (wxChar
)code
;
273 wxFAIL_MSG( wxT("unknown keyboard accel") );
280 #endif // wxUSE_ACCEL
282 bool wxMenuBase::ms_locked
= true;
284 // ----------------------------------------------------------------------------
285 // wxMenu ctor and dtor
286 // ----------------------------------------------------------------------------
288 void wxMenuBase::Init(long style
)
290 m_menuBar
= (wxMenuBar
*)NULL
;
291 m_menuParent
= (wxMenu
*)NULL
;
293 m_invokingWindow
= (wxWindow
*)NULL
;
295 m_clientData
= (void *)NULL
;
296 m_eventHandler
= this;
299 wxMenuBase::~wxMenuBase()
301 WX_CLEAR_LIST(wxMenuItemList
, m_items
);
303 // Actually, in GTK, the submenus have to get deleted first.
306 // ----------------------------------------------------------------------------
307 // wxMenu item adding/removing
308 // ----------------------------------------------------------------------------
310 void wxMenuBase::AddSubMenu(wxMenu
*submenu
)
312 wxCHECK_RET( submenu
, _T("can't add a NULL submenu") );
314 submenu
->SetParent((wxMenu
*)this);
317 wxMenuItem
* wxMenuBase::DoAppend(wxMenuItem
*item
)
319 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Append()") );
321 m_items
.Append(item
);
322 item
->SetMenu((wxMenu
*)this);
323 if ( item
->IsSubMenu() )
325 AddSubMenu(item
->GetSubMenu());
331 wxMenuItem
* wxMenuBase::Insert(size_t pos
, wxMenuItem
*item
)
333 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Insert") );
335 if ( pos
== GetMenuItemCount() )
337 return DoAppend(item
);
341 wxCHECK_MSG( pos
< GetMenuItemCount(), NULL
,
342 wxT("invalid index in wxMenu::Insert") );
344 return DoInsert(pos
, item
);
348 wxMenuItem
* wxMenuBase::DoInsert(size_t pos
, wxMenuItem
*item
)
350 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Insert()") );
352 wxMenuItemList::compatibility_iterator node
= m_items
.Item(pos
);
353 wxCHECK_MSG( node
, NULL
, wxT("invalid index in wxMenu::Insert()") );
355 m_items
.Insert(node
, item
);
356 item
->SetMenu((wxMenu
*)this);
357 if ( item
->IsSubMenu() )
359 AddSubMenu(item
->GetSubMenu());
365 wxMenuItem
*wxMenuBase::Remove(wxMenuItem
*item
)
367 wxCHECK_MSG( item
, NULL
, wxT("invalid item in wxMenu::Remove") );
369 return DoRemove(item
);
372 wxMenuItem
*wxMenuBase::DoRemove(wxMenuItem
*item
)
374 wxMenuItemList::compatibility_iterator node
= m_items
.Find(item
);
376 // if we get here, the item is valid or one of Remove() functions is broken
377 wxCHECK_MSG( node
, NULL
, wxT("bug in wxMenu::Remove logic") );
379 // we detach the item, but we do delete the list node (i.e. don't call
380 // DetachNode() here!)
383 // item isn't attached to anything any more
384 item
->SetMenu((wxMenu
*)NULL
);
385 wxMenu
*submenu
= item
->GetSubMenu();
388 submenu
->SetParent((wxMenu
*)NULL
);
389 if ( submenu
->IsAttached() )
396 bool wxMenuBase::Delete(wxMenuItem
*item
)
398 wxCHECK_MSG( item
, false, wxT("invalid item in wxMenu::Delete") );
400 return DoDelete(item
);
403 bool wxMenuBase::DoDelete(wxMenuItem
*item
)
405 wxMenuItem
*item2
= DoRemove(item
);
406 wxCHECK_MSG( item2
, false, wxT("failed to delete menu item") );
408 // don't delete the submenu
409 item2
->SetSubMenu((wxMenu
*)NULL
);
416 bool wxMenuBase::Destroy(wxMenuItem
*item
)
418 wxCHECK_MSG( item
, false, wxT("invalid item in wxMenu::Destroy") );
420 return DoDestroy(item
);
423 bool wxMenuBase::DoDestroy(wxMenuItem
*item
)
425 wxMenuItem
*item2
= DoRemove(item
);
426 wxCHECK_MSG( item2
, false, wxT("failed to delete menu item") );
433 // ----------------------------------------------------------------------------
434 // wxMenu searching for items
435 // ----------------------------------------------------------------------------
437 // Finds the item id matching the given string, wxNOT_FOUND if not found.
438 int wxMenuBase::FindItem(const wxString
& text
) const
440 wxString label
= wxMenuItem::GetLabelFromText(text
);
441 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
443 node
= node
->GetNext() )
445 wxMenuItem
*item
= node
->GetData();
446 if ( item
->IsSubMenu() )
448 int rc
= item
->GetSubMenu()->FindItem(label
);
449 if ( rc
!= wxNOT_FOUND
)
453 // we execute this code for submenus as well to alllow finding them by
454 // name just like the ordinary items
455 if ( !item
->IsSeparator() )
457 if ( item
->GetLabel() == label
)
458 return item
->GetId();
465 // recursive search for item by id
466 wxMenuItem
*wxMenuBase::FindItem(int itemId
, wxMenu
**itemMenu
) const
471 wxMenuItem
*item
= NULL
;
472 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
474 node
= node
->GetNext() )
476 item
= node
->GetData();
478 if ( item
->GetId() == itemId
)
481 *itemMenu
= (wxMenu
*)this;
483 else if ( item
->IsSubMenu() )
485 item
= item
->GetSubMenu()->FindItem(itemId
, itemMenu
);
489 // don't exit the loop
497 // non recursive search
498 wxMenuItem
*wxMenuBase::FindChildItem(int id
, size_t *ppos
) const
500 wxMenuItem
*item
= (wxMenuItem
*)NULL
;
501 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
504 for ( pos
= 0; node
; pos
++ )
506 if ( node
->GetData()->GetId() == id
)
508 item
= node
->GetData();
513 node
= node
->GetNext();
518 *ppos
= item
? pos
: (size_t)wxNOT_FOUND
;
525 wxMenuItem
* wxMenuBase::FindItemByPosition(size_t position
) const
527 wxCHECK_MSG( position
< m_items
.GetCount(), NULL
,
528 _T("wxMenu::FindItemByPosition(): invalid menu index") );
530 return m_items
.Item( position
)->GetData();
533 // ----------------------------------------------------------------------------
534 // wxMenu helpers used by derived classes
535 // ----------------------------------------------------------------------------
537 // Update a menu and all submenus recursively. source is the object that has
538 // the update event handlers defined for it. If NULL, the menu or associated
539 // window will be used.
540 void wxMenuBase::UpdateUI(wxEvtHandler
* source
)
542 if (GetInvokingWindow())
544 // Don't update menus if the parent
545 // frame is about to get deleted
546 wxWindow
*tlw
= wxGetTopLevelParent( GetInvokingWindow() );
547 if (tlw
&& wxPendingDelete
.Member(tlw
))
551 if ( !source
&& GetInvokingWindow() )
552 source
= GetInvokingWindow()->GetEventHandler();
554 source
= GetEventHandler();
558 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
561 wxMenuItem
* item
= node
->GetData();
562 if ( !item
->IsSeparator() )
564 wxWindowID id
= item
->GetId();
565 wxUpdateUIEvent
event(id
);
566 event
.SetEventObject( source
);
568 if ( source
->ProcessEvent(event
) )
570 // if anything changed, update the changed attribute
571 if (event
.GetSetText())
572 SetLabel(id
, event
.GetText());
573 if (event
.GetSetChecked())
574 Check(id
, event
.GetChecked());
575 if (event
.GetSetEnabled())
576 Enable(id
, event
.GetEnabled());
579 // recurse to the submenus
580 if ( item
->GetSubMenu() )
581 item
->GetSubMenu()->UpdateUI(source
);
583 //else: item is a separator (which doesn't process update UI events)
585 node
= node
->GetNext();
589 bool wxMenuBase::SendEvent(int id
, int checked
)
591 wxCommandEvent
event(wxEVT_COMMAND_MENU_SELECTED
, id
);
592 event
.SetEventObject(this);
593 event
.SetInt(checked
);
595 bool processed
= false;
597 // Try the menu's event handler
600 wxEvtHandler
*handler
= GetEventHandler();
602 processed
= handler
->ProcessEvent(event
);
605 // Try the window the menu was popped up from (and up through the
609 const wxMenuBase
*menu
= this;
612 wxWindow
*win
= menu
->GetInvokingWindow();
615 processed
= win
->GetEventHandler()->ProcessEvent(event
);
619 menu
= menu
->GetParent();
626 // ----------------------------------------------------------------------------
627 // wxMenu attaching/detaching to/from menu bar
628 // ----------------------------------------------------------------------------
630 wxMenuBar
* wxMenuBase::GetMenuBar() const
633 return GetParent()->GetMenuBar();
637 void wxMenuBase::Attach(wxMenuBarBase
*menubar
)
639 // use Detach() instead!
640 wxASSERT_MSG( menubar
, _T("menu can't be attached to NULL menubar") );
642 // use IsAttached() to prevent this from happening
643 wxASSERT_MSG( !m_menuBar
, _T("attaching menu twice?") );
645 m_menuBar
= (wxMenuBar
*)menubar
;
648 void wxMenuBase::Detach()
650 // use IsAttached() to prevent this from happening
651 wxASSERT_MSG( m_menuBar
, _T("detaching unattached menu?") );
656 // ----------------------------------------------------------------------------
657 // wxMenu functions forwarded to wxMenuItem
658 // ----------------------------------------------------------------------------
660 void wxMenuBase::Enable( int id
, bool enable
)
662 wxMenuItem
*item
= FindItem(id
);
664 wxCHECK_RET( item
, wxT("wxMenu::Enable: no such item") );
666 item
->Enable(enable
);
669 bool wxMenuBase::IsEnabled( int id
) const
671 wxMenuItem
*item
= FindItem(id
);
673 wxCHECK_MSG( item
, false, wxT("wxMenu::IsEnabled: no such item") );
675 return item
->IsEnabled();
678 void wxMenuBase::Check( int id
, bool enable
)
680 wxMenuItem
*item
= FindItem(id
);
682 wxCHECK_RET( item
, wxT("wxMenu::Check: no such item") );
687 bool wxMenuBase::IsChecked( int id
) const
689 wxMenuItem
*item
= FindItem(id
);
691 wxCHECK_MSG( item
, false, wxT("wxMenu::IsChecked: no such item") );
693 return item
->IsChecked();
696 void wxMenuBase::SetLabel( int id
, const wxString
&label
)
698 wxMenuItem
*item
= FindItem(id
);
700 wxCHECK_RET( item
, wxT("wxMenu::SetLabel: no such item") );
702 item
->SetText(label
);
705 wxString
wxMenuBase::GetLabel( int id
) const
707 wxMenuItem
*item
= FindItem(id
);
709 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetLabel: no such item") );
711 return item
->GetText();
714 void wxMenuBase::SetHelpString( int id
, const wxString
& helpString
)
716 wxMenuItem
*item
= FindItem(id
);
718 wxCHECK_RET( item
, wxT("wxMenu::SetHelpString: no such item") );
720 item
->SetHelp( helpString
);
723 wxString
wxMenuBase::GetHelpString( int id
) const
725 wxMenuItem
*item
= FindItem(id
);
727 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
729 return item
->GetHelp();
732 // ----------------------------------------------------------------------------
733 // wxMenuBarBase ctor and dtor
734 // ----------------------------------------------------------------------------
736 wxMenuBarBase::wxMenuBarBase()
739 m_menuBarFrame
= NULL
;
742 wxMenuBarBase::~wxMenuBarBase()
744 WX_CLEAR_LIST(wxMenuList
, m_menus
);
747 // ----------------------------------------------------------------------------
748 // wxMenuBar item access: the base class versions manage m_menus list, the
749 // derived class should reflect the changes in the real menubar
750 // ----------------------------------------------------------------------------
752 wxMenu
*wxMenuBarBase::GetMenu(size_t pos
) const
754 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
755 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::GetMenu()") );
757 return node
->GetData();
760 bool wxMenuBarBase::Append(wxMenu
*menu
, const wxString
& WXUNUSED(title
))
762 wxCHECK_MSG( menu
, false, wxT("can't append NULL menu") );
764 m_menus
.Append(menu
);
770 bool wxMenuBarBase::Insert(size_t pos
, wxMenu
*menu
,
771 const wxString
& title
)
773 if ( pos
== m_menus
.GetCount() )
775 return wxMenuBarBase::Append(menu
, title
);
777 else // not at the end
779 wxCHECK_MSG( menu
, false, wxT("can't insert NULL menu") );
781 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
782 wxCHECK_MSG( node
, false, wxT("bad index in wxMenuBar::Insert()") );
784 m_menus
.Insert(node
, menu
);
791 wxMenu
*wxMenuBarBase::Replace(size_t pos
, wxMenu
*menu
,
792 const wxString
& WXUNUSED(title
))
794 wxCHECK_MSG( menu
, NULL
, wxT("can't insert NULL menu") );
796 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
797 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Replace()") );
799 wxMenu
*menuOld
= node
->GetData();
808 wxMenu
*wxMenuBarBase::Remove(size_t pos
)
810 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
811 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Remove()") );
813 wxMenu
*menu
= node
->GetData();
820 int wxMenuBarBase::FindMenu(const wxString
& title
) const
822 wxString label
= wxMenuItem::GetLabelFromText(title
);
824 size_t count
= GetMenuCount();
825 for ( size_t i
= 0; i
< count
; i
++ )
827 wxString title2
= GetLabelTop(i
);
828 if ( (title2
== title
) ||
829 (wxMenuItem::GetLabelFromText(title2
) == label
) )
840 // ----------------------------------------------------------------------------
841 // wxMenuBar attaching/detaching to/from the frame
842 // ----------------------------------------------------------------------------
844 void wxMenuBarBase::Attach(wxFrame
*frame
)
846 wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
848 m_menuBarFrame
= frame
;
851 void wxMenuBarBase::Detach()
853 wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
855 m_menuBarFrame
= NULL
;
858 // ----------------------------------------------------------------------------
859 // wxMenuBar searching for items
860 // ----------------------------------------------------------------------------
862 wxMenuItem
*wxMenuBarBase::FindItem(int id
, wxMenu
**menu
) const
867 wxMenuItem
*item
= NULL
;
868 size_t count
= GetMenuCount(), i
;
869 wxMenuList::const_iterator it
;
870 for ( i
= 0, it
= m_menus
.begin(); !item
&& (i
< count
); i
++, it
++ )
872 item
= (*it
)->FindItem(id
, menu
);
878 int wxMenuBarBase::FindMenuItem(const wxString
& menu
, const wxString
& item
) const
880 wxString label
= wxMenuItem::GetLabelFromText(menu
);
883 wxMenuList::compatibility_iterator node
;
884 for ( node
= m_menus
.GetFirst(); node
; node
= node
->GetNext(), i
++ )
886 if ( label
== wxMenuItem::GetLabelFromText(GetLabelTop(i
)) )
887 return node
->GetData()->FindItem(item
);
893 // ---------------------------------------------------------------------------
894 // wxMenuBar functions forwarded to wxMenuItem
895 // ---------------------------------------------------------------------------
897 void wxMenuBarBase::Enable(int id
, bool enable
)
899 wxMenuItem
*item
= FindItem(id
);
901 wxCHECK_RET( item
, wxT("attempt to enable an item which doesn't exist") );
903 item
->Enable(enable
);
906 void wxMenuBarBase::Check(int id
, bool check
)
908 wxMenuItem
*item
= FindItem(id
);
910 wxCHECK_RET( item
, wxT("attempt to check an item which doesn't exist") );
911 wxCHECK_RET( item
->IsCheckable(), wxT("attempt to check an uncheckable item") );
916 bool wxMenuBarBase::IsChecked(int id
) const
918 wxMenuItem
*item
= FindItem(id
);
920 wxCHECK_MSG( item
, false, wxT("wxMenuBar::IsChecked(): no such item") );
922 return item
->IsChecked();
925 bool wxMenuBarBase::IsEnabled(int id
) const
927 wxMenuItem
*item
= FindItem(id
);
929 wxCHECK_MSG( item
, false, wxT("wxMenuBar::IsEnabled(): no such item") );
931 return item
->IsEnabled();
934 void wxMenuBarBase::SetLabel(int id
, const wxString
& label
)
936 wxMenuItem
*item
= FindItem(id
);
938 wxCHECK_RET( item
, wxT("wxMenuBar::SetLabel(): no such item") );
940 item
->SetText(label
);
943 wxString
wxMenuBarBase::GetLabel(int id
) const
945 wxMenuItem
*item
= FindItem(id
);
947 wxCHECK_MSG( item
, wxEmptyString
,
948 wxT("wxMenuBar::GetLabel(): no such item") );
950 return item
->GetText();
953 void wxMenuBarBase::SetHelpString(int id
, const wxString
& helpString
)
955 wxMenuItem
*item
= FindItem(id
);
957 wxCHECK_RET( item
, wxT("wxMenuBar::SetHelpString(): no such item") );
959 item
->SetHelp(helpString
);
962 wxString
wxMenuBarBase::GetHelpString(int id
) const
964 wxMenuItem
*item
= FindItem(id
);
966 wxCHECK_MSG( item
, wxEmptyString
,
967 wxT("wxMenuBar::GetHelpString(): no such item") );
969 return item
->GetHelp();
972 #endif // wxUSE_MENUS