- NSIS Discussion
- color installoptions
Archive: color installoptions
AlexBienheureux
9th September 2003 15:58 UTC
color installoptions
I try to put color on the zone of text of a window created with installoption.
I must have an error because it is necessary to click 2 times to cancel or validate:
my script:
Function MaPage
!insertmacro MUI_HEADER_TEXT "Test" "Ceci est un essai de couleur"
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "mdp.ini"
Pop $HWND
GetDlgItem $DLGITEM $HWND 1201 ;1200 + Field number - 1
SetCtlColors $DLGITEM FFFFFF FF0000
!insertmacro MUI_INSTALLOPTIONS_SHOW
!insertmacro MUI_INSTALLOPTIONS_DISPLAY_RETURN mdp.ini
Pop $R0
StrCmp $R0 "cancel" Fin
StrCmp $R0 "back" Fin
StrCmp $R0 "success" ""
MessageBox MB_OK 'Vous avez cliquez sur "continuer"'
Fin:
FunctionEnd
thank you to say to me what does not go...
kichik
9th September 2003 16:09 UTC
Init + show replace display. If you want to get the return value of IO use MUI_INSTALLOPTIONS_SHOW_RETURN.
I still don't understand why you don't want to use the leave function, it's so much simpler... It doesn't require you to check the return value, it's only called when the user clicked next and it allows you to stop the user from moving on to the next page.
AlexBienheureux
9th September 2003 19:56 UTC
thank you to answer also quickly.
I search how to use the leave function with modern ui, but I did not find for a page created with installoption...
kichik
9th September 2003 20:04 UTC
For custom pages it's the same as installers without the MUI. Use:
Page custom customFunction leaveFunction
AlexBienheureux
10th September 2003 06:51 UTC
1000 thanks you're the best !!!
i look the leave function ;)
AlexBienheureux
10th September 2003 08:58 UTC
me again
hello guy! :D
that functions parfaitement(without the function leave)
I tests to make the same thing without modern ui but I do not understand why that does not function.... :(
------------------------------------------------
Function MotdePasse
InstallOptions::dialog $PLUGINSDIR\mdp.ini
Pop $HWND
GetDlgItem $DLGITEM $HWND 1201 ;1200 + Field number - 1
SetCtlColors $DLGITEM FFFFFF FF0000
Pop $R0
StrCmp $R0 "cancel" Fin
StrCmp $R0 "back" Fin
StrCmp $R0 "success" ""
MessageBox MB_OK 'Vous avez cliquez sur "continuer"'
Fin:
Pop $R0
FunctionEnd
------------------------------------------------
thank you for your patience ;)
Joost Verburg
10th September 2003 11:05 UTC
You have to put the InstallOptions calls in the creator func and the the code that should be executed when Next has been clicked in the leave func.
AlexBienheureux
10th September 2003 12:15 UTC
ok thanks,
the leave function is ok, but the color in the label doesn't work !
my script : (without modern ui)
----------------------------------------------------------
...
Page license
page custom test "Validation" "Ceci est un test"
Page instfiles
Function test
InstallOptions::dialog $PLUGINSDIR\mdp.ini
Pop $HWND
GetDlgItem $DLGITEM $HWND 1201 ;1200 + Field number - 1
SetCtlColors $DLGITEM FFFFFF FF0000
FunctionEnd
Function Validation
MessageBox MB_OK 'Vous avez cliquez sur "continuer"'
FunctionEnd
----------------------------------------------------------
i don't know what is incorrect in my script...
kichik
10th September 2003 12:29 UTC
You can't do that with InstallOptions::dialog, you must use InstallOptions::initDialog and InstallOptions::show to be able to set the colors/fonts.
AlexBienheureux
10th September 2003 14:57 UTC
thank you very much to have answered all my questions.
now, all functions perfectly.
:up: :D :)