Dialog Control Language

Dialog Control Language

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"
(defun change-name ()
  (set_tile "greeting" (strcat "Hello, " (get_tile "name") "!")))
 
(setq hello-dcl (load_dialog "hello.dcl"))
(new_dialog "hello" hello-dcl)
(start_dialog)
(unload_dialog hello-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.

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • Dialog system — An automated online assistant on a website an example where dialog systems are major components. A dialog system or conversational agent (CA) is a computer system intended to converse with a human, with a coherent structure. Dialog systems have… …   Wikipedia

  • Language teaching methods — Main article: Language education Language education may take place as a general school subject or in a specialized language school. There are many methods of teaching languages. Some have fallen into relative obscurity and others are widely used; …   Wikipedia

  • Control flow — Not to be confused with Flow control. In computer science, control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions, or function calls of an imperative or a declarative program are… …   Wikipedia

  • Dialog tree — Example of a simple dialog tree. A dialog tree or conversation tree is a gameplay mechanic that is used throughout many adventure games[1][2][ …   Wikipedia

  • Language policy in Latvia — The basis of Language policy in Latvia are articles 4 and 114 of Constitution of Latvia, which constitute official status of Latvian and rights of ethnic minorities to preserve and develop their languages. All languages, except Latvian and… …   Wikipedia

  • mIRC scripting language — Paradigm(s) Event driven programming, Procedural programming Appeared in 1995 (1995) Designed by Khaled Mardam Bey Developer Khaled Mardam Bey …   Wikipedia

  • MIRC scripting language — The mIRC scripting language is the scripting language embedded in mIRC, a popular IRC client for Windows.Primary uses*Channel and personal protection against any types of attacks (flooding, spamming, CTCP floods, etc) *Dialog windows can be… …   Wikipedia

  • List of Control Panel applets — The applets listed below are components of the Microsoft Windows control panel, which allows users to define a range of settings for their computer, monitor the status of devices such as printers and modems, and set up new hardware, programs and… …   Wikipedia

  • Java (programming language) — infobox programming language name = Java paradigm = Object oriented, structured, imperative year = 1995 designer = Sun Microsystems latest release version = Java Standard Edition 6 (1.6.0) latest release date = latest test version = latest test… …   Wikipedia

  • Clarion (programming language) — For other uses, see Clarion. Clarion Developer(s) JPI, Clarion International, SoftVelocity Stable release 8.0 / August 30, 2011; 2 months ago (2011 08 30) Operating system …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”