Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
adding more radio buttons to an existing group
#1
Hello,
Sometimes there is the need to add more options to a choice.
in a dialog is there a way to add  one or more radio buttons (button-> option next) to an existing radio buttons group?

I can't find a way to "link" the new button to an existing group, as it remains "isolated" from the others and doesn't change state when the others ar clicked.
I've looked at the code created when the dialog is saved but I coudn't find a visible difference in it betwwen "option next" buttons of different groups.

Many thanks.
#2
all the option buttons need to be grouped together in the dialog definition for the added ones to be linked to the group.
Reorder the lines in the dialog definition so they together.
Function DialogExample
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Button 0x54032009 0x0 0 0 58 10 "Option first"
;4 Button 0x54002009 0x0 0 24 58 10 "Option next"
;5 Button 0x54002009 0x0 0 48 58 10 "Option next"
;7 Button 0x54002009 0x0 0 96 58 10 "Option next"
;6 Edit 0x54030080 0x200 0 73 72 13 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040A00 "*" "" "" ""


str controls = "3 4 5 6 7"
str o3Opt o4Opt o5Opt e6 o7Opt
o3Opt=1
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#3
Thank you Kevin, it works.
Only I've to separate each group of buttons from the others in the dialog definition with, say, a static text or edit: I missed that.

Have a good day!


Forum Jump:


Users browsing this thread: 1 Guest(s)