Old 11th November 2005, 21:26   #1
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
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:
code:
GetDlgItem $MUI_TEMP1 $MUI_HWND 1202 ;3rd control
SetCtlColors $MUI_TEMP1 "000000" "${MUI_BGCOLOR}"

But no luck. The iospecial.ini code is:
code:
[Field 3]
Type=GroupBox
Left=120
Right=315
Top=45
Bottom=90
Text=Final Update Status

Any ideas? Thanks.

Jnuw
Jnuw is offline   Reply With Quote
Old 11th November 2005, 21:32   #2
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
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?

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 11th November 2005, 21:33   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Modifying IntallOptions' test.nsi InstallOptions call did the trick and change the background color of the text.
code:
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th November 2005, 21:44   #4
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
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.
code:
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
Jnuw is offline   Reply With Quote
Old 11th November 2005, 21:51   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Quote:
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 11th November 2005, 22:01   #6
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
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:
code:
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
Jnuw is offline   Reply With Quote
Old 11th November 2005, 22:14   #7
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
Quote:
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).

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 14th November 2005, 21:43   #8
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
Quote:
Originally posted by Jnuw
code:
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
Jnuw is offline   Reply With Quote
Old 14th November 2005, 22:02   #9
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
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.

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 14th November 2005, 22:18   #10
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
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.
Jnuw is offline   Reply With Quote
Old 14th November 2005, 23:35   #11
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
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.

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 14th November 2005, 23:54   #12
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
Will do, and thanks again for your help.
Jnuw is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump