将 ActiveX 编辑控件添加到属性检查器
若要允许属性检查器承载自定义 ActiveX 编辑控件,请实现接口并将接口公开为连接点。该接口支持从属性检查器到控件的单向通信。属性检查器转发所选对象及其属性的指针。ActiveX 控件使用此信息来获取和设置对象的属性数据。该界面还提供用于管理控件显示的属性。IAcPiPropertyEditControlIAcPiPropertyEditEventsSinkIAcPiPropertyEditControlIDispatchIAcPiPropertyEditControl 控件通过传出接口将通信发送到其 Property Inspector 主机。此接口处理鼠标和键盘事件通知。这些事件是通过 COM 连接点机制触发的。IAcPiPropertyEditEventsSink 公开自定义控件的每个属性还必须实现接口及其方法。通过从模板类派生并声明每个属性显示映射,可以最轻松地完成此操作,如“属性检查器”中的“每个属性自定义”部分中所述。例如,如果已为控件分配了 PROG ID ,则可以使用以下宏调用:IAcPiPropertyDisplayGetCustomPropertyCtrl()IAcPiPropertyDisplayImplPROGID_MYCONTROL PROP_DISP_ENTRY(DISP_MYPROP, PROGID_MYCONTROL, NULL, NULL, NULL, NULL, 0x000000ff, FALSE, 0, 0) 请注意,DISP ID (DISP_MYPROP in the preceding example) must match the DISP ID passed to the OPMPROP_ENTRY macro call for the property that uses this control. This match establishes the custom control as the editor for this property. 父主题: |
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-3-14 06:08
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.