avcad
Joined: 22 May 2007
Posts: 1
|
Posted:
Tue May 22, 2007 5:40 pm Post subject:
Coding for Radio buttons??? |
|
|
Ok I have this program I am working on. Basically what it is a 1 dcl file and 1 lsp.
It works ok right now I still need to add in layer info and such but currently it does everything I need it too do except 1 feature which I can not figure out how too do for the life of me.
Basically, in the beginning it worked just off edit boxes for userinput. But After showing it to some people around my office they wanted some default values, so in the dcl I added radio buttons and left the user input option there but made it not active unless the radio button was selected for userinput.
But I cant get the other radio buttons to work. I mean you can click them but if you click them the variables for them are not used.
so any help would be great. I really just dont know how to code the buttons in the lisp file.
I have keys set up for all of them. All it needs to do is...if button 1 is selected it uses the value set to that button. if the user defined button is selected then it needs to use the edit box value.
Thanks in advance.
|
|
Adesu
Joined: 20 Jul 2005
Posts: 32
|
Posted:
Wed May 23, 2007 8:19 am Post subject:
Re: Coding for Radio buttons??? |
|
|
Hi avcad,
here a sample to use radio button, I hope this code can help you.
LSP file
| Code: |
; rb is for stands radio button
(defun c:rb (/ dcl_id ans)
(setq dcl_id (load_dialog "Radio Button.DCL"))
(if
(not (new_dialog "rb" dcl_id))
(exit)
)
(set_tile "rb1" "1")
(mode_tile "rb1" 2)
(mode_tile "rb2" 2)
(mode_tile "rb2" 2)
(action_tile "rb1" "(setq data_rb1 (get_tile \"rb1\"))")
(action_tile "rb2" "(setq data_rb1 (get_tile \"rb1\"))")
(action_tile "rb3" "(setq data_rb1 (get_tile \"rb1\"))")
(action_tile "accept" "(done_dialog 1)")
(setq ans (start_dialog))
(princ)
)
|
it's dcl file
| Code: |
rb : dialog {label= "Radio Button Manager";
: row {label = "Choose a radio button";
: radio_button {label= "Radio Button 1";
key= "rb1";}
: radio_button {label= "Radio Button 2";
key= "rb2";}
: radio_button {label= "Radio Button 3";
key= "rb3";}}
ok_only;}
|
| avcad wrote: | Ok I have this program I am working on. Basically what it is a 1 dcl file and 1 lsp.
It works ok right now I still need to add in layer info and such but currently it does everything I need it too do except 1 feature which I can not figure out how too do for the life of me.
Basically, in the beginning it worked just off edit boxes for userinput. But After showing it to some people around my office they wanted some default values, so in the dcl I added radio buttons and left the user input option there but made it not active unless the radio button was selected for userinput.
But I cant get the other radio buttons to work. I mean you can click them but if you click them the variables for them are not used.
so any help would be great. I really just dont know how to code the buttons in the lisp file.
I have keys set up for all of them. All it needs to do is...if button 1 is selected it uses the value set to that button. if the user defined button is selected then it needs to use the edit box value.
Thanks in advance. |
|
|