Skip to content
⌘ NSIS Forum Archive

Changing control text at runtime

7 posts

Guest#

Changing control text at runtime

Hi,

I have a dialog with three directory fields. If the user changes the first directory I want to be able to update the remaining two automatically (the user can override the next two manually).

Can this be done?

cheers,
Phani
Anders#
Add the notify flag (in the .ini) to the first dir field, in the leave function for the page, check if the dir field changed, if it did, use sendmessage with ${WM_SETTEXT} on the other fields

All is explained in the InstallOptions readme
deguix#
Add the notify flag (in the .ini) to the first dir field, in the leave function for the page, check if the dir field changed, if it did, use sendmessage with ${WM_SETTEXT} on the other fields
I don't think the NOTIFY flag works for DirRequest controls. I gonna check out this at home. But if my statement is true (which probably is), you can only change it automatically by using InstallOptionsEx.
deguix#edited
notify works with DirRequest
Bah, he is right, but only when the user clicks the button. It doesn't update the other controls when the user only changes the Text control part of the DirRequest control.

EDIT: The documentation doesn't mention that NOTIFY flag works for DirRequest, FileRequest, and ComboBox controls:

Used by "Button", "Link", "CheckBox", "RadioButton", "ListBox" and "DropList" controls.
Guest#
Tried using NOTIFY, and it only works if I use the button at the end of the DirRequest control. If I manually change the text in the textbox I don't get a notification message.

Am I doing something wrong?
/Phani
Anders#
Originally posted by Newbe
Am I doing something wrong?
no

You probably need to create a plugin and subclass if you want it to respond to changes in the text field.