Old 3rd August 2006, 09:09   #1
nsis_noesis
Junior Member
 
Join Date: Aug 2006
Posts: 6
Problem with MUI and checkbox notifying

I modifief the Modern UI InstallOptions.nsi example a bit.
Now Custom Page C has a dirrequest.
Both the dirrequest and the label are dependent of the checkbox. This means they should become disabled/enabled when the checkbox is toggled.
I tried to do this by adding the ValidatePageC Function.
However this does not seem to work. Should I maybe refresh the custom page after writing the values to the ini file?

Thanks already
nsis_noesis is offline   Reply With Quote
Old 3rd August 2006, 09:13   #2
nsis_noesis
Junior Member
 
Join Date: Aug 2006
Posts: 6
Here is the source
Attached Files
File Type: zip installoptions.zip (2.4 KB, 239 views)
nsis_noesis is offline   Reply With Quote
Old 3rd August 2006, 10:55   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
See Contrib\InstallOptions\testnotify.nsi

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd August 2006, 11:08   #4
nsis_noesis
Junior Member
 
Join Date: Aug 2006
Posts: 6
The only difference between my script and the testnotity.nsi seems to be this piece of code which I now included;
ReadINIStr $4 "ioC.ini" "Field 1" "HWND"
EnableWindow $4 $1
ReadINIStr $4 "ioC.ini" "Field 1" "HWND2"
EnableWindow $4 $1

ReadINIStr $4 "ioC.ini" "Field 3" "HWND"
EnableWindow $4 $1
ReadINIStr $4 "ioC.ini" "Field 3" "HWND2"
EnableWindow $4 $1

But it still doesn't work,
should I maybe do something special because I use MUI?

New code is attached
Attached Files
File Type: zip installoptions.zip (2.4 KB, 230 views)
nsis_noesis is offline   Reply With Quote
Old 3rd August 2006, 11:17   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I don't think you can use variables for the EnableWindow state parameter. Try moving them to under your ${If} structure with constants 0 and 1 instead of $1.

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd August 2006, 11:24   #6
nsis_noesis
Junior Member
 
Join Date: Aug 2006
Posts: 6
Tried this,
but still no results.
nsis_noesis is offline   Reply With Quote
Old 3rd August 2006, 12:19   #7
The Glimmerman
Junior Member
 
Join Date: Jul 2006
Posts: 43
You should think something like this.
I think.

FindWindow $R1 "#32770" "" $HWNDPARENT
GetDlgItem $1 $R1 1208
EnableWindow $1 1 0
The Glimmerman is offline   Reply With Quote
Old 3rd August 2006, 12:26   #8
nsis_noesis
Junior Member
 
Join Date: Aug 2006
Posts: 6
In the testnotity.nsi none of this is used,
I was wondering wether this has anything to do with the fact I use MUI and the testnotify.nsi doesn't.
Does someone maybe notice any difference between testnotify.nsi and my example?
nsis_noesis is offline   Reply With Quote
Old 3rd August 2006, 13:01   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
code:

Function ValidatePageC

!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioC.ini" "Settings" "State"
${If} $0 == 2

;Read checkbox state
!insertmacro MUI_INSTALLOPTIONS_READ $1 "ioC.ini" "Field 2" "State"
;Enable/Disable DirRequest
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioC.ini" "Field 3" "HWND"
EnableWindow $0 $1
!insertmacro MUI_INSTALLOPTIONS_READ $0 "ioC.ini" "Field 3" "HWND2"
EnableWindow $0 $1

Abort
${EndIf}

FunctionEnd



Problems:
You weren't checking if NOTIFY was sent.
You were using ReadINIStr instead of MUI_INSTALLOPTIONS_READ.

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd August 2006, 15:02   #10
nsis_noesis
Junior Member
 
Join Date: Aug 2006
Posts: 6
This was the problem,
now it works.
Thanks a lot!
nsis_noesis 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