| Code: |
|
procedure TSimpleGraph.DoCanMoveResizeNode(Node: TGraphNode; var aLeft, aTop, aWidth, aHeight: Integer; var CanMove, CanResize: Boolean); var i: integer; Delta: TPoint; R: TRect; begin if FreezeTopLeft then begin if aLeft < 0 then aLeft := 0; if aTop < 0 then aTop := 0; end else begin { MeW: scroll other nodes to the bottom right if a node is scrolled beyond the topleft } if (aLeft < Left) or (aTop < Top) then begin Delta := Point(0,0); if (aLeft < Left) then Delta.X := -aLeft; if (aTop < Top) then Delta.Y := -aTop; BeginUpdate; try for i:=0 to ObjectsCount-1 do begin if (Objects.Items[i] <> Node) then begin R := Objects[i].BoundsRect; OffsetRect(R, Delta.X, Delta.Y); Objects[i].BoundsRect := R; end; end; if (aLeft < Left) then aLeft := Left; if (aTop < Top) then aTop := Top; finally EndUpdate; end; end; end; if Assigned(OnCanMoveResizeNode) then OnCanMoveResizeNode(Self, Node, aLeft, aTop, aWidth, aHeight, CanMove, CanResize); end; |
| Code: |
|
procedure TExtGraph.DoCanMoveResizeNode(Node: TGraphNode; var aLeft, aTop, aWidth, aHeight: Integer; var CanMove, CanResize: Boolean); var i: integer; Delta: TPoint; R: TRect; begin if FreezeTopLeft then begin if aLeft < 0 then aLeft := 0; if aTop < 0 then aTop := 0; end else begin { MeW: scroll other nodes to the bottom right if a node is scrolled beyond the topleft } if (aLeft < 0) or (aTop < 0) then begin Delta := Point(0,0); if (aLeft < 0) then Delta.X := -aLeft; if (aTop < 0) then Delta.Y := -aTop; BeginUpdate; try for i:=0 to ObjectsCount-1 do begin if (Objects.Items[i] <> Node) then begin R := Objects[i].BoundsRect; OffsetRect(R, Delta.X, Delta.Y); Objects[i].BoundsRect := R; end; end; if (aLeft < 0) then aLeft := 0; if (aTop < 0) then aTop := 0; finally EndUpdate; end; end; end; if Assigned(OnCanMoveResizeNode) then OnCanMoveResizeNode(Self, Node, aLeft, aTop, aWidth, aHeight, CanMove, CanResize); end; |
output generated using printer-friendly topic mod. All times are GMT