Events interface for DMApplication Object
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:
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.
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 ...)
function Server_OnPlotPointClick(Doc, Point, Serie)
Server_OnPlotPointClick=not ((Doc is TempWnd) and (Serie<>1))
Every group (except minibrowser) may contain arbitrary number of event handlers. These groups invoked in the abovementioned order, and if some group return false, subsequent groups are just not called! So if your out-of-process automation client does not define this event handler, Scroller and Point Editor tools will not work.
Inside first two groups, every attached handler is called (keep in mind that COM object may have several client references), and the results are logically summed (OR operator). This is because .Net clients are connected to the event sink for every event handler (delegate object), so the event called many times in the client and the most of calls return false (since there is no handler defined for this connection).
OnPlotGetPoint event allows you to display points whose coordinates calculated by your code. This is in contrast to usual mode, when plot point coordinates are stored in containers and possibly transformed by DM2003 application using axes and series expressions and embedded expression parser. To enable this feature for particular series, set IDMSerie3.EnableGetPointEvent property to True. Notice that unlike OnPlotPointClick event, for which Point parameter is a sequential index of the clicked point in the container (if any), for OnPlotGetPoint event Point is a zero-based index! To find appropriate data item for data-based series, you should calculate actual item index. Also note that X,Y parameters are initialized by point coordinates.
Server.CreateDocument Server.InstallPath & "samples\data_1.dat"
' Returns point coordinates
function Server_OnPlotGetPoint(Doc, Point, Serie, ByRef X, ByRef Y)
' enter your code here
if x<100 then y=0.5