Joel
15th April 2007 03:16 UTC
SetCtlColors & Chekboxes in Finishpage
This is my function for show in finish page:
"Finish_ShowProc"
>SetCtlColors $MUI_HWND 0xFF0000 0xE3E8E7
GetDlgItem$0 $MUI_HWND 1201
SetCtlColors$0 0x566978 0xE3E8E7
GetDlgItem$1 $MUI_HWND 1202
SetCtlColors$1 0x566978 0xE3E8E7
>; Checkbox #1
>ReadINIStr $6 "$PLUGINSDIR\ioSpecial.ini" "Field 4" "HWND"
>SetCtlColors $6 0x00FF00 0xE3E8E7
>; Checkbox #2
>ReadINIStr $7 "$PLUGINSDIR\ioSpecial.ini" "Field 5" "HWND"
>SetCtlColors $7 0x566978 0xE3E8E7
>; This is a link, no problems here
ReadINIStr$8 "$PLUGINSDIR\ioSpecial.ini" "Field 6" "HWND"
>SetCtlColors $8 0x566978 0xE3E8E7
FunctionEnd
>
This only change the background colors propertly but the text color reminds black, any ideas?
Joel
15th April 2007 16:59 UTC
Ok, I found some topics about it..and now I'm using a pre function in finish page to change size of the checkbox and put a label instead:
"Finish_PreProc"
>!insertmacro MUI_PAGE_FINISH
>;...
Function "Finish_PreProc"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Left" "120"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Right" "130"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Top" "89"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 4" "Bottom" "100"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 7" "Type" "Label"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 7" "Left" "132"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 7" "Right" "321"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 7" "Top" "91"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 7" "Bottom" "99"
>!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 7" "Text" "Readme"
>FunctionEnd
>
The checkbox is correctly resize, but it doesn't display my label...any ideas?
Red Wine
15th April 2007 17:56 UTC
Is the NumFields increased to cover the extra label field you've added?
Also for your 1st post, following example works as expected, changes both colors,
OutFile "Test.exe"
InstallDir "$PROGRAMFILES\Test"
!include "mui.nsh"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\test.exe"
!define MUI_PAGE_CUSTOMFUNCTION_SHOW FinShow
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
Section
SectionEnd
Function FinShow
ReadINIStr $0 "$PLUGINSDIR\iospecial.ini" "Field 4" "HWND"
SetCtlColors $0 '0xFF0000' '0xFFFF80'
FunctionEnd
bnicer
15th April 2007 20:25 UTC
I haven't been able to change the foreground text color either; it's always black. You can't use underlined alt-character keys with a label, "&Readme" as opposed to "Readme".
Joel
15th April 2007 20:41 UTC
Thanks Red Wine! I figure it out! :)