Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: stahta01 on December 29, 2006, 09:07:35 pm

Title: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 09:07:35 pm
UPDATE: This is the patch mentioned in the Nightly thread http://forums.codeblocks.org/index.php?topic=4815.msg37738

I am using this thread now as a way to report on the wxWidgets patch submission pre-work.

Tim

OLD Message info follows:

Is this a windows only bug?
I found a simple change to wxWidgets that fixes the issue for windows.
Does the problem exist in Linux and Mac also?

Tim S

From http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/82394
Quote
Jamie Gadd wrote:

http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/src/msw/menu.cpp.diff?r1=1.128&r2=1.129

As a result of adding "&& !pItem->GetBitmap(true).Ok()", the
::InsertMenuItem() code never gets called.

wxMenuItem derives from wxOwnerDrawn where the GetBitmap() method is
with a default parameter of true. This then effectively becomes:

 if ( true && !true )
 ...

 This explains the regression with the menu margins. As it is now we
 are still not using the ::InsertMenuItem() code.

 Jamie

Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: killerbot on December 29, 2006, 09:10:25 pm
On my suse 10.2 I have wx263 and there everything is ok.

So it seems it might just be windows.


tell us , tell us ....
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 09:13:55 pm
Just remove the
&& !pItem->GetBitmap(true).Ok()

added to menu.cpp in version 1.129
and it is fixed.

Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: killerbot on December 29, 2006, 09:26:20 pm
you are talking about the line in "wxMenu::DoInsertOrAppend", correct ?

this was how it was in wx262
Code
        // 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  :
Code
        // 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).
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 09:36:57 pm
I read it in their group but I am not sure if anyone else read it.

Tim S

http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/82394

Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 09:45:39 pm
you are talking about the line in "wxMenu::DoInsertOrAppend", correct ?

this was how it was in wx262
Code
        // 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  :
Code
        // 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).

Correct that were I fixed it, and it worked with CVS 2.6_BRANCH with that change. I just commented out to test it like below.

        if ( pItem->GetBitmap().Ok() &&
                !pItem->GetTextColour().Ok() &&
                    !pItem->GetBackgroundColour().Ok() &&
                        !pItem->GetFont().Ok() /* &&
                            !pItem->GetBitmap(true).Ok() */ )

Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: killerbot on December 29, 2006, 09:49:55 pm
well there's good new and bad news :

1) good news : menu entries are nicely aligned again

2) BAD news : 90% of the icons in the menus are gone (example : build : only abort has an icon, debug : only stop debugger has an icon)  [I kind of recall we have had this in the past]

Or could there be a problem with our icons ??

Tim, since you are on those wx mailing list, could you provide them with this information, maybe it will help them understand ?
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 09:57:19 pm
well there's good new and bad news :

1) good news : menu entries are nicely aligned again

2) BAD news : 90% of the icons in the menus are gone (example : build : only abort has an icon, debug : only stop debugger has an icon)  [I kind of recall we have had this in the past]

Or could there be a problem with our icons ??

Tim, since you are on those wx mailing list, could you provide them with this information, maybe it will help them understand ?

I don't see the 2) BAD News, when I did it. (Using CVS not 2.6.3p2)
I will check with the 2.6.3p2 version of code and see if I see the bad news.

Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: Pecan on December 29, 2006, 10:21:51 pm
well there's good new and bad news :

1) good news : menu entries are nicely aligned again

2) BAD news : 90% of the icons in the menus are gone (example : build : only abort has an icon, debug : only stop debugger has an icon)  [I kind of recall we have had this in the past]

Or could there be a problem with our icons ??

2) was caused by keyBinder in the past. About a year ago (wx2.6.2) when images were added to the menu without telling keyBinder about it.
Turn off keyBinder (or make sure it's recompiled) and see if the problem goes away.
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 10:34:27 pm
Here's the only plugins I have on
BYO Games
Compiler
Copy strings to clipboard
Debugger
Dev-C++ devpak updater/installer
Dragscroll

Tim S

Note: I just enabled all of the plugins and it still looks good.
I am downloading a new copy of wxWidgets 2.6.3 because I can NOT find one that I have not patched.
I am going to rebuild it from scratch and see if I still get good results.
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 10:59:04 pm
...
Tim, since you are on those wx mailing list, could you provide them with this information, maybe it will help them understand ?

Yes, I can provide them with the info, but first I have to understand why you are not getting the bitmaps on some menus items. So, I am going to rebuild the DLL from unmodified source except for patches that I known were applied.

Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 11:07:00 pm
90 % of my icons have vanished and I have no idea what caused it.

Tim S :(
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: killerbot on December 29, 2006, 11:16:48 pm
indeed it seems the keybinder is related to it.

After I disabled the keybinder (be aware of the crashes that sometimes can happen when disabling plug-ins), I closed CB.
Restarted CB --> all icons there. Then I enabled the keybinder again and closed Cb and restarted CB --> keybinder said there was no profile and created a default profile, still all icons there. Closed CB, started CB [no remarks of keybinder this time] --> again 90% icons gone.

[EDIT] : tried this out twice -> reproducable
then a new test [started CB with active keybinder and 90% icons gone], Manage plugins : disable keybinder (hehe no crash ;-) ), checked the menus -> all icons back. Closing CB, and starting CB, all icons remain, but the momnt keybinder is turned on again (see above test procedure) 90% is gone again
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 29, 2006, 11:22:44 pm
indeed it seems the keybinder is related to it.

After I disabled the keybinder (be aware of the crashes that sometimes can happen when disabling plug-ins), I closed CB.
Restarted CB --> all icons there. Then I enabled the keybinder again and closed Cb and restarted CB --> keybinder said there was no profile and created a default profile, still all icons there. Closed CB, started CB [no remarks of keybinder this time] --> again 90% icons gone.

[EDIT] : tried this out twice -> reproducable
then a new test [started CB with active keybinder and 90% icons gone], Manage plugins : disable keybinder (hehe no crash ;-) ), checked the menus -> all icons back. Closing CB, and starting CB, all icons remain, but the momnt keybinder is turned on again (see above test procedure) 90% is gone again

I was also able to reproduce once, I am having problems turning off keybinder a second time without crashing. Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: killerbot on December 29, 2006, 11:42:24 pm
just keep on trying, it's a bug in the menu code [again menu code], but probably inside CB, see another thread [http://forums.codeblocks.org/index.php?topic=4754.0], with any plug-in.
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 30, 2006, 03:14:21 am
just keep on trying, it's a bug in the menu code [again menu code], but probably inside CB, see another thread [http://forums.codeblocks.org/index.php?topic=4754.0], with any plug-in.

I got it to turn off, I submitted a partial fix as a patch for the plugin disable issue also.

Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: Pecan on December 30, 2006, 04:03:51 am
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.

Code
}//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__ )
// ----------------------------------------------------------------------------

Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 30, 2006, 05:04:48 am
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.


This was the right way to fix this as a work around, but we might wish to find the cause, I think the cause is in wxWidgets MenuItem class.

I added code to the method RebuildMenuItem and it helps under 2.8.0, I am compiling it for 2.6.3.4 now and see if it works. Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 30, 2006, 05:30:44 am
I think I have found a patch to wxWidgets that fixes the issue. I will have to re-test to be sure.
The re-test still has the bug where keybinder removes 90% of the icons.

Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 30, 2006, 08:05:14 am
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

Code
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]

Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on December 30, 2006, 11:40:01 am
I added code to the method RebuildMenuItem and it helps under 2.8.0, I am compiling it for 2.6.3.4 now and see if it works. Tim S

It works for me under 2.6.3 with my menu items alignment patch applied to it.

[ Patch #1777 ] keybinder RebuildMenuitem patch
https://developer.berlios.de/patch/?func=detailpatch&patch_id=1777&group_id=5358

Tim S
Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: Pecan on December 30, 2006, 03:17:46 pm
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

Code
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]


These messages are correct. keybinder can have multiple profiles, so if the user switches to a secondary profile, the shortcuts must be removed and replaced with those of the secondary profile; else the old shortcuts will "leak" into the new chosen profile.

So the idea here is that when any profile is applied, remove the current shortcuts and replace them with those from the selected profile (previously recorded on disk in cbKeyBinder10.ini) . This applies to empty menuItems also. So if the user deleted a shortcut and saved it to disk, it gets replace with a "blank" shortcut when the profile is applied.

This of course, clobbers the icon in 2.6.2, but not 2.6.3 .

Re: The original problem with missing icons. Noone could change the text/label/shortcut of a menuitem without clobbering the icon. So the whole damn menuitem had to be rebuilt.

This also mean that anyone storing a pointer to the rebuilt menuitem is in deep doo. Because their pointer is now invalid.

You probably saw that in the code. I don't mean to insult your intelligence.

Title: Re: Solution To: menu items with icon not correctly aligned (since wx263)
Post by: Pecan on December 30, 2006, 03:26:46 pm
I added code to the method RebuildMenuItem and it helps under 2.8.0, I am compiling it for 2.6.3.4 now and see if it works. Tim S

It works for me under 2.6.3 with my menu items alignment patch applied to it.

[ Patch #1777 ] keybinder RebuildMenuitem patch
https://developer.berlios.de/patch/?func=detailpatch&patch_id=1777&group_id=5358

Tim S

Sorry, I don't get it. That patch is to menu.cpp . I thought you said it was a keybinder RebuildMenuItem patch.
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: stahta01 on December 30, 2006, 03:30:20 pm
Look at the Raw Patch View

https://developer.berlios.de/patch/download.php?id=1777

Tim S
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: killerbot on December 30, 2006, 04:09:05 pm
damn berlios, can't get to the raw patch :-(
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: stahta01 on December 30, 2006, 04:47:58 pm
damn berlios, can't get to the raw patch :-(

Code
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
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: Pecan on December 30, 2006, 05:23:04 pm
Look at the Raw Patch View

https://developer.berlios.de/patch/download.php?id=1777

Tim S

Applied (w/verbage) SVN 3443.

I don't know what you want done with the menu.cpp patch.
I'll leave that to Lieven.
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: stahta01 on December 30, 2006, 05:39:33 pm

I don't know what you want done with the menu.cpp patch.
I'll leave that to Lieven.


Sorry, that is just in case someone wanted to test it, and see it fixes the icon alignment bug.
Tim S
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: killerbot on December 30, 2006, 05:43:29 pm
yes, it works nicely. Well done guys.
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: stahta01 on December 31, 2006, 04:15:34 am
The wxWidgets people have not done any thing yet, so I am starting work on the patch submission process.
I am looking at the wxWidgets sample going to try to compile and verify problem exists with ownerdrw sample. If anyone has a better sample to demo the bug please email me which one is better. Tim S
Title: Re: Complete Solution To: menu items with icon not correctly aligned (since wx26
Post by: stahta01 on January 02, 2007, 06:56:24 pm
The wxWidgets people have not done any thing yet, so I am starting work on the patch submission process.
I am looking at the wxWidgets sample going to try to compile and verify problem exists with ownerdrw sample. If anyone has a better sample to demo the bug please email me which one is better. Tim S

The menu sample in folder samples\menu shows the problem when I compile menu.cpp using Code::Blocks. Now I have to verify the problem exists using the makefile.gcc and that it is fixed with the patch applied.
Progress is being made on the patch submission. Note, I am using CVS Head for all of this testing.
Tim S
Title: Re: wxWidget Patchwork: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on January 02, 2007, 09:05:18 pm
Uploaded Patch to wxWidgets
  http://sourceforge.net/tracker/index.php?func=detail&aid=1626428&group_id=9863&atid=309863
Bug reported in:
  http://sourceforge.net/tracker/index.php?func=detail&aid=1626424&group_id=9863&atid=109863

Tim S

Edit: They rejected my patch, I think they rejected it too quick to have really looked at the issue.
Title: Re: wxWidget Patchwork: menu items with icon not correctly aligned (since wx263)
Post by: stahta01 on January 13, 2007, 12:48:48 am
I found a flaw in my patch that I am working to fix.
Tim S
Title: Re: wxWidget Patchwork: menu items with icon not correctly aligned (since wx263)
Post by: killerbot on January 13, 2007, 12:49:58 am
great Tim  :D
Title: Re: REWORK wxWidget Patch: menu items with icon not correctly aligned (since wx263)
Post by: David Perfors on January 14, 2007, 07:01:21 pm
It seems that you're patch is rejected....
Title: Re: REWORK wxWidget Patch: menu items with icon not correctly aligned (since wx2
Post by: stahta01 on January 14, 2007, 08:48:05 pm
Someone applied it after they rejected it, by about a week.
Tim S
Title: Re: REWORK wxWidget Patch: menu items with icon not correctly aligned (since wx263)
Post by: David Perfors on January 14, 2007, 10:13:55 pm
I see, probably rejected because it was incomplete (I think)
Title: Re: REWORK wxWidget Patch: menu items with icon not correctly aligned (since wx2
Post by: stahta01 on January 14, 2007, 10:17:42 pm
I see, probably rejected because it was incomplete (I think)

Actually it was a valid reason to reject (They said to remove the fix, by applying my patch, for something else would result in some bug returning) but I asked it to be applied to CVS head so someone would find out what it breaks, I just assumed it would be someone other than me that would get bitten by the breakage.

Tim S 
Title: Re: REWORK wxWidget Patch: menu items with icon not correctly aligned (since wx2
Post by: stahta01 on January 17, 2007, 04:07:23 pm
I am testing my back port of the wxWidgets 2.8.1+ code to fix the issue on the 2.6 branch.
Tim S
Title: Re: REWORK wxWidget Patch: menu items with icon not correctly aligned (since wx2
Post by: stahta01 on January 17, 2007, 04:46:30 pm
I have uploaded my back port of how this problem was fixed in CVS head. The fix is patch 1637808 which updates the file menu.cpp. I would apply the patch 1637804  before doing this patch because menu uses code in the file ownerdrw.cpp.

Tim S

[ 1637808 ] MSW: menu.cpp backport to 2.6_BRANCH from cvs head
http://sourceforge.net/tracker/index.php?func=detail&aid=1637808&group_id=9863&atid=309863

[ 1637804 ] MSW: ownerdrw.cpp backport to 2.6_BRANCH from cvs head
http://sourceforge.net/tracker/index.php?func=detail&aid=1637804&group_id=9863&atid=309863

Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: killerbot on January 19, 2007, 11:10:01 pm
these are based on the wx guys solution to the problem. Since I once tried an earlier attempt of you (graying out of icons), but then th first letter could duplicated. Is this now a new way. Just to be sure, I don't try out twice the same ;-)
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: stahta01 on January 20, 2007, 03:21:14 am
Yes, this one does not double the first letters.

All my testing was with both of these patches applied.

Tim S

Edit: Before i was testing each patch by itself and discovered an problem of double the first letters happened when both patches where applied. This was because the alignment patch had code issues.



Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: killerbot on January 20, 2007, 03:13:50 pm
I have build  new wx dll by applying these 2 patches on the wx263p2 code and have tested with revision 3295 (rather old !!!). these are the results :
 - menus (with or without) icons alligned correctly
 - icons grayed out  in the menu as they should be
 - 90% of the icons are gone (due to keybinder)

updating my CB now to the latest revision, will adjust this post with the new results.
[EDIT : test finished]
with the latest svn revision 3516 : all is OK (all icons present) !!   :D :D :D
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: Pecan on January 20, 2007, 03:32:35 pm
I have build  new wx dll by applying these 2 patches on the wx263p2 code and have tested with revision 3295 (rather old !!!). these are the results :
 - menus (with or without) icons alligned correctly
 - icons grayed out  in the menu as they should be
 - 90% of the icons are gone (due to keybinder)

updating my CB now to the latest revision, will adjust this post with the new results.

I think you'll find that TimS's fix to keybinder to match his wxWidgets fixes occured in SVN 3443.
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: killerbot on January 20, 2007, 04:10:02 pm
@Tim : did the wx guys already fix the issue that relates to our problem where the replace button on the toolbar in windows being incorrect and showing the find button ??
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: stahta01 on January 21, 2007, 01:46:13 am
@Tim : did the wx guys already fix the issue that relates to our problem where the replace button on the toolbar in windows being incorrect and showing the find button ??

My backport fix for that problem is here.
Tim S
[ 1633748 ] wxMSW backport of tbar95 code in wxREMAP_BUTTON_COLOURS
http://sourceforge.net/tracker/index.php?func=detail&aid=1633748&group_id=9863&atid=309863
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: killerbot on January 21, 2007, 11:38:44 am
confirmed, it works :-)

new hacked dll coming up on berlios : wxmsw26u_gcc_cb_wx2.6.3p2AndCbPatch_version3.7z
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: Szabadember on January 21, 2007, 12:26:09 pm
I downloaded that new dll but the save button is still not grayed out..
everything else is fine( icons aligned correctly, all other toolbar buttons working properly)
rev3461
win xp sp2
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: Szabadember on January 21, 2007, 12:30:03 pm
And if i use large icons (22*22) even more toolbar icons are not grayed out (undo,redo,cut)

These problems are also present in rev3507
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: stahta01 on January 21, 2007, 01:15:26 pm
And if i use large icons (22*22) even more toolbar icons are not grayed out (undo,redo,cut)

These problems are also present in rev3507

I have just tried it under wxWidgets 2.8.1 + 2 patches that I back-ported and it has this issue our for toolbar icons.

Note: My patch was to fix the pull-down menus NOT the toolbar menus for graying out.
I can look at this issue, but I never really saw it before; did it exist a month ago?
Or has it started recently?
My patch on the toolbar menu was for reducing the number of colours in the bitmap.

I have looked at the issue and I am NOT sure if it is a wxWidgets or a Code::Blocks caused issue.
(undo,redo,cut) and I think save and paste may have the problem of not graying out.

Tim S
Title: Re: Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx
Post by: Szabadember on January 21, 2007, 03:24:09 pm
There were always problems with the toolbar images...
It would be nice if you could fix that issue too ;)