SimpleGraph

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

SimpleGraph

Postby moses » May 23rd, 2003, 2:06 am

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
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 23rd, 2003, 10:54 am

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

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

Sorry my bad.

Postby moses » May 23rd, 2003, 1:48 pm

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
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 24th, 2003, 12:04 pm

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

more

Postby moses » May 24th, 2003, 9:47 pm

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
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 25th, 2003, 1:59 am

Hi Jordan,

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

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

:)

Postby moses » May 26th, 2003, 5:59 am

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
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

One more thing :)

Postby moses » May 26th, 2003, 6:02 am

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
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 26th, 2003, 12:36 pm

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

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

OnMouseDown

Postby moses » May 26th, 2003, 3:11 pm

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
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 26th, 2003, 7:33 pm

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

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

Okay

Postby moses » May 26th, 2003, 10:03 pm

okay, thanks, this is my last post
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 26th, 2003, 10:08 pm

Why the last one? :shock:
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

heh

Postby moses » May 27th, 2003, 4:51 am

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 :)
But your help has been great for the record and i thank you very much for it sir.

Jordan
moses
Active Member
Active Member
 
Posts: 8
Joined: May 23rd, 2003, 2:04 am

Postby Kambiz » May 27th, 2003, 4:03 pm

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. :wink:

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


Return to DELPHI AREA Projects

Who is online

Users browsing this forum: No registered users and 3 guests

cron