DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Add the FreezeBottomRight to the property of SimpleGraph
Goto page 1, 2  Next
 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
Mirage
Member


Joined: 26 Oct 2005
Posts: 42

PostPosted: 01/11/05 11:44    Post subject: Add the FreezeBottomRight to the property of SimpleGraph Reply with quote

Hello!

Please how to add a FreezeBottomRight property for SimpleGraph.


Thank you in advance!
Back to top
View user's profile Send private message
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 02/11/05 09:30    Post subject: Reply with quote

Hello Mirage
you may take a look at the following thread

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

Hope it helps
Back to top
View user's profile Send private message
Mirage
Member


Joined: 26 Oct 2005
Posts: 42

PostPosted: 08/11/05 07:07    Post subject: Add the FreezeBottomRight to simplegraph Reply with quote

Hello

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

Thank you in advance
Back to top
View user's profile Send private message
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 08/11/05 15:35    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 10/11/05 14:40    Post subject: Reply with quote

Hi,

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

Cheers

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 11/11/05 11:23    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 11/11/05 17:24    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 13/11/05 16:15    Post subject: Reply with quote

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:  2264 Time(s)





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





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




Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 13/11/05 17:11    Post subject: Reply with quote

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

Can ZoomGraph method be what you are talking about?

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 13/11/05 19:54    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 14/11/05 06:20    Post subject: Reply with quote

I guess you mean AutoSize, right?
_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 14/11/05 10:13    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 14/11/05 15:30    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
lbc
Member


Joined: 04 Feb 2004
Posts: 48
Location: Italy

PostPosted: 14/11/05 16:16    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 14/11/05 19:59    Post subject: Reply with quote

Nice to hear that! Wink

Buona fortuna
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Goto page 1, 2  Next
Page 1 of 2

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group