Jump to content

Pop up/dialog box?


mitchellrodhous

Recommended Posts

Hi All,

 

Well wenn I look to the greatests LISP Routine's from some people over here I always see a kind of Pop up/dialog box were you create you're function. like the attachments image...

My question; is theire an small basic tutural, or could someone tell me how I can create thoose pop ups/dialog box?

I think it is also posseble to activate diverent LISP routines in one LISP/pop up/dialog box.

 

[img=http://www.cadtutor.net/forum/attachment.php?attachmentid=10883&d=1237303513]

Above you see an pop up/dialog box were you can create something by values insertion in this pop up/dialog box.

Anyone knows good tutoral?

 

Regards MR

Link to comment
Share on other sites

well, I had some sparetime, so I had time to read thoose tutorals, I used one of thoose turtorals for my basic form (see attachments). Changed it to my specifics. Aftyer all, ended not knowing how to go on...

Maybe someone, also has sparetime, can check up, also play the LISP, see what I am trying to reach and help me on.

 

I am trying to select the type cabinet on the leftside (I wrote this cabinets in LISP placed somewere else)

 

On the rightside I want to add the size, three boxes with one length, second widht, third has to be depth.

By clicking on the button "OK" he has to use a LISP routine belong to the type cabinet on the left. uses the sizes I added on the rightside.

 

ps1: It can be that some information given by the dcl or lsp file isn't even necessary for my options, I already noticed just copied from internet and changed it.

 

Hope for any response trying to finish it.

 

Regards MR

samp6.DCL

samp6.LSP

Cabinet.JPG

Link to comment
Share on other sites

weel I made a bit improvement myself... maybe somebody can explane me something....

 

I marked in my dcl code something in red and green..

 

samp6 : dialog {    //dialog name
     label = "Cabinet Drawer V2.1" ;  //give it a label

      : row {     //define row

      :boxed_radio_column {   //define radio column
      label = "Type" ;    //give it a label

       : radio_button {   //define radion button
       key = "[color=darkgreen]rb1[/color]" ;    //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "1" ;    //switch it on
       }     //end definition

     : radio_button {   //define radio button
       key = "[color=darkgreen]rb2[/color]" ;    //give it a name
       label = "Cabinet with back" ;  //give it a label
     }     //end definition

       }     //end radio column
       }     //end row

       : boxed_column {   //define boxed column
         label = "&Size";   //give it a label

      
       : edit_box {    //define edit box
         key = "[color=red]eb1[/color]" ;    //give it a name
         label = "Length :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
  : edit_box {    //define edit box
           key = "[color=red]eb2[/color]" ;   //give it a name
           label = "Widht :" ;   //give it a label
           edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
  : edit_box {    //define edit box
           key = "[color=red]eb3[/color]" ;   //give it a name
           label = "Depth :" ;   //give it a label
           edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box

  : edit_box {    //define edit box
           key = "[color=red]eb4[/color]" ;   //give it a name
           label = "Materialethickness :" ; //give it a label
           edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
        
      }     //end boxed column
       : boxed_column {   //define boxed column
         label = "&Specifics";   //give it a label


         
       : edit_box {    //define edit box
         key = "[color=red]eb5[/color]" ;    //give it a name
         label = "Back offset :" ;  //give it a label
         edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
       : edit_box {    //define edit box
         key = "[color=red]eb6[/color]" ;    //give it a name
         label = "Thickness back :" ;  //give it a label
         edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
      }     //end boxed column

       

    ok_cancel ;    //predifined OK/Cancel

    : row {     //define row

    : image {     //define image tile
    key = "im" ;    //give it a name
    height = 1.0 ;    //and a height
    width = 1.0 ;    //and now a width
    }      //end image

    : paragraph {    //define paragraph

    : text_part {    //define text
    label = "Designed and Created";  //give it some text
    }      //end text

    : text_part {    //define more text
    label = "By MR. CAD - MITCHELL RODHOUSE"; //some more text
    }      //end text

    }      //end paragraph

    }      //end row
    
    }      //end dialog

 

I want to use the red marked falues as falues for the lisp I marked in green. (I have write lisp files were it ask in the commandline for the falues I'll want to put into this dialog).

 

so an other thing, I want to activate one of two lisp files by clicking on that radio-button.

Any help would be appriciated!

 

Best Regards MR

2.JPG

Link to comment
Share on other sites

well not that much response, I hoped theire were experts enough in this forums to help me out...

Does anyone know how I can use the information I insert in to this dialog box? I think I just have to insert some command prompts, but I am not knowing were to start....

 

LISP file

(defun C:samp6 ()     ;define function 

 (setq dcl_id (load_dialog "samp7.dcl"))  ;load dialog

 (if (not (new_dialog "samp6" dcl_id)   ;test for dialog

     );not

   (exit)      ;exit if no dialog

 );if

 (setq w (dimx_tile "im")    ;get image tile width
       h1 (dimy_tile "im")    ;get image tile height
b "eb2"      ;Set Widht of the cabinet
h "eb1"      ;Set Hight of the cabinet
d "eb3"      ;Set Depth of the cabinet
m "eb4"      ;Set materialthickness
ba "eb5"     ;Set offset back
bat "eb6"     ;Set thickness back



);setq

 (start_image "im")     ;start the image
 (fill_image 0 0 w h1 5)    ;fill it with blue
 (end_image)      ;end image

 (action_tile "rb1" "(setq hole \"site\")")  ;store hole type
 (action_tile "rb2" "(setq hole \"shop\")")  ;store hole type
 (action_tile "rb3" "(setq hole \"hid\")")  ;store hole type
 (action_tile "rb4" "(setq hole \"ctsk\")")  ;store hole type
 (action_tile "rb5" "(setq hole \"elev\")")  ;store hole type
 (action_tile "rb6" "(setq hole \"slot\")  ;store hole type
                     (mode_tile \"eb1\" 0)  ;enable edit box
                     (mode_tile \"eb1\" 2)")  ;switch focus to edit box

   (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
   (strcat      ;string 'em together
     "(setq notes (get_tile \"eb1\"))"   ;get notes

     " (done_dialog)(setq userclick T))"  ;close dialog, set flag
   );strcat

 );action tile

 (start_dialog)     ;start dialog

 (unload_dialog dcl_id)    ;unload

  (if userclick     ;check O.K. was selected
   (progn



   );progn

 );if userclick

(princ)

);defun C:samp

(princ)

 

 

DCL file

samp6 : dialog {    //dialog name
     label = "Cabinet Drawer V2.1" ;  //give it a label

      : row {     //define row

      :boxed_radio_column {   //define radio column
      label = "Type" ;    //give it a label

       : radio_button {   //define radion button
       key = "rb1" ;    //give it a name
       label = "Cabinet free standing" ; //give it a label
       value = "1" ;    //switch it on
       }     //end definition

     : radio_button {   //define radio button
       key = "rb2" ;    //give it a name
       label = "Cabinet with back" ;  //give it a label
     }     //end definition

       }     //end radio column
       }     //end row

       : boxed_column {   //define boxed column
         label = "&Size";   //give it a label


       : edit_box {    //define edit box
         key = "eb1" ;    //give it a name
         label = "Length :" ;   //give it a label
         edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
  : edit_box {    //define edit box
           key = "eb2" ;   //give it a name
           label = "Widht :" ;   //give it a label
           edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
  : edit_box {    //define edit box
           key = "eb3" ;   //give it a name
           label = "Depth :" ;   //give it a label
           edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box

  : edit_box {    //define edit box
           key = "eb4" ;   //give it a name
           label = "Materialethickness :" ; //give it a label
           edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box

      }     //end boxed column
       : boxed_column {   //define boxed column
         label = "&Specifics";   //give it a label



       : edit_box {    //define edit box
         key = "eb5" ;    //give it a name
         label = "Back offset :" ;  //give it a label
         edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
       : edit_box {    //define edit box
         key = "eb6" ;    //give it a name
         label = "Thickness back :" ;  //give it a label
         edit_width = 10 ;   //30 characters
       }     //end edit box
     //end edit box
      }     //end boxed column



    ok_cancel ;    //predifined OK/Cancel

    : row {     //define row

    : image {     //define image tile
    key = "im" ;    //give it a name
    height = 1.0 ;    //and a height
    width = 1.0 ;    //and now a width
    }      //end image

    : paragraph {    //define paragraph

    : text_part {    //define text
    label = "Designed and Created";  //give it some text
    }      //end text

    : text_part {    //define more text
    label = "By MR. CAD - MITCHELL RODHOUSE"; //some more text
    }      //end text

    }      //end paragraph

    }      //end row

    }      //end dialog

 

regards MR

Link to comment
Share on other sites

My suggestion is to follow the above tutorials and after start to combine the simple dialogs that you designed during those lessons into more complex ones. Next step will be to download some examples from this forum and try to understand their code. Good luck!

 

Regards,

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...