Old 10th September 2008, 13:53   #1
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 500
Send a message via ICQ to Pawel
nsDialogs - GroupBox and RadioButtons problem

Hello, I ma trying to write nsdialogs page, that uses 2 GroupBox components and a few RadioButtons components, for each of the GroupBox.
This is how I create the page:
PHP Code:
Function CreateAutoRunPage

!insertmacro MUI_HEADER_TEXT "$(A_12)" "$(A_13)"
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}

GroupBox 1    
${NSD_CreateGroupBox0 40u 10040u "$(A_3)"    
Pop $GB_Ar1
    
RadioButton 1    
${NSD_CreateRadioButton759u 4010u "$(A_4)"
Pop $RB_Ar1

RadioButton 2
${NSD_CreateRadioButton5759u 4010u "$(A_5)"
Pop $RB_Ar2    

    
GroupBox 2    
${NSD_CreateGroupBox0 85u 4945u "$(A_6)"    
Pop $GB_Ar2    
    
RadioButton 3    
${NSD_CreateRadioButton798u 4010u "$(A_7)"
Pop $RB_Ar3

RadioButton 4    
${NSD_CreateRadioButton7113u 4010u "$(A_8)"
Pop $RB_Ar4            
    
    nsDialogs
::Show
        
FunctionEnd 
So, we created 2 GroupBox. Each of this GroupBox have two RadioButtons components. In each GroupBox ONLY 1 RadioButton can be selected. When I select 1 radiobutton of 1 Groupbox every radiobuttons are unselected. Please, tell me, how to do to select/unselect radiobuutons for each GroupBox only, not for all page...
I tried to use ${WS_GROUP} style, but it is not working...
Tried this:
SendMessage $GB_Ar1 ${WS_GROUP} 1 0
and this
${NSD_AddExStyle} $GB_Ar1 ${WS_GROUP}
and nothing, it is not working. GroupBox have to be separated.
Thanks for any help,
-Pawel
Attached Images
File Type: jpg no.jpg (25.3 KB, 372 views)
Pawel is offline   Reply With Quote
Old 10th September 2008, 15:12   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,604
http://forums.winamp.com/showthread....45#post2347845

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 10th September 2008, 15:17   #3
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 500
Send a message via ICQ to Pawel
Thanks Anders,
It work!
Ps:
The solution was adding this code after creating each GroupBox and first of RadioButton of each group.
${NSD_AddStyle} HANDLE ${WS_GROUP}|${WS_TABSTOP}

Thanks again, regards
-Pawel
Pawel is offline   Reply With Quote
Old 10th September 2008, 15:21   #4
{_trueparuex^}
Senior Member
 
{_trueparuex^}'s Avatar
 
Join Date: Dec 2005
Location: Glow
Posts: 285
WS_GROUP is not EX style so use ${NSD_AddStyle} instead of ${NSD_AddExStyle} and you should add the WS_GROUP style to the first RadioButton control of the group, not to the GroupBox control.

code:
Function CreateAutoRunPage

!insertmacro MUI_HEADER_TEXT "$(A_12)" "$(A_13)"
nsDialogs::Create /NOUNLOAD 1018
Pop $Dialog
${If} $Dialog == error
Abort
${EndIf}

; GroupBox 1
${NSD_CreateGroupBox} 0 40u 100% 40u "$(A_3)"
Pop $GB_Ar1

; RadioButton 1
${NSD_CreateRadioButton} 7% 59u 40% 10u "$(A_4)"
Pop $RB_Ar1
${NSD_AddStyle} $RB_Ar1 ${WS_GROUP}

; RadioButton 2
${NSD_CreateRadioButton} 57% 59u 40% 10u "$(A_5)"
Pop $RB_Ar2


; GroupBox 2
${NSD_CreateGroupBox} 0 85u 49% 45u "$(A_6)"
Pop $GB_Ar2

; RadioButton 3
${NSD_CreateRadioButton} 7% 98u 40% 10u "$(A_7)"
Pop $RB_Ar3
${NSD_AddStyle} $RB_Ar3 ${WS_GROUP}

; RadioButton 4
${NSD_CreateRadioButton} 7% 113u 40% 10u "$(A_8)"
Pop $RB_Ar4

nsDialogs::Show

FunctionEnd



Edit: Too slow.

PaR

The guy with the ridiculous username. Thou shall call him PaR instead.
Visit My Website
{_trueparuex^} is offline   Reply With Quote
Old 10th September 2008, 16:11   #5
Pawel
Moderator
 
Pawel's Avatar
 
Join Date: Aug 2004
Location: Poland
Posts: 500
Send a message via ICQ to Pawel
Quote:
Originally posted by {_trueparuex^}

Edit: Too slow.

PaR
Thanks anyway
Pawel 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