Author Topic: help with DCL - Embedding an image (logo) in a dialog  (Read 3431 times)

0 Members and 1 Guest are viewing this topic.

pedroantonio

  • Guest
help with DCL - Embedding an image (logo) in a dialog
« on: December 02, 2013, 12:01:07 PM »
I am trying to add a logo in a DCL . I miss somthing   :| and i need  alitle help.. 

Here  is my code

dcl code

Code: [Select]
//about.dcl
//Program to help dimension points of a section

nest2:dialog{
label="about";
: row {
        alignment = centered;
        : image_button {
            color = black ;
            fixed_height = true ;
            fixed_width = true ;
            height = 14 ;
            key = "im" ;
            width = 18 ;
        }
:boxed_column{
:paragraph{
:text_part{
label="Example";
            alignment = centered;
texth=14;
         }

:spacer{
 width=1;
        }
:text_part{
label="Hello ";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="This is an example";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="test";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="test ";
            alignment = centered;
          }
:spacer{
 width=1;
        }         
:text_part{
label="bla-bla-bla .....";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="end";
            alignment = centered;
          }
:spacer{
 width=1;
        }
          }
          }
ok_only;
            }

lisp code

Code: [Select]
(defun c:about () ;define function

  (setq dcl_id1 (load_dialog "about.dcl")) ;load the DCL file
  (slide_image 0 0 max_x max_y "imge2")
  (end_image)
  (if (not (new_dialog "nest2" dcl_id1)) ;load the nested dialogue box
    (exit)
  ) ;if not loaded exit
  (action_tile
    "accept"
    "(done_dialog) (setq userclick1 T)" ;close dialog, set flag
  ) ;action_tile
  (start_dialog) ;start the nested dialog box
  (unload_dialog dcl_id1) ;unload the nested dialogue box
)


Vandyck

  • Newt
  • Posts: 25
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #1 on: December 02, 2013, 12:19:31 PM »
reading AutoLISP code on the fly seems to me that is missing
(start_image "imge2")
to be inserted before
(slide_image 0 0 max_x max_y "imge2")
 :-)

pedroantonio

  • Guest
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #2 on: December 02, 2013, 12:47:25 PM »
dcl

Code: [Select]
//about2.dcl
//Program to help dimension points of a section

nest2:dialog{
label="about";
: row {
        alignment = centered;
        : image_button {
            color = black ;
            fixed_height = true ;
            fixed_width = true ;
            height = 14 ;
            key = "im" ;
            width = 18 ;
        }
:boxed_column{
:paragraph{
:text_part{
label="Example";
            alignment = centered;
texth=14;
         }

:spacer{
 width=1;
        }
:text_part{
label="Hello ";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="This is an example";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="test";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="test ";
            alignment = centered;
          }
:spacer{
 width=1;
        }         
:text_part{
label="bla-bla-bla .....";
            alignment = centered;
          }
:spacer{
 width=1;
        }
:text_part{
label="end";
            alignment = centered;
          }
:spacer{
 width=1;
        }
          }
          }
ok_only;
            }


lisp

Code: [Select]
(defun c:about2 () ;define function

  (setq dcl_id1 (load_dialog "about2.dcl")) ;load the DCL file
  (start_image "imge2")
  (slide_image 0 0 max_x max_y "imge2")
  (end_image)
  (if (not (new_dialog "nest2" dcl_id1)) ;load the nested dialogue box
    (exit)
  ) ;if not loaded exit
  (action_tile
    "accept"
    "(done_dialog) (setq userclick1 T)" ;close dialog, set flag
  ) ;action_tile
  (start_dialog) ;start the nested dialog box
  (unload_dialog dcl_id1) ;unload the nested dialogue box
)

gives me this error

"c:\user\admin\desktop\about\about2.dcl" at-end-of-file : premature end of file
"c:\user\admin\desktop\about\about2.dcl" at-end-of-file : syntax error  Symbol: "ok_only".

Command: (LOAD "C:/Users/Prodromos/Desktop/DiaTabs/about2.lsp") C:ABOUT2
Command: ABOUT2
; error: bad argument type: fixnump: nil
« Last Edit: December 02, 2013, 12:52:24 PM by pedroantonio »

efernal

  • Bull Frog
  • Posts: 206
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #3 on: December 02, 2013, 03:24:14 PM »
in your dcl file, image_button's key is "im"
in your lsp code, you are using "imge2"
max_x and max_y are undefined (see dimx_tile and dimy_tile functions...)
e.fernal

efernal

  • Bull Frog
  • Posts: 206
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #4 on: December 02, 2013, 03:26:39 PM »
also, you are trying to use an image_button before  (new_dialog ...
e.fernal

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #5 on: December 02, 2013, 03:31:15 PM »
I haven't tried to decipher your code logic, but the braces don't match in your DCL file
.. making sure your code is structurally correct would be a good place to start.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

pedroantonio

  • Guest
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #6 on: December 02, 2013, 04:36:20 PM »
i still have errors

Code - Auto/Visual Lisp: [Select]
  1. //about2.dcl
  2. //Program to help dimension points of a section
  3. : image_button {
  4. color = black ;
  5. fixed_height = true ;
  6. fixed_width = true ;
  7. height = 14 ;
  8. key = "imge2" ;
  9. width = 18 ;
  10.         }
  11. nest2:dialog{
  12. label="about";
  13.  
  14. :boxed_column{
  15. :paragraph{
  16. :text_part{
  17. label="Example";
  18.             alignment = centered;
  19. texth=14;
  20.          }
  21.  
  22. :spacer{
  23.  width=1;
  24.         }
  25. :text_part{
  26. label="Hello ";
  27.             alignment = centered;
  28.           }
  29. :spacer{
  30.  width=1;
  31.         }
  32. :text_part{
  33. label="This is an example";
  34.             alignment = centered;
  35.           }
  36. :spacer{
  37.  width=1;
  38.         }
  39. :text_part{
  40. label="test";
  41.             alignment = centered;
  42.           }
  43. :spacer{
  44.  width=1;
  45.         }
  46. :text_part{
  47. label="test ";
  48.             alignment = centered;
  49.           }
  50. :spacer{
  51.  width=1;
  52.         }        
  53. :text_part{
  54. label="bla-bla-bla .....";
  55.             alignment = centered;
  56.           }
  57. :spacer{
  58.  width=1;
  59.         }
  60. :text_part{
  61. label="end";
  62.             alignment = centered;
  63.           }
  64. :spacer{
  65.  width=1;
  66.         }
  67.           }
  68.           }
  69. ok_only;
  70.             }
« Last Edit: December 02, 2013, 07:06:17 PM by pedroantonio »

efernal

  • Bull Frog
  • Posts: 206
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #7 on: December 02, 2013, 05:22:09 PM »
//about2.dcl
//Program to help dimension points of a section
my_image : image_button { color = black ; fixed_height = true ;
           fixed_width = true ; height = 14 ;
           key = "imge2" ; width = 18 ;
           }

nest2: dialog { label="about";
:row { alignment=centered; fixed_width=true; fixed_height=true;
:column{fixed_width=true;fixed_height=true;
my_image;
}
:boxed_column{
:paragraph {
:text_part { label = "Example"; alignment = centered;  /* texth = 14; */ }
:spacer { width = 1; }
:text_part { label = "Hello "; alignment = centered; }
:spacer { width = 1; }
:text_part { label = "This is an example"; alignment = centered; }
:spacer { width = 1; }
:text_part { label = "test"; alignment = centered; }
:spacer { width = 1; }
:text_part { label = "test "; alignment = centered; }
:spacer { width = 1; }         
:text_part { label = "bla-bla-bla ....."; alignment = centered; }
:spacer { width = 1; }
:text_part{ label = "end"; alignment = centered; }
:spacer { width = 1; }
          } // paragraph
          } // boxed_column
          } // row
ok_only;
}
e.fernal

pedroantonio

  • Guest
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #8 on: December 02, 2013, 06:54:05 PM »
efernal thunk you for the code but, i run the lisp but gives me this error


; error: bad argument type: fixnump: nil

in your screen shot the image is black.Why?

dcl

Code - Auto/Visual Lisp: [Select]
  1. //about2.dcl
  2. //Program to help dimension points of a section
  3. my_image : image_button { color = black ; fixed_height = true ;
  4.            fixed_width = true ; height = 14 ;
  5.            key = "imge2" ; width = 18 ;
  6.            }
  7.  
  8. nest2: dialog { label="about";
  9. :row { alignment=centered; fixed_width=true; fixed_height=true;
  10. :column{fixed_width=true;fixed_height=true;
  11. my_image;
  12. }
  13. :boxed_column{
  14. :paragraph {
  15. :text_part { label = "Example"; alignment = centered;  /* texth = 14; */ }
  16. :spacer { width = 1; }
  17. :text_part { label = "Hello "; alignment = centered; }
  18. :spacer { width = 1; }
  19. :text_part { label = "This is an example"; alignment = centered; }
  20. :spacer { width = 1; }
  21. :text_part { label = "test"; alignment = centered; }
  22. :spacer { width = 1; }
  23. :text_part { label = "test "; alignment = centered; }
  24. :spacer { width = 1; }        
  25. :text_part { label = "bla-bla-bla ....."; alignment = centered; }
  26. :spacer { width = 1; }
  27. :text_part{ label = "end"; alignment = centered; }
  28. :spacer { width = 1; }
  29.           } // paragraph
  30.           } // boxed_column
  31.           } // row
  32. ok_only;
  33. }
  34.  

lisp

Code - Auto/Visual Lisp: [Select]
  1. (defun c:about2 ()                      ;define function
  2.  
  3.   (setq dcl_id1 (load_dialog "about2.dcl")) ;load the DCL file
  4.   (start_image "imge2")
  5.   (slide_image 0 0 max_x max_y "imge2")
  6.   (if (not (new_dialog "nest2" dcl_id1)) ;load the nested dialogue box
  7.     (exit)
  8.   )                                     ;if not loaded exit
  9.     "accept"
  10.     "(done_dialog) (setq userclick1 T)" ;close dialog, set flag
  11.   )                                     ;action_tile
  12.   (start_dialog)                        ;start the nested dialog box
  13.   (unload_dialog dcl_id1)               ;unload the nested dialogue box
  14. )
  15.  
« Last Edit: December 03, 2013, 02:55:25 AM by pedroantonio »

efernal

  • Bull Frog
  • Posts: 206
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #9 on: December 03, 2013, 06:32:02 AM »
Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. (DEFUN c:about2 ()                      ;define function
  3.   (SETQ dcl_id1 (LOAD_DIALOG "about2.dcl")) ;load the DCL file
  4.   (START_IMAGE "imge2")
  5.   (SLIDE_IMAGE 0 0 max_x max_y "imge2")
  6.   (END_IMAGE)
  7.   (IF (NOT (NEW_DIALOG "nest2" dcl_id1)) ;load the nested dialogue box
  8.     (EXIT)
  9.   )                                     ;if not loaded exit
  10.   (ACTION_TILE
  11.     "accept"
  12.     "(done_dialog) (setq userclick1 T)" ;close dialog, set flag
  13.   )                                     ;action_tile
  14.   (START_DIALOG)                        ;start the nested dialog box
  15.   (UNLOAD_DIALOG dcl_id1)               ;unload the nested dialogue box
  16. )
  17. |;
  18. (DEFUN c:about2 (/ dh dx dy)
  19.   (IF (> (SETQ dh (LOAD_DIALOG "about2.dcl")) 0)
  20.     ;; here you can provide the dcl path, like "C:\\Dcls\\About2.dcl"
  21.     (IF (NEW_DIALOG "nest2" dh)
  22.       (PROGN (SETQ dx (DIMX_TILE "imge2")
  23.                    dy (DIMY_TILE "imge2")
  24.              )
  25.              (START_IMAGE "imge2")
  26.              (SLIDE_IMAGE 0 0 dx dy "imge2")
  27.              ;; here you can provide the image path, like "C:\\Slds\\Imge2.sld"
  28.              (END_IMAGE)
  29.              (ACTION_TILE "accept" "(DONE_DIALOG)")
  30.              (START_DIALOG)
  31.              (UNLOAD_DIALOG dh)
  32.       )
  33.       nil
  34.     )
  35.     (ALERT "Error:\n\n\n\tCould not load dcl file...")
  36.   )
  37.   (PRINC)
  38. )
  39.    
  40.  
e.fernal

pedroantonio

  • Guest
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #10 on: December 03, 2013, 10:57:36 AM »
Thank you efernal  :-) ,but i want a little change. look the photo
« Last Edit: December 03, 2013, 12:33:35 PM by pedroantonio »

pedroantonio

  • Guest
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #11 on: December 03, 2013, 11:21:56 AM »
i want a little change. look the photo

dcl

Code - Auto/Visual Lisp: [Select]
  1. //about2.dcl
  2. //Program to help dimension points of a section
  3. my_image : image_button { color = black ; fixed_height = true ;
  4.            fixed_width = true ; height = 14 ;
  5.            key = "imge2" ; width = 18 ;
  6.            }
  7.  
  8. nest2: dialog { label="about";
  9. :row { alignment=centered; fixed_width=true; fixed_height=true;
  10. :column{fixed_width=true;fixed_height=true;
  11. my_image;
  12. }
  13. :boxed_column{
  14. :paragraph {
  15. :text_part { label = "Example"; alignment = centered;  /* texth = 14; */ }
  16. :spacer { width = 1; }
  17. :text_part { label = "Hello "; alignment = centered; }
  18. :spacer { width = 1; }
  19. :text_part { label = "This is an example"; alignment = centered; }
  20. :spacer { width = 1; }
  21. :text_part { label = "test"; alignment = centered; }
  22. :spacer { width = 1; }
  23. :text_part { label = "test "; alignment = centered; }
  24. :spacer { width = 1; }        
  25. :text_part { label = "bla-bla-bla ....."; alignment = centered; }
  26. :spacer { width = 1; }
  27. :text_part{ label = "end"; alignment = centered; }
  28. :spacer { width = 1; }
  29.           } // paragraph
  30.           } // boxed_column
  31.           } // row
  32. ok_only;
  33. }
  34.  

lisp

Code - Auto/Visual Lisp: [Select]
  1. ;|
  2. (DEFUN c:about2 ()                      ;define function
  3.   (SETQ dcl_id1 (LOAD_DIALOG "about2.dcl")) ;load the DCL file
  4.   (START_IMAGE "imge2")
  5.   (SLIDE_IMAGE 0 0 max_x max_y "imge2")
  6.   (END_IMAGE)
  7.   (IF (NOT (NEW_DIALOG "nest2" dcl_id1)) ;load the nested dialogue box
  8.     (EXIT)
  9.   )                                     ;if not loaded exit
  10.   (ACTION_TILE
  11.     "accept"
  12.     "(done_dialog) (setq userclick1 T)" ;close dialog, set flag
  13.   )                                     ;action_tile
  14.   (START_DIALOG)                        ;start the nested dialog box
  15.   (UNLOAD_DIALOG dcl_id1)               ;unload the nested dialogue box
  16. )
  17. |;
  18. (DEFUN c:about2 (/ dh dx dy)
  19.   (IF (> (SETQ dh (LOAD_DIALOG "about2.dcl")) 0)
  20.     ;; here you can provide the dcl path, like "C:\\Dcls\\About2.dcl"
  21.     (IF (NEW_DIALOG "nest2" dh)
  22.       (PROGN (SETQ dx (DIMX_TILE "imge2")
  23.                    dy (DIMY_TILE "imge2")
  24.              )
  25.              (START_IMAGE "imge2")
  26.              (SLIDE_IMAGE 0 0 dx dy "imge2")
  27.              ;; here you can provide the image path, like "C:\\Slds\\Imge2.sld"
  28.              (END_IMAGE)
  29.              (ACTION_TILE "accept" "(DONE_DIALOG)")
  30.              (START_DIALOG)
  31.              (UNLOAD_DIALOG dh)
  32.       )
  33.       nil
  34.     )
  35.     (ALERT "Error:\n\n\n\tCould not load dcl file...")
  36.   )
  37.   (PRINC)
  38. )
  39.  

« Last Edit: December 03, 2013, 12:33:23 PM by pedroantonio »

snownut2

  • Swamp Rat
  • Posts: 971
  • Bricscad 22 Ultimate
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #12 on: December 03, 2013, 05:29:47 PM »
pedroantonio,

All the code in the DCL is there, just take a look at it.  For example the DCL starts out with a ROW (the ROW is not terminated until the end), then there are 2-columns within the ROW the 1st column contains the IMAGE and the 2nd boxed_column contains the paragraph.  You should be able to figure this out if you study what is already there.

It seems you want to eliminate the ROW and just have 2-columns one above the other instead of beside each other.

You can load the DCL in the Visual Lisp Editor in ACAD (vlide) and make the adjustments then preview very quickly.

Bruce

efernal

  • Bull Frog
  • Posts: 206
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #13 on: December 03, 2013, 06:23:54 PM »
Code - Auto/Visual Lisp: [Select]
  1. nest2: dialog { label="about";
  2. :spacer{height=0.5;}
  3. :column{fixed_width=true;fixed_height=true;
  4. :image_button { color = black ; fixed_height = true ;
  5. fixed_width = true ; width = 44; aspect_ratio = 0.35 ; key = "imge2" ; }
  6. :boxed_column{
  7. :text{ label = "Example"; alignment = centered; }
  8. :text{ label = "Hello "; alignment = centered; }
  9. :text{ label = "This is an example"; alignment = centered; }
  10. :text{ label = "test"; alignment = centered; }
  11. :text{ label = "test "; alignment = centered; }      
  12. :text{ label = "bla-bla-bla ....."; alignment = centered; }
  13. :text{ label = "end"; alignment = centered; }
  14.          } // boxed_column
  15.          } // column
  16. ok_only;
  17. }
  18.  
e.fernal

pedroantonio

  • Guest
Re: help with DCL - Embedding an image (logo) in a dialog
« Reply #14 on: December 03, 2013, 06:29:56 PM »
Thank you all for the help  :-)