Page 1 of 1

TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 12:53 pm
by Athabasca
I use Simple Graph v2.71
Changes in dimension of the TRectangularNode (top, left, height or width) the property's,
change only the selection rectangle in the editor. The rectangle remains unchanged.

SG_Rect.png (6.22 KiB) Viewed 1574 times

With other Objects (TRoundRectangularNode and TEllipticNode) it works smoothly.
Any idea?

I use Delphi 2009 and Vista.

Thank you for the great Components!

Re: TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 3:04 pm
by Kambiz
I couldn't regenerate the problem on Delphi 2009 and Vista. :?

Re: TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 3:08 pm
by Kambiz
By the way, regarding other problem mentioning in your email...

The OnCloseQuery event handler of the form needs to be revised to the following code:

Code: Select all
procedure TMainForm.FormCloseQuery(Sender: TObject;var CanClose: Boolean);
begin
  if IsGraphSaved then
  begin
    SimpleGraph.Clear;
    CanClose := True;
  end
  else                           // was missing
    CanClose := False;           // was missing
end;

Re: TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 3:23 pm
by Athabasca
The changes i make in the Node Property Dialog are in the attachment.

Re: TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 4:40 pm
by Kambiz
Not only TRectangularNode, but also all other nodes suffering from that problem.

On line #6142 of SimpleGraph.pas, replace

Code: Select all
      if not IsUpdateLocked then
        BoundsChanged(dX, dY, dCX, dCY)
      else
        Changed([gcView, gcData, gcText, gcPlacement]);

with

Code: Select all
      BoundsChanged(dX, dY, dCX, dCY);

Thank you for reporting the bug.

Re: TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 4:42 pm
by Kambiz
It is better to use SetBounds method instead of setting Left, Top, Width, and Height properties individually.

Re: TSimpleGraph - Changes in property top, left, height, width

PostPosted: January 30th, 2009, 4:55 pm
by Athabasca
Thank you, it works fine. :mrgreen: