diff --git a/interface/wx/menu.h b/interface/wx/menu.h index 98f2eb56eb..56757d6a2d 100644 --- a/interface/wx/menu.h +++ b/interface/wx/menu.h @@ -73,7 +73,7 @@ public: @param menu The menu to add. Do not deallocate this menu after calling Append(). @param title - The title of the menu. + The title of the menu, must be non-empty. @return @true on success, @false if an error occurred. @@ -497,7 +497,7 @@ public: this string in the status line. @param kind May be @c wxITEM_SEPARATOR, @c wxITEM_NORMAL, @c wxITEM_CHECK or @c wxITEM_RADIO. - + Example: @code m_pFileMenu->Append(ID_NEW_FILE, "&New file\tCTRL+N", "Creates a new XYZ document"); diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 65adec344f..5f7c8cd9b4 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -616,9 +616,10 @@ wxMenu *wxMenuBarBase::GetMenu(size_t pos) const return node->GetData(); } -bool wxMenuBarBase::Append(wxMenu *menu, const wxString& WXUNUSED(title)) +bool wxMenuBarBase::Append(wxMenu *menu, const wxString& title) { wxCHECK_MSG( menu, false, wxT("can't append NULL menu") ); + wxCHECK_MSG( !title.empty(), false, wxT("can't append menu with empty title") ); m_menus.Append(menu); menu->Attach(this);