| View previous topic :: View next topic |
| Author |
Message |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 23/05/03 02:06 Post subject: SimpleGraph |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 23/05/03 10:54 Post subject: |
|
|
Sorry, but I couldn't get what you mean.
Kambiz |
|
| Back to top |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 23/05/03 13:48 Post subject: Sorry my bad. |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 24/05/03 12:04 Post subject: |
|
|
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 |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 24/05/03 21:47 Post subject: more |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 25/05/03 01:59 Post subject: |
|
|
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 |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 26/05/03 05:59 Post subject: :) |
|
|
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 |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 26/05/03 06:02 Post subject: One more thing :) |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 26/05/03 12:36 Post subject: |
|
|
For this purpose, you have to subclass your own node class from TGraphNode and then register it in the component.
Kambiz |
|
| Back to top |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 26/05/03 15:11 Post subject: OnMouseDown |
|
|
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 |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 26/05/03 19:33 Post subject: |
|
|
The CommandMode property should be cmViewOnly otherwise the control handles the event.
Kambiz |
|
| Back to top |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 26/05/03 22:03 Post subject: Okay |
|
|
| okay, thanks, this is my last post |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 26/05/03 22:08 Post subject: |
|
|
| Why the last one? |
|
| Back to top |
|
 |
moses Member
Joined: 23 May 2003 Posts: 8
|
Posted: 27/05/03 04:51 Post subject: heh |
|
|
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 |
|
| Back to top |
|
 |
Kambiz Administrator

Joined: 07 Mar 2003 Posts: 204
|
Posted: 27/05/03 16:03 Post subject: |
|
|
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 |
|
 |
|