XP themed bitmap button

If you have a cool piece of software to share, but you are not hosting it officially yet, please dump it in here. If you have code snippets that are useful, please donate!
Jamie
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Mar 30, 2005 10:56 pm

XP themed bitmap button

Post by Jamie » Sun Sep 04, 2005 5:53 pm

Code: Select all

    // removed
I have (finally) committed a better solution to CVS 2.6 branch. Now normal buttons with a non-default text colour are also XP themed.

Updated files are in 2.6.3 Patch 2.
Last edited by Jamie on Wed Apr 05, 2006 10:27 am, edited 2 times in total.

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Sun Sep 04, 2005 11:09 pm

I'll have a go at it - your old patch has some pointer problems... since wx moved to 2.6.1-2

Jamie
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Mar 30, 2005 10:56 pm

Post by Jamie » Mon Sep 05, 2005 1:10 am

lowjoel wrote:I'll have a go at it - your old patch has some pointer problems... since wx moved to 2.6.1-2
A lot has changed since that first patch was done. Now that wx has native enter/leave mouse events it should work a lot better. Could you explain what pointer problems? The wxUxThemeEngine class has changed since the first patch, do you mean here?

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Mon Sep 05, 2005 8:53 am

yea i meant that... anyways... ill quickly patch wxup and ill let you know... nice job with the old one anyway :P

Chr
Earned some good credits
Earned some good credits
Posts: 115
Joined: Tue May 31, 2005 2:17 pm

Post by Chr » Mon Sep 05, 2005 2:44 pm

what's the ux-theme engine class?
wxWidgets is nice

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Mon Sep 05, 2005 2:45 pm

setup.h - define 1 if u want to compile wxwidgets with XP Theming support.

Jamie
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Mar 30, 2005 10:56 pm

Post by Jamie » Wed Sep 07, 2005 12:33 pm

wxUxThemeEngine is a wrapper class around uxtheme.dll. It is defined to 1 by default in setup.h.

So has anyone tried the bitmap button yet? I'm interested to hear if anyone is using a theme that doesn't work correctly with this class.

Thanks

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Wed Sep 07, 2005 11:41 pm

works swell jamie, no probs so far :P

dsk
Experienced Solver
Experienced Solver
Posts: 91
Joined: Sat Jun 25, 2005 12:10 pm
Location: Poland

Post by dsk » Thu Sep 08, 2005 1:27 pm

Could someone post screenshot ?

Thanks
Back to wxWidgets and c++, from long time with php projects

Jamie
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Mar 30, 2005 10:56 pm

Post by Jamie » Thu Sep 08, 2005 1:57 pm

It looks just like a normal button in Windows XP, but instead of text it uses a bitmap. The wxBitmapButton class normally ownerdraws itself to look like pre-XP style buttons and this doesn't look good in XP.

Chr
Earned some good credits
Earned some good credits
Posts: 115
Joined: Tue May 31, 2005 2:17 pm

Post by Chr » Thu Sep 08, 2005 2:10 pm

can't this version (xp-looking) replace the orginal in the cvs?
wxWidgets is nice

Jamie
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Mar 30, 2005 10:56 pm

Post by Jamie » Thu Sep 08, 2005 2:20 pm

Screenshot from the controls sample:

Image

I will submit a patch to add this to CVS when it has been tested some more.

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Thu Oct 13, 2005 10:38 am

We got a slight problem... when Disable() is called in Win 98 (one of my school's comps just to see how CT will work out):

<img src="http://joelsplace.sg/Bitmap Button.PNG" alt="Bitmap Button">

Notice how the buttons get painted with white? The buttons work fine if they are enabled, however.

Jamie
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 205
Joined: Wed Mar 30, 2005 10:56 pm

Post by Jamie » Sat Oct 15, 2005 12:16 pm

lowjoel wrote:We got a slight problem... when Disable() is called in Win 98 (one of my school's comps just to see how CT will work out):
Does it work fine on Win 2000? What happens if you don't use my modified files, does it work correctly then?

I don't have a development system setup for Win 98 so I can't test this, but if you can answer these questions I will try and fix it.

lowjoel
Moderator
Moderator
Posts: 1511
Joined: Sun Jun 19, 2005 11:37 am
Location: Singapore
Contact:

Post by lowjoel » Sat Oct 15, 2005 1:56 pm

I'm not too sure about win2000, since I only use XP ands my school uses 98 in some computer labs. I'll have a go in the future.

Joel

Post Reply