无模式文档反应器?
通知调色板集合的子组件新文档已被激活的最佳方式是什么?**** Hidden Message ***** 这是我想到的...它工作
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]