Disable TeeCursor.

TeeChart for ActiveX, COM and ASP
Post Reply
Kabal
Newbie
Newbie
Posts: 19
Joined: Mon Mar 13, 2006 12:00 am

Disable TeeCursor.

Post by Kabal » Fri Apr 21, 2006 7:46 am

Hello Support Team,

I have one asTeeCursor and property FollowMouse is True. I want to disable this cursor on Double Click. How do it ? Disabled cursor can't move and cursor pointer should not change.

Best regards, Rustam.

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 Apr 21, 2006 8:04 am

Hi Rustam,

You can implement something like that on TeeChart's OnDblClick event doing something like this:

Code: Select all

Private Sub TChart1_OnDblClick()
    TChart1.Tools.Items(0).Active = Not TChart1.Tools.Items(0).Active
    'or
    'TChart1.Tools.Items(0).asTeeCursor.FollowMouse = Not TChart1.Tools.Items(0).asTeeCursor.FollowMouse
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

Kabal
Newbie
Newbie
Posts: 19
Joined: Mon Mar 13, 2006 12:00 am

Wrong

Post by Kabal » Fri Apr 21, 2006 9:07 am

narcis wrote:Hi Rustam,

You can implement something like that on TeeChart's OnDblClick event doing something like this:

Code: Select all

Private Sub TChart1_OnDblClick()
    TChart1.Tools.Items(0).Active = Not TChart1.Tools.Items(0).Active
    'or
    'TChart1.Tools.Items(0).asTeeCursor.FollowMouse = Not TChart1.Tools.Items(0).asTeeCursor.FollowMouse
End Sub
It is not correct. In first case (Active=False) the cursor disappears absolutely. In second case (FollowMouse=False) cursor pointer changes when it's on the line of asTeeCursor

Rustam.

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Mon Apr 24, 2006 10:11 am

Hi Rustam,

yes, in that case if you want to hide the mouse cursor the only way I can think of is by using the Canvas techniques to simulate a cursor. This will allow you to customize the aspect and enable or disable ti when you want.
An example of cursor using the canvas could be :

Code: Select all

Private Sub Form_Load()
 TChart1.Series(0).FillSampleValues 20
 TChart1.Series(1).FillSampleValues 20
End Sub

Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
 Dim xx, yy, i
 Dim InChart As Boolean

 xpos = X
 ypos = Y

 InChart = True

 With TChart1
  'Optionally use .Aspect.Width3D and Height3D to set Line to plane of Series
  'in a 3D Chart - recommend use of 2D for simplicity
  If X <= .Axis.Left.Position Then
    X = .Axis.Left.Position + 1
    InChart = False
    LastValueY = 0
  End If

  If X > .Axis.Right.Position Then
    X = .Axis.Right.Position - 1
    InChart = False
    LastValueY = .Series(0).Count - 1
  End If

  .Canvas.Brush.Style = bsClear
  .Repaint
  If .SeriesCount > 0 Then
   For s = 0 To .SeriesCount - 1
    If .Series(s).Count > 0 Then
     If InChart = True Then
       For i = .Axis.Top.Position To .Axis.Bottom.Position
        If .Series(s).Clicked(X, i) <> -1 Then
          Exit For
        End If
       Next i
       .Canvas.TextOut 10, 10 + (10 * s), "Series " & s & " Value: " & CInt(.Series(s).YScreenToValue(i))
     Else
      .Canvas.TextOut 10, 10 + (10 * s), "Series " & s & " Value: " & CInt(.Series(s).YValues.Value(LastValueY))
     End If
    End If
   Next s
  End If

  '.Canvas.Pen.Style = psDot
  '.Canvas.Pen.Color = vbWhite
  .Canvas.Pen.Color = vbBlue
  .Canvas.MoveTo X, .Axis.Top.Position
  .Canvas.LineTo X, .Axis.Bottom.Position
 End With
End Sub

Kabal
Newbie
Newbie
Posts: 19
Joined: Mon Mar 13, 2006 12:00 am

*

Post by Kabal » Tue Apr 25, 2006 8:09 am

I think that this will work slowly and to cause blinking on big surfaces (1024x1024),

Kabal
Newbie
Newbie
Posts: 19
Joined: Mon Mar 13, 2006 12:00 am

*

Post by Kabal » Tue Apr 25, 2006 8:09 am

I think that this will work slowly and to cause blinking on big surfaces (1024x1024),

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Thu Apr 27, 2006 11:31 pm

Hi,

I'm afraid that there's not other way that I'm aware of.

Post Reply