DIAdem Help

Object: ToolTipArrowContext

  • Updated2024-09-12
  • 2 minute(s) read

Object: ToolTipArrowContext

The ToolTipArrowContext object provides information about an arrow in DIAdem REPORT when DIAdem calls the event assigned to the OnArrow for ToolTipEvents property. DIAdem calls this event if you press the shift key and move the mouse over a REPORT object.

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 creates an arrow and assigns the user command MyToolTipEvent to the OnArrow for ToolTipEvents property:

Dim oMyArrow, oMyArrowPosition
Call Report.NewLayout()
Set oMyArrow = Report.ActiveSheet.Objects.Add(eReportObjectArrow,"MyArrow")
oMyArrow.ArrowHeadAtBegin = eArrowHeadPoint
oMyArrow.ArrowHeadAtEnd = eArrowHeadStandardArrow
Set oMyArrowPosition = oMyArrow.Position.ByCoordinate
oMyArrowPosition.X1 = 10
oMyArrowPosition.X2 = 40
oMyArrowPosition.Y1 = 30
oMyArrowPosition.Y2 = 90

'This event will be raised if the mouse is moved AND the shift key pressed 
Report.Events.ToolTip.OnArrow = "MyToolTipEvent"
Call Report.Refresh()

If you press the shift key and move the mouse over the arrow, the example displays the mouse position and the name and the type of the subobject over which you idle the mouse. The user command receives two parameters. The first parameter corresponds with the ToolTipArrowContext object and provides the information about the arrow in DIAdem REPORT when you press the shift key and move the mouse over the arrow. The second parameter is a text and corresponds with the tooltip for display:

Sub MyToolTipEvent(Context,ToolTipText)
  Dim oSubObject
  Set oSubObject = Context.SubObject
  ToolTipText = "Sheet: " & Context.Sheet.Name & VBCrLf & "Sub object" & VBCrLf & "Name: " &  oSubObject.Name & VBCrLf & "Type: " & GetConstNameForREPORTSubObj(oSubObject, oSubObject.Type)
  ToolTipText = ToolTipText & VBCrLf & "X position: " & Context.Position.X & VBCrLf & "Y position: " & Context.Position.Y 
End Sub

Properties

Arrow | Position | Sheet | SubObject