TLama

Untitled

Jan 8th, 2014
401
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.63 KB | None | 0 0
  1. type
  2.   TForm1 = class(TForm)
  3.     procedure FormCreate(Sender: TObject);
  4.   private
  5.     FLastTick: DWORD;
  6.   end;
  7.  
  8. implementation
  9.  
  10. procedure TForm1.FormCreate(Sender: TObject);
  11. begin
  12.   // this line is not necessary; the FLastTick will be initialized to 0
  13.   FLastTick := 0;
  14. end;
  15.  
  16. procedure TForm1.VTFocusChanged(Sender: TBaseVirtualTree;
  17.   Node: PVirtualNode; Column: TColumnIndex);
  18. var
  19.   CurTick: DWORD;
  20. begin
  21.   CurTick := GetTickCount;
  22.   if CurTick - FLastTick > 1000 then
  23.   begin
  24.     FLastTick := CurTick;
  25.     Sender.InvalidateNode(Node);
  26.     PostMessage(Handle, UM_VT_CHANGED, Integer(Sender), Integer(Node));
  27.   end;
  28. end;
Advertisement
Add Comment
Please, Sign In to add comment