SimpleGraph 2.6 released!

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

Postby Kambiz » March 31st, 2006, 7:10 pm

kokkoras wrote:Regarding positioning and resizing, is it hard to allow then and constrain them to the group object's bounding rect? (Are the old/current move and resize commands constrained?)


The bounding rectangle of a group is union of bounding rectangle of its members.

By moving/resizing a group, its members move/resize relatively.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 31st, 2006, 7:40 pm

Kambiz wrote:
kokkoras wrote:So, client objects of a group are absolutely positioned on the SimpleGraph canvas (NOT relative to the Group position). Also I understand that client objects of a group are painted like before. Correct?


"NOT relative to the Group position" is wrong. Seems you wrote this phrase before reading my entire post.

P.S. I mean ZOrder is relative. X and Y Positions are absolute.


Let me put it straight: If I have a group with TopLeft say, (100,100) and inside it a rectNode 10 pixels lower and 10 pixels righter. What are the coordinates of the topLeft of the rectNode? Are they (10, 10) that is relative, OR (110, 110), that is absolute?

In either way, can I somehow (by code) reposition an object inside the group? If I have more that 2 nodes inside the group then there is enough space to move one of them.

Idea: why don't you use another simplegraph canvas to provide dynamic edit of the group? When editing is required, copy the inner of the group to a new instance of simplegraph, allow editting and when exiting this group edit mode, copy back the inner stuff to the original simplegraph. OK, it's complex. It was just an idea. :roll:

edit: I think the idea above is beyond the scope of the library and should be implemented by the app developer.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby kokkoras » March 31st, 2006, 8:00 pm

This may sound biased but I think that it would be nice to be able to size the group bounding box. Use the union of the inner bounding boxes as the default bounding box for the group, but allow the programmer to resize it by code.

Thinking it again, I believe that the group should be just like a rectangleNode with the extra property of a list that holds the inner objects. The group should be paint before the inner objects and should get priority on the mouse clicks. This approach allows the group to also have a label, its own color and/or background image, margins, etc. etc. It would be also easy to drag'n'drop nodes inside the group.

I guess you agree with the functionality but I am not sure on the coding requirements to implement it.

What do you think?

EDIT: :idea: What about adding groups inside a group? Maybe you should consider the current graphNode as the groupNode (that is, provide it with the ability to hold possible clild objects, even other groups). Then..... :?:

Well, it's bloody complex :? . We need well defined specs before putting the hands on it.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 31st, 2006, 8:42 pm

It's a long time you are looking for a container node, I know. :)

My implementation of group, is a group not a container. If you want to draw something as the background of the group, you can:

  1. Subclass TGraphGroup and override its Draw method.
  2. Use OnObjectBeforeDraw event and paint background of the group.
  3. Add a non-selectable node as the first member, and restrict bounding rectangle of other members to bouding rectangle of the node. Actually, there's no need to apply any restriction. It's because user cannot move or resize individual objects.
As I already mentioned in my previous post, user (and program) can move/ resize the group. In addition, size and position of each member can be changed by code.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 31st, 2006, 8:57 pm

U R the boss. Groups are fine and contribute to my plans. :D What is the time there?

edit: I heard on the news about an earthquake there. It also shakes frequently here in Greece.
edit2: TContainerNode = TGroupNode + UI :lol:
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » March 31st, 2006, 9:12 pm

The new government has revoked "daylight saving" at least for this year. :roll: Therefore, relative to Greece, if you are in daylight saving, I'm half hour ahead. Otherwise, one and half hour.

Iran is on a fault and time to time a tough Earthquake happens. :(
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » March 31st, 2006, 9:27 pm

Kambiz wrote:The new government has revoked "daylight saving" at least for this year. :roll:

:!: I thought this was out of consideration.

Kambiz wrote:Therefore, relative to Greece, if you are in daylight saving, I'm half hour ahead. Otherwise, one and half hour.

You are 1/2 hour ahead.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby kokkoras » April 1st, 2006, 6:18 pm

Kambiz, will it be possible to have a group inside other group? Just curious, no request.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » April 1st, 2006, 10:16 pm

I think I've already answered this question. :?: Yes, nested groups are allowed. Each group considers as a single object.

By the way, as you suggested, I added AllObjects, NodeObjects, LinkObjects, and GroupObjects properties. Objects, SelectedObjects, and DraggingObjects properties are kept untouched.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » April 1st, 2006, 11:47 pm

Kambiz wrote:I think I've already answered this question.

You are right :oops: Sorry!

Kambiz wrote:By the way, as you suggested, I added AllObjects, NodeObjects, LinkObjects, and GroupObjects properties. Objects, SelectedObjects, and DraggingObjects properties are kept untouched.

That's nice. Thanks.
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby kokkoras » April 3rd, 2006, 12:07 am

This is something discussed in another thread a few versions :lol: ago.
It is about the ability to hide the labels of links (well, this could be apllied to all nodes as well). My position was the following:

1. Have a showLabel boolean property for each link (and node).
2. Have a showLabels boolean property at the simpleGraph level.

The first will enable us to display only specific lebels. The second one will allow us to teporarily switch on/off all the labels _without_ affecting the individual objects' showLabel state.

So a label for an object is displayed if:
a) object.showLabel=true
b) simpleGraph.showLabels=true

And a question about groups: do they have a label?
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » April 3rd, 2006, 3:47 pm

1. goShowCaption value of TGraphObject.Options is provided for this purpose.
2. It easily can be achived by a call to ForEachObject to change Options property.
3. Each object has the Text property, but group doesn't display it.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby kokkoras » April 3rd, 2006, 4:05 pm

Kambiz wrote:1. goShowCaption value of TGraphObject.Options is provided for this purpose.
ok.
Kambiz wrote:2. It easily can be achived by a call to ForEachObject to change Options property.
This is not the same. I am talking about temporarily hidding ALL the labels without affecting the value of the property. If I do it in the way you mentioned then there is no way back.
Kambiz wrote:3. Each object has the Text property, but group doesn't display it.
I guess it's hard to display it.

For what you have said so far, it seems that the group object is not far from considering it as an ordinary TSimpleObject. If this is the case then why don't you provide it with a conditionaly visible boundary, color, etc. and have a code section for them in the draw/paint method of the component?
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby kokkoras » April 13th, 2006, 10:04 am

Kambiz, have you consider the #2 feature above? Is it clear why this is a kernel feature? It's only a property in the lib and an IF statement with 2 conditions before drawing the label.

Let me give you an example.

Lets say I have 100 objects and 40 of them have their label visible while the rest 60 have their label hidden. So far so good. Now suppose I want to print the graph without labels. In current lib I have to set 40 objects/labels to hidden, print the graph, then bring back those 40 labels (if ever remember which they were).

In the suggested 2 level approach, you call the canvas properties, set the global flag to hidden, print, and finaly restore the global flag to visible.

Regards
Fotis
User avatar
kokkoras
Moderator
Moderator
 
Posts: 317
Joined: March 12th, 2005, 11:19 pm
Location: Thessaloniki, Greece

Postby Kambiz » April 13th, 2006, 10:34 am

OK, I'll add this property.
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: No registered users and 1 guest

cron