]> git.saurik.com Git - wxWidgets.git/commitdiff
allow creating items without parent menus (#3425)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 Jun 2008 14:47:40 +0000 (14:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 22 Jun 2008 14:47:40 +0000 (14:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

interface/menuitem.h
src/common/menucmn.cpp

index ba0905efd2b01b62ed73ae12b67f875b295cc6c1..f9372b5b7cef3466ae4a8c534707de2508f27bbe 100644 (file)
@@ -42,10 +42,12 @@ public:
         help string; that is, stock properties are set independently one from the other.
 
         @param parentMenu
-            Menu that the menu item belongs to.
+            Menu that the menu item belongs to. Can be @NULL if the item is
+            going to be added to the menu later.
         @param id
-            Identifier for this menu item. May be wxID_SEPARATOR, in which case the
-            given kind is ignored and taken to be wxITEM_SEPARATOR instead.
+            Identifier for this menu item. May be @c wxID_SEPARATOR, in which
+            case the given kind is ignored and taken to be @c wxITEM_SEPARATOR
+            instead.
         @param text
             Text for the menu item, as shown on the menu. An accelerator
             key can be specified using the ampersand " character. In order to embed an
@@ -53,8 +55,8 @@ public:
         @param helpString
             Optional help string that will be shown on the status bar.
         @param kind
-            May be wxITEM_SEPARATOR, wxITEM_NORMAL,
-            wxITEM_CHECK or wxITEM_RADIO
+            May be @c wxITEM_SEPARATOR, @c wxITEM_NORMAL, @c wxITEM_CHECK or @c
+            wxITEM_RADIO
         @param subMenu
             If non-@NULL, indicates that the menu item is a submenu.
     */
index db83047580ec2c0041b16babbfbf4c116c58b370..37c0c127f11178e0866c10233995177382e16db6 100644 (file)
@@ -58,7 +58,8 @@ wxMenuItemBase::wxMenuItemBase(wxMenu *parentMenu,
                                wxItemKind kind,
                                wxMenu *subMenu)
 {
-    wxASSERT_MSG( parentMenu != NULL, wxT("menuitem should have a menu") );
+    // notice that parentMenu can be NULL: the item can be attached to the menu
+    // later with SetMenu()
 
     m_parentMenu  = parentMenu;
     m_subMenu     = subMenu;
@@ -827,7 +828,7 @@ wxString wxMenuBarBase::GetHelpString(int id) const
     return item->GetHelp();
 }
 
-void wxMenuBarBase::UpdateMenus( void )
+void wxMenuBarBase::UpdateMenus()
 {
     wxEvtHandler* source;
     wxMenu* menu;