Creating MacOS-like dock with only 19 lines of delphi code, using HTML Component Library.
Creating MacOS-like dock with only 19 lines of delphi code, using HTML Component Library.
procedure TForm1.HtPanel2MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var E, C: TElement; i: integer; r: single; P: TPoint; CR: TRect;
begin
if Point(x, y)=LastP then exit;
LastP:=Point(x, y);
P:=HtPanel2.ScreenToClient(Point(x, y));
E:=HtPanel2.Doc.GetElementbyId('dock');
for i:=0 to E.Count-1 do
if E.Elements[i].Tag='a' then begin
C:=E.Elements[i];
CR:=C.Rects(0);
CR.Offset(C.RealLeft, C.RealTop);
P:=Point(CR.Left+CR.Width div 2, CR.Top+CR.Height div 2);
r:=sqrt(sqr(abs(x-P.X))+abs(sqr(y-P.Y)));
C.Style.Base.Zoom:=max(1, 1+(200-r)/200);
end;
HtPanel2.Doc.RecalcStyles;
HtPanel2.Doc.NeedRecalc:=true;
end;
http://delphihtmlcomponents.com
Markus Joos
ReplyDeleteGDI+
ReplyDeleteOk, thanks. Again, pretty cool work.
Alexander Sviridenkov woops, my bad, ignore my comments, I'm wasted...
ReplyDelete