Page 1 of 1

wxMenu looks bad

Posted: Fri Mar 20, 2009 8:46 am
by jacmoe
Why does wxMenu look like something dragged out of Win95 when I use images? :)

Image

I am tempted to use wxFlatMenu, but there must be some way to get a modern look. I mean: that's native on XP and Vista.
Seems like it is using some ancient win95 code under msw.

I can't figure out where the drawing is happening, is it in ownerdrawn?

Why hasn't people complained about it?

I've seen some posts in the past about the philosophy behind wxWidgets, but now I see that Ribboncontrol is in the list of suggested summer of code projects..

Why? All I need is a good looking menu.

Any ideas? :)

Re: wxMenu looks bad

Posted: Fri Mar 20, 2009 12:07 pm
by computerquip
jacmoe wrote:Why does wxMenu look like something dragged out of Win95 when I use images? :)

Image

I am tempted to use wxFlatMenu, but there must be some way to get a modern look. I mean: that's native on XP and Vista.
Seems like it is using some ancient win95 code under msw.

I can't figure out where the drawing is happening, is it in ownerdrawn?

Why hasn't people complained about it?

I've seen some posts in the past about the philosophy behind wxWidgets, but now I see that Ribboncontrol is in the list of suggested summer of code projects..

Why? All I need is a good looking menu.

Any ideas? :)
People don't complain about it because it's not what they get from wxWidgets. Could you show us a picture and possible the way your compiling your file?

Re: wxMenu looks bad

Posted: Fri Mar 20, 2009 1:07 pm
by jacmoe
computerquip wrote:People don't complain about it because it's not what they get from wxWidgets. Could you show us a picture and possible the way your compiling your file?
That's comforting to know. :wink:

<edit> I did link to a picture - do you not see it? </edit>

Here's how I do the menu:

Code: Select all

	menuBar = new wxMenuBar;

	// File menu
	mFileMenu = new wxMenu;
	// New Scene
	wxMenuItem* newMenuItem = new wxMenuItem(mFileMenu, ID_TBFILENEW, wxT("&New Scene"), wxT("New Scene"), wxITEM_NORMAL);
	wxBitmap newBitmap(itemFrame1->GetBitmapResource(wxT("16x16/filenew.png")));
	newMenuItem->SetBitmap(newBitmap);
	mFileMenu->Append(newMenuItem);
	// Open Scene
	wxMenuItem* openMenuItem = new wxMenuItem(mFileMenu, ID_TBFILEOPEN, wxT("&Open Scene"), wxT("Open Scene"), wxITEM_NORMAL);
	wxBitmap openBitmap(itemFrame1->GetBitmapResource(wxT("16x16/fileopen.png")));
	openMenuItem->SetBitmap(openBitmap);
	mFileMenu->Append(openMenuItem);
...
...
	menuBar->Append(mFileMenu, wxT("&File"));
I am working from a vanilla SVN trunk wxWidgets (2.9), using default settings.

This is my preprocessor defines:
WIN32;_DEBUG;_WINDOWS;__WXMSW__;__WXDEBUG__
I am linking to:
comctl32.lib rpcrt4.lib winmm.lib wsock32.lib wxmsw29ud_propgrid.lib
And, did I mention that it's in Vista? :)

Let me know if you need to know more.. :wink:

What's weird is that the menus without bitmaps looks just fine.. :?

<edit2>
Could it be that png is unsupported as native bitmap in windows?
</edit2>

Re: wxMenu looks bad

Posted: Fri Mar 20, 2009 8:51 pm
by Frank
computerquip wrote: People don't complain about it because it's not what they get from wxWidgets. Could you show us a picture and possible the way your compiling your file?
That's not true.

I see the exact same problem. Add a bitmap to a menu and it looks like stoneage (wxMSW 2.8.9, VC2008, Vista X64 with Fixpack1).

Posted: Sat Mar 21, 2009 5:25 pm
by jacmoe
I this not a problem for you people? :)

I mean, I haven't seen a single wxWidgets app using bitmaps in the menu..
Except those using wxFlatMenu..

If I wanted to fix this, where do I start? :)

Windows doesn't get a lot of wxLove these days - I can see that from following the wxWidgets SVN commmits. :wink:

Posted: Sat Mar 21, 2009 8:42 pm
by jacmoe
Fixed! :D

Vadim and I fixed the issue:
http://www.nabble.com/wxMenu-with-bitma ... #a22640176

This is really great. :)

Posted: Sat Mar 21, 2009 10:27 pm
by jacmoe
Well, semi-fixed.
As long as you don't use bitmaps for check and radio menu items. :wink: