]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed appending menu items for a (popup) menu with a title broken by last change...
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 24 Jun 2005 00:09:34 +0000 (00:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 24 Jun 2005 00:09:34 +0000 (00:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/menu.cpp

index 3ce1704aa8e2aca961e30fccbfa10ad1e655defe..d18f97c893e5fabcca8be218c8396395a0feb08f 100644 (file)
@@ -390,6 +390,10 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos)
         pos = GetMenuItemCount() - 1;
     }
 
+    // adjust position to account for the title, if any
+    if ( !m_title.empty() )
+        pos += 2; // for the title itself and its separator
+
     BOOL ok = false;
 
     // check if we have something more than a simple text item