From: Vadim Zeitlin Date: Fri, 24 Jun 2005 00:09:34 +0000 (+0000) Subject: fixed appending menu items for a (popup) menu with a title broken by last change... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5c5871a4fc3a83c494f9fc0c8ae7b6ca210d37f4 fixed appending menu items for a (popup) menu with a title broken by last change (and also fixed inserting in this case which didn't work even before last change) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 3ce1704aa8..d18f97c893 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -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