Old 27th September 2006, 14:25   #1
m_srinivasmca02
Junior Member
 
Join Date: Sep 2006
Posts: 1
Abt Radio Buttons

Hi,

I added one custom page using NSIS with some radio buttons.Based on a selection of radio button it has to pick up the exact CUSTOM page.

Please, help me on this regard.If possible can any one send a sample script to do that.

Thanks in advance.


regards,
srinivas
m_srinivasmca02 is offline   Reply With Quote
Old 19th October 2006, 06:55   #2
n_baua
Member
 
Join Date: Aug 2006
Posts: 86
Hello,
Even I need that too.
n_baua is offline   Reply With Quote
Old 20th October 2006, 09:30   #3
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
The selected radio button field will have a state of 1. Simply read the state values of each radio button, and decide which page to show according to the selected one. Something like:
code:
Function Page2
ReadINIStr $1 "$PLUGINSDIR\page1.ini" "Field 1" "State"
ReadINIStr $2 "$PLUGINSDIR\page1.ini" "Field 2" "State"
ReadINIStr $3 "$PLUGINSDIR\page1.ini" "Field 3" "State"
${If} $1 == 1
File /oname=$PLUGINSDIR\page2.ini rb1.ini
${Else} ${If} $2 == 1
File /oname=$PLUGINSDIR\page2.ini rb2.ini
${Else} ${If} $3 == 1
File /oname=$PLUGINSDIR\page2.ini rb3.ini
${EndIf}

InstallOptions::dialog $PLUGINSDIR\page2.ini
FunctionEnd


NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 21st October 2006, 20:27   #4
HaMsTeYr
Junior Member
 
Join Date: Feb 2006
Posts: 44
Hey there, this is also on the topic of radio buttons, mine doesn't seem to work in the modern ui. I've even tried compiling the one in the NSIS online page, and that doesn't work.

I've attached my .nsi file, and the commented out coding is the original one... can anyone tell me why this isn't working?
Attached Files
File Type: nsi css - skins (modern ui).nsi (10.0 KB, 214 views)
HaMsTeYr is offline   Reply With Quote
Old 24th October 2006, 18:48   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Put .onInit and .onSelChange after the section definitions. If the sections are defined later in the script, ${g1o1} and friends have no meaning and they all translate to zero.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump