IDMApplicationEvents Interface

Version: 2.0
Events interface for DMApplication Object

GUID: {673A9FC3-9A0B-11D4-B2A4-FD6847C75367}

IDMApplicationEvents interface should be used to receive notifications from the DM2003 application object(s). DM2003 supports multiple event sinks; following objects may take part in the event processing:

Members:
Kind Name ID Description
OnCreateDocument 1 Fired when new DataForm created
OnCloseDocument 2 Fired when DataForm closed
OnCommand 3 Provide feedback from server to client
OnLoadFile 4 Fired when disk file have been loaded into container
OnQuit 5 Fired from MainForm.OnClose
OnPlotClick 6 Plot point area clicked
OnPlotPointClick 7 Plot point clicked
OnPlotSelection 8 Plot selection changed

Syntax:
event OnCreateDocument(Document): HResult

Applies to:
DMApplication, DMInternalApplication

Syntax:
event OnCloseDocument(Document): HResult

Applies to:
DMApplication, DMInternalApplication

Syntax:
event OnCommand(Command): HResult

Applies to:
DMApplication, DMInternalApplication

OnCommand event handler fires when user invokes some action. The name of action passed in the Command parameter. This is the same name as used in IsCommandXXX properties and ExecuteCommand method. You can use this event to create "Macro recorder" applications or add something to the default action behavior. See also the list of standard action names.

Syntax:
event OnLoadFile(Document): HResult

Applies to:
DMApplication, DMInternalApplication

Syntax:
event OnQuit(SaveState): HResult

Applies to:
DMApplication, DMInternalApplication

OnQuit event has important feature: in the SaveState parameter it passes the state of "Save settings on exit" checkbox in the Application Properties Dialog.

Syntax:
event OnPlotClick(Document, X, Y): HResult

Applies to:
DMApplication, DMInternalApplication

Syntax:
event OnPlotPointClick(Document, Point, Serie, Result): HResult

Applies to:
DMApplication, DMInternalApplication

Use this event if you want to do something when user clicks plot point (that is, mouse coordinates are inside some point). Notice that you can change default behavior of plot eraser and editor modes if you return false in this handler as shown in the example below (in case of several event handlers, their results are logically multiplied: Result1 and Result2 and ...)

Example:

function Server_OnPlotPointClick(Doc, Point, Serie)
  Server_OnPlotPointClick=not ((Doc is TempWnd) and (Serie<>1))
end function

Syntax:
event OnPlotSelection(Document): HResult

Applies to:
DMApplication, DMInternalApplication