Skip to content
⌘ NSIS Forum Archive

radio button on a custom page

6 posts

novocaine#

radio button on a custom page

first of all i would like to thanks who gives me help in my last thread, i have solved everything with your suggestions.

now i got a problem with a custom page.

i wish to create a mirror selector.

creating a var, if mirror 1 is selected var become http://wwww.url.ex
else if mirror 2 is selected var became http://otherurl.ex

now, i have understand how to do radio buttons in a custom page..

    	${NSD_CreateRadioButton} 0 12u 100% 10u "mirror 1"
Pop $mirror1

${NSD_CreateRadioButton} 0 24u 100% 10u "mirror 2"
Pop $mirror2
nsDialogs::Show
but... now?

how can i set a variabile with the radio buttons?
if check box 1 is setted $server become X else Y

how?
Red Wine#
Don't hesitate to search the forum,



Of course there are 100s examples if you dig deeply.
novocaine#
sorry but i have seen a thousand threads but i didn't find what i'm searching.

could you make me some code for example even only with messagebox?
jpderuiter#
This search result should be able to help you:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
novocaine#
solved:
    Var Dialog
var hwnd
Var Checkbox1
Var Checkbox2
Var Checkbox_State
var server

Function mirrorselection
nsDialogs::Create 1018
Pop $Dialog
${NSD_CreateRadioButton} 0 12u 100% 10u "mirror 1"
Pop $checkbox1
${NSD_AddStyle} $checkbox1 ${WS_GROUP}
${NSD_OnClick} $checkbox1 radioclick
${NSD_CreateRadioButton} 0 24u 100% 10u "mirror 2"
Pop $checkbox2
${NSD_OnClick} $checkbox2 radioclick
nsDialogs::Show
FunctionEnd

Function RadioClick
Pop $hwnd
${If} $hwnd == $checkbox1
strcpy $server "http://xxx.com"
MessageBox MB_OK "selezionato: $server"
${ElseIf} $hwnd == $checkbox2
strcpy $server "http://www.yyy.com/"
MessageBox MB_OK "selezionato: $server"
${EndIf}
Animaether#
also, perhaps...