Coding for Radio buttons???
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Coding for Radio buttons???

 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization
Author Message
avcad



Joined: 22 May 2007
Posts: 1

Posted: Tue May 22, 2007 5:40 pm    Post subject: Coding for Radio buttons??? Reply with quote

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.

Back to top
View user's profile Send private message
Adesu



Joined: 20 Jul 2005
Posts: 31

Posted: Wed May 23, 2007 8:19 am    Post subject: Re: Coding for Radio buttons??? Reply with quote

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.
Back to top
View user's profile Send private message
 
Post new topic   Reply to topic    CADForums.net Forum Index -> Customization All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB