[讨论]关于自定义双击
在一个程序中,我定义了一个双击类.重载了 startEdit() 和 finishEdit() 函数. 但好像在程序结束后,要再运行一下任意一个命令才能结束这个双击. 请问是怎么回事?这是类定义#pragma once
#include "acdblclkedit.h"
#include "BclPro.h"
class BclClk :
public AcDbDoubleClickEdit
{
public:
BclClk(void);
virtual ~BclClk(void);
public:
virtual void startEdit(AcDbEntity *pEnt, AcGePoint3d pt);
virtual void finishEdit();
};
类的实现:#include "StdAfx.h"
#include "BclClk.h"
#include "FrmMain.h"
BclClk::BclClk(void)
{
}
BclClk::~BclClk(void)
{
}
void BclClk::startEdit(AcDbEntity *pEnt, AcGePoint3d pt)
{
acDocManager->lockDocument(curDoc());
if (pEnt->isKindOf(BclSub::desc()) == Adesk::kTrue)
{
BclSub *pEntity = BclSub::cast(pEnt);
if (pEntity->upgradeOpen() == Acad::eOk)
{
CAcModuleResourceOverride resoverrid;
FrmMain *pMainFrm = new FrmMain(CWnd::FromHandle(adsw_acadMainWnd()));
pMainFrm->setEntity(pEntity);
pMainFrm->startDialog(pMainFrm, true);
if (pMainFrm)
{
delete pMainFrm;
pMainFrm = NULL;
}
pEntity->recordGraphicsModified();
pEntity->close();
pEntity->recordGraphicsModified();
}
}
acDocManager->unlockDocument(curDoc());
acedUpdateDisplay();
finishEdit();
}
void BclClk::finishEdit()
{
acedSSSetFirst(NULL, NULL);
}
现在这样做了之后,必须得任意运行一个命令才能结束双击,看到实体的修改变化.请问我应该如何做才能让它自动结束这个双击?
页:
[1]