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

SimpleGraph

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 23/05/03 02:06    Post subject: SimpleGraph Reply with quote

Is it possible with simplegraph to just have it add an image when you click on a button say on the toolbar instead of using a shape, nix the shape and just add a image from a image list or something? if so how?

Jordan
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 23/05/03 10:54    Post subject: Reply with quote

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

Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 23/05/03 13:48    Post subject: Sorry my bad. Reply with quote

Well lets take the demo, instead of just clicking the circle or box button on the toolbar and click and drag to create that, instead of a circle, what about changing that to a predetermined image, so instead of adding a shape and then right clicking and adding a "background" it would already automaticly add the image when you add the shape, or perhaps just adding the image and no shape? I don't know if that makes more sense, i'm sorry if it doesn't

Jordan
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 24/05/03 12:04    Post subject: Reply with quote

Hi Jordan,

You can use the InsertNode method of TSimpleGraph to add a node. The function returns the new created node, so you can change its proprties as you wish.

Cheers,
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 24/05/03 21:47    Post subject: more Reply with quote

Okay, got that far, but now another question, can i have it so the nodes are movable but not resizable. Also instead of clicking to add the node, what about just clicking a button for a new node and it automaticly adds it to say the upper left and corner of the simplegraph with a specific size and have it none sizeable?

Jordan
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 25/05/03 01:59    Post subject: Reply with quote

Hi Jordan,

The component is there and you can do whatever you want.

You can perevent resizing the nodes by setting CanResize parameter of the OnCanMoveResizeNode event to false. You have also OnMouseDown event, insert the node there and set its width and height to the size that you want.

Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 26/05/03 05:59    Post subject: :) Reply with quote

Okay, sorry if i sound like a complete idiot, i usually only need pointing in the right direction to get the brain moving and you've done that, your component is great by the way and thank you for your help.

Jordan
Back to top
View user's profile Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 26/05/03 06:02    Post subject: One more thing :) Reply with quote

How would i go about adding an image to the canvas of simple graph, i know i just can't use TImage because it isn't on top. i just want to add a image to the center of the canvas of simplegraph and then add things that would appear above it, any suggestions would be great, thank you.

Jordan
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 26/05/03 12:36    Post subject: Reply with quote

For this purpose, you have to subclass your own node class from TGraphNode and then register it in the component.

Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 26/05/03 15:11    Post subject: OnMouseDown Reply with quote

When i try and use the OnMouseDown it doesn't seem to respond to anything, if i put a simple edit1.text := 'yes the mouse is down'; it doesn't change the text, nor does it respond to me trying to insert a node, perhaps i'm doing something wrong?

Jordan
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 26/05/03 19:33    Post subject: Reply with quote

The CommandMode property should be cmViewOnly otherwise the control handles the event.

Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 26/05/03 22:03    Post subject: Okay Reply with quote

okay, thanks, this is my last post
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 26/05/03 22:08    Post subject: Reply with quote

Why the last one?
Back to top
View user's profile Send e-mail Visit poster's website
moses
Member


Joined: 23 May 2003
Posts: 8

PostPosted: 27/05/03 04:51    Post subject: heh Reply with quote

Well i guess i lied.. i figure that you are ready to kill me or something and i don't want you to do that Smile
But your help has been great for the record and i thank you very much for it sir.

Jordan
Back to top
View user's profile Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 206

PostPosted: 27/05/03 16:03    Post subject: Reply with quote

I am glad that you are not serious about what you said.

If I didn't like to answer to your questions, firstly this forum was not here, secondly I didn't publish any component, and lastly I just didn't answer.

Cheers,
Kambiz
Back to top
View user's profile Send e-mail Visit poster's website
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
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 2.0.6 © 2001, 2002 phpBB Group