Property: OnCursorChanged for Events

DIAdem 2018 Help


Edition Date: June 2018
Part Number: 370858P-01
View Product Info

DOWNLOAD (Windows Only)


DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help
DIAdem 2020 Help
DIAdem 2020 SP1 Help

Specifies the name of the user command that DIAdem executes when the cursor changes in DIAdem VIEW. This event occurs if you move the cursor, if you change the measurement mode or the cursor type, or if you change the active area.

The user command receives a parameter: This parameter contains the current Cursor object when the user command is called. If the script of the user command contains an error, DIAdem aborts the script without an error message. The DIAdem logfile contains information on the error.

DIAdem VIEW saves this property with the layout.

Object.OnCursorChanged
ObjectEvents
Object with this property
Object.OnCursorChangedString with read and write access
Note  To test the example script, you must first save the second script and register it as a user command in the dialog box that opens when you select Settings»Extensions»User Commands.

The following example executes the user command DisplayCursor when the cursor moves. The user command displays the current cursor settings in a text box:

Call AddUserCommandToEvent("View.Events.OnCursorChanged","DisplayCursor")

Sub DisplayCursor(oCursor)
  Dim Text
  Text = Text & "Mode : " & oCursor.Mode & vbCrLf
  Text = Text & "Type : " & oCursor.Type & vbCrLf
  Text = Text & "X1   : " & oCursor.X1 & vbCrLf
  Text = Text & "Y1   : " & oCursor.Y1 & vbCrLf
  Text = Text & "X2   : " & oCursor.X2 & vbCrLf
  Text = Text & "Y2   : " & oCursor.Y2 & vbCrLf
  Text = Text & "dX   : " & oCursor.dX & vbCrLf
  Text = Text & "dY   : " & oCursor.dY & vbCrLf
  Text = Text & "P1   : " & oCursor.P1 & vbCrLf
  Text = Text & "P2   : " & oCursor.P2 & vbCrLf
  oCursor.Sheet.Areas(2).DisplayObj.Text = Text
End Sub

Note Use the AddUserCommandToEvent command to assign several user commands to one event. Use the RemoveUserCommandFromEvent command to delete a single user command from a list of user commands which you assigned to an event. Assign an empty string to an event so that the event is no longer assigned to a user command.

WAS THIS ARTICLE HELPFUL?

Not Helpful