Cannot disable whole FileRequest control
Hi,
I have problem with enabling/disabling of the GUI control. I need input control for file selection, so I've used FileRequest control. But there are also two radiobuttons and FileRequest control have to be enabled/disabled according to the radio buttons state. User wants either default file (included in the installation) or browse filesystem for his own already existing file.
My .ini file looks like this:
[Settings]
NumFields=3
[Field 1]
Type=RadioButton
Text=Default file
Left=0
Right=74
Top=4
Bottom=14
State=1
Flags=NOTIFY
[Field 2]
Type=RadioButton
Text=Already existing file
Left=0
Right=74
Top=36
Bottom=44
Flags=NOTIFY
[Field 3]
Type=FileRequest
Left=0
Right=170
Top=52
Bottom=65
Flags=DISABLED
Page function:
Function SetFileTypePage
!insertmacro INSTALLOPTIONS_DISPLAY "FileType.ini"
FunctionEnd
And my page leave function:
Function SetFileTypeLeave
Push $0
Push $1
!insertmacro INSTALLOPTIONS_READ $0 "FileType.ini" "Settings" "State"
${If} $0 == 1 ; default
; disable the FileRequest control
!insertmacro INSTALLOPTIONS_READ $1 "FileType.ini" "Field 3" "HWND"
EnableWindow $1 0
Abort
${ElseIf} $0 == 2 ; existing
; enable the FileRequest control
!insertmacro INSTALLOPTIONS_READ $1 "FileType.ini" "Field 3" "HWND"
EnableWindow $1 1
Abort
${EndIf}
Pop $1
Pop $0
FunctionEnd
But the problem is, that enabling/disabling works only for the textbox, not the button for files browsing. The button remains still disabled.
I don't know any way how to enable also the buton for files browsing. It is one FileRequest control, so I supposed that enabling will work for whole control (textbox and small button together), but not.
Any ideas please?