## The new GraphLink class and Mouse issue (SimpleGraph)

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.
No Retreat Baby, No... Surrender.
(Bruce Springsteen)

All Quotes from Kambiz:
RightClick and DoubleClick doesn't do their own default behaviors if an object is dragging.

Ahaha! You don't care using Right button Isn'it?

Dragging an edge or caption moves the object entirly.

Alt+Click on a point, deletes the point.

LeftClick in the point>RightClick>point deleted.

Alt+Click on an edge, inserts a breakpoint at the clicked point. For convenience, Alt+Drag does the same.

LeftClick on the edge>RightClick>point inserted.

Dragging a point (eighter endpoint or breakpoint) moves the point. While dragging the point, right click insteats a new breakpoint.

If an endpoint drops on an object, the link is established.

Forgetting this questions; this is going to be the best free-component ever made :)
elias
Senior Member

Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Here is the new SimpleGraph demo application.

Please look at "Help/Using Keyboard and Mouse" menu for keyboard and mouse actions.

Cheers
Attachments
SGDemo.zip
SGDemo 2.0 Beta
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

elias wrote:...this is going to be the best free-component ever made

This IS the best free-component ever made. The demo rules.

Thanks Kambiz.

kokkoras
Moderator

Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Just 3 notes:

1. When a link is selected you can't start a move by d'n'd.

2. When the breakpoints of a link are locked and the endpoints are not and you start to move the link the second point and the one before the last are also moving (they are supposed to be locked).

3. Does the text of a link belongs to a particular branch? I can not figure out the policy you use to place this text.

Great job man. Well done and thanks again.

kokkoras
Moderator

Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

1. Why? Only links with the following properties cannot be moved:-

• The link has no breakpoint, and at least one of the endpoints is either linked or fixed.
• The link has breakpoint, but is fixed.
2. Obviously this is a bug.
3. There's an integer property (TextPosition) for this purpose, and indicates the index of the line that the text will attach to it. The default value is -1, which means the longest line. In the demo program, you can change position of the caption using "Link Properites Dialog\Label Position".
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Prooved over the exe-demo:

Kind-Bugs:
-Locked Nodes may be modified with Shift+arrows & Ctrl+Arrows
-Moving nodes Don't Snap to grid in SnapToGrid Mode. The same moving marker (at nodes & links); (try moving quickly).
-Shift key to continue creating links or nodes (without selecting the action again) doesn't work
-Changing Label Position gives me an "Invalid float operation" and after this I cannot see the text until I save/load again.
-Once I tried to hook a link to a node, but they worked like unhooked until I save/load again. Don't know which the case were, yet.

Other:
-Link to link seem to me any skillful; I'd prefer the link having a center(dynamic center, as nodes) to hook. I'm thinking too about resources weight and the dificult to derive new link-classes with this behavior. What do you think?

I see too that you have modified any things you didn't say :) I like, in general.

Thats everything; good work.

Update: Link doesn't shrink and grow proportionaly
elias
Senior Member

Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Thanks Kambiz. This is a wonderful component.
Is there a chance to get more control over Resize and rotation? (Rotating in a free angle and resizing in a user defined ratio (perhaps via mouse?))

And by the way - I noticed an unproportional result by enlarging a link (see attachment: The left polygon is a enlarged version of the left one. Theres a noticable difference)

P_G
Attachments
SG1.jpg (52.52 KiB) Viewed 4448 times
P_G
Senior Member

Posts: 51
Joined: June 14th, 2004, 11:13 am
Location: Germany

elias wrote:-Locked Nodes may be modified with Shift+arrows & Ctrl+Arrows

I couldn't regenerate the case.

elias wrote:-Moving nodes Don't Snap to grid in SnapToGrid Mode. The same moving
marker (at nodes & links); (try moving quickly).

The bug fixed.

I couldn't get the meaning, sorry!

elias wrote:-Shift key to continue creating links or nodes (without selecting the action again) doesn't work

It's not supported. Using provided events you can make it using your own prefered mouse and keyboard combinations.

elias wrote:-Changing Label Position gives me an "Invalid float operation" and after this I cannot see the text until I save/load again.

The bug fixed.

elias wrote:-Once I tried to hook a link to a node, but they worked like unhooked until I save/load again. Don't know which the case were, yet.

The bug fixed.

elias wrote:-Link to link seem to me any skillful; I'd prefer the link having a center(dynamic center, as nodes) to hook. I'm thinking too about resources weight and the dificult to derive new link-classes with this behavior. What do you think?

In my point of view, it's somting useful. Without that you can't have a connection branch. The new link classes may need to override two protected methods (GetFixHookAnchor and GetRelativeHookAnchor) to provide the coordinate of two links intersection for the interface. In the other hand, using Options property or event you can change the default behavior.

elias wrote:I see too that you have modified any things you didn't say I like, in general.

Actually there are many changes in the code to make driving new classes easier. I hope these changes help Extended Graph team. Beisdes what you see in SGDemo, there are other new events and properties.

elias wrote:Link doesn't shrink and grow proportionaly
P_G wrote:I noticed an unproportional result by enlarging a link (see attachment: The left polygon is a enlarged version of the left one. Theres a noticable difference)

This bug fixed too.

P_G wrote:Is there a chance to get more control over Resize and rotation? (Rotating in a free angle and resizing in a user defined ratio (perhaps via mouse?))

The following methods are provided to rotate and scale the links:-

Code: Select all
function Rotate(const Angle {in radians}: Double): Boolean;function Scale(const Factor {in percent}: Double): boolean;

However, there's no mouse or keyboard interface for doing these operations.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

kokkoras wrote:1. When a link is selected you can't start a move by d'n'd.

Maybe it wasn't clear enough.
1. Create 2 nodes.
3. Alt+click on the link to create a breakpoint.
4. Deselect all (if selected)
5. click on the link (and release the mouse): the link is selected
6. Press down the left mouse button on the link and without releasing it try to drag the link. It doesn't move. (THIS IS THE ISSUE)
7. Deselect all.
8. Click on the link without releasing the mouse button and start dragging. The link is selected and is moving.

I think 6 should work like 8.

Fotis
Last edited by kokkoras on February 18th, 2006, 10:27 pm, edited 1 time in total.

kokkoras
Moderator

Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

### Note to all the folks here

People (including myself),

Let's not overcharge Kambiz with anything but bug reports. He desided to invest his valuable time to improve the library. We should not request things unless these are very related to what is carently implemented or we were asked to do so.

Fotis

kokkoras
Moderator

Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

kokkoras wrote:1. When a link is selected you can't start a move by d'n'd.

That was a bug, which is fixed now.

Thank you!
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Here is the update of SGDemo.

Please let me know if it's time to begin update the control's documentation and publish the code.

Thank you
Attachments
SGDemo.zip
SGDemo 2.0 Beta 2
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Kambiz wrote:
elias wrote:-Once I tried to hook a link to a node, but they worked like unhooked until I save/load again. Don't know which the case were, yet.

The bug fixed.

I'm impressed you understood what i was meaning!!

Kambiz wrote:
elias wrote:I see too that you have modified any things you didn't say :) I like, in general.

Actually there are many changes in the code to make driving new classes easier. I hope these changes help Extended Graph team. Beisdes what you see in SGDemo, there are other new events and properties.

I was looking the project weeks ago; I think it could be found interesting code. Personally I found interesting the BezierLink Class... I'll watch again.
Attachments
Dibujo.JPG (103.63 KiB) Viewed 4386 times
elias
Senior Member

Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Hi Kambiz,

[quote="Kambiz"]
[quote="P_G"]
Is there a chance to get more control over Resize and rotation? (Rotating in a free angle and resizing in a user defined ratio (perhaps via mouse?))
[/quote]
The following methods are provided to rotate and scale the links:-

[code]function Rotate(const Angle {in radians}: Double): Boolean;
function Scale(const Factor {in percent}: Double): boolean;[/code]
However, there's no mouse or keyboard interface for doing these operations.[/quote]

I don't think a mouse/keyboard interface is really needed for scaling, but if one really wants it, I suppose it could be done. Here are 2 alternatives:

Alternative 1)

i) Mouse interface: Select the node. Press Ctrl while rotating the mouse wheel.

ii) Keyboard interface: Select the node. Press Ctrl + 'UpKey' to scale up, or Ctrl + 'DownKey' to scale down. Ctrl + '0' combination resets the scaling.

Alternative 2)

Select the node. Right click for 'Properties' and adjust the scale in a slider in the Properties window.

Obviously, Alternative 2 is easier to implement --even I can implement this --, while Alternative 1 is (arguably) more user frinedly.

Anyway, I am more interested in rotation which needs your expertise. Here's how I would like to see it happen:

i) Mouse interface: Select the node. While pressing Shift on one of the Grabboxes (those little boxes that appear around the selection rectange) move the mouse. This rotates the selection rectange around it center.

ii) Keyboard interface: I have no idea how to handle this, sorry

Incidentally, SGDemo v2b2 does not seem to show the link lines. Is this by design (i.e. is there some option to check) or is it a missing feature.
Active Member

Posts: 22
Joined: February 20th, 2006, 12:47 pm

In the previous versions of SimpleGraph, while an object was inserting or a link was dragging, a class method used to draw a draft image of the object.

In the current release, a dragging object appears with all of its details. To show dargging object, the control highlights tehm with a not pen. The width of pen depends on width of object's pen and follows the following rule:

Code: Select all
if Object.Pen.Width >= 2 then  Highlight.Pen.Width := (Object.Pen.Width - 1) div 2else  Highlight.Pen.Width := Object.Pen.Width + 2;

P.S. When a point of a link is dragging, only edges that are connected to the point will be highlighted and fixed stuffs appear as normal.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

PreviousNext

### Who is online

Users browsing this forum: No registered users and 1 guest