X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/23c37c2c4ee81762a0c44a3ccbbc28b8531d4879..4de25822f373782dab54d09e1be978d94b97ca76:/src/msw/menu.cpp diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 37965b485a..f2bcc2000e 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -4,7 +4,6 @@ // Author: Julian Smart // Modified by: Vadim Zeitlin // Created: 04/01/98 -// RCS-ID: $Id$ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -543,6 +542,7 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // check if we have something more than a simple text item #if wxUSE_OWNER_DRAWN + bool makeItemOwnerDrawn = false; if ( pItem->IsOwnerDrawn() ) { #ifndef __DMC__ @@ -696,6 +696,9 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) // set menu as ownerdrawn m_ownerDrawn = true; + // also ensure that the new item itself is made owner drawn + makeItemOwnerDrawn = true; + ResetMaxAccelWidth(); } // only update our margin for equals alignment to other item @@ -727,6 +730,12 @@ bool wxMenu::DoInsertOrAppend(wxMenuItem *pItem, size_t pos) return false; } + + if ( makeItemOwnerDrawn ) + { + SetOwnerDrawnMenuItem(GetHmenu(), pos, + reinterpret_cast(pItem), TRUE); + } }