- UID
- 2299
- 积分
- 465
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-31
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
Double Click API.
====================
There is a new ObjectARX API exposed in AutoCAD 2000i for handling
double-click events on entities. The API is based on the new ARX
class AcDbDoubleClickEdit and will allow reactor handlers to receive
notification messages of double-click events on AutoCAD entities.
The default behavior in AutoCAD 2000i when an entity is
double-clicked is to invoke the appropriate entity-specific editor,
or (if there is no specific editor) the Object property Manager.
If multiple entities are selected, double-clicking an entity in
the selection will bring up the Object Property Manager.
It is possible to override the default behavior by trapping the
double-click notification for AcDbEntity-derived entities in
ObjectARX. The notification order will ascend the inheritance
tree from the selected entity type up through AcDbEntity, so the
double-click notification can be handled anywhere in between.
The API is implemented through Protocol Extensions. The client
would need to derive a class from AcDbDoubleClickEdit for each
entity type to be notified of a double-click event.
Example for a PLINE:
#include "AcDblClkEdit.h"
class AcDbDoubleClickEditPline : public AcDbDoubleClickEdit
{
public:
...
void startEdit(AcDbEntity *pEnt,AcGePoint3d pt);
void finishEdit(void);
};
The client would need to implement both startEdit() and finishEdit()
methods in order to receive notification messages. Note that these
are the only two messages available.
When the client is loaded, the AcDbDoubleClickEdit class needs to add
the protocol extension to the appropriate database object.
For example within InitApplication():
pPlineEdit = new AcDbDoubleClickEditPline;
AcDbPline::desc()->addX(AcDbDoubleClickEdit::desc(),pPlineEdit);
Similarly, when the client is unloaded, it should delete the protocol
extension from the appropriate database object:
AcDbPline::desc()->delX(AcDbDoubleClickEdit::desc());
The client also needs to link with AcDblClkEditPE.lib, and should verify
that the AcDblClkEditPE.arx file is loaded: (Also within InitApplication):
acrxDynamicLinker->loadModule(/*MSG0*/"ACDBLCLKEDITPE.ARX",Adesk::kFalse);
The sample 'DblClickSamp' is a MSVC project that demonstrates the use of the
double-click API feature. The sample works with 'PLINE', 'SPLINE' and
'CIRCLE' entities. When a user double-clicks a PLINE or SPLINE, a vertex
or fit-point will be added to the object at the cursor location, which can
then be edited using grips. When a CIRCLE is double-clicked, the color
index is changed. When any other entity is double-clicked, the appropriate
entity-specific editor is invoked, or (if none exists) Object Property Manager.
感兴趣的朋友可在 \Samples\DblClick 中找到例子 |
|