Chapter 22. DCL: The Graphical User Interface

Since Release 12 AutoCAD introduced the possibility of displaying dialog boxes from AutoLISP programs. This way AutoLISP caught up with how current applications interact with their users. The dialog boxes creation is a field where Visual LISP innovations have not been felt. The Dialog Control Language or DCL in Visual LISP is still the same Release 12 AutoLISP DCL from 20 years ago. However, Visual LISP’s capacity for acting as an ActiveX client and server makes it possible to link a Visual LISP application with dialog boxes programmed in other languages and compiled as DLL files. An alternative would be using the OpenDCL application, Especially developed for its use with AutoLISP, whose use will be explained in this book’s last chapter.
Visual LISP does not offer, like other "visual" environments, a graphic interface that allows drawing on the screen the DCL dialog boxes. The dialogs are created by a proprietary programming language’s expressions that are included in a file with the DCL extension. These expressions may be checked in the Visual LISP Editor. For this, select the Interface tools option in the Editor’s Tools menu. Two possibilities are offered here, Preview DCL in selection and Preview DCL in Editor. The first one is enabled when part of the text is selected in the Editor window.
In addition to displaying the resulting dialog, this tool will report any errors found in the DCL code. If the error is too severe, for example missing closing braces,  the dialog’s name will not even appear in the initial window.
Components of a DCL dialog box.
This Chapter includes a Tutorial showing how to implement a DCL dialog box for a 3D modeling application using the functions available in AutoLISP’s Programmable Dialog Box (PDB) language.
Although we will not explore more than a few tiles, how to design these dialogs and make them operational through LISP programming will be explained in its fundamental aspects.
We must also note that these dialog boxes can be packed with the Visual LISP code that make them work as Visual LISP compiled executable (VLX) files. This capability simplifies the distribution of applications because it is not necessary to install the DCL file independently.
More elaborated dialogs may be created by other means like the OpenDCL application to which we devote this book’s final chapter. In both cases, as they are created by procedures specifically designed for AutoLISP/Visual LISP, we are able to create standalone applications that include in a single file both the application’s code and the user interface’s definition, thing that is not possible using dialogs created by other means.
Dialog box designed in the Tutorial.
Solids and Surfaces created using the Parametric Model dialog box.

This Chapter includes the following sections:

22.1. The DCL language.
22.2. Programming a dialog in the Visual LISP Editor.
22.3. Tutorial: Dialog box for generating Parametric models.
22.4. Controlling the dialog.
22.5. Event callback functions.
22.6. Assignment of the callback functions.
22.7. Activating the Dialog Box.
22.8. Generating the Model.
22.9. Summary.
Chapter 22 Source code.

Your questions or comments about this Chapter's contents are welcome!

Buy this book from Amazon

No comments:

Post a Comment