Double Click on point series

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
dev
Newbie
Newbie
Posts: 2
Joined: Mon Jan 30, 2006 12:00 am

Double Click on point series

Post by dev » Fri Jan 12, 2007 8:52 am

Good morning,

Since we upgraded from a previous version of TeeChart to the new release, some of our code is not working anymore.

Indeed, we created some events in our code that allow to show an annotation when the user clicks on a point.

Here is the used code we use to handle the event:

Code: Select all


        Dim pt As Steema.TeeChart.Styles.Points

        pt = New Steema.TeeChart.Styles.Points(TChartScatter.Chart)

        pt.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.None
        pt.YValues.Order = Steema.TeeChart.Styles.ValueListOrder.None

        AddHandler pt.DblClick, AddressOf pt_DblClick
Here is the sub that handles the event:

Code: Select all

    Private Sub pt_DblClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs)


        For Each ann As Steema.TeeChart.Tools.Tool In TChartScatter.Tools
            If ann.GetType Is GetType(Steema.TeeChart.Tools.Annotation) Then
                Dim tmpAnn As Steema.TeeChart.Tools.Annotation = ann
                If tmpAnn.Active And tmpAnn.Left = 6 And tmpAnn.Top = 8 Then
                    MsgBox("Please first move the annotation that appear in the top left corner", MsgBoxStyle.Information, "EMIS V2")
                    Exit Sub
                End If
            End If
        Next

        Dim newAnnotation As Steema.TeeChart.Tools.Annotation

        newAnnotation = New Steema.TeeChart.Tools.Annotation(TChartScatter.Chart)
        TChartScatter.Tools.Add(newAnnotation)

        newAnnotation.Active = False
        newAnnotation.Cursor = System.Windows.Forms.Cursors.Default
        newAnnotation.Height = 17
        newAnnotation.Shape.Font.Shadow.Visible = False
        newAnnotation.Width = 9

        Dim tmpPoint As Steema.TeeChart.Styles.Points = CType(sender, Steema.TeeChart.Styles.Points)

        Dim index = tmpPoint.Clicked(e.X, e.Y)
        newAnnotation.Text = tmpPoint.Item(index).Label()
        newAnnotation.Callout.XPosition = tmpPoint.CalcXPos(index)
        newAnnotation.Callout.YPosition = tmpPoint.CalcYPos(index)
        If tmpPoint.Item(index).Color.Equals(System.Drawing.Color.White) Then
            newAnnotation.Callout.Arrow.Color = System.Drawing.Color.Black
        Else
            newAnnotation.Callout.Arrow.Color = tmpPoint.Item(index).Color
        End If
        newAnnotation.Callout.Arrow.Width = 2
        newAnnotation.Callout.Arrow.Visible = True
        newAnnotation.Cursor = System.Windows.Forms.Cursors.SizeAll
        newAnnotation.Shape.Shadow.Visible = False
        newAnnotation.Active = True

        _dicAnnotation.Add(TChartScatter.Tools.Count - 1, index)

        AddHandler newAnnotation.Click, AddressOf newAnnotation_Click

    End Sub
The problem is that since we upgraded, the sub pt_DblClick isn't called anymore. Sould it be possible that the event isn't raised anymore in this build version?

The Question is: Why isn't it working anymore??? How to make it work again???

This matter is urgent because some of our customer are complaining about it.

Thanks in advance.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Jan 12, 2007 10:53 am

Hi dev,

I could reproduce the issue here and added it (TF02012023) to the top of our defect list to be fixed ASAP.

In the meantime, a workaround is using TeeChart's DoubleClick event, something like this:

Code: Select all

	Private Sub TChart1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TChart1.DoubleClick
		If (TChart1(0).Clicked(X, Y) <> -1) Then
			Dim args As System.Windows.Forms.MouseEventArgs = New MouseEventArgs(MouseButtons.Left, 2, X, Y, 0)

			pt_DblClick(TChart1(0), args)
		End If
	End Sub

	Private X, Y As Integer

	Private Sub TChart1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TChart1.MouseDown
		X = e.X
		Y = e.Y
	End Sub
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply