8382 发表于 2010-9-8 09:06:24

无模式文档反应器?

通知调色板集合的子组件新文档已被激活的最佳方式是什么?
**** Hidden Message *****

香甜云尼拿 发表于 2010-9-8 10:19:49

这是我想到的...它工作
class ExtDocReactor : public AcApDocManagerReactor
{
private:
CPaletteBlockChildDlg *mpDlg;
public:
ExtDocReactor (CPaletteBlockChildDlg *dlg):mpDlg(dlg){
    acDocManager->addReactor (this) ;
}
~ExtDocReactor () {
    if ( acDocManager != NULL )
      acDocManager->removeReactor (this);
}
virtual void documentActivated(AcApDocument* pActivatedDoc) {
    if(mpDlg)
      mpDlg->OnDocumentActivated(pActivatedDoc);
}
};

同时在 CPaletteBlockChildDlg 这个 mojo 正在工作
CPaletteBlockChildDlg::CPaletteBlockChildDlg (CWnd *pParent /*=NULL*/, HINSTANCE hInstance /*=NULL*/)
: CAcUiDialog (CPaletteBlockChildDlg::IDD, pParent, hInstance)
{
//{{AFX_DATA_INIT(CPaletteBlockChildDlg)
mExtDocReactor = new ExtDocReactor(this);
m_locale = _get_current_locale();
//}}AFX_DATA_INIT
}
页: [1]
查看完整版本: 无模式文档反应器?