Object: ToolTip2DTableContext

DIAdem 2018 Help


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

DOWNLOAD (Windows Only)


DIAdem 2012 Help
DIAdem 2014 Help
DIAdem 2015 Help
DIAdem 2017 Help
DIAdem 2018 Help
DIAdem 2019 Help

The ToolTip2DTableContext object provides information on a 2D table in DIAdem REPORT when DIAdem calls the event assigned to the OnTable2D 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 a 2D table and assigns the user command MyToolTipEvent to the OnTable2D for ToolTipEvents property:

Dim oMy2DTable, oMyPosition, oMyColumn
Call Report.NewLayout()
Set oMy2DTable = Report.ActiveSheet.Objects.Add(eReportObject2DTable,"My2DTable")
Set oMyPosition = oMy2DTable.Position.ByBorder
oMyPosition.Top = 30
oMyPosition.Bottom = 20
oMyPosition.Left = 20
oMyPosition.Right = 30
Set oMyColumn = oMy2DTable.Columns.Add(e2DTableColumnChannel)
oMyColumn.Channel.Reference = "[1]/[2]"
oMyColumn.Settings.Alignment = eTableAlignmentDecimalPoint
oMyColumn.Settings.Format = "d.dddd"

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

If you press the shift key and move the mouse over the 2D table, 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 ToolTip2DTableContext object and provides the information about the 2D table in DIAdem REPORT when you press the shift key and move the mouse over the 2D table. 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

Position | Sheet | SubObject | Table2D

WAS THIS ARTICLE HELPFUL?

Not Helpful