Add the FreezeBottomRight to the property of SimpleGraph

Please post bug reports, feature requests, or any question regarding the DELPHI AREA products here.

Add the FreezeBottomRight to the property of SimpleGraph

Postby Mirage » November 1st, 2005, 11:44 am

Hello!

Please how to add a FreezeBottomRight property for SimpleGraph.


Thank you in advance!
User avatar
Mirage
Junior Member
Junior Member
 
Posts: 44
Joined: October 26th, 2005, 11:41 am

Postby lbc » November 2nd, 2005, 9:30 am

Hello Mirage
you may take a look at the following thread

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

Hope it helps
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Add the FreezeBottomRight to simplegraph

Postby Mirage » November 8th, 2005, 7:07 am

Hello

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

Thank you in advance
User avatar
Mirage
Junior Member
Junior Member
 
Posts: 44
Joined: October 26th, 2005, 11:41 am

Postby lbc » November 8th, 2005, 3:35 pm

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
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Postby Kambiz » November 10th, 2005, 2:40 pm

Hi,

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

Cheers
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby lbc » November 11th, 2005, 11:23 am

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!
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Postby Kambiz » November 11th, 2005, 5:24 pm

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
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby lbc » November 13th, 2005, 4:15 pm

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

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
Attachments
sg1_1.jpg
Simple example:
a simplegraph with Graphcontraints on a panel
zoom 100%
sg1_1.jpg (44.79 KiB) Viewed 8065 times
sg1_2.jpg
zoomed in
sg1_2.jpg (39.02 KiB) Viewed 8065 times
sg1_3.jpg
now zooming also the graph boundaries
sg1_3.jpg (47.56 KiB) Viewed 8065 times
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Postby Kambiz » November 13th, 2005, 5:11 pm

Sorry, but I couldn't get what you mean. :oops:

Can ZoomGraph method be what you are talking about?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby lbc » November 13th, 2005, 7:54 pm

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!
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Postby Kambiz » November 14th, 2005, 6:20 am

I guess you mean AutoSize, right?
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby lbc » November 14th, 2005, 10:13 am

Hi Kambiz
yes, basically something that resizes the graph dimensions according to the current zoom values :)

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!
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Postby Kambiz » November 14th, 2005, 3:30 pm

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
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby lbc » November 14th, 2005, 4:16 pm

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) :D
thanks again
lbc
Junior Member
Junior Member
 
Posts: 48
Joined: February 4th, 2004, 7:50 am
Location: Italy

Postby Kambiz » November 14th, 2005, 7:59 pm

Nice to hear that! :wink:

Buona fortuna
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Next

Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 2 guests