pos += 2; // for the title itself and its separator
BOOL ok = false;
+
+#if wxUSE_OWNER_DRAWN
+ // Currently, mixing owner-drawn and non-owner-drawn items results in
+ // inconsistent margins, so we force this to be owner-drawn if any other
+ // items already are. Later we might want to use a boolean in the wxMenu
+ // to avoid search. Also we might make this fix unnecessary by getting the correct
+ // margin using NONCLIENTMETRICS.
+ if ( !pItem->IsOwnerDrawn() )
+ {
+ // Check if any other items are ownerdrawn, and make ownerdrawn if so
+ wxMenuItemList::compatibility_iterator node = GetMenuItems().GetFirst();
+ while (node)
+ {
+ if (node->GetData()->IsOwnerDrawn())
+ {
+ pItem->SetOwnerDrawn(true);
+ break;
+ }
+ node = node->GetNext();
+ }
+ }
+#endif
// check if we have something more than a simple text item
#if wxUSE_OWNER_DRAWN
// while our owner-drawn code is not
// first compile-time check
-#if defined(MIIM_BITMAP) && !defined(__MINGW32__)
+#if defined(MIIM_BITMAP) && (_WIN32_WINNT >= 0x0500)
WinStruct<MENUITEMINFO> mii;
// now run-time one: MIIM_BITMAP only works under WinME/2000+