DG Kernel (ActiveX) Documentation


Skip Navigation Links.
Start page
Quick Start
Search Page
Installation
What is new
Upgrading Native Apps
Licensing
Expand ModelsModels
Collapse DG Kernel ControlsDG Kernel Controls
Expand API ReferenceAPI Reference
Expand ViewsViews
Expand Samples and TutorialsSamples and Tutorials
Expand GraphicsGraphics
Expand Math ObjectsMath Objects
Expand DeprecatedDeprecated
Redistribution
Model Viewer
Open Source
Support
Skip Navigation LinksHome Page > DG Kernel Controls > Properies, Methods, Events > Events Go to DGKC docs Search Documentation


Events of DG Kernel Control

MouseDown
MouseMove
MouseUp
ClientDraw
CurrentObjectChanged
Extended Mouse Events
KernelCADEvent Event
DgkMiscEvent Event
 
See also: Properties, Methods
void OnMouseDownKernelCAD(short Button, short Shift, long x, long y)     

Parameters  

Button - [in] 1 if left button pressed, 2 - if right mouse button pressed. Shift - [in] equals to 1 if Shift key is down and 0 otherwise. x, y - [in] - window coordinates of the mouse pointer. 

Remarks

The name of the handler for the event can be selected during implementation. OnMouseDownKernelCAD method is called when the user clicks in the control display area.


void OnMouseMoveKernelCAD(short Button, short Shift, long x, long y)     

Parameters  

Button - [in] 1 if left button pressed, 2 - if right mouse button pressed. Shift - [in] equals to 1 if Shift key is down and 0 otherwise. x,y - [in] - window coordinates of the mouse pointer. 

Remarks

The name of the handler for the event can be selected during implementation. OnMouseMoveKernelCAD method is called when the user moves the mouse in the control display area.


void OnMouseUpKernelCAD(short Button, short Shift, long x, long y)     

Parameters  

Button - [in] 1 if left button pressed, 2 - if right mouse button pressed. Shift - [in] equals to 1 if Shift key is down and 0 otherwise. x,y - [in] - window coordinates of the mouse pointer. 

Remarks

The name of the handler for the event can be selected during implementation. OnMouseDownKernelCAD method is called when user releases a mouse button while the pointer is positioned over the control display.


void OnClientDraw()    

Remarks

ClientDraw event is raised per rendering frame when the controls view needs to be repainted and after the rest of the model has been drawn.

Starting from v6.0 using IDraw interface inside OnClientDraw() has been deprecated and should be avoided. It is recommended to construct the required object as an entity, perhaps transient one,  and control its properties outside of this event. IDraw_DG queried from IModel_DG is useful to move code out of the handler with minimal changes. Compare implementation of Metrics sample in v5.2 and v6.0 to see an example.

As client drawing involves some performance cost this event is not raised by default. To enable or disable it RequestClientDraw method has to be called.
void CurrentObjectChanged(VARIANT entity)   

Remarks

This event is raised in Modify mode when the user selects a different object as current. punkVal member of entity  is a reference to IEntity_DG interface (can be safely cast to IEntity_DG type) of the newly selected object.

The case when the passed reference is NULL, means that the user has clicked outside of any objects in the window.

There are two context properties which modify behaviour related to this event. See more at Selection via the current object


void MouseEx(long eventType, long xMouse, long yMouse, long data)   

Parameters  

eventType [in] - Type of the event 

xMouse, yMouse [in] - window coordinates of the mouse pointer. The coordinates are relative to the top left corner of the window of the control. 

data[in] -Currently unused. Reserved for different types of events to be added in future releases

Remarks

The MouseEx event is used for detection of mouse behaviour slightly more complex than standard Mouse Up/Down/Move events. The actual type of event is described by the eventType parameter. Valid values of  eventType are enumerated by EDIEvent. In this release only eEventMouseHover, eEventMouseRButtonDown, eEventMouseRButtonMove and eEventMouseRButtonUp are passed through via this event. Consider disabling the conext menu for the right hand mouse button actions

The MouseHover event type occurs when the mouse pointer has stopped in a small area for about half a second after some movement. This is similar to behaviour detected for displaying tool tips in Windows User Interface.

To receive notifications about any of the MouseEx events, it has to be enabled with a call to RequestEvent with the same eventType value.


void KernelCADEvent( long eventType, const VARIANT& param0, VARIANT* param1 ) 

Parameters

eventType [in] - Type of the event. Valid values are enumerated in EDIEvent

param0 [in] - Parameter of the event. Meaning depends on eventType and is documented in each particular case

param1 [in,out] - Parameter of the event. Meaning depends on eventType and is documented in each particular case

Remarks

Meaning of param0 and param1 depends on the eventType. Most often the KernelCADEvent event is used to notify the application that the user selected a context menu item. eventType in this case coincides with EDIEvent.eEventUICommand. See more details in Context Menu topic


void DgkMiscEvent(long eventType, const VARIANT* param0, VARIANT* param1 ) 

Parameters

eventType [in] - Type of the event. Valid values are enumerated in EDIEvent

param0 [in] - Parameter of the event. Meaning depends on eventType and is documented in each particular case

param1 [in,out] - Parameter of the event. Meaning depends on eventType and is documented in each particular case

Remarks

DgkMiscEvent is designed as an alternative to KernelCADEvent, which differs only by its signature. The reason for its existence is that Delphi IDE and possibly some othe development environments do not interpret correctly the param0 passed by reference. In this case it is recommended to disable KernelCADEvent and request DgkMiscEvent instead like: m_dgk.RequestEvent(eEventKernelCAD, false); m_dgk.RequestEvent(eEventDgkMisc, true);

Meaning of param0 and param1 depends on the eventType. Most often the KernelCADEvent event is used to notify the application that the user selected a context menu item. eventType in this case coincides with EDIEvent.eEventUICommand. See more details in Context Menu topic