Old 16th September 2005, 23:21   #1
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
Change Background Color of Text Box on Custom Page

Hello all.

I have scoured the forums, and help files, and tried to decipher the IoColors.zip example, but am still confused. Basically what I have is a custom page (ResultsPage) that contains a text box (Type=Text in the ResultsPage.ini). I have the text box set with: Flags=MULTILINE|VSCROLL|READONLY, as I'm using it to display a large amount of text. I want to keep in READONLY but don't like the gray background it produces.

So... I just need a hand setting the background of this custom control (Type=Text) back to white as if it was not READONLY. Below is the code for the display of the ResultsPage, and the corresponding INI. Can someone please show me the commands I need? Thanks so much all!

Jnuw

code:

Function SetFinishPage
;Next 4 lines removes next and back buttons
GetDlgItem $0 $HWNDPARENT 3
ShowWindow $0 0
GetDlgItem $0 $HWNDPARENT 1
ShowWindow $0 0

StrCmp $NumMissing 0 0 +2
!insertmacro MUI_INSTALLOPTIONS_WRITE "ResultsPage.ini" "Field 5" "Flags" "DISABLED"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ResultsPage.ini" "Field 2" "State" "$Output"
!insertmacro MUI_INSTALLOPTIONS_WRITE "ResultsPage.ini" "Settings" "Title" "${PRODUCT_NAME}"
!insertmacro MUI_HEADER_TEXT "Results" "Please review the results below."
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "ResultsPage.ini"
FunctionEnd



ResultsPage.ini
code:

[Settings]
NumFields=5
Title=
CancelShow=1
CancelButtonText=Exit


[Field 1]
Type=GroupBox
Left=0
Right=-1
Top=0
Bottom=-1
Text=""

[Field 2]
Type=Text
Left=10
Right=-10
Top=10
Bottom=120
State="Error..."
Flags=MULTILINE|VSCROLL|READONLY

[Field 3]
Type=Link
Left=10
Right=139
Top=126
Bottom=136
State=http://www.blabla.com/
Text=Click to open Website.

[Field 4]
Type=Button
Flags=NOTIFY
Text=&Print Results
Left=240
Right=-10
Top=123
Bottom=137

[Field 5]
Type=Button
Flags=NOTIFY
Text=&Download Missing Updates
Left=140
Right=235
Top=123
Bottom=137

Jnuw is offline   Reply With Quote
Old 17th September 2005, 10:15   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ResultsPage.ini"
Pop $R0 # HWND
GetDlgItem $R1 $R0 1201 ; 1200 + Field # - 1
SetCtlColors $R1 000000 FFFFFF
!insertmacro MUI_INSTALLOPTIONS_SHOW

Instead of MUI_INSTALLOPTIONS_DISPLAY

-Stu
Afrow UK is offline   Reply With Quote
Old 18th September 2005, 15:17   #3
Jnuw
Senior Member
 
Join Date: Sep 2004
Location: Wisconsin, US
Posts: 258
Thanks again Stu, that did the trick perfectly. I really appreciate your help!
Jnuw is offline   Reply With Quote
Old 22nd January 2007, 09:06   #4
Takeshi
Junior Member
 
Join Date: Dec 2006
Location: Malaysia
Posts: 28
Quote:
Originally posted by Afrow UK
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ResultsPage.ini"
Pop $R0 # HWND
GetDlgItem $R1 $R0 1201 ; 1200 + Field # - 1
SetCtlColors $R1 000000 FFFFFF
!insertmacro MUI_INSTALLOPTIONS_SHOW

Instead of MUI_INSTALLOPTIONS_DISPLAY

-Stu
hello guys
i have tried using this code for my custom pages
to change the color of the text box to white color, but what happened is like the one u can see in the attachment.
anyone have idea, how to modify my code, so that only the text box background color is changed, and i dont want that grey background color (the one in the red square)
this is my .ini code

[Settings]
NumFields=5

[Field 1]
Type=Label
Text=Please enter your name and the name of the company for which you work.
Left=0
Right=262
Top=0
Bottom=8

[Field 2]
Type=Label
Text=User Name:
Left=0
Right=269
Top=25
Bottom=34

[Field 3]
Type=Text
Left=0
Right=272
Top=37
Bottom=51

[Field 4]
Type=Label
Text=Company Name
Left=0
Right=273
Top=64
Bottom=72

[Field 5]
Type=Text
Left=0
Right=275
Top=74
Bottom=88

and this the coding in the function

Function Create_Pg_UserInfo

!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "userinfo.ini"

${if} $OLD == "$(^Name)"
Abort
${endif}

ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOwner"
!insertmacro MUI_INSTALLOPTIONS_WRITE "userinfo.ini" "Field 3" "State" "$0"

ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOrganization"
!insertmacro MUI_INSTALLOPTIONS_WRITE "userinfo.ini" "Field 5" "State" "$0"

Pop $R0 # HWND
GetDlgItem $R1 $R0 1202 ; 1200 + Field # - 1
SetCtlColors $R1 "000000" "FFFFFF"

!insertmacro MUI_HEADER_TEXT "Customer Information" "Please enter your information"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "userinfo.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
FunctionEnd

thank you guys for always helping me
Takeshi is offline   Reply With Quote
Old 22nd January 2007, 10:05   #5
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Now InstallOptions writes the HWND of every control to ini, so,
Instead of GetDlgItem $R1 $R0 1202 ; 1200 + Field # - 1
Use
code:
ReadINIStr "$R1" "$PLUGINSDIR\userinfo.ini" "field 3" "HWND"
SetCtlColors "$R1" "000000" "FFFFFF"


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 22nd January 2007, 10:24   #6
Takeshi
Junior Member
 
Join Date: Dec 2006
Location: Malaysia
Posts: 28
Red Wine, do i need to include this:
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "userinfo.ini" ?
i have tried using the code above,

ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOwner"
!insertmacro MUI_INSTALLOPTIONS_WRITE "userinfo.ini" "Field 3" "State" "$0"

ReadRegStr $0 ${PRODUCT_UNINST_ROOT_KEY} "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOrganization"
!insertmacro MUI_INSTALLOPTIONS_WRITE "userinfo.ini" "Field 5" "State" "$0"
; !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "userinfo.ini"
Pop $R0 # HWND
ReadINIStr "$R1" "userinfo.ini" "field 3" "HWND"
SetCtlColors "$R1" "000000" "FFFFFF"
!insertmacro MUI_HEADER_TEXT "Customer Information" "Please enter your information"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "userinfo.ini"
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS

without the initdialog, i cant get the result at all, the box doesnt turn to white background color, and if i use with the initdialog, the result is the same as the attachment..
did i put the code at the wrong place?
Takeshi is offline   Reply With Quote
Old 22nd January 2007, 11:37   #7
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
Yeah! you already discovered this!
1st init the dialog, set ctl colors and then show the dialog.
You certainly know how to do it

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS

Last edited by Red Wine; 22nd January 2007 at 12:22.
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 02:27   #8
Takeshi
Junior Member
 
Join Date: Dec 2006
Location: Malaysia
Posts: 28
I thought I had attached an attachment during my 1st post..but I didnt...
Im sorry Red Wine, I still cannot solve my prob..
please see the attachment
i want to remove that grey background color
Attached Images
File Type: jpg user_info_page.jpg (35.3 KB, 317 views)
Takeshi is offline   Reply With Quote
Old 23rd January 2007, 04:21   #9
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
code:
..............
..............
Push $1
InstallOptions::InitDialog /NOUNLOAD "$PLUGINSDIR\userinfo.ini"
Pop $1
FindWindow $1 "#32770" "" $HWNDPARENT
SetCtlColors $1 '' '0x000000'
InstallOptions::Show "$PLUGINSDIR\userinfo.ini"
Pop $1

Pop $1
Pop $1
FunctionEnd


Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 06:47   #10
Takeshi
Junior Member
 
Join Date: Dec 2006
Location: Malaysia
Posts: 28
Anyway, what is the different between :

!insertmacro MUI_INSTALLOPTIONS_INITDIALOG
&
INSTALLOPTIONS::InitDialog

and

!insertmacro MUI_INSTALLOPTIONS_DISPLAY
&
!insertmacro MUI_INSTALLOPTIONS_SHOW
&
INSTALLOPTIONS::SHOW
Takeshi is offline   Reply With Quote
Old 23rd January 2007, 06:55   #11
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
The MUI macro system is designed for your convenience

!insertmacro MUI_INSTALLOPTIONS_INITDIALOG == INSTALLOPTIONS::InitDialog /NOUNLOAD

!insertmacro MUI_INSTALLOPTIONS_SHOW ==
INSTALLOPTIONS::SHOW

!insertmacro MUI_INSTALLOPTIONS_DISPLAY ==
INSTALLOPTIONS::DISPLAY

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 23rd January 2007, 07:17   #12
Takeshi
Junior Member
 
Join Date: Dec 2006
Location: Malaysia
Posts: 28
ok Red Wine. thanx a lot for your help!
Takeshi 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