- NSIS Discussion
- color examples?
Archive: color examples?
billym
11th October 2003 01:20 UTC
color examples?
Could I please get some complete examples on how to color the dialogs and controls using nsis. I know I have had responses to my postings but have not once received a complete example and I cannot get the pieces to work. I searched the forums for examples but only found pieces of script related to color changing. Thanks in advance for the assistance. My goal is to get the background of all of the controls and dialogs colored white. I am using custom pages as well as the defaults with the modern UI.
Joost Verburg
11th October 2003 13:08 UTC
It has been explained how you can change these colors. Please take some time to read the documentation / Modern UI Readme. If you have created a script and still have problems, attach it so people can have a look at it.
billym
12th October 2003 19:24 UTC
Here is an example script that does not seem to work for me....
!include "MUI.nsh"
Name "Color Test 1.0"
OutFile "colortest.exe"
Var HWND
Var DLGITEM
Page custom CustomPageA
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
ReserveFile "ioA.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
Section test
SectionEnd
Function .onInit
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioA.ini"
FunctionEnd
Function CustomPageA
!insertmacro MUI_HEADER_TEXT "text1" "text2"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioA.ini"
Pop $HWND
GetDlgItem $DLGITEM $HWND 1078
SetCtlColors $DLGITEM FFFFFF FF0000
!insertmacro MUI_INSTALLOPTIONS_SHOW
FunctionEnd
How do you determine the dialog id number? I have tried several and still does not color anything?
ioA.ini ...
[Settings]
NumFields=2
[Field 1]
Type=label
Text=Install Options Page A
Left=0
Right=-1
Top=0
Bottom=10
[Field 2]
Type=label
Text=test text
Left=0
Right=-1
Top=20
Bottom=30
Joost Verburg
12th October 2003 19:35 UTC
Please read the "Call InstallOptions" section in the Modern UI documentation. You have to use the InstallOptions initdialog/show macros.
billym
13th October 2003 21:54 UTC
Ok, have everythign working except the background color of the inner dialogs. what is the appropriate way to do this for the license page and custom pages. I also seem to have a problem with my header text not refreshing when I change pages. It just writes over the previous text.
Joost Verburg
14th October 2003 13:50 UTC
You can find the inner dialog using:
FindWindow $R0 "#32770" "" $HWNDPARENT
billym
14th October 2003 23:33 UTC
I have everything working except I cannot figure out how to get the inner dialog of the license page to change color. Can someone please point me in the right direction. Where does it belong?
FindWindow $HWND "#32770" "" $HWNDPARENT
Pop $HWND
GetDlgItem $DLGITEM $HWND 102
SetCtlColors $DLGITEM 000000 FFFFFF
deguix
15th October 2003 01:23 UTC
Try this (to work with custom pages):
"text1" "text2"
>!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioA.ini"
>Pop $HWND
GetDlgItem $DLGITEM $HWND 1201;1201 is 1200 + Field Number - 1
SetCtlColors $DLGITEM FFFFFF FF0000
>!insertmacro MUI_INSTALLOPTIONS_SHOW
>
And to use with the license page, is complicated to explain in 30 minutes! Someone can answer it.
A suggestion:
Have a command to paint all the dialog background to a color (including external parts of controls).
billym
15th October 2003 14:55 UTC
All of this has worked but still unable to get the inner dialog of the license page to change color.
Afrow UK
15th October 2003 16:33 UTC
Which version of NSIS are you using?
-Stu
deguix
15th October 2003 22:34 UTC
If SetCtlControls works, is using about the latest development snapshot. If someone don't answer first (that will occur), I will say all the controls to color (the external part of them) and how to paint the rest.
kichik
15th October 2003 22:51 UTC
Originally posted by billym
All of this has worked but still unable to get the inner dialog of the license page to change color.
By the fact that you have mentioned only the license page I assume you're talking about the license data itself. This is set using
LicenseBkColor.