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

TSimpleGraph

 
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products
View previous topic :: View next topic  
Author Message
perahi
Member


Joined: 02 Mar 2005
Posts: 6

PostPosted: 02/03/05 13:16    Post subject: TSimpleGraph Reply with quote

Hi!
1. How can I get multiline text at de links between objects in TSimpleGraph?
2. And is it possible to get multiple text areas in one node?

Thanx
Perahi
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 66
Location: Netherlands

PostPosted: 03/03/05 11:03    Post subject: Reply with quote

Hi,

1. As far as I know, it is not possible.
2. See 1.

But these could be good requests for the ExtGraph project; visit:
http://sourceforge.net/projects/extgraph and
go to the "Request Feature" section on that site and describe your request.

Cheers,
Stefan
Back to top
View user's profile Send e-mail
perahi
Member


Joined: 02 Mar 2005
Posts: 6

PostPosted: 03/03/05 12:50    Post subject: Reply with quote

thank you for your answer!
I have tried to modify the Demo, so that you can write mulitilinetext in the linkproperties.
But the outcome of this is two boxes between the lines, insted of lineshift.
I see theese boxes also when i rezise a node so that the text is to big to fit into the node.

Perahi
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 66
Location: Netherlands

PostPosted: 04/03/05 13:53    Post subject: Reply with quote

I don't know what you mean by

"But the outcome of this is two boxes between the lines, insted of lineshift.
I see theese boxes also when i rezise a node so that the text is to big to fit into the node."

Please explain?
Back to top
View user's profile Send e-mail
perahi
Member


Joined: 02 Mar 2005
Posts: 6

PostPosted: 04/03/05 15:04    Post subject: Reply with quote

Sorry Smile
Here is a screenshot....



example.GIF
 Description:
 Filesize:  3.6 KB
 Viewed:  169 Time(s)




Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 66
Location: Netherlands

PostPosted: 04/03/05 15:14    Post subject: Reply with quote

Aha... those boxes!
That's one for the CR and one for the LF...

You've only changed the TEdit to a TMemo, which does indeed allow you to enter more lines but that doesn't mean the property it's setting and the drawing engine, drawing that property's value, know what to do with it.

In short, you / we'll need to update the part that draws the text you enter, so that it support multiple lines. As I said, you could fill in a Feature Request at SourceForge: go here
and click "Submit new" to create a new request.

Cheers,
Stefan
Back to top
View user's profile Send e-mail
perahi
Member


Joined: 02 Mar 2005
Posts: 6

PostPosted: 04/03/05 16:31    Post subject: Reply with quote

ok...
Thank you for your answers

Perahi
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 66
Location: Netherlands

PostPosted: 04/03/05 16:33    Post subject: Reply with quote

Any time Smile
Back to top
View user's profile Send e-mail
kokkoras
Member


Joined: 12 Mar 2005
Posts: 2

PostPosted: 12/03/05 23:32    Post subject: I think it is possible... Reply with quote

...by altering the code in the function TGraphLink.GetTextRegion.

DrawTextFlags control how the bounding box for the text is calculated. It is used later on in the call to DrawText method. This method does not draw the text actualy, because it uses the extra flag DT_CALCRECT which tells her not to draw but to calculate the bounding box (check DrawText in Win 32 Programmer's Reference for details on these flags).

I haven't try the above. But I came to this conclusion by playing with the TGraphNode.GetMaxTextRect function, to resolve the ... issue (truncated text at various zoom states with no obvious reason).
Back to top
View user's profile
perahi
Member


Joined: 02 Mar 2005
Posts: 6

PostPosted: 14/03/05 08:57    Post subject: Reply with quote

Thx for your answer..
Did you mangage to solve the ... issue? Can you please show me how?


As far as I understand, the TGraphLink.GetTextRegion function supports multiline since the DT_SINGLELINE flag is not set. TGraphLink.DrawText uses the TextOut function, while TGraphNode.DrawText uses the Windows.DrawText without the DT_CALCRECT flag.
Isnt the TextOut function capable of printing multiline??

perahi
Back to top
View user's profile
kokkoras
Member


Joined: 12 Mar 2005
Posts: 2

PostPosted: 15/03/05 09:27    Post subject: Reply with quote

perahi wrote:
Thx for your answer..
Did you mangage to solve the ... issue? Can you please show me how?
perahi


Go to TGraphNode.GetTextRect function. Locate the code below:

if Result.Right > MaxTextRect.Right then
Result.Right := MaxTextRect.Right;

And change it to this:

// if Result.Right > MaxTextRect.Right then
Result.Right := MaxTextRect.Right+1;

That is, comment out the condition (if-part) and add always 1
to the assignment. Don't forget to recompile / reinstall the
component.

perahi wrote:

As far as I understand, the TGraphLink.GetTextRegion function supports multiline since the DT_SINGLELINE flag is not set. TGraphLink.DrawText uses the TextOut function, while TGraphNode.DrawText uses the Windows.DrawText without the DT_CALCRECT flag.
Isnt the TextOut function capable of printing multiline??
perahi


I have no idea. If DrawText for graph nodes supports multiline then I think it will be easy to have the same in DrawText for links.

BTW, is it possible to trace into the source of SimpleGraph (add breakpoints, etc.) while working on a project that uses the TSimpleGraph component???

Fotis
Back to top
View user's profile
perahi
Member


Joined: 02 Mar 2005
Posts: 6

PostPosted: 15/03/05 10:10    Post subject: Reply with quote

Thank you mr.

Yes this is possible. You just open the sourcecode in your project and add breakpoint as usual...

perahi
Back to top
View user's profile
Display posts from previous:   
   Reply to topic    DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Page 1 of 1

 
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 2.0.6 © 2001, 2002 phpBB Group