Hi
Im trying to use the gannt drag and resize but also want to keep right click menus I have added. This is a Visual Foxpro application.
The problem I am having is a right click will give me the menu I require, but also continue moving the bar which I dont want. I only want drag and resize if the left click is down not the right click. I have tried setting the pointer.asgantt.allowdrag and allowresize in the seriesclick depending on the button but this does not seem to work.
Any advice please.
Regards
Allen
OnGanttToolDragBar
Re: OnGanttToolDragBar
I should have added this is using version 7 of the activex
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: OnGanttToolDragBar
Hi Allen,
I've found this only occurs when you have disabled scrolling in your chart. You could either enable it or set a different mouse button for it. You'll find more information on how ot do that in tutorial 11. Tutorials can be found at TeeChart's program group.
I've found this only occurs when you have disabled scrolling in your chart. You could either enable it or set a different mouse button for it. You'll find more information on how ot do that in tutorial 11. Tutorials can be found at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: OnGanttToolDragBar
Thanks for the reply. I had disabled scroll and zoom because I do not want it used. I have decided to have modes for the chart so the user can decide on the mode to use like the right click menu or move or zoom.
One other question, I can use the tools for moving in time, what is the best way to have drag drop in vertical, ie from one line to another rather than across the chart.
Thanks
Allen
One other question, I can use the tools for moving in time, what is the best way to have drag drop in vertical, ie from one line to another rather than across the chart.
Thanks
Allen
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: OnGanttToolDragBar
Hi Allen,
In that case you should try DragPoints tool.
Hope this helps!
In that case you should try DragPoints tool.
Hope this helps!
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: OnGanttToolDragBar
Sorry for the delay, been very busy. I am now trying the drag point but it seems unclear what to do with it as it does not snap to the axis. At the moment I am just wanting drag style "Y" but it can leave the point (gantt) anywhere. I can see OnDragPointToolDragPoint but am unsure what to do with it. I need to use the new position to change the data. Any advice please or pointer to a demo
Thanks
Allen
Thanks
Allen
Re: OnGanttToolDragBar
Hi Allen,
I'm not sure to understand how you would like the points to snap to the axis. Here you have an example of how you could customize the Gantt series drag using the Mouse events. Note that this is a VB6 example.
I'm not sure to understand how you would like the points to snap to the axis. Here you have an example of how you could customize the Gantt series drag using the Mouse events. Note that this is a VB6 example.
Code: Select all
Dim MouseStartX, MouseStartY, clickedIndex As Integer
Private Sub Form_Load()
TChart1.Aspect.View3D = False
TChart1.AddSeries scGantt
TChart1.Series(0).FillSampleValues 10
TChart1.Zoom.Enable = False
TChart1.Scroll.Enable = pmNone
clickedIndex = -1
MouseStartX = -1
MouseStartY = -1
End Sub
Private Sub TChart1_OnMouseDown(ByVal Button As TeeChart.EMouseButton, ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
clickedIndex = TChart1.Series(0).Clicked(X, Y)
If clickedIndex <> -1 Then
MouseStartX = X
MouseStartY = Y
TChart1.Header.Text.Text = Str$(clickedIndex)
End If
End Sub
Private Sub TChart1_OnMouseMove(ByVal Shift As TeeChart.EShiftState, ByVal X As Long, ByVal Y As Long)
If clickedIndex <> -1 Then
With TChart1.Series(0).asGantt
.StartValues.Value(clickedIndex) = .StartValues.Value(clickedIndex) + TChart1.Axis.Bottom.CalcPosPoint(X) - TChart1.Axis.Bottom.CalcPosPoint(MouseStartX)
.EndValues.Value(clickedIndex) = .EndValues.Value(clickedIndex) + TChart1.Axis.Bottom.CalcPosPoint(X) - TChart1.Axis.Bottom.CalcPosPoint(MouseStartX)
End With
TChart1.Series(0).YValues.Value(clickedIndex) = TChart1.Series(0).YValues.Value(clickedIndex) + TChart1.Axis.Left.CalcPosPoint(Y) - TChart1.Axis.Left.CalcPosPoint(MouseStartY)
MouseStartX = X
MouseStartY = Y
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)
clickedIndex = -1
End Sub
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |