Old 23rd November 2005, 12:57   #1
mattheus
Junior Member
 
Join Date: Nov 2005
Posts: 1
How to make forms background white?

Hello community,

Please advise, how can I make background color of all my forms (Pages) in NSIS installer white? Custom Pages and standard MUI pages?

I am taking not about BGGradient function, but about forms that will be showed with
Page custom ... insructions

For example like here
http://nsis.sourceforge.net/mediawik...creenshot6.png or here http://nsis.sourceforge.net/mediawik...reenshot5.png, but not only for Welcome of Finish pages but for all other pages too.
For example how to make background color white here http://nsis.sourceforge.net/mediawik...creenshot1.png ?

I tried to use
FindWindow $R0 "#32770" "" $HWNDPARENT
GetDlgItem $R0 $R0 1001
SetCtlColors $R0 0xFFFFFF 0x000000
In my scripts, but it don't works.

Thanks.
mattheus is offline   Reply With Quote
Old 23rd November 2005, 13:02   #2
iceman_k
NSIS Dev
 
iceman_k's Avatar
 
Join Date: Feb 2003
Location: Boston, MA, U.S.A.
Posts: 455
Use Resource Hacker to modify the UI, then use ChangeUI to change the dialog.

Cheers,
Iceman_K

EclipseNSIS - An NSIS IDE for the Eclipse Platform | My contributions to the wiki
iceman_k is offline   Reply With Quote
Old 23rd November 2005, 14:06   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You can't change the colours of controls with Resource Hacker.

Take a look at Custom pages > Using InstallOptions for custom pages. There's an example further down which shows how to change the font of a control.

As for all the NSIS pages, you need to apply the background colours for all controls in the dialogs. This applies to controls inside the inner dialog (which you get using FindWindow which you have already got) and the outer dialog ($HWNDPARENT).

To get all the control ID's you need to use Resource Hacker. IDD 105 is the the outer (parent) dialog whereas the rest are all inner dialogs.

-Stu
Afrow UK is offline   Reply With Quote
Old 2nd December 2005, 13:54   #4
dandaman32
Senior Member
 
dandaman32's Avatar
 
Join Date: Jan 2005
Location: Look behind you.
Posts: 209
Use the InstallOptions "Rect" field to set the control that will host the child window:
code:
[Settings]
Rect=1044

Then, skin the background of the window:
code:
Page custom Init Verify

Function Init
!insertmacro MUI_INSTALLOPTIONS_EXTRACT InstallOptions.ini
InstallOptions::initDialog /NOUNLOAD "$PLUGINSDIR\InstallOptions.ini"
Pop $1
SetCtlColors $1 0xFFFFFF 0xFFFFFF
StrCpy $2 1199
SkinLoop:
IntOp $2 $2 + 1
GetDlgItem $0 $1 $2
SetCtlColors $0 0x000000 0xFFFFFF
IntCmp $2 1300 SkinLoop SkinLoop ""
InstallOptions::show
FunctionEnd

Function Verify
# any custom code to verify the user's input here...
FunctionEnd

If your dialog has more than 100 fields (not likely) increase the 1300 to any value >1201, but the higher you go, the longer it will take to initialize the page, especially on slower systems.

Edit: you could probably do this with a for-loop in LogicLib, but this will work just as well.

-dandaman32

ExperienceUI for NSIS | Latest project: Enano CMS
Do not PM me on the Winamp forums, I hardly ever check my messages here; you are more likely to get my attention through the ExperienceUI forum.
dandaman32 is offline   Reply With Quote
Old 30th January 2006, 23:43   #5
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
Dan, this approach works great, but I ran into a little problem. When I do this on a custom finish page, it makes my header line regular-sized and un-bolded.

I tried excluding that field from the skinloop:

!insertmacro MUI_INSTALLOPTIONS_READ $3 "ioCustom.ini" "Field 2" "HWND"
SkinLoop:
IntOp $2 $2 + 1
GetDlgItem $0 $1 $2
${If} $0 <> $3
SetCtlColors $0 0x000000 0xFFFFFF
${EndIf}
....

but that left the text unformatted as well.

Any ideas on how to retain the header line formatting? Comparing the header entries in ioSpecial.ini and ioCustom.ini, they look identical.

Thanks!
dienjd is offline   Reply With Quote
Old 31st January 2006, 16:24   #6
dienjd
Senior Member
 
Join Date: Oct 2005
Posts: 189
I thought I'd exhausted my search of the forum, but I just ran across Afrow UK's reference to CreateFont in another thread, and it works perfectly.

For reference, that post is here:
http://forums.winamp.com/showthread....xt+custom+page
dienjd is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump