How to turn off chart movement via right-click

TeeChart for ActiveX, COM and ASP
Post Reply
Phoenix
Newbie
Newbie
Posts: 14
Joined: Thu May 08, 2003 4:00 am
Location: Blacksburg, VA
Contact:

How to turn off chart movement via right-click

Post by Phoenix » Thu Feb 05, 2004 8:41 pm

It appears that there is a mode where right-click and drag turns on 3d mode and moves the entire chart panel (changes aspect.horizoffset and vertoffset). Using the TeeCommander you can get rid of this by clicking on the select mode, but I need a way to programmatically turn this off. Is there an appropriate API for use here?

The problem is that I have an embedded graph w/ no commander visible in 2-d mode. Simply right-clicking in the chart changes it to 3-d mode with no visible reason why or any way to change it back without diving through many levels of options.

Thanks!

Nathan

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

Post by Pep » Thu Feb 05, 2004 11:36 pm

Hi Nathan,

which TeeChart version are you using ?
using the TeeChart Pro v5.06 and v6.04 I'm able to right-click and drag without get the Chart in 3D mode.
To disable the Scroll (right-click and drag) you must use :

Code: Select all

tChart1.Scroll.Enable = pmNone

Phoenix
Newbie
Newbie
Posts: 14
Joined: Thu May 08, 2003 4:00 am
Location: Blacksburg, VA
Contact:

Post by Phoenix » Fri Feb 06, 2004 1:26 pm

I am using 6.0.0.4. I have made an example excel file to demonstrate the problem. Use "right-click"-save-as to save the file locally.

1) Load the file
2) click on the button
3) Right-click drag in the chart. It'll turn to 3d and the chart will move as a whole (it actually pans and scrolls at the same time!)
4) Click in the teecommander to turn off 3-d mode, now click on the "normal" mode arrow button.
5) Chart now scrolls correctly w/o the panning.

http://www.phoenix-int.com/~nsharp/teeC ... roblem.xls

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

Post by Pep » Mon Feb 09, 2004 11:32 am

Hi Nathan,

I see now what you refer. This can be solved using the following code :

Code: Select all

Private Sub CommandButton1_Click()
   TeeCommander1.Chart = TChart1
   TChart1.Aspect.View3D = False
   TChart1.RemoveAllSeries
   TChart1.AddSeries scLine
   TChart1.Series(0).AddXY 0, 0, "", clTeeColor
   TeeCommander1.Buttons = Array(tcbNormal, tcbRotate, tcbMove, tcbZoom, tcbDepth, tcb3D, tcbSeparator, tcbLabel)
End Sub

Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If Button = mbRight Then
    TeeCommander1.ChartLink = -1
End If
End Sub

Private Sub TChart1_OnMouseUp(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If Button = mbRight Then
    TeeCommander1.ChartLink = TChart1.ChartLink
End If
End Sub

Phoenix
Newbie
Newbie
Posts: 14
Joined: Thu May 08, 2003 4:00 am
Location: Blacksburg, VA
Contact:

Post by Phoenix » Mon Feb 09, 2004 4:41 pm

Thanks! That does the trick. We appreciate the quick reply.

Post Reply