Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Refixed wxWidget Patch: menu items with icon not correctly aligned (since wx263)

(1/11) > >>

stahta01:
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


--- End quote ---

killerbot:
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 ....

stahta01:
Just remove the
&& !pItem->GetBitmap(true).Ok()

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

Tim S

killerbot:
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

--- End code ---

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

--- End code ---


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).

stahta01:
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

Navigation

[0] Message Index

[#] Next page

Go to full version