DELPHI AREA
MESSAGE BOARD
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   Watched TopicsWatched Topics     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SimpleGraph 2.5 released!
Goto page Previous  1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 27/03/06 12:15    Post subject: Reply with quote

Kambiz wrote:
What do you think about having OnObjectMouseEnter and OnObjectMouseLeave events?


It's getting too detailed. I am not sure. I thought that there were such events already. How does the tooltip apears?

Does this event fire when dragging another node and entering/leaving the bounding rect of another?

How about the 2nd post in this tread?

_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 27/03/06 12:23    Post subject: Reply with quote

kokkoras wrote:
Thank you!

If you are still in good mood please consider adding a method to equally size selected nodes (like those for alignment you added in 2.5).

size widths of selected to widest/narrowest node
size heights of selected to tallest/shortest node


I'm waiting for a good mood. Wink

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 27/03/06 12:32    Post subject: Reply with quote

Kambiz wrote:
I'm waiting for a good mood. Wink


Laughing Laughing Laughing Laughing Laughing

_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
HPW
Senior Member


Joined: 25 Feb 2006
Posts: 120
Location: Germany

PostPosted: 27/03/06 12:43    Post subject: Reply with quote

Quote:
What do you think about having OnObjectMouseEnter and OnObjectMouseLeave events?


Sounds very usefull to me!
More control than OnInfoTip alone.
And OnMouseMove of cource.

_________________
Hans-Peter
Back to top
View user's profile Send private message
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 27/03/06 12:44    Post subject: Reply with quote

kokkoras wrote:
Kambiz wrote:
What do you think about having OnObjectMouseEnter and OnObjectMouseLeave events?


It's getting too detailed. I am not sure. I thought that there were such events already. How does the tooltip apears?

Does this event fire when dragging another node and entering/leaving the bounding rect of another?

How about the 2nd post in this tread?


A usage of OnObjectMouseEnter and OnObjectMouseLeave could be:

Code:
procedure TMainForm.SimpleGraphObjectMouseEnter(Graph: TSimpleGraph;
  GraphObject: TGraphObject);
var
  Rect: TRect;
begin
  if GraphObject is TRectangularNode then
  begin
    Rect := GraphObject.BoundsRect;
    InflateRect(Rect, -4, -4);
    Rect.TopLeft := SimpleGraph.GraphToClient(Rect.Left, Rect.Top);
    Rect.BottomRight := SimpleGraph.GraphToClient(Rect.Right, Rect.Bottom);
    Memo1.BoundsRect := Rect;
    Memo1.Color := GraphObject.Brush.Color;
    Memo1.Font := GraphObject.Font;
    Memo1.Alignment := TGraphNode(GraphObject).Alignment;
    Memo1.Text := GraphObject.Text;
    Memo1.Visible := True;
  end;
end;

procedure TMainForm.SimpleGraphObjectMouseLeave(Graph: TSimpleGraph;
  GraphObject: TGraphObject);
begin
  if Memo1.Visible then
  begin
    GraphObject.Text := Memo1.Text;
    Memo1.Visible := False;
  end;
end;

The above code enables user to edit text of a Rectangular Node directly on the graph.

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 27/03/06 12:48    Post subject: Reply with quote

I think OnObjectMouseEnter and OnObjectMouseLeave events are more usefull to show/hide speed buttons on the objects.
_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 27/03/06 13:56    Post subject: Reply with quote

Kambiz wrote:
A usage of OnObjectMouseEnter and OnObjectMouseLeave could be:

Code:
procedure TMainForm.SimpleGraphObjectMouseEnter(Graph: TSimpleGraph;
  GraphObject: TGraphObject);
var
  Rect: TRect;
begin
  if GraphObject is TRectangularNode then
  begin
    Rect := GraphObject.BoundsRect;
    InflateRect(Rect, -4, -4);
    Rect.TopLeft := SimpleGraph.GraphToClient(Rect.Left, Rect.Top);
    Rect.BottomRight := SimpleGraph.GraphToClient(Rect.Right, Rect.Bottom);
    Memo1.BoundsRect := Rect;
    Memo1.Color := GraphObject.Brush.Color;
    Memo1.Font := GraphObject.Font;
    Memo1.Alignment := TGraphNode(GraphObject).Alignment;
    Memo1.Text := GraphObject.Text;
    Memo1.Visible := True;
  end;
end;

procedure TMainForm.SimpleGraphObjectMouseLeave(Graph: TSimpleGraph;
  GraphObject: TGraphObject);
begin
  if Memo1.Visible then
  begin
    GraphObject.Text := Memo1.Text;
    Memo1.Visible := False;
  end;
end;

The above code enables user to edit text of a Rectangular Node directly on the graph.


And where does this memo1 control live? Is it a public control for that purpose? Is it created (and then destroyed) on purpose?

_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 27/03/06 14:06    Post subject: Reply with quote

It's a TMemo dropped on SimpleGraph control.

SimpleGraph accepts child controls.

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 27/03/06 14:35    Post subject: Reply with quote

ok, I think we talked about them too much. The idea is fine. If it's easy to implement just drop the events and let the developer deside for the usage.
========================

Please do not take the next requests seriously:

Looking at other components of yours, how about adding gradient colloring? (please, don't)

Regarding the polyline arrows: do you know the maths to draw splines between breakpoints? For 3 points A, B, and C, there must be 2 equations, say f1(x) and f2(x) for which the following are known:

f1(A), f1(B), f2(B), f2(C): f1 and f2 satisfy (X,Y) of A, B, C
f1'(A), f2'(C): first derivations can be set ad-hoc (how the line starts/ends)
f1(B)= f2(B) : boundary condition for f1, f2. B is common point.
f1'(B)=f2'(B): boundary condition for derivations of f1, f2

By solving this system we get nice splines for arrows.


_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 27/03/06 19:15    Post subject: Reply with quote

kokkoras wrote:
Regarding the polyline arrows: do you know the maths to draw splines between breakpoints? For 3 points A, B, and C, there must be 2 equations, say f1(x) and f2(x) for which the following are known:

f1(A), f1(B), f2(B), f2(C): f1 and f2 satisfy (X,Y) of A, B, C
f1'(A), f2'(C): first derivations can be set ad-hoc (how the line starts/ends)
f1(B)= f2(B) : boundary condition for f1, f2. B is common point.
f1'(B)=f2'(B): boundary condition for derivations of f1, f2

By solving this system we get nice splines for arrows.

It's much easier to use PolyBezier Windows API (Bézier curves).

I'm more interested to add grouping support to the control. But it's scary to begin something that needs some efforts.

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 27/03/06 20:50    Post subject: Reply with quote

Kambiz wrote:
I'm more interested to add grouping support to the control. But it's scary to begin something that needs some efforts.


I had told you once about the issue of drawing links on top of nodes because I wanted to have, at least visualy, a nesting situation, that is, graphs inside nodes. I think that drawing wise, we just need the graph to get painted after the container node. Of course, management wise, we need some new structures. I aggre that it's complicated and even thinking of it abstractly is scary. I hope to get my hands back on my stalled project seriously during the summer.

_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 28/03/06 12:51    Post subject: Reply with quote

What about ZOrder and DrawOrder properties? Cannot be managed by these properties?

By the way, could you please attach an image regarding to your last post about splines and arrows? Maybe I didn't get what you meant.

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 28/03/06 13:15    Post subject: Reply with quote

Kambiz wrote:
What about ZOrder and DrawOrder properties? Cannot be managed by these properties?

By the way, could you please attach an image regarding to your last post about splines and arrows? Maybe I didn't get what you meant.


Visually wise, it can be handled. But I need some extra functionality. For example, when moving the container node I want all the internals to follow. I also want this nesting situation recursive. That is have node A containing Node B and inside B I want graph G and inside node GA of graph G I want........ got it?

In my app, the objects are Concepts (Rect Nodes), Relations (Oval Nodes), Arrows (Links), Graphs (interconected Concepts, Relations and Arrows). What is missing are NestingNodes, that is, a special kind of concept object (or a new object type, anyway) that has other concepts or graphs inside it. Here it comes the need for nesting.

I think you were talking abstractly about the ability to group simplegraph objects. That's fine. I can use them to define the visualization of my NestingNode objects.

So, a groupNode should have at least a container (TList?) with all the simple objects it owns, and should be created on the fly by selecting some objects and issuing a group command. I am not sure though if special draw handling is required. These groupNodes must be also stored in the disk.

As you mentioned, it's a complex task that requires some time.

BTW, in my app I store my objects in an XML file and re-create them when loading. I am not using your save facilities, although I am considering utilizing them in the future, in order to remove all the visual aspects from my XML file (position, dims, colors, fonts, etc).

Regards

_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
kokkoras
Senior Member


Joined: 12 Mar 2005
Posts: 250
Location: Thessaloniki, Greece

PostPosted: 28/03/06 13:32    Post subject: Reply with quote

Kambiz wrote:
By the way, could you please attach an image regarding to your last post about splines and arrows? Maybe I didn't get what you meant.


I basicaly recall the way ACAD draws splines. It asks for (X,Y) points (breakpoints) and the direction (1st derivation) at the begining and the end of the line. The parts of the line (between succesive points) are (if my memory serves well Confused ) 2nd order polynomial equations (the f1, f2 in my past post). These equations have some functors that must be defined for the spline to get precise form. This requires to solve a set of equations (those mentioned in the other post). The problenm is that this set of equations must be somehow solved, probably with arithmetic methods.

I have no idea though on what is available in Win API about beziers.



Untitled.gif
 Description:
 Filesize:  1.9 KB
 Viewed:  998 Time(s)





_________________
Fotis
Back to top
View user's profile Send private message Visit poster's website
Kambiz
Administrator


Joined: 07 Mar 2003
Posts: 1044
Location: Tehran, Iran

PostPosted: 28/03/06 14:00    Post subject: Reply with quote

  • I also think having groups resolves your case. To be honest, while grouping is not implemented, I'm not happy about SimpleGraph.
  • Converting save format of SimpleGraph to XML is another task should be done. SVG format is the best choice, but I think it's easier to have a private format and use RTTI to save published properties.
  • In Bézier curves for each point there are two control points. So, it's more or less like what you described.

_________________
Kambiz
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

Add to favorites

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group