Private xDataType As Int ' Sets whether to display default inded: vale or date time
Public CurveXLookupDates(10000) As Long 'rjg stores millisecond ticks
'Draws the cursor values
If mDrawCursorValues = True Then
For i = 0 To lstTwoCursors.Size - 1
TC = lstTwoCursors.Get(i)
If TC.XIndex >= ScaleX.IBegin And TC.XIndex <= ScaleX.IEnd Then
x = Graph.Left + (TC.XIndex - ScaleX.IBegin) / (ScaleX.IEnd - ScaleX.IBegin) * Graph.Width
' Txt = " Index = " & TC.XIndex & " "
' rjg block mod start
Select xDataType
Case 0
Txt = " " & TC.XIndex & " : " & NumberFormat3(CurveX(TC.XIndex), 6) & " "
Case 1
Txt = " " & DateTime.Time(CurveXLookupDates(TC.XIndex)) & " "
Case 2
Txt = " " & DateTime.Date(CurveXLookupDates(TC.XIndex)) & "
Case 3
Txt = " " & DateTime.Date(CurveXLookupDates(TC.XIndex)) & " " & DateTime.Time(CurveXLookupDates(TC.XIndex)) & " "
Case Else
Txt = " " & TC.XIndex & " : " & NumberFormat3(CurveX(TC.XIndex), 6) & " "
End Select
' rjg block mod end
TxtWidth = MeasureTextWidth(Txt, Texts.ScaleFont)
For c = 0 To lstCurvesToDisplay.Size - 1
Txt = " " & NumberFormat3(CurveY(lstCurvesToDisplay.Get(c), TC.XIndex), 6) & " "
TxtWidth = Max(TxtWidth, MeasureTextWidth(Txt, Texts.ScaleFont))
Next
TxtWidth_2 = TxtWidth / 2
TxtHeight = Texts.ScaleTextHeight * (lstCurvesToDisplay.Size + 1) + 0.4 * Texts.ScaleTextHeight
TxtColor = xui.Color_White
' TxtColor = xui.Color_ARGB(200, 255, 255, 255)
xt = Min(x, Graph.Right - TxtWidth_2)
xt = Max(xt, Graph.Left + TxtWidth_2)
If i = 1 And Abs(xt - x1) < TxtWidth Then
yt = Graph.Top + 2 * xd + TxtHeight + 3dip
Else
yt = Graph.Top + 2 * xd
x1 = xt
End If
RectTxt.Initialize(xt - TxtWidth_2, yt, xt + TxtWidth_2, yt + TxtHeight)
xcvsTwoCursors.DrawRect(RectTxt, TxtColor, True, 1dip)
' Txt = " Index = " & TC.XIndex & " "
' rjg block mod start
Select xDataType
Case 0
Txt = " " & TC.XIndex & " : " & NumberFormat3(CurveX(TC.XIndex), 6) & " "
Case 1
Txt = " " & DateTime.Time(CurveXLookupDates(TC.XIndex)) & " "
Case 2
Txt = " " & DateTime.Date(CurveXLookupDates(TC.XIndex)) & "
Case 3
Txt = " " & DateTime.Date(CurveXLookupDates(TC.XIndex)) & " " & DateTime.Time(CurveXLookupDates(TC.XIndex)) & " "
Case Else
Txt = " " & TC.XIndex & " : " & NumberFormat3(CurveX(TC.XIndex), 6) & " "
End Select
' rjg block mod end
xcvsTwoCursors.DrawText(Txt, xt, yt + Texts.ScaleTextHeight, Texts.ScaleFont, TC.Color, "CENTER")
yt = yt + Texts.ScaleTextHeight
For nc = 0 To lstCurvesToDisplay.Size - 1
c = lstCurvesToDisplay.Get(nc)
If mUseCustomColors = False Then
col = CurveColor(nc)
Else
col = CurveCustomColor(c)
End If
If mGraphWithMissingData = True And CurveY(lstCurvesToDisplay.Get(nc), TC.XIndex) >= mMissingDataValue Then
Txt = "NaN"
Else
Txt = NumberFormat3(CurveY(lstCurvesToDisplay.Get(nc), TC.XIndex), 6)
End If
yt = yt + Texts.ScaleTextHeight
xcvsTwoCursors.DrawText(Txt, xt, yt, Texts.ScaleFont, col, "CENTER")
Next
End If
Next
End If
xcvsTwoCursors.Invalidate
End Sub