View
10
Download
0
Category
Preview:
Citation preview
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 1
DCL – Dialog Control Language:
João Manuel R. S. Tavares
Introdução
Bibliografia Material disponível no AfraLisp.net em http://www.afralisp.net
Programação em AutoCAD, Curso CompletoFernando Luís Ferreira, João SantosFCA
Sistema de ajuda do AutoCAD
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução2
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 2
Introdução A Dialog Control Language permite criar interfaces gráficas (caixas de
diálogo e de mensagens) para aplicações em AutoLISP/Visual Lisp
Cada caixa de diálogo deve ser definida (dialog definition) em ficheiros de definição com a extensão dcl
Cada controlo de um diálogo necessita ser definido (tile definition) e é referenciado no código lisp pelo seu nome (key)
Cada propriedade (property) de um controlo (tile) é designada por atributo do diálogo (attribute)
Cada método de um controlo é designado por expressão de acção
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
(action expression)
O Visual Lisp Editor possibilita a previsão de um diálogo definido num ficheiro dcl (em Tools, Interface Tools)
3
Introdução (cont.)
No ficheiro base.dcl do AutoCAD existem definições e estruturas úteis que podem ser usadas (para usar, incluir @include "base.dcl" no ficheiro respectivo)
Na definição dos diálogos (ficheiros dcl): São usados { } em vez de ( )
Para definir propriedades usa-se o sinal =
As linhas de atributos terminam com ;
Comentários são indicados com // ou /* */
As definições são iniciadas com :
C i ã d diál
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
Criação de um diálogo: Sintaxe: nome : dialog { conteúdo }
4
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 3
Introdução (cont.)
Exemplo (ficheiro hello.dcl):hello : dialog { // é dado o nome "hello" à
// caixa de diálogo label = "Primeira Caixa de Diálogo"; // título a aparecer na caixa
: text { // início de zona de textolabel = "Hello, world"; // texto a aparecer
} // fim da zona de texto: button { // é criado um botão OK para terminar
key = "terminado"; // o valor da tecla
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
label = "OK"; // o nome da teclais_default = true; // declara que este é o botão por omissão
} // fim do botão "ok"}
5
Introdução (cont.)
Exemplo (ficheiro hello.lsp):
(Defun c:hello ()
(setq dcl_id (load_dialog "hello.dcl")) ; o file é carregado
(if (not (new_dialog "hello" dcl_id)) ; verifica se existe o ficheiro
(exit) ; se não existe saí
)
d l é d d
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
(start_dialog) ; é mostrada a caixa de dialogo
(unload_dialog dcl_id) ; retira a recém-criada caixa
)
6
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 4
Introdução (cont.)
Definição de um controlo (tile): nome : item1 [ : item2 : item3 …]
{ atributo = valor ; … }
Referência a um controlo predefinido: : nome {
atributo = valor ;…
}
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução7
Introdução (cont.)
Exemplo (ficheiro hello1.dcl):
hello : dialog { // é dado o nome "hello" à
// caixa de diálogo
label = "Primeira Caixa de Diálogo"; // título a aparecer na caixa
: text { // início de zona de texto
label = "Hello, world"; // texto a aparecer
} // fim da zona de texto
ok_only; // botão "ok" predefinido
}
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução8
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 5
Introdução (cont.)
Exemplo (ok_cancel.dcl)
ex_cancel : dialog { // é dado o nome "ex_cancel" à
// i d diál // caixa de diálogo
label = "Exemplo Ok_Cancel"; // título a aparecer na caixa
spacer_0; // espaçamento
ok_cancel; // botões "ok" e "cancel"// predefinidos
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução9
}
Introdução (cont.)
Exemplo (ficheiro hello1.lsp):
(Defun c:hello ()
(setq dcl_id (load_dialog "hello1.dcl")) ; o ficheiro é carregado
(if (not (new_dialog "hello" dcl_id)) ; verifica se existe o ficheiro
(exit) ; se não existe saí
)
(start_dialog) ; é mostrada a caixa de diálogo
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
(unload_dialog dcl_id) ; retira a recém-criada caixa
)
10
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 6
Controlos Predefinidos Exit Buttons e Error Tiles
ok_only ok_cancel ok cancel help
Decorative e Informative Tiles image
text ok_cancel_help ok_cancel_help_errtile ok_cancel_help_info errtile
Predefined Active Tiles button edit_box list_box
spacer
spacer_0
spacer_1
Text Clusters ncatenation
paragraph
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução11
popup_list radio_button toggle slider image_button
text_part
Controlos Predefinidos (cont.)
Tile Clusters boxed_column
boxed_radio_column
boxed_radio_row
boxed_row
column
dialog
radio_column
radio_row
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução12
row
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 7
Atributos de Controlos Globais
alignment fixed_height
fi d id h fixed_width height width
Aplicam-se a: All Tiles
Action Tiles action is_enabled
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução13
is_tab_stop key mnemonic Aplicam-se a: button; edit_box; image_button; list_box; popup_list;
radio_button; slider; toggle; radio_column; radio_row
Atributos de Controlos (cont.)
Tile Clusters children_alignment children_fixed_height _ _ g children_fixed_width
Aplicam-se a: row; column; radio_row; radio_column; boxed_row; boxed_column; boxed_radio_row; boxed_radio_column
Specific Tiles allow_accept Aplicam-se a: edit_box; image_button; list_box
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução14
aspect_ration Aplicam-se a: image; image_button
big_increment Aplicam-se a: slider
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 8
Atributos de Controlos (cont.)
Specific Tiles (cont.) color Aplicam-se a: image; image_button
edit_limit Aplicam-se a: edit_box
edit_width Aplicam-se a: edit_box; popup_list
fixed_width_font Aplicam-se a: edit_box; popup_list
initial focus
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução15
initial_focus Aplicam-se a: dialog
is_cancel Aplicam-se a: button
Atributos de Controlos (cont.)
Specific Tiles (cont.) is_default Aplicam-se a: button
label Aplicam-se a: boxed_row; boxed_column; boxed_radio_row;
boxed_radio_column; button; dialog; edit_box; list_box; popup_list; radio_button; text; toggle
layout Aplicam-se a: slider
list A li li t b li t
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução16
Aplicam-se a: list_box; popup_list
max_value Aplicam-se a: slider
min_value Aplicam-se a: slider
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 9
Atributos de Controlos (cont.)
Specific Tiles (cont.) multiple_select Aplicam-se a: list_box
password_char Aplicam-se a: edit_box
small_increment Aplicam-se a: slider
tabs Aplicam-se a: list_box; popup_list
tab truncate
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução17
tab_truncate Aplicam-se a: list_box; popup_list
value Aplicam-se a: text; todos active tiles (excepto buttons e image_buttons)
(load_dialog ficheiro.dcl) ; carrega file (new_dialog nome dcl_id acção ecrã) ; carrega diálogo (start_dialog) ; mostra diálogo
Funções AutoLISP para diálogos DCL
( _ g) ; g (done_dialog saida) ; fecha diálogo e retorna saída (term_dialog) ; fecha todos diálogos abertos (unload_dialog dcl_id) ; descarrega diálogo (action_tile key expressão) ; estabelece acção para tile key (get_attr key atributo) ; obter valor do tile key (string) ( t til k ) bt l d til k ( t i )
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução18
(get_tile key) ; obter valor do tile key (string) (set_tile key valor) ; atribuir valor para o tile key (string) (mode_tile key modo) ; define modo (0 - activa, 1 - desactiva, 2 -
destaca, 3 - selecciona conteúdo, 4 - muda destaque de uma imagem)
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 10
(start_list key operação indice) ; inicia lista
(add_list string) ; adiciona string numa lista
( d li t) t i li t
Funções AutoLISP para diálogos DCL (cont.)
(end_list) ; termina lista
(start_image key) ; inicia criação de imagem
(dimx_tile key) ; dimensão de imagem em x
(dimy_tile key) ; dimensão de imagem em y
(vector_image xini yini xfim yfim cor) ; desenha vector
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução19
(fill_image xini yini larg alt cor) ; desenha rectângulo
(slide_image xini yini larg alt nomeslide) ; inserir slide
(end_image) ; termina criação de imagem
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução20
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 11
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução21
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução22
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 12
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução23
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução24
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 13
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução25
Funções AutoLISP para diálogos DCL (cont.)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução26
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 14
Exemplo: file TEST_DCL1.DCL//DCL CODING STARTS HEREtest_dcl1: dialog{
label = "Test Dialog No 1";label Test Dialog No 1 ;: text // controlo de texto{label = "This is a Test Message";alignment = centered;}: button // definição de um botão{key = "accept"; // nome do botãolabel = "Close"; // etiqueta do botão
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
qis_default = true; // controlo por defeitofixed_width = true;alignment = centered; // alinhamento}
}//DCL CODING ENDS HERE
27
Exemplo: file TEST_DCL1.LSP; AUTOLISP CODING STARTS HERE
(prompt "\nType TEST_DCL1 to run.....") ; indicação no prompt do autocad após load do programa
(defun C:TEST_DCL1 ()
(setq dcl id (load dialog "test dcl1 dcl")) ; load do ficheiro de definição(setq dcl_id (load_dialog test_dcl1.dcl )) ; load do ficheiro de definição
(if (not (new_dialog "test_dcl1" dcl_id)) ; carregamento do diálogo em memoria
(exit)
) ; if
(action_tile "accept" "(done_dialog)") ; action_tile – quando carrega no botão, fecha o diálogo
(start_dialog) ; mostrar diálogo
(unload_dialog dcl_id) ; descarregar o diálogo da memoria
(princ)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução
(princ)
) ; defun
(princ)
; AUTOLISP CODING ENDS HERE
28
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 15
Exemplo: Notas
Cada linha de atributo no ficheiro de definição do diálogo termina com ;
Comentários indicados com // Comentários indicados com //
Sensível a maiúsculas e a minúsculas
Sequência de utilização: Load do ficheiro do diálogo Load da definição do diálogo Executar instrução(ões) action tile
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução29
ç ( ) _
Iniciar o diálogo Descarregar o diálogo da memória
Exemplo: file TEST_DCL2.DCL//DCL CODING STARTS HEREtest_dcl2: dialog{
alignment = centered;edit_limit = 3; // input max. 3 charsedit_width = 3; // largura max. 3 charsvalue = ""; // valor inicial
label = "Test Dialog No 2";: edit_box{label = "Enter Your Name :";mnemonic = "N"; // char sublinhadokey = "name";alignment = centered;edit_limit = 30; // max. 30 charsedit width = 30; // larg max 30 chars
}: button{key = "accept";label = "OK";is_default = true;fixed_width = true;alignment = centered;}
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução30
edit_width = 30; // larg. max. 30 chars}: edit_box{label = "Enter Your Age :";mnemonic = "A";key = "age";
}: errtile // para mensagem de erro{width = 34;}
}//DCL CODING ENDS HERE
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 16
Exemplo: file TEST_DCL2.LSP; AUTOLISP CODING STARTS HERE
(prompt "\nType TEST_DCL2 to run.....")(defun C:TEST_DCL2 (/ dcl_id)(setq dcl_id (load_dialog "test_dcl2.dcl"))q g(if (not (new_dialog "test_dcl2" dcl_id))(exit)
) ; if(set_tile "name" "Enter Name Here") ; define conteúdo em run-time(mode_tile "name" 2) ; permite override(action_tile "name" "(setq name $value)") ; após selecção atribui valor à variável name(action_tile "age" "(setq age $value)") ; após selecção atribui valor à variável age(action_tile "accept" "(val1)") ; após selecção chama subprograma( d l ) d ál
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução31
(start_dialog) ; mostra diálogo(unload_dialog dcl_id)(alert (strcat "Your name is " name ; message box
"\nand you are " age" years of age.")
)
Exemplo: file TEST_DCL2.LSP (cont.)(princ)
) ; defun;-----------------------(defun val1 ()(if (= (get_tile "name") "Enter Name Here") ; receber valor no controlo(progn(set_tile "error" "You must enter a name!") ; por valor no controlo(mode_tile "name" 2)
) ; progn(val2) ; chama subprograma
) ; if) ; defun
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução32
;-------------------(defun val2 ()(if (< (atoi (get_tile "age")) 1) ; receber valor no controlo(progn(set_tile "error" "Invalid Age - Please Try Again!!") ; por valor no controlo(mode_tile "age" 2)
)
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 17
Exemplo: file TEST_DCL2.LSP (cont.); progn
(done_dialog) ; fecha diálogo) ; if
) ; defun(princ)
;AUTOLISP CODING ENDS HERE
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução33
Exemplo: file TEST_DCL3.DCLafra : dialog {
label = "A" ;: column {: row {
}}: row {: button {
: button {label = "OK";key = "accept";mnemonic = "O";alignment = centered;width = 12;is_default = true; // tem de existir um
// default}
label = "Save";key = "save";mnemonic = "S";alignment = centered;width = 12;}: button {label = "Load";key = "load";
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução34
}: button {label = "Cancel";key = "cancel";mnemonic = "C";alignment = centered;width = 12;
key = load ;mnemonic = "L";alignment = centered;width = 12;}}
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 18
Exemplo: file TEST_DCL3.DCL (cont.): row {: button {label = "Help...";key = "help";mnemonic = "H";alignment = centered;width = 12;}: button {label = "About...";key = "About";mnemonic = "H";alignment = centered;
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução35
alignment = centered;width = 12;}}}
}
Exemplo: file TEST_DCL3.LSP; AUTOLISP CODING STARTS HERE
(prompt "\nType TEST_DCL3 to run.....")(defun C:TEST_DCL3 (/ dcl_id)(setqqdcl_id (load_dialog
" TEST_DCL3.DCL")
)(if (not (new_dialog "afra" dcl_id))(exit)
) ; if(start_dialog) ; sai do diálogo quando seleccionar o botão OK( l d d l d l d)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução36
(unload_dialog dcl_id)(princ)
) ; defun
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 19
Exemplo: file TEST_DCL4.DCLsamp : dialog { //dialog name
label = "Structural Holes" ; //give it a label: row { //define row: boxed_radio_column { //define radio column{label = "Type" ; //give it a label: radio_button { //define radion buttonkey = "rb1" ; //give it a namelabel = "Bolt Holes &Site" ; //give it a labelvalue = "1" ; //switch it on} //end definition: radio_button { //define radio buttonkey = "rb2" ; //give it a namel b l "B l H l Sh " // l b l
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução37
label = "Bolt Holes Sho&p" ; //give it a label} //end definition: radio_button { //define radio buttonkey = "rb3" ; //give it a namelabel = "Bolt Holes &Hidden" ; //give it a label} //end definition
Exemplo: file TEST_DCL4.DCL (cont.): radio_button { //define radio buttonkey = "rb4" ; //give it a namelabel = "Bolt Holes &Ctsnk" ; //give it a label} //end definition}: radio_button { //define radio buttonkey = "rb5" ; //give it a namelabel = "Bolt Holes &Elevation" ; //give it a label} //end definition: radio_button { //define radion buttonkey = "rb6" ; //give it a namelabel = "Bolt Holes &Slotted" ; //give it a label} //end definition} // d d l
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução38
} //end radio column: boxed_column { //define boxed columnlabel = "&Size"; //give it a label: popup_list { //define popup listkey = "selections"; //give it a namevalue = "5”; //initial value
}
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 20
Exemplo: file TEST_DCL4.DCL (cont.)} //end boxed column} //end row: edit_box { //define edit boxkey = "eb1" ; //give it a namey glabel = "Slot &Length (O/All Slot)" ; //give it a labeledit_width = 6 ; //6 characters only} //end edit box: slider { //defin sliderkey = "myslider" ; //give it a namemax_value = 100; //upper valuemin_value = 0; //lower valuevalue = "50"; //initial value} // d l d
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução39
} //end slider: boxed_row { //*define boxed row: toggle { //*define togglekey = "tog1"; //*give it a namelabel = "Ortho On/Off"; //*give it a label}
Exemplo: file TEST_DCL4.DCL (cont.): toggle { //*define togglekey = "tog2"; //*give it a namelabel = "Snap On/Off"; //*give it a label} //*end definition}} //*end boxed rowok_cancel ; //predifined OK/Cancel: row { //define row: image { //define image tilekey = "im" ; //give it a nameheight = 1.0 ; //and a heightwidth = 1.0 ; //and now a width} //end image h { //d f h
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução40
: paragraph { //define paragraph: text_part { //define textlabel = "Designed and Created"; //give it some text} //end text: text_part { //define more textlabel = "by Kenny Ramage"; //some more text} //end text
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 21
Exemplo: file TEST_DCL4.DCL (cont.)} //end paragraph} //end row} //end dialog
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução41
Exemplo: file TEST_DCL4.LSP(defun C:samp () ; define function(setq lngth 50.0) ; preset slot length(setq hole "site") ; preset hole type(setq siz "M20") ; preset hole sizeq p(setq NAMES '("M6" "M8" "M10" "M12" "M16" "M20" "M24" "M30“) ; define list)(setq ; setqdcl_id (load_dialog
" TEST_DCL4.DCL")
) ; load dialog(if (not (new_dialog "samp" dcl_id) ; test for dialog
)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução42
) ; not(exit) ; exit if no dialog
) ; if(setq w (dimx_tile "im") ; get image tile width
h (dimy_tile "im") ; get image tile height) ; setq
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 22
Exemplo: file TEST_DCL4.LSP (cont.)(start_image "im") ; start the image(fill_image 0 0 w h 5) ; fill it with blue(end_image) ; end image(start_list "selections") ; start the list box(mapcar 'add_list NAMES) ; fill the list box(end_list) ; end list(set_tile "eb1" "50") ; put dat into edit box(mode_tile "eb1" 1) ; disable edit box(mode_tile "myslider" 1) ; disable slider(setq orth (itoa (getvar "orthomode"))) ; *get orthomode value(set_tile "tog1" orth) ; *switch toggle on or off(setq sna (itoa (getvar "snapmode"))) ; *get snap value( l " 2" ) * h l ff
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução43
(set_tile "tog2" sna) ; *switch toggle on or off(action_tile"myslider" ; if user moves slider"(slider_action $value $reason)"
) ; pass arguments to slider_action
Exemplo: file TEST_DCL4.LSP (cont.)(action_tile"eb1" ; is user enters slot length"(ebox_action $value $reason)"
) ; pass arguments to ebox_actionp g(defun slider_action (val why) ; define function(if (or (= why 2) (= why 1)) ; check values(set_tile "eb1" val)
)) ; update edit box(defun ebox_action (val why) ; define function(if (or (= why 2) (= why 1)) ; check values(set_tile "myslider" val)
)
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução44
)) ; update slider(action_tile "tog1" "(setq orth $value)") ; *get ortho toggle value(action_tile "tog2" "(setq sna $value)") ; *get snap toggle value(action_tile "rb1" "(setq hole \"site\")") ; store hole type(action_tile "rb2" "(setq hole \"shop\")") ; store hole type
DCL - Dialog Control Language: Introdução 2009@FEUP/DEMec-SDI
João Manuel R. S. Tavares 23
Exemplo: file TEST_DCL4.LSP (cont.)(action_tile "rb3" "(setq hole \"hid\")") ; store hole type(action_tile "rb4" "(setq hole \"ctsk\")") ; store hole type(action_tile "rb5" "(setq hole \"elev\")") ; store hole type(action_tile"rb6""(setq hole \"slot\") ; store hole type
(mode_tile \"eb1\" 0) ; enable edit box(mode_tile \"myslider\" 0) ; enable slider(mode_tile \"eb1\" 2)"
) ; switch focus to edit box(action_tile"cancel" ; if cancel button pressed"(d d l ) ( l k l)" l d l fl
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução45
"(done_dialog) (setq userclick nil)" ; close dialog, set flag) ; action_tile(action_tile"accept" ; if O.K. pressed(strcat ; string 'em together"(progn
Exemplo: file TEST_DCL4.LSP (cont.)(setq SIZ (atof (get_tile \"selections\")))" ; get list selection"(setq lngth (atof (get_tile \"eb1\")))" ; get slot length"(setvar \"orthomode\" (atoi orth))" ; *ortho on/off"(setvar \"snapmode\" (atoi sna))" ; *snap on/offp p" (done_dialog)(setq userclick T))" ; close dialog, set flag
) ; strcat) ; action tile(start_dialog) ; start dialog(unload_dialog dcl_id) ; unload(if userclick ; check O.K. was selected(progn(setq SIZ (fix SIZ)) ; convert to integer( SIZ ( h SIZ NAMES)) h
2009@João TavaresCFAC: DCL - Dialog Control Language: Introdução46
(setq SIZ (nth SIZ NAMES)) ; get the size) ; progn
) ; if userclick(princ)
) ; defun C:samp(princ)
Recommended