明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2052|回复: 5

[求助]对话框控件置灰

[复制链接]
发表于 2004-12-23 15:51:00 | 显示全部楼层 |阅读模式
一个对话框里有两个单选按钮a,b和一个普通按钮c,如何编写lisp实现按下a时,按钮c被置灰,按下b时,按钮c可以使用.我想应该是用(mode_tile " " 1)来做吧?可我试了n次都不行,对话框一闪而过,请哪位高手教教我应该如何实现这个动作,谢谢!
发表于 2004-12-23 16:57:00 | 显示全部楼层
试一下: (action_tile "a" "(SETQ A (ATOI $value))(SET_TILE \"b\" \"0\")(togscr)")
(action_tile "b" "(SETQ B (ATOI $value))(SET_TILE \"a\" \"0\")(togscr)") (defun togscr ()
(if (= A 1) (mode_tile "c" 1))
(if (= B 1) (mode_tile "c" 0))
)
 楼主| 发表于 2004-12-23 17:35:00 | 显示全部楼层
还是不行呀,大侠再看看好吗?拜托,拜托!
发表于 2004-12-23 21:06:00 | 显示全部楼层
程序内容如下: (DEFUN c:test (/ dcl_filename dcl_index dcl_name)
(SETQ dcl_filename "dialog_test.dcl"
dcl_name "test"
)
(IF (<= (SETQ dcl_index (LOAD_DIALOG dcl_filename)) 0)
(*error* (STRCAT "不能装入对话框文件“" dcl_filename "”。"))
)
(IF (NOT (NEW_DIALOG dcl_name dcl_index))
(PROGN
(UNLOAD_DIALOG dcl_index)
(*error* (STRCAT "在对话框文件“" dcl_filename "”中不能开始对话框“" dcl_name "”。"))
)
)
(ACTION_TILE "test" "(mode_tile \"c\"(if (= \"a\" $value) 1 0))")
(IF (> (START_DIALOG) 0)
(PRINC) ;作相应的处理
)
(UNLOAD_DIALOG dcl_index)
(PRINC)
) 对话框内容如下: test:dialog{
label = "Test";
: radio_row {
key = "test";
: radio_button {
key = "a";
label = "&A";
}
: radio_button {
key = "b";
label = "&B";
}
}
: edit_box {
key = "c";
label = "&C";
width = 10;
}
ok_cancel;
}
发表于 2004-12-24 09:56:00 | 显示全部楼层
程序:
  1. (DEFUN C:TEST ()
  2.   (IF (> (SETQ DCL_ID (LOAD_DIALOG "TEST")) 0)
  3.    (IF (NEW_DIALOG "test" DCL_ID "") (PROGN
  4.      (action_tile "test" "(SETQ TS $value) (togscr)")
  5.      (action_tile "accept"   "(DONE_DIALOG 1)")
  6.      (action_tile "cancel" "(DONE_DIALOG 0)")
  7.      (SETQ RE (START_DIALOG))
  8.    ) (PROGN
  9.      (ALERT "Unable to display dialog box!\n无法显示对话框!")
  10.      (UNLOAD_DIALOG DCL_ID)
  11.    ))
  12.    (ALERT "Unable to load dialog box!\n无法装载对话框!")
  13.   )
  14. )(defun togscr ()
  15.   (if (= ts "a") (mode_tile "c" 1) (mode_tile "c" 0))
  16. )
对话框
  1. dcl_settings : default_dcl_settings { audit_level = 3; }
  2. test : dialog {
  3.      : radio_row {
  4.            value = "b" ;
  5.            key = "test" ;
  6.            : radio_button {
  7.                  key = "a" ;
  8.                  label = "a" ;
  9.            }
  10.            : radio_button {
  11.                  key = "b" ;
  12.                  label = "b" ;
  13.            }
  14.      }
  15.      : button {
  16.            key = "c" ;
  17.            label = "c" ;
  18.      }
  19.        ok_cancel ;
  20. }
 楼主| 发表于 2004-12-24 15:52:00 | 显示全部楼层
谢谢ZZXXQQ和lockmyeye的回答,问题已解决是用ZZXXQQ的方法做的,不过lockmyeye方法也可以,在此给二位大侠送上一朵鲜花,以表谢意.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-9-30 00:33 , Processed in 0.143420 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表