you are talking about the line in "wxMenu::DoInsertOrAppend", correct ?
this was how it was in wx262
// is the item owner-drawn just because of the bitmap?
if ( pItem->GetBitmap().Ok() &&
!pItem->GetTextColour().Ok() &&
!pItem->GetBackgroundColour().Ok() &&
!pItem->GetFont().Ok() )
{
// try to use InsertMenuItem() as it's guaranteed to look correctly
// while our owner-drawning code is not
and in wx 263 they changed it into :
// is the item owner-drawn just because of the bitmap?
if ( pItem->GetBitmap().Ok() &&
!pItem->GetTextColour().Ok() &&
!pItem->GetBackgroundColour().Ok() &&
!pItem->GetFont().Ok() &&
!pItem->GetBitmap(true).Ok() )
{
// try to use InsertMenuItem() as it's guaranteed to look correctly
// while our owner-drawning code is not
did you bring this to the attention of the wx guys.
I am gonna rebuild our wx_cb_dll, this is a nice fix (hopefully with no side effects).
If you would like to try an experiment with keybinder:
At menuutils.cpp line 190 (keybinder) there are two RebuildMenuItem() routines.
The second one was the one that solved the missing icon problem in wx2.6.2 .
With your "fixed" wxWidgets, comment out the first RebuildMenuItem and uncomment the second to see if it solves the problem.
It may cause a crash since it hasnt been used/updated in a year, but it'll tell us if the missing icons are fixed.
}//Update
// ----------------------------------------------------------------------------
// RebuildMenuitem
// ----------------------------------------------------------------------------
wxMenuItem* wxMenuCmd::RebuildMenuitem(wxMenuItem* pMnuItem)
{//+v0.4.25 WXMSW
// Since wxWidgets 2.6.3, we don't have to rebuild the menuitem
// to preserve the bitmapped menu icon.
return pMnuItem;
}//RebuildMenuitem
// ----------------------------------------------------------------------------
// The following routine was used when wxWidgets would not SetText()
// without clobbering the menu Bitmap icon
// ----------------------------------------------------------------------------
//wxMenuItem* wxMenuCmd::RebuildMenuitem(wxMenuItem* pMnuItem)
//{//+v0.4.6 WXMSW
// // ---------------------------------------------------------------
// // Do it the slow/hard way, remove and delete the menu item
// // ---------------------------------------------------------------
// wxMenu* pMenu = pMnuItem->GetMenu();
// wxMenuItemList items = pMenu->GetMenuItems();
// int pos = items.IndexOf(pMnuItem);
// // rebuild the menuitem
// wxMenuItem* pnewitem = new wxMenuItem(pMenu, m_nId, pMnuItem->GetText(),
// pMnuItem->GetHelp(), pMnuItem->GetKind(),
// pMnuItem->GetSubMenu() );
// pnewitem->SetBitmap(pMnuItem->GetBitmap() );
// pnewitem->SetFont(pMnuItem->GetFont() );
// // remove the menuitem
// pMenu->Destroy(pMnuItem);
// // update keybinder array menu item pointer
// m_pItem = pnewitem;
// // put the menuitem back on the menu
// pMenu->Insert(pos, pnewitem);
// return pnewitem;
//
//}//RebuildMenuitem
#endif //#if defined( __WXMSW__ )
// ----------------------------------------------------------------------------
Here's a snippet of the keybinder logging under debug and kbLOGGING, does it give any information or is it unrelated to anything. Tim S
01:59:08: wxMenuCmd::Update - Removing shortcuts [Continue Ctrl-F7] for [Continue]
01:59:08: wxMenuCmd::Update - Setting shortcuts for [Continue Ctrl-F7]
01:59:08: wxMenuCmd::Update - Removing shortcuts [Toggle breakpoint F5] for [Toggle breakpoint]
01:59:08: wxMenuCmd::Update - Setting shortcuts for [Toggle breakpoint F5]
01:59:08: CreateNew()UnMatched id:1413 name:Edit startup script
01:59:08: Debug: keybinder.cpp(602): assert "ret" failed.
01:59:18: wxMenuCmd::Update - Removing shortcuts [Goto file... Alt-G] for [Goto file...]
01:59:18: wxMenuCmd::Update - Setting shortcuts for [Goto file... Alt-G]
01:59:18: wxMenuCmd::Update - Removing shortcuts [Activate next project Alt-F6] for [Activate next project]
01:59:18: wxMenuCmd::Update - Setting shortcuts for [Activate next project Alt-F6]
01:59:18: wxMenuCmd::Update - Removing shortcuts [Activate prior project Alt-F5] for [Activate prior project]
damn berlios, can't get to the raw patch :-(
Index: src/plugins/contrib/keybinder/menuutils.cpp
===================================================================
--- src/plugins/contrib/keybinder/menuutils.cpp (revision 3442)
+++ src/plugins/contrib/keybinder/menuutils.cpp (working copy)
@@ -190,40 +190,54 @@
// ----------------------------------------------------------------------------
// RebuildMenuitem
// ----------------------------------------------------------------------------
-wxMenuItem* wxMenuCmd::RebuildMenuitem(wxMenuItem* pMnuItem)
-{//+v0.4.25 WXMSW
- // Since wxWidgets 2.6.3, we don't have to rebuild the menuitem
- // to preserve the bitmapped menu icon.
- return pMnuItem;
-
-}//RebuildMenuitem
+//wxMenuItem* wxMenuCmd::RebuildMenuitem(wxMenuItem* pMnuItem)
+//{//+v0.4.25 WXMSW
+// // Since wxWidgets 2.6.3, we don't have to rebuild the menuitem
+// // to preserve the bitmapped menu icon.
+// return pMnuItem;
+//
+//}//RebuildMenuitem
// ----------------------------------------------------------------------------
// The following routine was used when wxWidgets would not SetText()
// without clobbering the menu Bitmap icon
// ----------------------------------------------------------------------------
-//wxMenuItem* wxMenuCmd::RebuildMenuitem(wxMenuItem* pMnuItem)
-//{//+v0.4.6 WXMSW
-// // ---------------------------------------------------------------
-// // Do it the slow/hard way, remove and delete the menu item
-// // ---------------------------------------------------------------
-// wxMenu* pMenu = pMnuItem->GetMenu();
-// wxMenuItemList items = pMenu->GetMenuItems();
-// int pos = items.IndexOf(pMnuItem);
-// // rebuild the menuitem
-// wxMenuItem* pnewitem = new wxMenuItem(pMenu, m_nId, pMnuItem->GetText(),
-// pMnuItem->GetHelp(), pMnuItem->GetKind(),
-// pMnuItem->GetSubMenu() );
-// pnewitem->SetBitmap(pMnuItem->GetBitmap() );
-// pnewitem->SetFont(pMnuItem->GetFont() );
-// // remove the menuitem
-// pMenu->Destroy(pMnuItem);
-// // update keybinder array menu item pointer
-// m_pItem = pnewitem;
-// // put the menuitem back on the menu
-// pMenu->Insert(pos, pnewitem);
-// return pnewitem;
-//
-//}//RebuildMenuitem
+wxMenuItem* wxMenuCmd::RebuildMenuitem(wxMenuItem* pMnuItem)
+{ //+v0.4.6 WXMSW
+ // ---------------------------------------------------------------
+ // Do it the slow/hard way, remove and delete the menu item
+ // ---------------------------------------------------------------
+ wxMenu* pMenu = pMnuItem->GetMenu();
+ wxMenuItemList items = pMenu->GetMenuItems();
+ int pos = items.IndexOf(pMnuItem);
+ // rebuild the menuitem
+ wxMenuItem* pnewitem = new wxMenuItem(pMenu, m_nId, pMnuItem->GetText(),
+ pMnuItem->GetHelp(), pMnuItem->GetKind(),
+ pMnuItem->GetSubMenu() );
+ pnewitem->SetBitmap(pMnuItem->GetBitmap() );
+ pnewitem->SetFont(pMnuItem->GetFont() );
+#if wxUSE_OWNER_DRAWN
+ if ( pMnuItem->IsOwnerDrawn() )
+ {
+ pnewitem->SetOwnerDrawn(true);
+ pnewitem->SetMarginWidth(pMnuItem->GetMarginWidth());
+ pnewitem->SetDisabledBitmap(pMnuItem->GetDisabledBitmap());
+ if (pMnuItem->IsCheckable())
+ {
+ pnewitem->SetCheckable(true);
+ pnewitem->SetBitmaps(pMnuItem->GetBitmap(true), pMnuItem->GetBitmap(false));
+ }
+ }
+#endif
+
+ // remove the menuitem
+ pMenu->Destroy(pMnuItem);
+ // update keybinder array menu item pointer
+ m_pItem = pnewitem;
+ // put the menuitem back on the menu
+ pMenu->Insert(pos, pnewitem);
+ return pnewitem;
+
+}//RebuildMenuitem
#endif //#if defined( __WXMSW__ )
// ----------------------------------------------------------------------------
bool wxMenuCmd::IsNumericMenuItem(wxMenuItem* pwxMenuItem) //v0.2
Tim S