请问BeginEditorCommand()这个函数是干什么用的?
聚點交回AUTOCAD.
聚點交回AUTOCAD.我是个初学者,能不能讲详细点呢?谢谢了
回复:请问BeginEditorCommand()这个函数是干什么用的?
BeginEditorCommand -- 挂起对话框,等待用户输入CompleteEditorCommand -- 重新调出对话框
CancelEditorCommand -- 不显示对话框并且关闭
非常感谢
Answer
CAcUiDialog类是从CAdUiBaseDialog类派生的类,是一个提供了只能在AutoCAD中才能起作用的一系列对话框尺寸变化和数据记忆的成员函数的通用类。可以用来代替CDialog建立模态和非模式对话框。在该类中有几个成员函数
BeginEditorCommand() 表示交互式命令开始
CompleteEditorCommand() 表示交互式命令完成
CancelEditorCommand() 表示交互式命令取消
使用方法:
BeginEditorCommand();
ads_point pt;
if(acedGetPoint(NULL,"请拾取一个点",pt)==RTNORM)
{
CompleteEditorCommand();
}else
{
CancelEditorCommand();
}
为什么我用了,对话框不能隐藏!
void GRALIBMAIN::OnButtonInsert(){
// TODO: Add your control notification handler code here
BeginEditorCommand();//Òþ²Ø¶Ô»°¿òº¯Êý
ads_point basept;
InsertDlg Indlg;
// int nReturnValue = Indlg.DoModal();
if (acedGetPoint(NULL, "\nPick a point: ", basept) == RTNORM)
{
CompleteEditorCommand();
// m_strXPt.Format("%g", basept);
// m_strYPt.Format("%g", basept);
// m_strZPt.Format("%g", basept);
}
else
{
CancelEditorCommand();
}
}
确保你的类基于CAcUiDialog
?
对话框是基于CAcUiDialog类的压class InsertDlg : public CAcUiDialog
!
这个函数已经被我实践了千百遍(有点夸张),你再仔细检查一下,肯定是某些地方出问题了
页:
[1]
2