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") );
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(), FALSE
,
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
, FALSE
, 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
);
393 bool wxMenuBase::Delete(wxMenuItem
*item
)
395 wxCHECK_MSG( item
, FALSE
, wxT("invalid item in wxMenu::Delete") );
397 return DoDelete(item
);
400 bool wxMenuBase::DoDelete(wxMenuItem
*item
)
402 wxMenuItem
*item2
= DoRemove(item
);
403 wxCHECK_MSG( item2
, FALSE
, wxT("failed to delete menu item") );
405 // don't delete the submenu
406 item2
->SetSubMenu((wxMenu
*)NULL
);
413 bool wxMenuBase::Destroy(wxMenuItem
*item
)
415 wxCHECK_MSG( item
, FALSE
, wxT("invalid item in wxMenu::Destroy") );
417 return DoDestroy(item
);
420 bool wxMenuBase::DoDestroy(wxMenuItem
*item
)
422 wxMenuItem
*item2
= DoRemove(item
);
423 wxCHECK_MSG( item2
, FALSE
, wxT("failed to delete menu item") );
430 // ----------------------------------------------------------------------------
431 // wxMenu searching for items
432 // ----------------------------------------------------------------------------
434 // Finds the item id matching the given string, -1 if not found.
435 int wxMenuBase::FindItem(const wxString
& text
) const
437 wxString label
= wxMenuItem::GetLabelFromText(text
);
438 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
440 node
= node
->GetNext() )
442 wxMenuItem
*item
= node
->GetData();
443 if ( item
->IsSubMenu() )
445 int rc
= item
->GetSubMenu()->FindItem(label
);
446 if ( rc
!= wxNOT_FOUND
)
450 // we execute this code for submenus as well to alllow finding them by
451 // name just like the ordinary items
452 if ( !item
->IsSeparator() )
454 if ( item
->GetLabel() == label
)
455 return item
->GetId();
462 // recursive search for item by id
463 wxMenuItem
*wxMenuBase::FindItem(int itemId
, wxMenu
**itemMenu
) const
468 wxMenuItem
*item
= NULL
;
469 for ( wxMenuItemList::compatibility_iterator node
= m_items
.GetFirst();
471 node
= node
->GetNext() )
473 item
= node
->GetData();
475 if ( item
->GetId() == itemId
)
478 *itemMenu
= (wxMenu
*)this;
480 else if ( item
->IsSubMenu() )
482 item
= item
->GetSubMenu()->FindItem(itemId
, itemMenu
);
486 // don't exit the loop
494 // non recursive search
495 wxMenuItem
*wxMenuBase::FindChildItem(int id
, size_t *ppos
) const
497 wxMenuItem
*item
= (wxMenuItem
*)NULL
;
498 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
501 for ( pos
= 0; node
; pos
++ )
503 if ( node
->GetData()->GetId() == id
)
505 item
= node
->GetData();
510 node
= node
->GetNext();
515 *ppos
= item
? pos
: (size_t)wxNOT_FOUND
;
522 wxMenuItem
* wxMenuBase::FindItemByPosition(size_t position
) const
524 wxCHECK_MSG( position
< m_items
.GetCount(), NULL
,
525 _T("wxMenu::FindItemByPosition(): invalid menu index") );
527 return m_items
.Item( position
)->GetData();
530 // ----------------------------------------------------------------------------
531 // wxMenu helpers used by derived classes
532 // ----------------------------------------------------------------------------
534 // Update a menu and all submenus recursively. source is the object that has
535 // the update event handlers defined for it. If NULL, the menu or associated
536 // window will be used.
537 void wxMenuBase::UpdateUI(wxEvtHandler
* source
)
539 if (GetInvokingWindow())
541 // Don't update menus if the parent
542 // frame is about to get deleted
543 wxWindow
*tlw
= wxGetTopLevelParent( GetInvokingWindow() );
544 if (tlw
&& wxPendingDelete
.Member(tlw
))
548 if ( !source
&& GetInvokingWindow() )
549 source
= GetInvokingWindow()->GetEventHandler();
551 source
= GetEventHandler();
555 wxMenuItemList::compatibility_iterator node
= GetMenuItems().GetFirst();
558 wxMenuItem
* item
= node
->GetData();
559 if ( !item
->IsSeparator() )
561 wxWindowID id
= item
->GetId();
562 wxUpdateUIEvent
event(id
);
563 event
.SetEventObject( source
);
565 if ( source
->ProcessEvent(event
) )
567 // if anything changed, update the changed attribute
568 if (event
.GetSetText())
569 SetLabel(id
, event
.GetText());
570 if (event
.GetSetChecked())
571 Check(id
, event
.GetChecked());
572 if (event
.GetSetEnabled())
573 Enable(id
, event
.GetEnabled());
576 // recurse to the submenus
577 if ( item
->GetSubMenu() )
578 item
->GetSubMenu()->UpdateUI(source
);
580 //else: item is a separator (which doesn't process update UI events)
582 node
= node
->GetNext();
586 bool wxMenuBase::SendEvent(int id
, int checked
)
588 wxCommandEvent
event(wxEVT_COMMAND_MENU_SELECTED
, id
);
589 event
.SetEventObject(this);
590 event
.SetInt(checked
);
592 bool processed
= FALSE
;
594 // Try the menu's event handler
597 wxEvtHandler
*handler
= GetEventHandler();
599 processed
= handler
->ProcessEvent(event
);
602 // Try the window the menu was popped up from (and up through the
606 const wxMenuBase
*menu
= this;
609 wxWindow
*win
= menu
->GetInvokingWindow();
612 processed
= win
->GetEventHandler()->ProcessEvent(event
);
616 menu
= menu
->GetParent();
623 // ----------------------------------------------------------------------------
624 // wxMenu attaching/detaching to/from menu bar
625 // ----------------------------------------------------------------------------
627 wxMenuBar
* wxMenuBase::GetMenuBar() const
630 return GetParent()->GetMenuBar();
634 void wxMenuBase::Attach(wxMenuBarBase
*menubar
)
636 // use Detach() instead!
637 wxASSERT_MSG( menubar
, _T("menu can't be attached to NULL menubar") );
639 // use IsAttached() to prevent this from happening
640 wxASSERT_MSG( !m_menuBar
, _T("attaching menu twice?") );
642 m_menuBar
= (wxMenuBar
*)menubar
;
645 void wxMenuBase::Detach()
647 // use IsAttached() to prevent this from happening
648 wxASSERT_MSG( m_menuBar
, _T("detaching unattached menu?") );
653 // ----------------------------------------------------------------------------
654 // wxMenu functions forwarded to wxMenuItem
655 // ----------------------------------------------------------------------------
657 void wxMenuBase::Enable( int id
, bool enable
)
659 wxMenuItem
*item
= FindItem(id
);
661 wxCHECK_RET( item
, wxT("wxMenu::Enable: no such item") );
663 item
->Enable(enable
);
666 bool wxMenuBase::IsEnabled( int id
) const
668 wxMenuItem
*item
= FindItem(id
);
670 wxCHECK_MSG( item
, FALSE
, wxT("wxMenu::IsEnabled: no such item") );
672 return item
->IsEnabled();
675 void wxMenuBase::Check( int id
, bool enable
)
677 wxMenuItem
*item
= FindItem(id
);
679 wxCHECK_RET( item
, wxT("wxMenu::Check: no such item") );
684 bool wxMenuBase::IsChecked( int id
) const
686 wxMenuItem
*item
= FindItem(id
);
688 wxCHECK_MSG( item
, FALSE
, wxT("wxMenu::IsChecked: no such item") );
690 return item
->IsChecked();
693 void wxMenuBase::SetLabel( int id
, const wxString
&label
)
695 wxMenuItem
*item
= FindItem(id
);
697 wxCHECK_RET( item
, wxT("wxMenu::SetLabel: no such item") );
699 item
->SetText(label
);
702 wxString
wxMenuBase::GetLabel( int id
) const
704 wxMenuItem
*item
= FindItem(id
);
706 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetLabel: no such item") );
708 return item
->GetText();
711 void wxMenuBase::SetHelpString( int id
, const wxString
& helpString
)
713 wxMenuItem
*item
= FindItem(id
);
715 wxCHECK_RET( item
, wxT("wxMenu::SetHelpString: no such item") );
717 item
->SetHelp( helpString
);
720 wxString
wxMenuBase::GetHelpString( int id
) const
722 wxMenuItem
*item
= FindItem(id
);
724 wxCHECK_MSG( item
, wxT(""), wxT("wxMenu::GetHelpString: no such item") );
726 return item
->GetHelp();
729 // ----------------------------------------------------------------------------
730 // wxMenuBarBase ctor and dtor
731 // ----------------------------------------------------------------------------
733 wxMenuBarBase::wxMenuBarBase()
736 m_menuBarFrame
= NULL
;
739 wxMenuBarBase::~wxMenuBarBase()
741 WX_CLEAR_LIST(wxMenuList
, m_menus
);
744 // ----------------------------------------------------------------------------
745 // wxMenuBar item access: the base class versions manage m_menus list, the
746 // derived class should reflect the changes in the real menubar
747 // ----------------------------------------------------------------------------
749 wxMenu
*wxMenuBarBase::GetMenu(size_t pos
) const
751 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
752 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::GetMenu()") );
754 return node
->GetData();
757 bool wxMenuBarBase::Append(wxMenu
*menu
, const wxString
& WXUNUSED(title
))
759 wxCHECK_MSG( menu
, FALSE
, wxT("can't append NULL menu") );
761 m_menus
.Append(menu
);
767 bool wxMenuBarBase::Insert(size_t pos
, wxMenu
*menu
,
768 const wxString
& title
)
770 if ( pos
== m_menus
.GetCount() )
772 return wxMenuBarBase::Append(menu
, title
);
774 else // not at the end
776 wxCHECK_MSG( menu
, FALSE
, wxT("can't insert NULL menu") );
778 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
779 wxCHECK_MSG( node
, FALSE
, wxT("bad index in wxMenuBar::Insert()") );
781 m_menus
.Insert(node
, menu
);
788 wxMenu
*wxMenuBarBase::Replace(size_t pos
, wxMenu
*menu
,
789 const wxString
& WXUNUSED(title
))
791 wxCHECK_MSG( menu
, NULL
, wxT("can't insert NULL menu") );
793 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
794 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Replace()") );
796 wxMenu
*menuOld
= node
->GetData();
805 wxMenu
*wxMenuBarBase::Remove(size_t pos
)
807 wxMenuList::compatibility_iterator node
= m_menus
.Item(pos
);
808 wxCHECK_MSG( node
, NULL
, wxT("bad index in wxMenuBar::Remove()") );
810 wxMenu
*menu
= node
->GetData();
817 int wxMenuBarBase::FindMenu(const wxString
& title
) const
819 wxString label
= wxMenuItem::GetLabelFromText(title
);
821 size_t count
= GetMenuCount();
822 for ( size_t i
= 0; i
< count
; i
++ )
824 wxString title2
= GetLabelTop(i
);
825 if ( (title2
== title
) ||
826 (wxMenuItem::GetLabelFromText(title2
) == label
) )
837 // ----------------------------------------------------------------------------
838 // wxMenuBar attaching/detaching to/from the frame
839 // ----------------------------------------------------------------------------
841 void wxMenuBarBase::Attach(wxFrame
*frame
)
843 wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
845 m_menuBarFrame
= frame
;
848 void wxMenuBarBase::Detach()
850 wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
852 m_menuBarFrame
= NULL
;
855 // ----------------------------------------------------------------------------
856 // wxMenuBar searching for items
857 // ----------------------------------------------------------------------------
859 wxMenuItem
*wxMenuBarBase::FindItem(int id
, wxMenu
**menu
) const
864 wxMenuItem
*item
= NULL
;
865 size_t count
= GetMenuCount(), i
;
866 wxMenuList::const_iterator it
;
867 for ( i
= 0, it
= m_menus
.begin(); !item
&& (i
< count
); i
++, it
++ )
869 item
= (*it
)->FindItem(id
, menu
);
875 int wxMenuBarBase::FindMenuItem(const wxString
& menu
, const wxString
& item
) const
877 wxString label
= wxMenuItem::GetLabelFromText(menu
);
880 wxMenuList::compatibility_iterator node
;
881 for ( node
= m_menus
.GetFirst(); node
; node
= node
->GetNext(), i
++ )
883 if ( label
== wxMenuItem::GetLabelFromText(GetLabelTop(i
)) )
884 return node
->GetData()->FindItem(item
);
890 // ---------------------------------------------------------------------------
891 // wxMenuBar functions forwarded to wxMenuItem
892 // ---------------------------------------------------------------------------
894 void wxMenuBarBase::Enable(int id
, bool enable
)
896 wxMenuItem
*item
= FindItem(id
);
898 wxCHECK_RET( item
, wxT("attempt to enable an item which doesn't exist") );
900 item
->Enable(enable
);
903 void wxMenuBarBase::Check(int id
, bool check
)
905 wxMenuItem
*item
= FindItem(id
);
907 wxCHECK_RET( item
, wxT("attempt to check an item which doesn't exist") );
908 wxCHECK_RET( item
->IsCheckable(), wxT("attempt to check an uncheckable item") );
913 bool wxMenuBarBase::IsChecked(int id
) const
915 wxMenuItem
*item
= FindItem(id
);
917 wxCHECK_MSG( item
, FALSE
, wxT("wxMenuBar::IsChecked(): no such item") );
919 return item
->IsChecked();
922 bool wxMenuBarBase::IsEnabled(int id
) const
924 wxMenuItem
*item
= FindItem(id
);
926 wxCHECK_MSG( item
, FALSE
, wxT("wxMenuBar::IsEnabled(): no such item") );
928 return item
->IsEnabled();
931 void wxMenuBarBase::SetLabel(int id
, const wxString
& label
)
933 wxMenuItem
*item
= FindItem(id
);
935 wxCHECK_RET( item
, wxT("wxMenuBar::SetLabel(): no such item") );
937 item
->SetText(label
);
940 wxString
wxMenuBarBase::GetLabel(int id
) const
942 wxMenuItem
*item
= FindItem(id
);
944 wxCHECK_MSG( item
, wxEmptyString
,
945 wxT("wxMenuBar::GetLabel(): no such item") );
947 return item
->GetText();
950 void wxMenuBarBase::SetHelpString(int id
, const wxString
& helpString
)
952 wxMenuItem
*item
= FindItem(id
);
954 wxCHECK_RET( item
, wxT("wxMenuBar::SetHelpString(): no such item") );
956 item
->SetHelp(helpString
);
959 wxString
wxMenuBarBase::GetHelpString(int id
) const
961 wxMenuItem
*item
= FindItem(id
);
963 wxCHECK_MSG( item
, wxEmptyString
,
964 wxT("wxMenuBar::GetHelpString(): no such item") );
966 return item
->GetHelp();
969 #endif // wxUSE_MENUS