• Welcome to Theos PowerBasic Museum 2017.

XPButton - Theme aware push button

Started by Scott Slater, February 18, 2009, 06:42:18 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Scott Slater

I just downloaded this and it requires a file called "uxtheme.inc".  Where can I get this.  It isn't in the default PB9 include files.

Thanks,

-Scott

José Roca

 
I don't use the include files that come with the compiler, but my own translation of the Windows SDK Headers: http://www.jose.it-berater.org/smfforum/index.php?board=344.0

Scott Slater


Gian Young

Hi Jose,

"uxtheme.inc" now requires "windows.inc"

This include file is not located in the WINAPI_110.ZIP file, can you let me know where this can be found.

Also when compiling PB reports that #ENDIF missing in "uxtheme.inc"

Regards

Gian Young

José Roca

#4
 
Of course it is. Please don't just download the files, but also read the post.

Quote
Unzip the attached file to a folder of your choice and replace the PB Include path in the PB Ide or the editor that you are using to that folder instead of C:\PBWin90\WinApi.

Mixing my include files with the include files provided by the compiler is incompatible.

Read also this thread: http://www.jose.it-berater.org/smfforum/index.php?topic=1759.0

Gian Young

Thanks Jose,

Will dig deeper.

Regards

Gian

Jordi Vallès

Hi José,

Recently I detected a different behaviour on some controls if a program uses this "XPButton Theme aware push button" and run under XP SP3 or Vista SP1. Is not relevant where was compiled and happens with DDT and SDK.

Easy to detect is in the Frame Control. Running on a XP the program can change the color dynamically using the uxtheme functions, but no under Vista, that always is black. To solve this differences I disable XPTheme for a specific frame control using the routine provided by Jules Marchildon on http://www.powerbasic.com/support/pbforums/showthread.php?t=39745 and after the program can change the colors using the classic code and the behaviour is exactly the same on both Operating Systems.

Its really a problem? or perhaps depends of some configuartion on Vista PCs? or is a MS caprice?

Same problem has been detected on "GroupLineCtx - Theme aware group line control". Run the sample provided in this forum on both systems and you can see the problem. 

Saludos
Jordi




Gian Young

Hi Jose

"RE Unzip the attached file to a folder of your choice and replace the PB Include path in the PB Ide or the editor that you are using to that folder instead of C:\PBWin90\WinApi."

I wanted to report that I am attempting to use these with Firefly 2.91 and PB 9.0, I have followed your instructions as indicated above but have experienced much difficulty attempting to compile with these set to operate within Firefly.

Initially I have taken a Firefly project that compiles without error, then without making any modifications to the project other than changing the project properties path for "Include Files" to point the NEW folder that contains the unzipped .INC files from WINAPI_110.ZIP, I now unfortunately cannot get a successful compile of the same project without a number of Powerbasic compiler errors. e.g. "Parameter Mismatch Errors" to "Duplicate Equate" etc.

Either I have misinterpreted the instructions very badly or getting these to work with Firefly requires much more than just changing the path address for .INC files in the project properties. It could very well be a Firefly incompatibility thing.

I am very happy using Firefly as my IDE and would dearly love to get your Theme Aware push buttons going within Firefly but regretably cannot get off the ground. Is there another way around this??

Best Regards

Gian


José Roca

 
It must be adding a reference to one of the include files provided with the compiler. I think that version 3.0 of FireFly will allow the use of my include files.

There is a legacy version that should work with the current version of FireFly: http://www.jose.it-berater.org/smfforum/index.php?topic=76.0

José Roca

Quote
Recently I detected a different behaviour on some controls if a program uses this "XPButton Theme aware push button" and run under XP SP3 or Vista SP1. Is not relevant where was compiled and happens with DDT and SDK.

Sorry, Jordi, but I only have XP SP2.

Gian Young

Hi Jose,

I wanted to thank you for pointing me in the direction of the legacy version of XPButton. I now have TB_XPBUTTON working with SDK coding and Firefly 2.91 with PB9 with one minor hurdle to get past.

Basically I wanted a Classic Button style with icon on the left hand side and text to the right of the icon, I have figured out the various property permutations of the theme button to get a classic style looking button with the icon and have added a small bit of code to make the button caption also move down (1) and right (1) with the icon when the button is toggled. For some reason you didn't include this.

I have still not quite achieved what I want because I cannot successfully load the font style, font size and font attribute that I wish to use for the caption (FUNCTION TB_XPButton_SetFont), for some reason regardless of what font and size I create and use the button appears to have a mind of its own and only implements the System Font and Size and ignores any attempts to change it. I must be doing something subtly wrong somewhere and am still trying to figure this out.

Anyway thank you for providing this code for the Theme Button and for the challenge.

Regards

Gian

Gian Young

Hi Jose,

I wanted to add to my previous comments regarding using the legacy version of TB_XPBUTTON with Firefly 2.91. I have found a work around regarding the font creation difficulty I was experiencing by tapping into the fonts created by Firefly for the button control, this has overcome the issue I was having.

I wanted to post a pic of some of the buttons I have created using TB_XPBUTTON for the interest of others but all attempts to include a Pic (.GIF) here only seem to produce negative results when I preview the reply??.



I would be happy to send detail to anyone interested vis email link.

Once again my thanks to you for the education.

Regards

Gian Young

Joop Blokker

Hello Jordi, José & All..!

Quote from: Jordi Vallès on February 21, 2009, 08:11:28 PM
Recently I detected a different behaviour on some controls if a program uses this "XPButton Theme aware push button" and run under XP SP3 or Vista SP1. Is not relevant where was compiled and happens with DDT and SDK.

José, thanks again for the great themed XPButton routines, the interface looks so much better! I found another difference:

Non-themed button:  Move the mouse cursor over a button, press the left mouse switch and keep it pressed. On second thought you do not want that action and - still keeping the switch pressed - you drag the cursor off of the button. When releasing the mouse switch, no action is taken.

Themed XPButton: Do the same as above, release the mouse switch when the coursor is outside the button and YET the action fires.

I wonder what extra check I should add to the callback function to cancel the click if the mouse pointer moved outside the button. Thanks in advance for any idea.

Joop.



Have fun, no matter what..

Patrice Terrier

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com