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 >>

TAdvSmoothDock
Controlling how long the item jumping lasts.

When an item is clicked or double clicked an extra visual feature can be started to indicate the item has been clicked: Set Jump to true to allow the item to jump. Set Jump to false to stop the jumping. This way it is under full control of the application code how long the item jumping lasts.

With this code a Timer is started to count 3 seconds before the item stops jumping:

var 
  time, clickeditem: integer; 
implementation 

{$R *.dfm} 

procedure TForm1.AdvSmoothDock1ItemClick(Sender: TObject; ItemIndex: Integer); 
begin 
  Timer1.Enabled := true; 
  time := 0; 
  clickeditem := ItemIndex; 
  AdvSmoothDock1.Items[clickeditem].Jump := true; 
end; 

procedure TForm1.Timer1Timer(Sender: TObject); 
var 
  i: integer; 
begin 
  if time >= 3 then 
  begin
    Timer1.Enabled := false; 
    for I := 0 to AdvSmoothDock1.Items.Count - 1 do 
       AdvSmoothDock1.Items[I].Jump := false; 
  end; 
  Inc(time); 
end;