Archive: Change groupbox color


Change groupbox color
Hello guys..
1st of all, i would like to say thank you very much for always helping me. I started using NSIS with zero knowledge about it, and now i can create good installer with it.
I need your help again
I am currently using UMUI, i have a custom page, a confirmation page, where it lists all the info and settings that entered by the user (see attachment).
I use !define MUI_BGCOLOR D3CDDB to change the background color of the skin, but now, i want to change ONLY the groupbox into white. how could i do that?
by the way, this is the confirmation.ini

[Settings]
NumFields=11

[Field 1]
Type=Label
Text=Setup has enough information to start copying the program files. If you want to review or change any settings, click Back. If you are statisfied with settings, click Install to begin copying files:
Left=0
Right=276
Top=0
Bottom=30

[Field 2]
Type=Label
Text=Current Settings
Left=0
Right=276
Top=32
Bottom=40

[Field 3]
Type=Groupbox
Left=0
Right=278
Top=40
Bottom=160

[Field 4]
Type=Label
Text=[Name]
Left=5
Right=277
Top=45
Bottom=54

[Field 5]
Type=Label
Left=5
Right=270
Top=56
Bottom=64

[Field 6]
Type=Label
Text=[Company]
Left=5
Right=272
Top=70
Bottom=79

[Field 7]
Type=Label
Left=5
Right=276
Top=80
Bottom=88

[Field 8]
Type=Label
Text=[Suffix]
Left=5
Right=274
Top=94
Bottom=103

[Field 9]
Type=Label
Left=5
Right=269
Top=104
Bottom=112

[Field 10]
Type=Label
Text=[Program Install Directory]
Left=5
Right=269
Top=118
Bottom=127

[Field 11]
Type=Label
Left=5
Right=265
Top=128
Bottom=149

and, another question is, what is the control id for the text field in startmenu page?
Thank you in advance!


It seems that within the script isn't possible to change the color inside the groupbox frame while the actual space that is added to the groupbox is the space around its label. It might be possible by modifying the recourse ui...
Also you may try a trick that it might work, no tested though.
You could add a bitmap control covering the entire groupbox frame, with a plain white small bmp and assign on it flags TRANSPARENT|RESIZETOFIT. I guess this trick has some possibilities to work.

You may find all controls id by opening the recourse ui with Recourse Hacker for instance, or just compile and execute the following script, it will offer you a text file with all ids for standard mui dialogs.

name 'Find Control IDs'
outfile 'findctlID_MUI.exe'
showinstdetails show
InstallDir '$EXEDIR'

var header

!include mui.nsh

!define MUI_PAGE_CUSTOMFUNCTION_PRE lic_pre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW lic_show
!insertmacro MUI_PAGE_LICENSE '${NSISDIR}\License.txt'

!define MUI_PAGE_CUSTOMFUNCTION_SHOW comp_show
!insertmacro MUI_PAGE_COMPONENTS

!define MUI_PAGE_CUSTOMFUNCTION_SHOW dir_show
!insertmacro MUI_PAGE_DIRECTORY

!define MUI_PAGE_CUSTOMFUNCTION_SHOW smn_show
!insertmacro MUI_PAGE_STARTMENU app $R9

!define MUI_PAGE_CUSTOMFUNCTION_SHOW inst_show
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "English"

section
sectionend

function lic_show
strcpy $header "LICENSE PAGE CONTROLS"
call findIDs
functionend

function comp_show
strcpy $header "COMPONENTS PAGE CONTROLS"
call findIDs
functionend

function dir_show
strcpy $header "DIRECTORY PAGE CONTROLS"
call findIDs
functionend

function smn_show
strcpy $header "START MENU PAGE CONTROLS"
call findIDs
functionend

function inst_show
strcpy $header "INSTALL FILES PAGE CONTROLS"
call findIDs
functionend

function lic_pre
fileopen $5 '$EXEDIR\ids.txt' a
fileseek $5 '' END
filewrite $5 "PARENT DIALOG CONTROLS$\r$\n"
strcpy $0 0
loop:
strcmp $0 '2000' end
GetDlgItem $R0 $HWNDPARENT $0
strcmp $R0 0 +3
fileseek $5 '' END
filewrite $5 "Control ID == $0$\r$\n"
intop $0 $0 + 1
goto loop
end:
filewrite $5 "$\r$\n"
fileclose $5
functionend

function findIDs
fileopen $5 '$EXEDIR\ids.txt' a
fileseek $5 '' END
filewrite $5 "$header$\r$\n"
strcpy $0 0
loop:
strcmp $0 '2000' end
FindWindow $R5 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R5 $0
strcmp $R0 0 +3
fileseek $5 '' END
filewrite $5 "Control ID == $0$\r$\n"
intop $0 $0 + 1
goto loop
end:
filewrite $5 "$\r$\n"
fileclose $5
functionend

function .onInit
IfFileExists '$EXEDIR\ids.txt' 0 +2
delete '$EXEDIR\ids.txt'
functionend

Red Wine, thanx a lot for your guide..
I will try!


Originally posted by Red Wine
You could add a bitmap control covering the entire groupbox frame, with a plain white small bmp and assign on it flags TRANSPARENT|RESIZETOFIT. I guess this trick has some possibilities to work.
Red Wine, i tried this, but pls see the attachment for the result.
I think, I can transparent the labels in the groupbox, but how about the area that I show with red arrows?
I dont think I can paint those areas, since there is no ctrl id for them.
Do you have any idea?

sorry, i forgot the attachment


try to set backround color for all controls to white instead of transparent, also change the parent dialog's color to white

   FindWindow $1 "#32770" "" $HWNDPARENT
SetCtlColors $1 '' '0x000000'


See this wiki page for more details

http://nsis.sourceforge.net/Demonstr...Pre_Show_Leave

Red Wine, thanx a lot for your help
I did make it.
1st I followed ur advice, bout the white color bitmap
then i used 2nd bitmap image with the same color of the backgound, put it on the white bitmap


Well...it's been said before!
With NSIS you can do it the way you like ;) (always)


I'd like to change control colors in UMUI. I tried to use SetCtlColors, it works. But some controls are drew with system colors (checkbox, listbox...). Can I customize these colors too?