woodman78 Posted July 16, 2009 Posted July 16, 2009 I have a question about radio buttons on dialog boxes. Is there a limitation of one set of radio buttons per dialog. I want to select two items but I don't want to use radio buttons and toggle boxes. I get an error whenever I try to put in more than one set of radio buttons. Thanks. Quote
Lee Mac Posted July 16, 2009 Posted July 16, 2009 No, you can have multiple sets of radio buttons - just put each set in a different "category" (can't think of the correct term). See this as an example: http://www.cadtutor.net/forum/showthread.php?t=33919 Quote
The Buzzard Posted July 16, 2009 Posted July 16, 2009 I have a question about radio buttons on dialog boxes. Is there a limitation of one set of radio buttons per dialog. I want to select two items but I don't want to use radio buttons and toggle boxes. I get an error whenever I try to put in more than one set of radio buttons.Thanks. I used your samp4.dcl & samp4.lsp as an example to add another column of radio_buttons. DCL samp4 : dialog { //*dialog name label = "Existing Storm Sewers" ; //*give it a label [color=red] : row { //*define row[/color] [color=red] : column { //*define column[/color] : boxed_radio_column { //*define radio column label = "Choose a Type" ; //*give it a label : radio_button { //*define radio_button key = "T1"; //*give it a name label = "Type 1"; //*give it a label } //*end radio_button : radio_button { //*define radio_button key = "T2"; //*give it a name label = "Type 2"; //*give it a label } //*end radio_button : radio_button { //*define radio_button key = "T3"; //*give it a name label = "Type 3"; //*give it a label } //*end radio_button : radio_button { //*define radio_button key = "T4"; //*give it a name label = "Type 4"; //*give it a label } //*end radio_button } //*end boxed_radio_column [color=red] } //*end column[/color] [color=red] : column { //*define column[/color] [color=red] : boxed_radio_column { //*define radio column[/color] [color=red] label = "Choose a Whatever" ; //*give it a label[/color] [color=red] : radio_button { //*define radio_button[/color] [color=red] key = "W1"; //*give it a name[/color] [color=red] label = "Whatever 1"; //*give it a label[/color] [color=red] } //*end radio_button[/color] [color=red] : radio_button { //*define radio_button[/color] [color=red] key = "W2"; //*give it a name[/color] [color=red] label = "Whatever 2"; //*give it a label[/color] [color=red] } //*end radio_button[/color] [color=red] : radio_button { //*define radio_button[/color] [color=red] key = "W3"; //*give it a name[/color] [color=red] label = "Whatever 3"; //*give it a label[/color] [color=red] } //*end radio_button[/color] [color=red] : radio_button { //*define radio_button[/color] [color=red] key = "W4"; //*give it a name[/color] [color=red] label = "Whatever 4"; //*give it a label[/color] [color=red] } //*end radio_button[/color] [color=red] } //*end boxed_radio_column[/color] [color=red] } //*end column[/color] [color=red] } //*end row[/color] ok_cancel ; //*predifined OK/Cancel : row { //*define row : paragraph { //*define paragraph : text_part { //*define text label = "Designed by BD"; //*give it some text } //*end text : text_part { //*define more text label = "for CCC NNRDO"; //*some more text } //*end text } //*end paragraph } //*end row } //*end dialog LSP (defun C:samp4 (/ hole) ;define function (setq dcl_id (load_dialog "samp4.dcl")) ;load dialog (if (not (new_dialog "samp4" dcl_id) ;test for dialog );not (progn (alert "Can not find your dcl file") (exit) ;exit if no dialog ) );if (set_tile "T1" "1") ;Set radio_button T1 as default [color=red](set_tile "W1" "1") ;Set radio_button W1 as default[/color] (setq hole "TB1") ;Set variable hole to TB1 as default [color=red](setq Whatever "WB1") ;Set variable whatever to WB1 as default[/color] (action_tile "T1" "(setq hole \"TB1\")") ;*store hole type (action_tile "T2" "(setq hole \"TB2\")") ;*store hole type (action_tile "T3" "(setq hole \"TB3\")") ;*store hole type (action_tile "T4" "(setq hole \"TB4\")") ;*store hole type [color=red](action_tile "W1" "(setq whatever \"WB1\")") ;*store whatever[/color] [color=red](action_tile "W2" "(setq whatever \"WB2\")") ;*store whatever[/color] [color=red](action_tile "W3" "(setq whatever \"WB3\")") ;*store whatever[/color] [color=red](action_tile "W4" "(setq whatever \"WB4\")") ;*store whatever[/color] (action_tile "cancel" ;if cancel button pressed "(done_dialog)(setq userclick nil)" ;close dialog, set flag );action_tile (action_tile "accept" ;if O.K. pressed "(done_dialog)(setq userclick T))" ;??? Is this standard code. );action tile (start_dialog) ;start dialog (unload_dialog dcl_id) ;unload (if userclick ;When OK button is selected (cond ;And one of the following conditions apply ((= hole "TB1")(C:ESS1500)) ;If TB1 selected, Go to C:ESS1500 ((= hole "TB2")(C:ESS1350)) ;If TB2 selected, Go to C:ESS1350 ((= hole "TB3")(C:ESS1200)) ;If TB3 selected, Go to C:ESS1200 ((= hole "TB4")(C:ESS1050)) ;If TB4 selected, Go to C:ESS1050 ;(t (princ "\nNothing changed.")) ;_ end of optional else condition ) ;End cond ) ;End if (princ) ;Exit quietly ) ;End defun (princ "\nThis loaded fine") (princ) ;;;;;;;;;;Existing Storm_Sewer 1500mm;;;;;;;;;; Start (defun C:ESS1500() (setq a "CCC_DR_1500") (if (= (tblsearch "ltype" a) nil) (command "-linetype" "l" a "acadiso.lin" "") (princ)) (graphscr) (command "._-layer" "N" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1500" "M" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1500" "L" "CCC_DR_1500" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1500" "C" "84" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1500" "LW" "0.3" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1500" "" ) (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0") (princ) ) ;;;;;;;;;;Existing Storm_Sewer 1500mm;;;;;;;;;; End ;;;;;;;;;;Existing Storm_Sewer 1350mm;;;;;;;;;; Start (defun C:ESS1350() (setq a "CCC_DR_1350") (if (= (tblsearch "ltype" a) nil) (command "-linetype" "l" a "acadiso.lin" "") (princ)) (graphscr) (command "._-layer" "N" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1350" "M" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1350" "L" "CCC_DR_1350" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1350" "C" "84" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1350" "LW" "0.3" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1350" "" ) (command "pline" pause "width" "0.0" "0.0" pause "width" "0.0" "0.0") (princ) ) ;;;;;;;;;;Existing Storm_Sewer 1350mm;;;;;;;;;; End ;;;;;;;;;;Existing Storm_Sewer 1200mm;;;;;;;;;; Start (defun c:ESS1200() (setq a "CCC_DR_1200") (if (= (tblsearch "ltype" a) nil) (command "-linetype" "l" a "acadiso.lin" "") (princ)) (graphscr) (command "._-layer" "N" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1200" "M" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1200" "L" "CCC_DR_1200" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1200" "C" "84" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1200" "LW" "0.3" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1200" "" ) (command "pline" pause "width" "0.0" "0.0") (princ) ) ;;;;;;;;;;Existing Storm_Sewer 1200mm;;;;;;;;;; End ;;;;;;;;;;Existing Storm_Sewer 1050mm;;;;;;;;;; Start (defun c:ESS1050() (setq a "CCC_DR_1050") (if (= (tblsearch "ltype" a) nil) (command "-linetype" "l" a "acadiso.lin" "") (princ)) (graphscr) (command "._-layer" "N" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1050" "M" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1050" "L" "CCC_DR_1050" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1050" "C" "84" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1050" "LW" "0.3" "CCC_SERVICES_EXISTING_Drainage_Storm_Sewer_1050" "" ) (command "pline" pause "width" "0.0" "0.0") (princ) ) ;;;;;;;;;;Existing Storm_Sewer 1050mm;;;;;;;;;; End All changes are in red. Quote
flowerrobot Posted July 17, 2009 Posted July 17, 2009 Mr buzzard Is there a reason why you arnt using the radio button groups? As all it would require is a cond & action tile @ the "ok" point? [color=#ff0000]: boxed_radio_column { [/color] [color=red]label = "Choose a Whatever" ;[/color] [color=#ff0000]key = "Group_radio_1")[/color] [color=red]: radio_button { [/color] [color=red] key = "W1"; [/color] [color=#ff0000]etc...[/color] (set_tile "[color=#ff0000]Group_radio_1" 0)[/color] [color=#ff0000](action_tile "ok" (setq hi (get_tile "Group_radio_1"))[/color] [color=#ff0000](cond [/color] [color=#ff0000]((= hi 0)[/color][color=#ff0000](setq hole "WB1")[/color][color=#ff0000])[/color] [color=#ff0000])[/color] Just enquiring since you've being doing dcl alot longer than i have Quote
The Buzzard Posted July 17, 2009 Posted July 17, 2009 Mr buzzard Is there a reason why you arnt using the radio button groups? As all it would require is a cond & action tile @ the "ok" point? [color=#ff0000]: boxed_radio_column { [/color] [color=red]label = "Choose a Whatever" ;[/color] [color=#ff0000]key = "Group_radio_1")[/color] [color=red]: radio_button { [/color] [color=red] key = "W1"; [/color] [color=#ff0000]etc...[/color] (set_tile "[color=#ff0000]Group_radio_1" 0)[/color] [color=#ff0000](action_tile "ok" (setq hi (get_tile "Group_radio_1"))[/color] [color=#ff0000](cond [/color] [color=#ff0000]((= hi 0)[/color][color=#ff0000](setq hole "WB1")[/color][color=#ff0000])[/color] [color=#ff0000])[/color] Just enquiring since you've being doing dcl alot longer than i have The way I learned seems to work for me. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.