+static void wxMenubarUnsetInvokingWindow( wxMenu *menu )
+{
+ menu->SetInvokingWindow( (wxWindow*) NULL );
+
+ wxMenuItemList::Node *node = menu->GetMenuItems().GetFirst();
+ while (node)
+ {
+ wxMenuItem *menuitem = node->GetData();
+ if (menuitem->IsSubMenu())
+ wxMenubarUnsetInvokingWindow( menuitem->GetSubMenu() );
+ node = node->GetNext();
+ }
+}
+
+static void wxMenubarSetInvokingWindow( wxMenu *menu, wxWindow *win )
+{
+ menu->SetInvokingWindow( win );
+
+ wxMenuItemList::Node *node = menu->GetMenuItems().GetFirst();
+ while (node)
+ {
+ wxMenuItem *menuitem = node->GetData();
+ if (menuitem->IsSubMenu())
+ wxMenubarSetInvokingWindow( menuitem->GetSubMenu() , win );
+ node = node->GetNext();
+ }
+}
+
+void wxMenuBar::UnsetInvokingWindow()
+{
+ m_invokingWindow = (wxWindow*) NULL;
+ wxMenuList::Node *node = m_menus.GetFirst();
+ while (node)
+ {
+ wxMenu *menu = node->GetData();
+ wxMenubarUnsetInvokingWindow( menu );
+ node = node->GetNext();
+ }
+}
+
+void wxMenuBar::SetInvokingWindow(wxFrame *frame)
+{
+ m_invokingWindow = frame;
+ wxMenuList::Node *node = m_menus.GetFirst();
+ while (node)
+ {
+ wxMenu *menu = node->GetData();
+ wxMenubarSetInvokingWindow( menu, frame );
+ node = node->GetNext();
+ }
+}
+
+void wxMenuBar::Detach()
+{
+ wxMenuBarBase::Detach() ;
+}
+
+void wxMenuBar::Attach(wxFrame *frame)
+{
+ wxMenuBarBase::Attach( frame ) ;
+}
+// ---------------------------------------------------------------------------
+// wxMenuBar searching for menu items
+// ---------------------------------------------------------------------------
+
+// Find the itemString in menuString, and return the item id or wxNOT_FOUND
+int wxMenuBar::FindMenuItem(const wxString& menuString,
+ const wxString& itemString) const
+{
+ wxString menuLabel = wxStripMenuCodes(menuString);
+ size_t count = GetMenuCount();
+ for ( size_t i = 0; i < count; i++ )
+ {
+ wxString title = wxStripMenuCodes(m_titles[i]);
+ if ( menuString == title )
+ return m_menus[i]->FindItem(itemString);
+ }
+
+ return wxNOT_FOUND;
+}
+
+wxMenuItem *wxMenuBar::FindItem(int id, wxMenu **itemMenu) const