Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvSmoothTimeLine
Moving the indicator on the timeline with mouse click

Normally the user have to drag the indicator to change the position of the indicator on the timeline. To move the indicator on the timeline with a mouse click, you'd need to do this programmatically.

From the mousedown event, you can get the time of the spot clicked with AdvSmoothTimeLine.XToDateTime(x). You could then for example store a reference to the last indicator clicked in the OnIndicatorClick event and when it is assigned perform the move via:
var
  lastindicator: TAdvSmoothTimeLineBarIndicator;

procedure TForm4.AdvSmoothTimeLine1IndicatorClick(Sender: TObject;
  indicator: TAdvSmoothTimeLineBarIndicator); begin
  lastindicator := indicator;
end;

procedure TForm4.AdvSmoothTimeLine1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin
  if assigned(lastindicator) then
  begin
    lastindicator.Position := advsmoothtimeline1.XToDateTime(x);
  end;
end;