- UID
- 10108
- 积分
- 5956
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-9-17
- 最后登录
- 1970-1-1
|
发表于 2017-2-6 17:14:11
|
显示全部楼层
本帖最后由 st788796 于 2017-2-6 17:18 编辑
OpenDCL Help
Furthermore, since the dialog may already be active when startup code executes (after opening a second drawing file, for example), it must act accordingly. For example, if the application must read some initialization settings from the registry, it likely needs to do that only when the modeless dialog is initially activated. If such initialization is performed in the dialog's OnInitialize event, it will only get executed once when the dialog is first activated. If the application needs to determine at runtime whether the dialog is already active it can use an expression like the following:
(and MyProject-MyForm (dcl-Form-IsActive MyProject-MyForm))
In addition to programming startup code to act appropriately when more than one drawing is opened, modeless dialogs must also behave correctly when all open drawings are closed (resulting in a state referred to as a "no doc state") or when the user switches between multiple active drawings. If the modeless dialog contains controls whose settings or properties depend on the drawing contents, then it must define event handlers for the OnDocActivated and OnEnteringNoDocState events to update the controls as the document state changes.
非模态对话框除了判断 Form 存在和显示,还应该考虑 文档切换(OnDocActived)以及全部文档关闭后(OnEnteringNoDocState)
|
|