Skip to content
⌘ NSIS Forum Archive

GroupBox Text Question

12 posts

Jnuw#

GroupBox Text Question

Hello all.

I have an installer where I am editing the stock Finish Page's iospecial.ini before it is diplayed in order to add some colored text. That is working just fine.

However I also added a GroupBox to the Finish Page, and it too looks good, but I noticed that the GroupBox Text (Final Update Status) is always displaying in a dark blue (see below). I tested this on another installer that begins with a custom page, and there again, the text is blue.



I tried to change this using:
GetDlgItem $MUI_TEMP1 $MUI_HWND 1202   ;3rd control
SetCtlColors $MUI_TEMP1 "000000" "${MUI_BGCOLOR}"
But no luck. The iospecial.ini code is:
[Field 3]
Type=GroupBox
Left=120
Right=315
Top=45
Bottom=90
Text=Final Update Status
Any ideas? Thanks.

Jnuw
iceman_k#
This is probably your XP theme doing its thing.
I think that XP themes will override any colors you try to set, unless you subclass the control and override the XP theme.
Did you try turning XPStyle off?
kichik#
Modifying IntallOptions' test.nsi InstallOptions call did the trick and change the background color of the text.
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\test.ini"
Pop ${TEMP1}
ReadINIStr ${TEMP1} "$PLUGINSDIR\test.ini" "Field 1" "HWND" # 2.11 feature
SetCtlColors ${TEMP1} 0x00FF00 0xFF
InstallOptions::show
Are you sure the HWND is correct? Try hiding the window using ShowWindow. This way you can't be wrong about the window handle you got.

[edit] Turning XPStyle on indeed changed my text color. That might be the problem.
Jnuw#
iceman_k, yes, when I turn off XPStyle, it goes back to black, however I don't want to give up the XPStyle, but thanks for the suggestion.

kichik, I believe I have the HWND correct when I added the last line of code below, the GroupBox disappeared.
GetDlgItem $MUI_TEMP1 $MUI_HWND 1202  ;Set to 3rd control
SetCtlColors $MUI_TEMP1 "000000" "${MUI_BGCOLOR}"
ShowWindow $MUI_TEMP1 Hide
I have these commands in the Finish Page SHOW function, along with the other commands to change the color of other Finish Page controls. Am I doing something wrong? Thanks.

Jnuw
kichik#
Originally posted by Jnuw
Am I doing something wrong?
Nope, it seems correct. And if the control hides with ShowWindow, it most probably is. Try a transparent background, that might work.
Jnuw#
kichik, thanks for looking at this. I tried setting the background to Transparent, and no change. Then just to see if it was working, I did this:
GetDlgItem $MUI_TEMP1 $MUI_HWND 1202  ;Set to 3rd control
SetCtlColors $MUI_TEMP1 "000000" "000000"
And got this:



So part of the command is working (backgrond), but not the font color part.

Jnuw
iceman_k#
Originally posted by Jnuw
iceman_k, yes, when I turn off XPStyle, it goes back to black, however I don't want to give up the XPStyle, but thanks for the suggestion.
Like I said before, as long as you have XPStyle on, I don't think you can do anything about the Groupbox text color.
One hack would be to place a label on top of the Groupbox which lies on top of the Groupbox label. Then set the label text color.
If you are hellbent on using XPStyle then consider creating a plugin which subclasses the Groupbox control.
The VisualStylesXP wrapper might be of help there.
(I am using it in EclipseNSIS to circumvent a bug in the Microsoft implementation of WM_PRINT for certain XP themed controls).
Jnuw#
Originally posted by Jnuw
GetDlgItem $MUI_TEMP1 $MUI_HWND 1202  ;Set to 3rd control
SetCtlColors $MUI_TEMP1 "000000" "000000"
And got this:



So part of the command is working (background), but not the font color part.
Since the above command is not working for me, I took your suggestion iceman, and put a label control directly on top of the groupbox label. It works/looks good on my PC.

My question is this, will have any display or stability problems on my customers' PCs, with varying operating systems and/or video cards? I just want to double check that I'm not taking any risks or making a buggy installer by intentionally programming a label control on top of another control. Thanks all for your help.

Jnuw
iceman_k#
Is there a particular reason why you want the groupbox color in black?
Why don't you leave it as it is?
That way the installer UI look & feel will be consistent with the end-user's desktop look & feel.
IMHO, that is better than forcing it to be black.
Jnuw#
Hi iceman_k, I know I'm being picky, however because I am using multiple colors (see below) within the groupbox, I feel that the blue text clashes with the rest of the colored text, and also draws some attention away from the inner text as well. Again, I know I am being picky, but as along as there are no issues putting the a control on top of another, I would like the text to be black. Sorry to be a pain, and thanks again for your help.



Versus


I know, it is subtle, but I think it looks better with the black. 🙂
iceman_k#
Just to make sure that no underlying text is shown for the GroupBox, set its Text value to blank.
I don't anticipate any issues on other versions of Windows O/S or different video cards.