关于 DCL 文件 (DCL) 中的语法和注释
对话框控制语言 (DCL) 文件是定义对话框及其元素的普通 ASCII 文件。 注意:AutoLISP 中的 DCL 支持仅限于 Windows。
对话框中的元素(如按钮和编辑框)称为磁贴。每个磁贴的大小和功能由磁贴的属性控制。对话框的大小及其零件的布局是自动设置的,只需最少的定位信息。 对话框定义从使用对话框磁贴开始。您必须在 DCL 文件中为每个对话框定义添加唯一名称的前缀;此名称用于引用将要显示该对话框的 AutoLISP 程序中的对话框。对话框磁贴的 label 属性可用于设置将显示在对话框标题栏中的文本。 下面是名称为 的对话框定义的示例。本示例为对话框指定一个标题,并显示一个“确定”按钮。minimaldcl minimaldcl : dialog
{
label="Minimal Example";
ok_only;
}
注意:对话框定义必须至少具有“取消”或“确定”按钮才能成为有效的对话框。
定义基本对话框后,可以向其添加磁贴,这些磁贴表示向用户提供信息或允许用户启动操作的控件。上一示例中的磁贴是标签为 OK 的按钮的预定义磁贴定义。切片的外观和回调操作是使用属性和属性值配对定义的。下图显示了标题为“花园路径磁贴规范”的 DCL 文件中定义的对话框的示例。ok_only ![]() 下面显示了包含对话框及其切片及其属性的 DCL 文件的内容,以及“花园路径切片规范”对话框的属性: gp_mainDialog : dialog {
label = "Garden Path Tile Specifications";
: boxed_radio_column { // defines the radio button areas
label = "Outline Polyline Type";
: radio_button { // defines the Lightweight radio button
label = "&Lightweight";
key = "gp_lw";
value = "1";
}
: radio_button { // defines the old-style polyline radio button
label = "&Old-style";
key = "gp_hw";
}
}
: boxed_radio_column { // defines the radio button areas
label = "Tile Creation Method";
: radio_button { // defines the ActiveX radio button
label = "&ActiveX Automation";
key = "gp_actx";
value = "1";
}
: radio_button { // defines the (entmake) radio button
label = "&Entmake";
key = "gp_emake";
}
: radio_button { // defines the (command) radio button
label = "&Command";
key = "gp_cmd";
}
}
: edit_box { // defines the Radius of Tile edit box
label = "&Radius of tile";
key = "gp_trad";
edit_width = 6;
}
: edit_box { // defines the Spacing Between Tiles edit box
label = "&Spacing between tiles";
key = "gp_spac";
edit_width = 6;
}
: row { // defines the OK/Cancel button row
: spacer { width = 1; }
: button { // defines the OK button
label = "OK";
is_default = true;
key = "accept";
width = 8;
fixed_width = true;
}
: button { // defines the Cancel button
label = "Cancel";
is_cancel = true;
key = "cancel";
width = 8;
fixed_width = true;
}
: spacer { width = 1;}
}
}
评论在 DCL 文件中,前面有两个正斜杠 ( // ) 的语句被视为注释。出现在 // 和行尾之间的任何内容都将被忽略。DCL 还允许 C 语言样式注释。这些具有 .起始 /* 和结束 */ 可以在单独的行上。/*comment text */ 父主题: |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-10-21 04:27
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.