The new GraphLink class and Mouse issue (SimpleGraph)

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

Postby elias » February 15th, 2006, 10:17 am

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
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby Kambiz » February 15th, 2006, 8:41 pm

Here is the new SimpleGraph demo application.

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

Also, don't miss to look at the new menu items for links' popup menu.

Cheers
Attachments
SGDemo.zip
SGDemo 2.0 Beta
(434.16 KiB) Downloaded 120 times
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » February 16th, 2006, 7:28 am

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.
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby kokkoras » February 16th, 2006, 7:35 am

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.
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » February 16th, 2006, 11:26 am

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

Postby elias » February 16th, 2006, 11:36 am

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).
-Links previous images not always agrees with the created Links.
-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
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby P_G » February 17th, 2006, 6:43 pm

Thanks Kambiz. This is a wonderful component. :D
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
SG1.jpg (52.52 KiB) Viewed 5201 times
P_G
Senior Member
Senior Member
 
Posts: 51
Joined: June 14th, 2004, 11:13 am
Location: Germany

Postby Kambiz » February 18th, 2006, 1:51 pm

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.

elias wrote:-Links previous images not always agrees with the created Links.

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

Postby kokkoras » February 18th, 2006, 10:19 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.
2. Link then witha direct link.
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.
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Note to all the folks here

Postby kokkoras » February 18th, 2006, 10:23 pm

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
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » February 18th, 2006, 11:15 pm

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

Postby Kambiz » February 19th, 2006, 3:04 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
(435.74 KiB) Downloaded 133 times
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby elias » February 21st, 2006, 12:18 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
About Comments
Dibujo.JPG (103.63 KiB) Viewed 5139 times
elias
Senior Member
Senior Member
 
Posts: 90
Joined: November 8th, 2005, 12:09 pm
Location: Galicia, Spain

Postby Adem » February 22nd, 2006, 1:28 am

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.
Adem
Active Member
Active Member
 
Posts: 22
Joined: February 20th, 2006, 12:47 pm

Postby Kambiz » February 23rd, 2006, 2:13 am

elias wrote:Links previous images not always agrees with the created Links.

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

PreviousNext

Return to DELPHI AREA Projects

Who is online

Users browsing this forum: Bing [Bot] and 3 guests

cron