Dialog Control Language

Last updated

Dialog Control Language (DCL) is a high-level description language and interpreter within AutoCAD for creating simple graphical dialogs. AutoLISP extensions use it to interact with the user in the AutoCAD environment.

Contents

Features and usage

Unlike other major GUI APIs, DCL is not a complete GUI toolkit for application programming. It is only intended for providing simple dialogs within AutoCAD. It includes basic form widgets such as text boxes, buttons, checkboxes and list boxes. DCL is object-oriented; it allows re-use through inheritance and composition.

DCL syntax is based on defining and using 'tiles'. A 'tile' represents a GUI widget such as a text box or a text label. Tiles also represent widgets that hold other widgets, such as columns, radio button groups and the dialogs themselves. DCL provides built-in tiles for all major widgets, and new tiles can be defined through inheritance and composition of other tiles.

DCL allows interactions with the dialog at run-time by Lisp code. Certain widgets can have actions associated with them by naming an AutoLISP function to be run, and values to be passed to it. Unlike other types of GUIs, DCL dialogs cannot be changed substantially at run time. The contents of certain widgets such as text boxes and list boxes can be changed, but widgets cannot be removed from or added to the dialog.

Example

Here is an example DCL file (and accompanying AutoLISP file) demonstrating the major features of DCL.

name_button : button {  label = "Submit name";  action = "(change-name)";  }  hello : dialog {  label = "DCL Example";    : edit_box {  label = "Name: ";  key = "name";  }   : name_button {  key = "submit-name";  }   : text {  key = "greeting";  }   ok_only; } 

The dialog is created by inheriting from the built-in tile 'dialog'. Properties are set on the dialog and other widgets in name/value pairs. Tiles can be placed inside the dialog just by naming them, or by naming them and specifying additional properties. A new tile ('name_button') is defined for use by naming it and specifying properties for it.

; DCL is saved as "hello.dcl"(defunchange-name()(set_tile"greeting"(strcat"Hello, "(get_tile"name")"!")))(setqhello-dcl(load_dialog"hello.dcl"))(new_dialog"hello"hello-dcl)(start_dialog)(unload_dialoghello-dcl)

A DCL dialog is instantiated by calling a series of functions in an AutoLisp file. Tiles can call back into AutoLISP code on certain events, and Lisp can manipulate the contents of tiles while the dialog is running.

Alternative technologies

For creating more general GUIs and other extensions within CAD, AutoDesk provides several other choices. The ObjectARX API for C++ allows extensions to be built as within Microsoft Visual Studio. VBA allows drag-and-drop programming for AutoCAD as for Microsoft Office and other applications.

As of AutoCAD 2007 and later, AutoLISP or Visual-LISP programs can call routines written in Visual Studio .NET (VB or C#). Programmers can now create dialogs in VB or C# that have the full range of controls found in the .NET Forms API and can be called and accessed from Visual-LISP.

Related Research Articles

AutoLISP is a dialect of the programming language Lisp built specifically for use with the full version of AutoCAD and its derivatives, which include AutoCAD Map 3D, AutoCAD Architecture and AutoCAD Mechanical. Neither the application programming interface (API) nor the interpreter to execute AutoLISP code are included in the AutoCAD LT product line. A subset of AutoLISP functions is included in the browser-based AutoCAD web app.

<span class="mw-page-title-main">Visual Basic (.NET)</span> Object-oriented computer programming language

Visual Basic (VB), originally called Visual Basic .NET (VB.NET), is a multi-paradigm, object-oriented programming language, implemented on .NET, Mono, and the .NET Framework. Microsoft launched VB.NET in 2002 as the successor to its original Visual Basic language, the last version of which was Visual Basic 6.0. Although the ".NET" portion of the name was dropped in 2005, this article uses "Visual Basic [.NET]" to refer to all Visual Basic languages released since 2002, in order to distinguish between them and the classic Visual Basic. Along with C# and F#, it is one of the three main languages targeting the .NET ecosystem. Microsoft updated its VB language strategy on 6 Feb 2023 stating that VB is a stable language now and Microsoft will keep maintaining it.

<span class="mw-page-title-main">Swing (Java)</span> Java-based GUI toolkit

Swing is a GUI widget toolkit for Java. It is part of Oracle's Java Foundation Classes (JFC) – an API for providing a graphical user interface (GUI) for Java programs.

<span class="mw-page-title-main">Graphical widget</span> Element of interaction in a graphical user interface

A graphical widget in a graphical user interface is an element of interaction, such as a button or a scroll bar. Controls are software components that a computer user interacts with through direct manipulation to read or edit information about an application. User interface libraries such as Windows Presentation Foundation, Qt, GTK, and Cocoa, contain a collection of controls and the logic to render these.

Open Programming Language (OPL) is a programming language for embedded systems and mobile devices that run the operating systems EPOC and Symbian. It was released by the British company Psion in 1984.

<span class="mw-page-title-main">Fox toolkit</span>

The FOX toolkit is an open-source, cross-platform widget toolkit, i.e. a library of basic elements for building a graphical user interface (GUI). FOX stands for Free Objects for X.

wxPython Python wrapper for wxWidgets

wxPython is a wrapper for the cross-platform GUI API wxWidgets for the Python programming language. It is one of the alternatives to Tkinter. It is implemented as a Python extension module.

<span class="mw-page-title-main">PHP-GTK</span> PHP library for GTK+ GUI applications

PHP-GTK is a set of language bindings for the programming language PHP which allow GTK graphical user interface (GUI) applications to be written in PHP. PHP-GTK provides an object-oriented programming interface to GTK classes and functions. PHP-GTK partly supports GTK2, but GTK3 is unsupported.

gtkmm is the official C++ interface for the popular GUI library GTK. gtkmm is free software distributed under the GNU Lesser General Public License (LGPL).

Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI. Tkinter is included with standard Linux, Microsoft Windows and macOS installs of Python.

Layout managers are software components used in widget toolkits which have the ability to lay out graphical control elements by their relative positions without using distance units. It is often more natural to define component layouts in this manner than to define their position in pixels or common distance units, so a number of popular widget toolkits include this ability by default. Widget toolkits that provide this function can generally be classified into two groups:

qooxdoo Open-source Ajax web application framework

qooxdoo is an open-source Ajax web application framework. It is an LGPL- and/or EPL-licensed client-side and server-agnostic solution, and includes support for professional JavaScript development, a graphical user interface (GUI) toolkit and high-level client-server communication.

<span class="mw-page-title-main">Tk (software)</span> GUI toolkit or framework

Tk is a cross-platform widget toolkit that provides a library of basic elements of GUI widgets for building a graphical user interface (GUI) in many programming languages. It is free and open-source software released under a BSD-style software license.

XBLite is a free Open Source BASIC programming language compiler and development system. It was started in 2001 by David Szafranski in order to provide a Windows exclusive version of the XBasic dialect. XBLite is released under the GNU GPL licensing scheme, Standard libraries are released under the GNU LGPL licensing scheme.

Wt is an open-source widget-centric web framework for the C++ programming language. It has an API resembling that of Qt framework, also using a widget-tree and an event-driven signal/slot system.

<span class="mw-page-title-main">Abstract Window Toolkit</span> Java-based GUI toolkit

The Abstract Window Toolkit (AWT) is Java's original platform-dependent windowing, graphics, and user-interface widget toolkit, preceding Swing. The AWT is part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for Java program. AWT is also the GUI toolkit for a number of Java ME profiles. For example, Connected Device Configuration profiles require Java runtimes on mobile telephones to support the Abstract Window Toolkit.

<span class="mw-page-title-main">Kivy (framework)</span> Free and multi-platform graphical library for Python

Kivy is a free and open source Python framework for developing mobile apps and other multitouch application software with a natural user interface (NUI). It is distributed under the terms of the MIT License, and can run on Android, iOS, Linux, macOS, and Windows.

JWt is an open-source widget-centric web application framework for the Java programming language developed by Emweb. It has an API that uses established GUI application development patterns. The programming model is component-based and event-driven, similar to Swing.

<span class="mw-page-title-main">Fyne (software)</span> Graphical toolkit for building cross platform GUIs

Fyne is a free and open-source cross-platform widget toolkit for creating graphical user interfaces (GUIs) across desktop and mobile platforms. Fyne uses OpenGL to provide cross-platform graphics. It is inspired by the principles of Material Design to create applications that look and behave consistently across all platforms. It is licensed under the terms of the 3-clause BSD License, supporting the creation of free and proprietary applications. In December 2019 Fyne became the most popular GUI toolkit for Go, by GitHub star count and in early February 2020 it was trending as #1 project in GitHub trending ranks.