Add the FreezeBottomRight to the property of SimpleGraph
Select messages from
# through # FAQ
[/[Print]\]

DELPHI AREA -> DELPHI AREA's Products

#1: Add the FreezeBottomRight to the property of SimpleGraph Author: Mirage PostPosted: 01/11/05 11:44
    —
Hello!

Please how to add a FreezeBottomRight property for SimpleGraph.


Thank you in advance!

#2:  Author: lbcLocation: Italy PostPosted: 02/11/05 09:30
    —
Hello Mirage
you may take a look at the following thread

http://www.delphiarea.com/forum/viewtopic.php?t=459

Hope it helps

#3: Add the FreezeBottomRight to simplegraph Author: Mirage PostPosted: 08/11/05 07:07
    —
Hello

Given me more explanation for this program and method of use.

Thank you in advance

#4:  Author: lbcLocation: Italy PostPosted: 08/11/05 15:35
    —
Hello
basically, according to that thread, as currently there isn't a FreezeBottomright property, you can try to work with the SimpleGraph
OnCanMoveResizeNode event.

In that event you can check the Node's Right/Bottom corner against the Graph.ClientWidth/ClientHeight and depending on the result of the check you can assign CanMove/CanResize to false to avoid the Node moving/resizing.

Anyway it's just a work-around and of course a FreezeBottomRight property would be great.

hope that helps

#5:  Author: KambizLocation: Tehran, Iran PostPosted: 10/11/05 14:40
    —
Hi,

Download v1.65 of the component, and check out the new GraphConstratins property.

Cheers

#6:  Author: lbcLocation: Italy PostPosted: 11/11/05 11:23
    —
thank you Kambiz, really excellent!

just some quick notes

- to avoid the temporary displaying of the scrollbars when inserting a new node with dimensions larger than the rightbottom corner (after having set the GraphConstraints.MaxBottom and Maxright to a given value) it's necessary to set the vertical and orizontal scrollbar to visible = false, else the scrollbars show up (temporarily)

- when i insert a node at the very rightbottom corner (for example a rectangle within the current Graphconstraints.MaxBottom/right ) with both the scrollbars visibile properties set to false, and then i start zooming in, some part of the node "disappears" as only the simplegraph contents is zoomed, but i think that maybe it would be nice (when GraphContraints.MaxBottom and MaxRight have been set up to a given value, say the max graph dimensions) that also the graph clientwidth and clientheight get zoomed in, accordingly to the zoom value.

Of course if the scroolbars are visibile i can scroll down to watch the whole zoomed node but i think that when we set the maxright/maxbottom contraints to a given value it would be nice to keep the scrollbars hidden and zoom both the "graph contents" and the "graph boundaries" (for now i can anyway update manually the clientwidth/height of the graph in the zoom in / zoom out events)..


hope that helps
thanks again for your great component!

#7:  Author: KambizLocation: Tehran, Iran PostPosted: 11/11/05 17:24
    —
Regading inserting nodes and scroll bars, I have to admit that I was missed to check constraints during insertion of a new node. So, no need to change any other thing.

Just for your information:

All values in SimpleGraph are in graph coordinates, and independent of the current zoom or scroll bars' position.

The zoom value uses only in:
  • Calculating the scroll bars' maximum range.
  • Converting client coordinates to graph coordinates and vise versa.
  • Defining the parameters of ANISOTROPIC off-screen canvas.

By the way, the fix is available to download (v1.66).

Cheers

#8:  Author: lbcLocation: Italy PostPosted: 13/11/05 16:15
    —
Hi Kambiz

Kambiz wrote:
Regading inserting nodes and scroll bars, I have to admit that I was missed to check constraints during insertion of a new node. So, no need to change any other thing.


really no problem, it was just to help
thank you for your very fast addition into the new release of SG

Quote:

All values in SimpleGraph are in graph coordinates, and independent of the current zoom or scroll bars' position.


thank you for the details
in my second point above, basically i was suggesting that i think it would be nice, when the graphcontraints are set, to have also the graph boundaries zoomed in/out together with the graph contents.

I have added 3 simple pictures to describe that.

sg1_1 is the initial situation a simplegraph 200x200 over a panel, with zoom = 100%

sg1_2 the initial simplegraph zoomed in to 125%

sg1_3 ithe same as step 2 but this time i have manually "zoomed" also the graph boundaries



thank you again



sg1_1.jpg
 Description:
Simple example:
a simplegraph with Graphcontraints on a panel
zoom 100%
 Filesize:  44.79 KB
 Viewed:  2277 Time(s)





sg1_2.jpg
 Description:
zoomed in
 Filesize:  39.02 KB
 Viewed:  2277 Time(s)





sg1_3.jpg
 Description:
now zooming also the graph boundaries
 Filesize:  47.56 KB
 Viewed:  2277 Time(s)





#9:  Author: KambizLocation: Tehran, Iran PostPosted: 13/11/05 17:11
    —
Sorry, but I couldn't get what you mean. Embarassed

Can ZoomGraph method be what you are talking about?

#10:  Author: lbcLocation: Italy PostPosted: 13/11/05 19:54
    —
Hello Kambiz
thank you as usual for your help and support

as far as the ZoomGraph function unfortunately it seems to me that doesnt get what i was telling about

basically i'd wish to get the "graph boundaries" zoomed, just like when zooming a drawing canvas

for example i currently get this result, just putting the following code inside the code for the zoom in/zoom out buttons on the sample application above (sg1 is the simplegraph, W0 and H0 are the initial graph dimensions that is 200 x 200).

if (chkZoomboundaries.Checked) then
begin
sg1.Width := Round(W0 * sg1.Zoom / 100);
sg1.Height := Round(H0 * sg1.Zoom / 100);
end;
in this way both the graph nodes/links and the graph boundaries are zoomed, else only the nodes/links are zoomed and the scrollbars appears

I was wondering if this could be incorporated into the simplegraph itself

thanks again!

#11:  Author: KambizLocation: Tehran, Iran PostPosted: 14/11/05 06:20
    —
I guess you mean AutoSize, right?

#12:  Author: lbcLocation: Italy PostPosted: 14/11/05 10:13
    —
Hi Kambiz
yes, basically something that resizes the graph dimensions according to the current zoom values Smile

to give an example, while there is non need for this feature when the graph is usually alClient aligned and fills the whole client window area (ie. like in the SG demo), i think the "autosize" cold be handful when using the graph with specified width and height corresponding to a "drawing canvas" and the graph constraints are set in order to avoid that the user "escapes" out the right/bottom side. In these cases i think it would be nice to get both the nodes/links and the graph client width/height zoomed in/out just it happens in the drawing applications or, to be closer to another excellent product of yours, like zooming the print preview "paper" page (think for example when the print preview is in "whole page" mode and resizing the client area makes the print preview area, both the borders and its contents, resized accordingly to the current zoom value)

thanks again!

#13:  Author: KambizLocation: Tehran, Iran PostPosted: 14/11/05 15:30
    —
It's possible to add this feature, however it may confuse some users because graph boundaries depends on the graph itself, and in the other hand it can be a very large value.

I do suggest to go with your own code.

By the way, for your convenience I added OnZoomChange event to the control. You can download the update now.

Cheers

#14:  Author: lbcLocation: Italy PostPosted: 14/11/05 16:16
    —
Hello Kambiz
I have just downloaded the new 1.67 release
Thank a lot! the new Onzoomchange event is very handful!
I have moved my "graph zoom resize" code there and everything works fine furthermore the zoom in/out buttons code can stay untouched

Excellent job (as usual) Very Happy
thanks again

#15:  Author: KambizLocation: Tehran, Iran PostPosted: 14/11/05 19:59
    —
Nice to hear that! Wink

Buona fortuna
Kambiz

#16:  Author: Mirage PostPosted: 15/11/05 09:29
    —
Thanks you Kambiz!

#17:  Author: Mirage PostPosted: 15/11/05 09:33
    —
Thanks you Kambiz

#18:  Author: lbcLocation: Italy PostPosted: 15/11/05 10:28
    —
Kambiz wrote:
Nice to hear that! Wink

Buona fortuna
Kambiz


grazie, buona fortuna anche a te Very Happy
ciao dall'Italia

#19:  Author: Mirage PostPosted: 15/11/05 10:43
    —
Thank you Ibc



DELPHI AREA -> DELPHI AREA's Products


output generated using printer-friendly topic mod. All times are GMT

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group