How to auto-scroll the chart when the user drags an allocation past the edge.
Drop a timer on the form, and attach the following events:
procedure TForm1.RACAllocationDragStart( Sender: TObject; Resource: TssResource; Allocation: TssResourceAllocation; var AllowDrag: Boolean); begin Timer1.Interval := 100; Timer1.Enabled := true; end; procedure TForm1.RACAllocationDragEnd( Sender: TObject; Resource: TssResource; Allocation: TssResourceAllocation); begin Timer1.Enabled := false; end; procedure TForm1.RACAllocationDragCancel( Sender: TObject; Resource: TssResource; Allocation: TssResourceAllocation); begin Timer1.Enabled := false; end; procedure TForm1.TssRACAllocationSwitchResource( Sender: TObject; FromResource, ToResource: TssResource; Allocation: TssResourceAllocation); begin Timer1.Enabled := false; end; // this event handler only fires when an allocation is being dragged procedure TForm1.Timer1Timer(Sender: TObject); var pt: TPoint; begin with TssRAC do begin pt := ScreenToClient(Mouse.CursorPos); // scroll horizontally? if pt.x < PlotRect.Left then ScrollChart(-(EndAt - StartAt) / 25.0) else if pt.x > PlotRect.Right then ScrollChart((EndAt - StartAt) / 25.0); // scroll vertically? if pt.y > PlotRect.Bottom then FirstDisplayedIndex := FirstDisplayedIndex + 1 else if pt.y < PlotRect.Top then FirstDisplayedIndex := FirstDisplayedIndex - 1; end; end;
- Overview
- Download
- Screen Shots
- Properties
- FAQ & Getting Started
- User Comments
- Support Forum
- Change History
- License
- Buy
What People Say |
---|
![]() Great component... ![]() Danny Banks, FMI Solutions Limited |
More … |