Skip to content
⌘ NSIS Forum Archive

Dynamic choice in RadioButton

14 posts

anonym#

Dynamic choice in RadioButton

I'm using Modern UI

There are two RadioButtons and one FileRequest.
First RadioButton (Default) - Install new database
Second RadioButton - Select existing database
FileRequest assign with Second RadioButton.
How I can after select of file in FileRequest - enable Second RadioButton and disable First RadioButton?

Thank you
deguix#
First you need to use "NOTIFY" flag in both radiobuttons (in the .INI file).

Second, see the example to how to create a basic code in the .nsi file in "Contrib\InstallOptions" subfolder of NSIS.

Third, if you mean "disable a control" use EnableWindow command to enable-disable any control when is selected a radiobutton.
anonym#
Thank you for your answers.

Sorry, I mean select Second RadioButton and unselect First RadioButton.

Where can I find of documentation about "NOTIFY" flag and EnableWindow command?

In the .nsi file in "Contrib\InstallOptions" subfolder of NSIS not enough information.

Thank you
Joost Verburg#
Information about NOTIFY can be found in the InstallOptions documentation, it calls the leave function when the control is changed.

EnableWindow is a NSIS command (use it in the leave function), for more information see the NSIS Users Manual.
anonym#
Sorry, but there is no information about "NOTIFY" flag into InstallOptions documentation in NSIS20b3 and NSIS20b4.

How I can declare leave function in my installation module?

Please, write example of using "NOTYFY" flag and leave function.

Thank you
anonym#
Thank you, I copied NSIS20rc2.

EnableWindow not approach.

I need to select (State=1) Second RadioButton but not disable.

Say me please, how to do it?

Thank you
anonym#
In testnotify.nsi in Contrib\InstallOptions there is no information about checking of RadioButton.

Next code not work:

FindWindow $hwnd "#32770" "" $HWNDPARENT
GetDlgItem ${TEMP} $hwnd 1202 ; 1202 - Second RadioButton
SendMessage ${TEMP} BM_SETCHECK BST_CHECKED 0
; and SendMessage $hwnd BM_SETCHECK BST_CHECKED 0

How I can check Second RadioButton?

Thank you
Joost Verburg#
You should defines for the window messages, like ${WM_SETTEXT}. For more of them see WinMessages.nsh.