Archive: color installoptions


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...


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.


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...


For custom pages it's the same as installers without the MUI. Use:

Page custom customFunction leaveFunction


1000 thanks you're the best !!!


i look the leave function ;)


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 ;)


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.


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...


You can't do that with InstallOptions::dialog, you must use InstallOptions::initDialog and InstallOptions::show to be able to set the colors/fonts.


thank you very much to have answered all my questions.
now, all functions perfectly.

:up: :D :)