找回密码
 注册
关于网站域名变更的通知

在关闭form时,触发事件?

查看数: 545 | 评论数: 5 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2022-2-22 09:40

正文摘要:

用什么函数可以在在关闭form时,触发事件? 试过下面这个不行 axlCmdRegister("pis" 'Part_Place_Inside ?cmdType "interactive" ?doneCmd 'pisDone ?cancelCmd 'piscancel) 复制代码 ...

回复

db-_- 发表于 2022-2-22 12:21
本帖最后由 db-_- 于 2022-2-22 12:26 编辑

应该可以捕获事件,但我觉得没必要,我一般都在这里处理。
Notes:
The doneState shows 0 for most actions. If a button with Done or Ok is pushed, then the done state is set. A button with the Cancel label sets the cancel state. In either the Done or Cancel state, you need to close the form with axlFormClose. If the abort state is set, the form closes even if you do not issue an axlFormClose.

以下代码摘自x:\Cadence_SPB_17.2-2016\share\pcb\examples\skill\form\basic目录下的axlform.il
  1. (defun _afCallback (fw)
  2.      (prog (t1 item field cnt)
  3.         
  4.         ; support for active help (like in enved cmd) - must enable capability by
  5.         ; calling axlFormSetMouseActive after form is opened
  6.         when(fw->mouseActive
  7.                 axlFormSetField(fw "active_help" sprintf(nil "Help for %s" fw->curField))
  8.             return(t)
  9.         )
  10.         (printf "field/value %L = %L (int %L\n)"
  11.                 fw->curField fw->curValue, fw->curValueInt )
  12.         (printf "doneState %L\n" fw->doneState )

  13.         case(fw->curField
  14.                 ("tab"
  15.                         f1s_lastTab = fw->curValue)
  16.         )
  17.                
  18.        if((nequal fw->doneState 0)  then
  19.             axlFormClose(fw)
  20.                 ;;;;在这里添加
  21.                
  22.         )
  23.         return()
  24. ))
复制代码

点评

可以,感谢!  详情 回复 发表于 2022-2-24 09:02
hifirockz 发表于 2022-3-30 20:10
thanks for info!
digitzing 发表于 2022-3-22 14:34
zs_king 发表于 2022-3-4 12:53
和其他控件的判断一样,curfield  在关闭按钮点下的时候 ,返回的是 双引号引起来的一个空字符

是的,今天无意发现,case增加一个 (“”        这里添加关闭代码 ) 就行了 ,很简单
digitzing 发表于 2022-2-24 09:02
db-_- 发表于 2022-2-22 12:21
应该可以捕获事件,但我觉得没必要,我一般都在这里处理。
Notes:
The doneState shows 0 for most actio ...

可以,感谢!
serenade 发表于 2022-2-22 11:20
我在VS2005 中向 _closed()事件添加了事件响应函数,调用了Application.exit()可是,在模拟器上关闭程序时(点击右上角的×之后),通过调试,发现并没有调用 _closed()。
关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-11-22 05:52 , Processed in 0.218750 second(s), 31 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

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