亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? magnetunit.pas

?? 這是一個有 BUG 的磁性窗體的組件/單元
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
    begin
      aTop := aRect.Top;
      Result := True;
    end;
    // bottom edge
    if (aTop + aHeight > aRect.Bottom - Range) then
    begin
      aTop := aRect.Bottom - aHeight;
      Result := True;
    end;
  end
  else
    if (aBorder in [sbOuter, sbNear]) then
    begin
      RangeRect := GrowRect(aRect, Range);

      IntersectRect(ISect, RangeRect, Rect(aLeft, aTop, aLeft + aWidth, aTop +
        aHeight));
      if IsRectEmpty(ISect) then Exit;

    // if sbOuter is specified the larger part of the rectangle must be outside,
      if (aBorder = sbOuter) then
      begin
        IntersectRect(ISect, aRect, Rect(aLeft, aTop, aLeft + aWidth, aTop +
          aHeight));
        if (RectArea(ISect) >=
          RectArea(Rect(aLeft, aTop, aLeft + aWidth, aTop + aHeight)) div 2) then
            Exit;
      end;

    // left to the right border
      if (Abs(aLeft - aRect.Right) < Range) then
      begin
        aLeft := aRect.Right;
        Result := True;
      end;
    // left on the left border
      if (Abs(aLeft - aRect.Left) < Range) then
      begin
        aLeft := aRect.Left;
        Result := True;
      end;
    // right to the left border
      if (Abs(aLeft + aWidth - aRect.Left) < Range) then
      begin
        aLeft := aRect.Left - aWidth;
        Result := True;
      end;
    // right on the right border
      if (Abs(aLeft + aWidth - aRect.Right) < Range) then
      begin
        aLeft := aRect.Right - aWidth;
        Result := True;
      end;
    // top to the bottom border
      if (Abs(aTop - aRect.Bottom) < Range) then
      begin
        aTop := aRect.Bottom;
        Result := True;
      end;
    // top to the top border
      if (Abs(aTop - aRect.Top) < Range) then
      begin
        aTop := aRect.Top;
        Result := True;
      end;
    // if bottom to the top border
      if (Abs(ATop + aHeight - aRect.Top) < Range) then
      begin
        aTop := aRect.Top - aHeight;
        Result := True;
      end;
    // if bottom to the bottom border
      if (Abs(ATop + aHeight - aRect.Bottom) < Range) then
      begin
        aTop := aRect.Bottom - aHeight;
        Result := True;
      end;
    end;
end;

procedure TMagnet.WindowPosChanging(var aPos: TPoint; const W, H: integer; Sizing: Boolean = False);
var
  i, j: integer;
  MainFormR: TRect;
  Delta,
    P: TPoint;
  M: TMagnet;
begin
  if (SnapOptions = []) then Exit;

  // determine delta request
  Delta.X := (aPos.X - Area.Left);
  Delta.Y := (aPos.Y - Area.Top);

  // detect any active magnet in the same group in the neighbourhood
  if (soMagnet in SnapOptions) then
  begin
    i := ActiveMagnets.Count - 1;
    while (i >= 0) do
    begin
      // only enable snap to active magnets not in this cluster
      if (FCluster.IndexOf(ActiveMagnets[i]) < 0) and
        (TMagnet(ActiveMagnets[i]).GroupIndex = GroupIndex) then
      begin
        if SnapToRect(aPos.x, aPos.y, W, H,
          TMagnet(ActiveMagnets[i]).Area, sbOuter) then
        begin
          FSnapList.Add(ActiveMagnets[i]);
        end;
      end;
      Dec(i);
    end;
  end;

  // every magnet in the cluster has it's own snap and is to be considered
  // if in the cluster
  if (InCluster) and (Dragging) and (ClusterSnapping) then
  begin
    for i := 0 to FCluster.Count - 1 do
    begin
      M := TMagnet(Cluster[i]);
      if (M <> Self) then
      begin
        // transform to M new position request
        P.X := M.Area.Left + Delta.X;
        P.Y := M.Area.Top + Delta.Y;
        // allow M to snap from the virtual new position
        M.WindowPosChanging(P, M.Area.Right-M.Area.Left, M.Area.Bottom-M.Area.Top);

        // should merge snaplist with the most recent snaplist of M
        for j:=0 to M.FSnapList.Count-1 do
          if FSnapList.IndexOf(M.FSnapList[j]) < 0 then
            FSnapList.Add(M.FSnapList[j]);

        // transform virtual snapped M back to a suggested delta
        P.X := P.X - M.Area.Left;
        P.Y := P.Y - M.Area.Top;
        // apply M's suggestion if it is different from the original delta
        if ((P.X <> Delta.X) or (P.Y <> Delta.Y)) then
        begin
          // transform the adjusted delta to current coordinates
          aPos.X := aPos.X - Delta.x + P.X;
          aPos.Y := aPos.Y - Delta.y + P.Y;
        end;
      end;
    end;
  end;

  // only snap to the mainform if this is not the mainform and it is active
  // (if it's not active and it would be behind the mainform it would never
  //  reappear, even while moving the mainform aside)
  if (soInMainForm in SnapOptions) and
    (Dragging) then
  begin
    MainFormR := Application.MainForm.BoundsRect;
    if RectOverlap(Area, MainFormR) then
    begin
      MainFormR := Classes.Rect(
        Application.MainForm.ClientToScreen(
          Application.MainForm.ClientRect.TopLeft),
        Application.MainForm.ClientToScreen(
          Application.MainForm.ClientRect.BottomRight));
    end;
    SnapToRect(aPos.x, aPos.y, W, H, MainFormR, sbNear);
  end;

  // determine screen snapping
  // implemented multimonitor support
  if (soInScreen in SnapOptions) then
  begin
    if Sizing then
    begin
      {$IFDEF CODESITE}
      if (Delta.X = 0) and (Delta.Y = 0) and
        ((aPos.X > Area.Left) or (aPos.Y > Area.Top)) then
      begin
        Delta.X := (aPos.X - Area.Left);
        Delta.Y := (aPos.Y - Area.Top);
        CodeSite.SendPoint('BottomRight snapsize suggestion', Delta);
      end
      else
      if (Delta.X > (aPos.X - Area.Left)) or (Delta.Y > (aPos.Y - Area.Top)) then
      begin
        Delta.X := (aPos.X - Area.Left);
        Delta.Y := (aPos.Y - Area.Top);
        CodeSite.SendPoint('TopLeft snapsize suggestion', Delta);
      end;
      {$ENDIF}
    end;
    // MultiMonitor support is simply handled by turning off the Inner and
    // change the snap behaviour to Near.
    // TO DO:
    // To solve this properly the outer edge of multiple monitors should
    // be considered.
    if (Screen.MonitorCount = 1) then
      SnapToRect(aPos.X, aPos.Y, W, H, Form.Monitor.WorkareaRect, sbInner)
    else
      SnapToRect(aPos.X, aPos.Y, W, H, Form.Monitor.WorkareaRect, sbNear);

    (*
    if (Sizing) and () then
    begin
      if ((aPos.Y = Area.Top) and (Delta.Y <> 0))
      {$IFDEF CODESITE}
      // Once snapped to the screen edge, the resizing doesn't snap anymore...
      // this is because the final code in this routine takes the screen into
      // consideration. However this should only be the case if moving is
      // active. If sizing is active the screen should be checked first and not
      // last...?
      {$ENDIF}
    end;
    *)
  end;
end;

procedure TMagnet.UnCluster;
var
  j: integer;
  OldNeighbour: TMagnet;
  OldNeighbours: TList;
begin
  {$IFDEF CODESITE} CodeSite.EnterMethod(Form.Name+' Uncluster'); {$ENDIF}
  // remove this magnet from all others in the Cluster
  for j := Cluster.Count - 1 downto 0 do
  begin
    if (Cluster[j] <> Self) then
      TMagnet(Cluster[j]).RemoveFromCluster(Self);
  end;
  // reclusterize old neighbours which were in this cluster
  OldNeighbours := TList.Create;
  try
    for j:=Cluster.Count-1 downto 0 do
      if RectAligned(FOldArea, TMagnet(Cluster[j]).Area) then
        OldNeighbours.Add(Cluster[j]);
    while (OldNeighbours.Count > 0) do
    begin
      OldNeighbour := TMagnet(OldNeighbours[0]);
      OldNeighbour.ReCluster(nil);
      OldNeighbours.Extract(OldNeighbour);
      // make sure other old neighbours which are now reclustered are no longer
      // in the list to be reclustered again
      for j:=0 to OldNeighbour.Cluster.Count-1 do
        OldNeighbours.Extract(OldNeighbour.Cluster[j]);
    end;
    // empty the cluster list
    for j:=Cluster.Count-1 downto 0 do
      if Cluster[j] <> Self then
        Cluster.Delete(j);
  finally
    OldNeighbours.Free;
  end;

  {$IFDEF CODESITE} CodeSite.ExitMethod(Form.Name+' Uncluster'); {$ENDIF}
end;

function TMagnet.Area: TRect;
begin
  Result := Form.BoundsRect;
end;

procedure TMagnet.SetEnableClustering(const Value: Boolean);
begin
  if (EnableClustering <> Value) then
  begin
    if not (Value) and InCluster then
      UnCluster;
    FEnableClustering := Value;
  end;
end;

procedure TMagnet.RemoveFromCluster(aMagnet: TMagnet);
begin
  {$IFDEF CODESITE}
  CodeSite.SendMsg(Form.Name+' removes '+aMagnet.Form.Name+' from clusterlist');
  {$ENDIF}
  Cluster.Extract(aMagnet);
end;

procedure TMagnet.SetAutoSnap(const Value: boolean);
begin
  FAutoSnap := Value;
end;

procedure TMagnet.SetClusterSnapping(const Value: Boolean);
begin
  FClusterSnapping := Value;
end;

function TMagnet.Center: TPoint;
begin
  Result.X := Area.Left + (Area.Right - Area.Left) div 2;
  Result.Y := Area.Top + (Area.Bottom - Area.Top) div 2;
end;

procedure TMagnet.ClusterSnapList;
var
  i, j: integer;
  Candidate: TMagnet;
begin
  try
    if (FSnapList.Count > 0) and
      (EnableClustering) then
    begin
      // The snaplist contains all magnets which the current magnet or cluster
      // snapped into. Every candidate in this snaplist should be considered to
      // become part of the cluster.
      // For this the candidate must be aligned to the already existing cluster,
      // it must share the same ClusterIndex and must have ClusterSnapping
      // enabled.
      for j := 0 to FSnapList.Count - 1 do
      begin
        Candidate := TMagnet(FSnapList[j]);
        if (Candidate.ClusterIndex = ClusterIndex) and
          (Candidate.ClusterSnapping) then
          for i:=0 to Cluster.Count-1 do
            if (RectAligned(TMagnet(Cluster[i]).Area, Candidate.Area)) then
              AppendCluster(Candidate.Cluster);
      end;
      // distribute the newly assembled Cluster to all magnets involved
      for j := 0 to Cluster.Count - 1 do
        TMagnet(Cluster[j]).AppendCluster(Cluster);
    end;
  finally
    FSnapList.Clear;
  end;
end;

procedure TMagnet.ReCluster(NewCluster: TList);
var
  i, j: integer;
  NewC: TList;
begin
  {$IFDEF CODESITE}
  CodeSite.EnterMethod(Form.Name+' ReClustering');
  {$ENDIF}
  // assign the new clusterlist, of none is assigned this magnet is the initiator
  // for the new cluster to be build.
  NewC := NewCluster;
  try
    if (NewC = nil) then
      NewC := TList.Create;
    // since we're asked to recluster we should be neighbour and be added
    NewC.Add(Self);
    // ask all magnets from the old cluster which is not yet in the new cluster
    // to check for its neighbours.
    for j:=0 to Cluster.Count-1 do
    begin
      if (NewC.IndexOf(Cluster[j]) = -1) and
        (RectAligned(Area, TMagnet(Cluster[j]).Area)) then
        TMagnet(Cluster[j]).ReCluster(NewC);
    end;
    // if this is the initiator for the new cluster broadcast the changes
    if (NewCluster = nil) then
    begin
      // extract all magnets in the new list from the old cluster
      for j:=Cluster.Count-1 downto 0 do
        for i:=0 to NewC.Count-1 do
          TMagnet(Cluster[j]).RemoveFromCluster(TMagnet(NewC[i]));
      // publish the new clusterlist to all magnets in this new list (incl self)
      for j:=0 to NewC.Count-1 do
        TMagnet(NewC[j]).Cluster.Assign(NewC);
    end;
  finally
    if (NewC <> NewCluster) then
    begin
      {$IFDEF CODESITE}
      CodeSite.SendInteger(Form.Name+' clustersize', NewC.Count);
      {$ENDIF}
      NewC.Free;
    end;
  end;
  {$IFDEF CODESITE}
  CodeSite.ExitMethod(Form.Name+' ReClustering');
  {$ENDIF}
end;

procedure TMagnet.WindowSizeChanging(var aRect: TRect);
var
  P: TPoint;
begin
  // determine potential move snap and apply this to the width and height
  P := aRect.TopLeft;
  WindowPosChanging(
    P,
    aRect.Right-aRect.Left,
    aRect.Bottom-aRect.Top, True);
  // snapping is translated to the left position or the width
  if (aRect.Left <> FDragStart.Left) then
    aRect.Left := P.X
  else
  if (aRect.Right <> FDragStart.Right) then
    aRect.Right := aRect.Right + (P.X - aRect.Left);
  // snapping is translated to the top position or the height
  if (aRect.Top <> FDragStart.Top) then
    aRect.Top := P.Y
  else
  if (aRect.Bottom <> FDragStart.Bottom) then
    aRect.Bottom := aRect.Bottom + (P.Y - aRect.Top);
  // reclustering is performed
  if InCluster and Dragging then
    UnCluster;
end;

procedure TMagnet.AdjustCluster(Delta: TPoint);
var
  i: integer;
begin
  // if this is the main magnet being dragged it should drag other InCluster magnets along
  if Dragging then
  begin
    for i := 0 to Cluster.Count - 1 do
      if (Cluster[i] <> Self) then
      begin
        TMagnet(Cluster[i]).ApplyDeltaPos(Delta);
      end;
  end;
end;

procedure TMagnet.SetImmediateCluster(const Value: boolean);
begin
  FImmediateCluster := Value;
end;

procedure TMagnet.SetGroupIndex(const Value: integer);
begin
  FGroupIndex := Value;
end;

procedure TMagnet.SetClusterIndex(const Value: integer);
begin
  if (FClusterIndex <> Value) then
  begin
    if InCluster then
      UnCluster;
    FClusterIndex := Value;
  end;
end;

initialization
  ActiveMagnets := TList.Create;
  AllMagnets := TList.Create;

finalization
  AllMagnets.Free;
  ActiveMagnets.Free;

end.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线电影院国产精品| 在线免费亚洲电影| 亚洲一区二区精品视频| 久久综合视频网| 99国产欧美久久久精品| 麻豆精品视频在线观看免费| 一色屋精品亚洲香蕉网站| 91精品国产综合久久香蕉麻豆| 成人免费三级在线| 久久av老司机精品网站导航| 亚洲最色的网站| 国产精品久久久久久久蜜臀| 久久综合色婷婷| 日韩一区二区在线观看| 欧美三级资源在线| 91在线观看成人| 国产麻豆精品在线| 青青草国产成人av片免费| 亚洲一区在线观看网站| 亚洲欧美二区三区| 中文字幕不卡的av| 久久综合狠狠综合久久激情| 日韩一区二区麻豆国产| 欧美日韩另类一区| 色婷婷精品大视频在线蜜桃视频| 粉嫩嫩av羞羞动漫久久久| 精品一区二区免费看| 日产精品久久久久久久性色| 洋洋成人永久网站入口| 一级中文字幕一区二区| 亚洲天堂久久久久久久| 国产精品久久久爽爽爽麻豆色哟哟| 精品不卡在线视频| 2023国产精品自拍| 久久久亚洲精品石原莉奈| 精品国产免费一区二区三区四区 | 亚洲欧洲三级电影| 国产精品三级视频| 国产精品白丝在线| 亚洲日本乱码在线观看| 亚洲柠檬福利资源导航| 亚洲美女少妇撒尿| 亚洲成人免费电影| 日韩国产精品久久久久久亚洲| 日韩电影在线免费| 久久精品国产精品亚洲综合| 激情五月婷婷综合| 国产a视频精品免费观看| 成人天堂资源www在线| 成人av网址在线| 色综合婷婷久久| 欧美剧在线免费观看网站 | 国产精品2024| 成+人+亚洲+综合天堂| 91论坛在线播放| 91麻豆精品国产91久久久久久| 91精品国产综合久久久蜜臀图片| 日韩欧美中文字幕公布| 欧美精品一区二区三区蜜桃视频| 国产精品无遮挡| 夜夜精品视频一区二区| 日韩av中文字幕一区二区| 国产在线视频一区二区三区| 成人免费黄色大片| 在线观看一区二区视频| 日韩欧美一区在线| 中文文精品字幕一区二区| 亚洲乱码日产精品bd | 99久久久久久| 欧美欧美欧美欧美首页| 久久综合九色综合久久久精品综合 | 26uuu精品一区二区在线观看| 国产婷婷色一区二区三区在线| 18成人在线视频| 秋霞成人午夜伦在线观看| 国产激情视频一区二区在线观看| 99riav久久精品riav| 91麻豆精品国产自产在线观看一区| 久久免费电影网| 一区二区三区四区激情| 久久成人麻豆午夜电影| 91免费小视频| 欧美一级艳片视频免费观看| 国产无人区一区二区三区| 亚洲高清视频在线| 国内精品伊人久久久久av影院| 91视频.com| 久久综合久色欧美综合狠狠| 亚洲精品国产精华液| 国精品**一区二区三区在线蜜桃 | 日韩三级免费观看| 亚洲色图在线看| 国内精品视频一区二区三区八戒| 色婷婷久久一区二区三区麻豆| 精品国产一区二区精华| 亚洲成a人v欧美综合天堂下载 | 欧美日韩午夜精品| 国产精品午夜在线| 久久精品国产99久久6| 色就色 综合激情| 欧美国产97人人爽人人喊| 日韩成人免费在线| 在线观看成人免费视频| 欧美国产精品中文字幕| 精品一区二区三区蜜桃| 欧美日韩视频在线第一区| 中文字幕一区二区5566日韩| 激情都市一区二区| 欧美日韩一区高清| 亚洲人成小说网站色在线| 国产成人免费av在线| 日韩一区二区三区电影| 亚洲一区二区四区蜜桃| 99国产精品久久| 国产日韩精品一区二区三区在线| 青青草国产成人av片免费| 91福利在线观看| 国产精品久久久久天堂| 国产成人精品午夜视频免费| 欧美大片一区二区三区| 石原莉奈在线亚洲二区| 欧美日韩一卡二卡| 亚洲一区精品在线| 91成人在线观看喷潮| 亚洲欧美日韩中文播放| 91在线观看高清| 亚洲欧美成人一区二区三区| 成人av在线资源| 1024精品合集| 91在线视频网址| 中文字幕亚洲一区二区av在线| 丁香天五香天堂综合| 久久精品欧美一区二区三区不卡 | 欧美日韩亚洲国产综合| 一区二区不卡在线播放| 在线观看亚洲a| 亚洲高清视频的网址| 欧美日韩一区二区三区在线看 | 国产无人区一区二区三区| 国产精品一区免费视频| 国产嫩草影院久久久久| 成人激情开心网| 国产精品福利在线播放| eeuss鲁片一区二区三区 | 激情欧美日韩一区二区| 久久久国产精华| 成a人片国产精品| 亚洲欧洲精品一区二区精品久久久 | 国产在线一区二区综合免费视频| 久久综合中文字幕| 国产成人av一区二区三区在线| 国产精品午夜在线观看| 色综合天天综合狠狠| 亚洲电影在线播放| 日韩欧美国产三级电影视频| 国产精品资源在线看| 亚洲三级在线免费| 欧美偷拍一区二区| 免费看欧美女人艹b| 国产日韩欧美综合在线| 91在线无精精品入口| 五月天亚洲婷婷| 精品女同一区二区| 不卡区在线中文字幕| 亚洲成人综合视频| 久久蜜臀中文字幕| 91影院在线观看| 日韩国产欧美一区二区三区| 久久精品欧美日韩| 91精品福利视频| 麻豆久久久久久久| 中文字幕一区二区三区乱码在线| 欧美日韩在线观看一区二区| 国产在线播放一区| 一区二区日韩av| 久久无码av三级| 色哟哟国产精品免费观看| 日韩高清在线不卡| 成人免费在线视频| 欧美一卡二卡在线观看| 成人激情免费视频| 免费在线视频一区| 亚洲精品国产视频| 久久久久久久久久久电影| 91国偷自产一区二区使用方法| 美女一区二区视频| 一区二区三区四区不卡在线 | 欧美一区二区在线播放| 成人午夜av影视| 六月丁香婷婷久久| 亚洲精品视频在线看| wwwwww.欧美系列| 欧美色图12p| 99久久婷婷国产综合精品电影 | 欧洲精品中文字幕| 国产一区二区剧情av在线| 婷婷亚洲久悠悠色悠在线播放| 欧美国产日韩在线观看| 日韩欧美黄色影院| 91精品办公室少妇高潮对白|