Is it possible to have a full window background image in a burn theme?
Asked Answered
L

3

7

When I set an Image to fill the window, it seems to render over the top of the other controls and generally make a mess of painting the window. The order in the file doesn't seem to help, however if I put it inside it's own Page section it behaves a little better.

Is there any way to display an image behind everything in the window?

Also, the other controls don't seem to render over the top of it properly when they do (text has white background, buttons have white squares), I'm guessing they need a transparent mode set somewhere?


Edit:

Here is an example of the problem, the button and checkbox became visible from mouseover, and the text from selecting:

problem image

Leopoldeen answered 4/4, 2013 at 5:30 Comment(0)
L
9

I was not able to get the Image as a background to work, however I was able to get what I wanted using the window background.

The Window allows you to use an image specified in the Theme/@ImageFile, and then specify the Window/@SourceX and Window/@SourceY offsets to 0. However this is not enough, as the Windows referenced font background will override the window image background. You need to use a font without a background specified.

<Theme xmlns="http://wixtoolset.org/schemas/thmutil/2010"
    ImageFile="background.png">
    <Window Width="485" Height="300" HexStyle="100a0000"
        FontId="0" SourceX="0" SourceY="0">#(loc.Caption)</Window>
    <Font Id="0" Height="-12" Weight="500"
        Foreground="000000" Background="FFFFFF">Segoe UI</Font>

There are two other issues I had to work around:

  • The checkboxes dont obey the background colour but that's because of the common controls wixstdba uses, just have to deal with it.
  • The progress text changes but doesn't have its background repainted, so it draws over itself, worked around by giving it a background.

dialog with background image

Leopoldeen answered 9/4, 2013 at 14:19 Comment(2)
Your solution was very helpful. Thank you! I'd like to know how you had to deal with the checkboxes? Even if I set the font to be transparent, it still ends up having a white backgound. Same for Hypertext controls and progress bar text. What is your workaround for that? You said you give it a background. Can you please elaborate on that?Piggery
Hey @Thracian, a little late, but what I did was just accept the checkbox as is (possibly work around it in the image) and set the background colour of the font used for the progress text to have a white background also.Leopoldeen
G
4

Yes, it is possible. If you have a static image that is the same for all pages in the theme then you can put the Image element above all the page elements. Optionally, if you want a different background per-page then put the image first in the page. I organize my theme like so:

<Theme>
   <Window />
   <Font /> <!-- as many as necessary -->

   <Image /> <!-- global background image -->

   <Page> <!-- repeat for each page -->
      <Image /> <!-- per-page background image -->
      <other controls />

The order of the control elements defines the Z-order in reverse. The first control is on bottom and the controls down from there stack on top. That's why the background Image needs to be first.

As for transparent text, it is possible with varying levels of goodness. First to get rid of the white background, you need to remove the Background attribute from the Font element used for the transparent text. An absent Background attribute means use the null brush for the text, which is essentially transparent.

The levels of transparency goodness depends on the control. Checkboxes never seem to respect the transparent text. Also, transparent text does not work well if it gets redrawn. You'll see the old text left behind. So transparency only works on Text that isn't updated.

Anyway, hopefully the above gets you started. If you'd like to contribute to help improve transparency or theme's I recommend taking a look at the code in src\dutil\thmutil.cpp. Maybe you can us figure out how to make it work perfectly.

Gilreath answered 4/4, 2013 at 13:29 Comment(4)
Lol I was wondering why this was one of the few places on t'net that has an explicit understanding of the Themes for Wix. Should have known it was one of the contributors lol! Thanks Rob.Agreed
I frequent three places: my blog at robmensching.com/blog, [email protected] mailing list, and StackOverflow wix tag. :)Gilreath
This isn't working for me, the image is drawn over the top initially, though when you move the mouse around the controls repaint over the image. I'll add some images and examples for thmviewer tomorrow.Leopoldeen
redwyre - the z-order is unpredictable certainly (we have the progress bar currently rendering behind). The best tip I can give you is use the themeViewer, it removes the guess work!Agreed
A
4

I've just found out a key field when attempting to theme WIX.

Visible="yes"

Does not mean the element visible. It means the element is always visible. On every Page.

Agreed answered 9/4, 2013 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.