Archive: UltraModernUI and button color


UltraModernUI and button color
Hi,

I have a problem with the cancel button of a custom page I'm using. I'm using nsis 2.40 and the latest UltraModernUI (build 2008-08-15) and the custom page uses InstallOptions 2.

The cancel button has the basic style on this custom page (and only this one!):
http://uppix.net/4/7/e/27f3e29045e8a...d9087e5c27.jpg


If I click next to go to the next page and then previous to display my custom page again the problem is gone:
http://uppix.net/7/0/e/316e0f08f1eb6...9f32e6c59f.jpg

I'm not the original developper of this script but it worked with a previous version of nsis and ultramodernui (and all the others custom pages don't have this problem with a similar code). The code for diplaying the custom page is the following:

Function SetPlacesBar

WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 1" "Text" $(TEXT_PLACESBAR_DESCRIPTION)
WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 2" "Text" $(TEXT_PLACESBAR_CONFIRM_MODIFY)
WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 3" "Text" "$TEMP\placesbar.bmp"
WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 3" "State" "0"

!insertmacro MUI_HEADER_TEXT $(TITLE_MENU_PLACESBAR) $(SUBTITLE_MENU_PLACESBAR)
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "PlacesBar.ini"
; In this mode InstallOptions returns the window handle
Pop $HWND
;Apply the background color
SetCtlColors $HWND "" "${MUI_BGCOLOR}"
;Apply the right text color and background color at all fields
StrCpy $1 1200
StrCpy $2 1202
LoopItem:
GetDlgItem $0 $HWND $1
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}
IntOp $1 $1 + 1
IntCmp $1 $2 LoopItem LoopItem Exit
Exit:
!insertmacro MUI_INSTALLOPTIONS_SHOW

FunctionEnd

It looks like your loop is fine to me, but what I would do as a test is instead of doing a loop, just hard code it like this as an experiment, and also do them all twice. Maybe there's something about a delay or some refreshing that doesn't allow it to stick the first time:

GetDlgItem $0 $HWND 1200
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1201
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1202
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1200
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1201
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1202
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}


I tried without the loop and it didn't solve anything.

Function SetPlacesBar

WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 1" "Text" $(TEXT_PLACESBAR_DESCRIPTION)
WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 2" "Text" $(TEXT_PLACESBAR_CONFIRM_MODIFY)
WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 3" "Text" "$TEMP\placesbar.bmp"
WriteINIStr "$PLUGINSDIR\PlacesBar.ini" "Field 3" "State" "0"

!insertmacro MUI_HEADER_TEXT $(TITLE_MENU_PLACESBAR) $(SUBTITLE_MENU_PLACESBAR)
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "PlacesBar.ini"
; In this mode InstallOptions returns the window handle
Pop $HWND

GetDlgItem $0 $HWND 1200
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1201
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1202
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1200
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1201
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}

GetDlgItem $0 $HWND 1202
SetCtlColors $0 ${UMUI_TEXT_COLOR} ${MUI_BGCOLOR}


!insertmacro MUI_INSTALLOPTIONS_SHOW

FunctionEnd


Is there any way to force the page to repaint itself?