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

TSimpleGraph
Goto page 1, 2  Next
 
   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: 8

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: 90
Location: Belgium, Antwerp

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: 8

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: 90
Location: Belgium, Antwerp

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: 8

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

Sorry Smile
Here is a screenshot....
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 90
Location: Belgium, Antwerp

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: 8

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: 90
Location: Belgium, Antwerp

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: 8

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: 8

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
Vital
Member


Joined: 30 Apr 2005
Posts: 5

PostPosted: 30/04/05 06:14    Post subject: Reply with quote

Hello Kkambizambiz. I already wrote you once on cause SimpleGraph. I have heard on put that this project will is continued in Extgraph - a visualization of the functioning the industrial systems. I just and tried on base of your component this do - a degree project, Moscow aircraft institute, branch, city Baikonur. I have done much changes, but one beside me is not got perfect: SimpleGraph powerfully holds up, when graphic object overruns the seen part and appear the bands of the rolling. I think, this because of TSimpleGraph.DrawBackground, more exactly in lines
Rect := Canvas.ClipRect;
Canvas.FillRect(Rect);
when no bands of the rolling, that, for instance, Rect=(0, 0 , 1024, 800), but when appear the bands of the rolling, that Rect will more, for instance Rect = (0, 0, 5000, 4000), here is this, probably, long works. Can be you ?????? to prompt, what is wrong.
If you will interest, as I used your component, that I try you its show
Excuse me on my english.
Back to top
View user's profile
Vital
Member


Joined: 30 Apr 2005
Posts: 5

PostPosted: 04/05/05 02:37    Post subject: Reply with quote

There is who alive? I want to send You its variant of the expansion SimpleGraph
Back to top
View user's profile
Stefan
Junior Member


Joined: 27 Sep 2004
Posts: 90
Location: Belgium, Antwerp

PostPosted: 04/05/05 07:25    Post subject: Reply with quote

Hi,

Could you send the proof-of-concept code to my personal address?
My address is stefanmelis(at)yahoo.(c)om.

Regards,
Stefan
Back to top
View user's profile Send e-mail
Display posts from previous:   
   Reply to topic       DELPHI AREA Forum Index -> DELPHI AREA's Products All times are GMT
Goto page 1, 2  Next
Page 1 of 2

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