Themed Buttons on BMP background

Post Reply
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Themed Buttons on BMP background

Post by James Bott »

Themed buttons on a bitmap background (on a dialog) do not have a transparent background so there is an ugly one pixel gray border around them. I also notice that isAppThemed() always returns .f. even when I have a manifest file. Is this a bug, and could this be the reason?

Using May 2006 build and Harbour and XP Pro SP2.

James

Code: Select all

function doit()
   local oDlg,oBrush,cName:=space(20),oBtn
   define brush oBrush file "bluegrad.bmp"
   define dialog oDlg title " with Brush" brush oBrush
   @ 1,1 get cName of oDlg
   @ 2,1 say oSay prompt "Name" of oDlg
   oSay:lTransparent:=.t.
   @ 3,1 button oBtn prompt "Ok" action oDlg:end()
   oBtn:lTransparent:=.t.
   activate dialog oDlg centered
return nil
User avatar
Maurilio Viana
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil
Contact:

Re: Themed Buttons on BMP background

Post by Maurilio Viana »

James, I think TButtonB don't get transparency and don't change face color because Win API. But lets wait for words by Antonio, he ever have a solution.

Regards
Maurilio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

James,

It is a Windows theme issue (we already reviewed this with Brian Hays). Here it is how it looks with XP standard blue theme:
Image
Here you see it with a different XP theme (it looks ok):
Image
The FWH exe is the same in both samples.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

James,

Regarding IsAppThemed(): this function just checks if the manifest file is linked into the EXE. We may need to modify it to detect an external manifest file.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Antonio,

>Here it is how it looks with XP standard blue theme:

It is even worse when the button is not in focus--the gray border is on all sides of the button.

>It is a Windows theme issue

This is very dissapointing. Since many (if not most) users are using the standard blue theme, we cannot produce a decent looking themed button on a colored or bitmapped dialog in our applications without many users seeing the odd display.

What theme are you using in the version without the gray outline?

Thanks for the isAppThemed() explaination. It would be helpful if isAppThemed() would detect external theme manifest files. Otherwise it is more difficult to test small samples of code since you need to build a resource file for each one.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

James,

> What theme are you using in the version without the gray outline?

As you may know, Windows XP themes support for non standard ones is blocked. To unblock it and use many available free themes on Internet, you have to replace uxtheme.dll with a patched one.

There are lots of them. I use one that looks like Windows Vista one.

Regarding IsAppThemed(), yes, we are going to modify it asap.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Antonio,

>As you may know, Windows XP themes support for non standard ones is blocked. To unblock it and use many available free themes on Internet, you have to replace uxtheme.dll with a patched one.

I understand. We can solve the problem for ourselves, but one cannot distribute an application with buttons that look bad with the standard XP themes. Our applications would look very unprofessional. So, in order to avoid the problem, our only solution is to avoid using color and bitmap backgrounds on dialogs. Unfortunately, more color and graphics is the current trend in applications.

I had even figured out how to paint gradient backgrounds on windows and dialogs, but now I guess I can't use them because of the button problem. :-(

Thank you for looking into fixing isAppThemed to work with external manifest files.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

James,

Microsoft applications have the same problem, but they use lighter colors for the background. Its the XP theme that makes a gradient from the surounding background color.

Have a look at Microsoft Visual C++ Express edition:
Image
From here:
Image
As I have commented you, this is a Windows issue, its not a FWH one.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

James,

When you use an external manifest file, how do you name it ? Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Antonio,

>Microsoft applications have the same problem, but they use lighter colors for the background. Its the XP theme that makes a gradient from the surounding background color.

I have noticed that too. That does seem to be a workaround although very limiiting.

>As I have commented you, this is a Windows issue, its not a FWH one.

I understand, I'm not blaming FW, just expressing my dissapointment in the situation. We could design some really nice looking apps if this wasn't a problem.

>When you use an external manifest file, how do you name it ?

[application name].exe.manifest

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

James,

>> When you use an external manifest file, how do you name it ?

> [application name].exe.manifest

We have modified IsAppThemed() to detect such external file too.
We are emailing you a new FiveHC.lib for your review. Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurilio Viana
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil
Contact:

Post by Maurilio Viana »

Antonio Linares wrote: There are lots of them. I use one that looks like Windows Vista
Antonio, I'm searching for a "Vista Like Theme" for any weeks...
Where you downloaded it?

Regards!
Maurilio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Maurilio,

You may download it from here:
http://hyperupload.com/download/0205a69 ... n.zip.html
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Maurilio Viana
Posts: 252
Joined: Tue Oct 25, 2005 2:48 pm
Location: Garça/Garza/Heron City - Brazil
Contact:

Post by Maurilio Viana »

Thanks a lot, Antonio!

Regards
Maurilio
Post Reply