|
|
#1 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
Radio button in NSIS
hi all,
How to include radio button for yes/no option in the dialog. And the "next" button should enable/disable depends on the above option. Thanks, Chinna |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Feb 2007
Posts: 546
|
radiobutton:
http://nsis.sourceforge.net/NsDialog...f_RadioButtons disable next button: http://forums.winamp.com/showthread.php?postid=2399140 |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
Thanks for your reply.
I am very new this NSIS..... I am using the following code... var Group1Radio1 var Group1Radio2 Function WelcomePageSetupRadioButtonPre ;nsDialogs::Create 1018 Pop $dialog ${NSD_CreateRadioButton} 0 0 40% 6% "Group 1, Radio 1" Pop $Group1Radio1 ${NSD_AddStyle} $Group1Radio1 ${WS_GROUP} ${NSD_OnClick} $Group1Radio1 RadioClick ${NSD_CreateRadioButton} 0 12% 40% 6% "Group 1, Radio 2" Pop $Group1Radio2 ${NSD_OnClick} $Group1Radio2 RadioClick ;nsDialogs::Show FunctionEnd Function RadioClick Pop $hwnd ${If} $hwnd == $Group1Radio1 MessageBox MB_OK "onClick:Group1Radio1" ${ElseIf} $hwnd == $Group1Radio2 MessageBox MB_OK "onClick:Group1Radio2" ${EndIf} FunctionEnd This is not working out for me... Appreciate you provide a simple example with code... Thanks, |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Feb 2007
Posts: 546
|
What do you mean with 'not working'?
What doesn't work? What I can see now is that you commented the 'nsDialogs::Create' and 'nsDialogs::Show' out. Those are required, so you shouldn't do that. |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
jpderuiter,
Thank for your quick reply... I understand your saying. I got an assignment to 1. create two radio buttons (yes/no) on the "Welcome page" which comes an default dialog(not an user defined dialog). 2. Depends upon the above input I have to enable/disable the button (i am not sure how the radio button selection will effect on button) Appreciate you to provide a simple example code |
|
|
|
|
|
#6 |
|
Major Dude
Join Date: Feb 2007
Posts: 546
|
OK, well, you can't edit the Welcome page with nsDialogs.
The only way to do that is using a resource editor, like ResourceHacker (search the forum). The other option is to use a custom page instead of the Welcome page, with the same content as a normal Welcome page, and your radiobuttons. |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
thank you jpderuiter....
What is your advice to achieve this output.. using resource editor or create cutom page.. Which one is easier
|
|
|
|
|
|
#8 |
|
Major Dude
Join Date: Feb 2007
Posts: 546
|
I personally prefer using a custom page, as I think it's easier to do.
|
|
|
|
|
|
#9 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
|
Actually the welcome page (and finish page) is made with nsDialogs (MUI2.nsh). Just define an MUI_PAGE_CUSTOMFUNCTION_SHOW for it and then add your controls.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
Thanks stu....
Appreciate you to provide a example code for this.... |
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
Stu,
I am able to add two radio buttons in the welcome page... Now, how can i make the "next" button to act depends upon the radio buttons' selection. If Yes, enable "next" button If No, disable "next" button |
|
|
|
|
|
#12 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
|
Assign an OnClick event along with using ${NSD_GetState} and EnableWindow.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#13 |
|
Junior Member
Join Date: Mar 2010
Posts: 8
|
Stu,
${NSD_GetState} is for custom dialog.... am i right? I am looking into Welcome dialog. |
|
|
|
|
|
#14 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
|
As I've already said, the welcome (and finish) pages are custom pages using nsDialogs.
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|