No announcement yet.

XP Theme support in PB/Win

  • Filter
  • Time
  • Show
Clear All
new posts

  • XP Theme support in PB/Win

    It seems to me that John Spikowski's question in the Linux discussion in the Café merits it's own thread here:
    I did a search for XP manifest support and could only find this thread which seems unanswered. Can someone tell me what the current status of XP theme manifest support for PowerBASIC is?
    The link you give, John, provides a very comprehensive solution for XP-themed buttons by José Roca, but some other aspects of XP theming remain somewhat difficult to achieve in PB/Win.

    The child dialog of a Tab controls is a particular problem because of its gradient fill background. Whilst it is reasonably easy to create the blank dialog, drawing and updating labels and other controls on it is a problem.

    I'm not aware of any post here containing a comprehensive solution to all XP-theming issues, and I support John's implication that it would be helpful to have more inbuilt theme support in future versions of PB/Win.
    Last edited by Simon Morgan; 23 Jun 2008, 06:47 AM. Reason: Link fixed

  • #2
    This contains all the code needed for creating a themed application:
    PowerBASIC and related source code. Please do not post questions or discussions, just source code.

    Themed custom controls are another matter though, I believe Jose has more translations of the UXTHEME header on his forum. | Slam DBMS | PrpT Control | Other Downloads | Contact Me


    • #3
      Thanks guys for following up on this !

      I will give the suggestions in this post a try with the tab demo and see how it works out.



      • #4
        Originally posted by Kev Peel
        Adding to already compiled applications

        You can add theme support to any existing win32 program by simply creating the .xml file as "exename.exe.manifest", where "exename.exe" is the program's name. Place it in the program's folder. I did this with Visual Studio 6 and it worked fine.
        Thanks Kev !

        That couldn't have been easier. I just copied the HB manifest to the PB tab example folder and renamed it to TabControl.exe.manifest and the following appeared.

        Originally posted by Simon Morgan
        I support John's implication that it would be helpful to have more inbuilt theme support in future versions of PB/Win.
        I'm thinking of creating a reusable xpstyle.pbr that I would use as a default #RESOURCE meta tag if I didn't have any other resources to add. The HB meta tag is nice because you only have to create a .manifest file for the compiler and the meta tag then adds it to your .exe as well but embedded. Something to add to the PowerBASIC wish list.
        Last edited by John Spikowski; 24 Jun 2008, 05:11 AM.


        • #5
          That's looking good, John, but the child dialog on each Tab should really be off-white, getting darker towards the bottom. That way the dialog is contiguous with the relevant tab and border, so that the end user is unaware that there is a child dialog. Calling Kev's EnableDialogTheme function for the child dialog should achieve this.

          While we are on the subject, it's not just custom controls that need individual attention in order to appear themed. Anything with an image (instead of text) also comes out in the old (Win 2000) style, despite adding the manifest (try CONTROL ADD IMGBUTTON, for example).

          José's include file provides for almost any type of action button, but I haven't seen any code for a themed option (radio) button labelled with a bitmap. (I currently cheat by drawing the option unlabelled and add the graphic separately.)


          • #6

            The nonthemed image button seems to be a bug or limitation with the BUTTON class on XP (I'd go with the latter -- they were lazy with it on XP). The following compares a BS_ICON button between XP and Vista:

            As you can see, the Vista buttons are themed. They also have the "hot" changes when the mouse is hovered over. The only way I can see to reproduce this on XP is to create a custom control and handle all the hover and theme drawing yourself. With these hover effects, an ownerdrawn button just won't cut it. It's not that hard to call UXTHEME to draw a custom button, but personally I didn't bother (perhaps an idea for my hoverbutton control in the source forum )
            Last edited by Kev Peel; 24 Jun 2008, 12:45 PM.
   | Slam DBMS | PrpT Control | Other Downloads | Contact Me


            • #7
              Does anyone know of a way to tweak the manifest (file/resource) to change color of buttons for example. (default blue override) I would like the use a color more like Kev's example.




              • #8

                The colors/styles are defined by the Windows theme in use. The only way of changing it is to modify the theme via control panel.
       | Slam DBMS | PrpT Control | Other Downloads | Contact Me


                • #9
                  This looks like something of interest. (FREE)

                  XP Theme Manager

                  Comments welcome !