Archive: IO:DirRequest - NOTIFY ?


IO:DirRequest - NOTIFY ?
Hi,

I've got only one question. How to implement notify feature on DirRequest field ?

I have custom page with 3 dirRequest fields. 1st field for base instalation directory, 2nd and 3rd for subdirectories. I need a mechanism that allow to modify path of subdirectories after changing value of base directory.

The paths don't need to be the same, that's user choice.


Anyone can help ?


Suppose DirRequests are Field #1, #2, #3.
Give them the notify flag.
Now in the leave function examine the state key of [settings] section. If it's value is 1, then read appropriate [Field #] state keys, manipulate the strings, and use

GetDlgItem $DLGITEM $HWND 1202
SendMessage $DLGITEM ${WM_SETTEXT} 0 "STR:$2"
GetDlgItem $DLGITEM $HWND 1204
SendMessage $DLGITEM ${WM_SETTEXT} 0 "STR:$3"

where $2, $3 contain appropriate paths.
Also in INIT function do
!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "iopage.ini"
Pop $HWND ;HWND of dialog
...
!insertmacro MUI_INSTALLOPTIONS_SHOW

And offcourse :D declare variables DLGITEM and HWND

That was my first idea but it didn't work :(

Documentation to IO2 says:

NOTIFY Used by "Button", "Link", "CheckBox", "RadioButton", "ListBox" and "DropList" controls ...

So????
It still works ;)


DirRequest field fires validation procedure only after choosing new directory by using button "...". When I type the directory name directly to text field it doesn't work :(

For now I gave up and split this into 2 pages ...

Thanks for all suggestion opher


Well I tweaked around there and I have a workaround that would be fine as long as its acceptable to restrict the user to ONLY browse for the folder (optionally creating new folders through that dialogue). Simply set the DirRequest Flags property to NOTIFY|READONLY.
Best of luck.