Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   radio button on a custom page (http://forums.winamp.com/showthread.php?t=303416)

novocaine 23rd February 2009 14:56

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..

code:
${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 23rd February 2009 15:47

Don't hesitate to search the forum,

http://forums.winamp.com/search.php?...by=&sortorder=

Of course there are 100s examples if you dig deeply.

novocaine 23rd February 2009 17:24

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 23rd February 2009 17:54

This search result should be able to help you:
http://forums.winamp.com/showthread....s+radio+button

novocaine 23rd February 2009 18:14

solved:
code:
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 23rd February 2009 19:12

also, perhaps...
http://nsis.sourceforge.net/NsDialog...ton_selections


All times are GMT. The time now is 04:27.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.