同UCanCode一起释放 Visual C++, C# 的巨大能量!
  

E-Form++企业版本产品信息


二十二、批处理命令

 E-Form++可视化图形组件库支持批处理命令操作,也就是您可以根据自己的需要任意将E-Form++可视化图形组件库画布上的对象的操作集中起来一次性完成,而在Undo/Redo的时候只需要一次就可以完成。

批处理命令的函数如下:

// Starting action.
void BegAction(const UINT &nActionType = 0,const BOOL &bUpdateAll = FALSE,
const BOOL &bRemoveAllSelection = TRUE,const BOOL &bEnablePrepare = FALSE);

// Starting action.
void BegAction(const CString& strComment,const UINT &nActionType = 0,const BOOL &bUpdateAll = FALSE,
const BOOL &bRemoveAllSelection = TRUE,const BOOL &bEnablePrepare = FALSE);

// Starting action.
void BegActionExt(const UINT& nIDComment,const UINT &nActionType = 0,const BOOL &bUpdateAll = FALSE,
const BOOL &bRemoveAllSelection = TRUE,const BOOL &bEnablePrepare = FALSE);

// Prepare and starting the group action
void BegActionExt(CFODirectActionMacro* pUndoGrp);

// Change action's comment
// strComment -- comment string of the action
void SetUndoComment(const CString& strComment);

// Change action's comment
// nIDComment -- string id for the action
void SetUndoComment(const UINT& nIDComment);

// Add action.
// pAction -- pointer of the action
virtual void AddAction(CFOAction *pAction);

// Add action.
// pAction -- pointer of the action
virtual void AddMacroAction(CFOActionMacro *pAction);

// Add action.
// pList -- list of the actions
virtual void AddMultiActions(CActionList *pList);

// End current macro action.
void EndAction();

调用示范如下:

先调用,BegAction,然后调用 AddAction增加您想要的命令到批处理命令中,最后调用EndAction来确认执行即可:

CFOGroupAction* xxx::DoMacroAction(CFODrawShapeList* pShapeList)
{
// Prepare actions.
BegActionExt(IDS_CMD_GROUP_SHAPE,(UINT)FOP_EXT_MOVESHAPES_BACK);

CFOAddCompAction *pChildAction = new CFOAddCompAction(GetCurrentModel(), pReturn);
pChildAction->SetCompShape(pCompNew);
AddAction(pChildAction);
pReturn->Release();
}
}

EndAction();

return NULL;
}

 

 

[ 主页 | 产品 | 新闻 | 下载 | 购买 | 技术支持 | 与我们联系 ]



地址:中国.成都高新区永丰路24号附1号 (邮编:610041)电话: +86-28-85354645 
Copyright ?998-2026 UCanCode Software, ? 版权所有。
其他的产品和公司名称或注册的商标属于其各公司版权所有。

任何问题或者建议请与我们联系:webmaster@ucancode.com