TSimpleGraph

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

TSimpleGraph

Postby perahi » March 2nd, 2005, 1:16 pm

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
perahi
Active Member
Active Member
 
Posts: 8
Joined: March 2nd, 2005, 1:13 pm

Postby Stefan » March 3rd, 2005, 11:03 am

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
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands

Postby perahi » March 3rd, 2005, 12:50 pm

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
perahi
Active Member
Active Member
 
Posts: 8
Joined: March 2nd, 2005, 1:13 pm

Postby Stefan » March 4th, 2005, 1:53 pm

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?
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands

Postby perahi » March 4th, 2005, 3:04 pm

Sorry :)
Here is a screenshot....
perahi
Active Member
Active Member
 
Posts: 8
Joined: March 2nd, 2005, 1:13 pm

Postby Stefan » March 4th, 2005, 3:14 pm

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
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands

Postby perahi » March 4th, 2005, 4:31 pm

ok...
Thank you for your answers

Perahi
perahi
Active Member
Active Member
 
Posts: 8
Joined: March 2nd, 2005, 1:13 pm

Postby Stefan » March 4th, 2005, 4:33 pm

Any time :)
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands

I think it is possible...

Postby kokkoras » March 12th, 2005, 11:32 pm

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

Postby perahi » March 14th, 2005, 8:57 am

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
perahi
Active Member
Active Member
 
Posts: 8
Joined: March 2nd, 2005, 1:13 pm

Postby kokkoras » March 15th, 2005, 9:27 am

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

Postby perahi » March 15th, 2005, 10:10 am

Thank you mr.

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

perahi
perahi
Active Member
Active Member
 
Posts: 8
Joined: March 2nd, 2005, 1:13 pm

Postby Vital » April 30th, 2005, 6:14 am

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.
Vital
Active Member
Active Member
 
Posts: 5
Joined: April 30th, 2005, 6:08 am

Postby Vital » May 4th, 2005, 2:37 am

There is who alive? I want to send You its variant of the expansion SimpleGraph
Vital
Active Member
Active Member
 
Posts: 5
Joined: April 30th, 2005, 6:08 am

Postby Stefan » May 4th, 2005, 7:25 am

Hi,

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

Regards,
Stefan
User avatar
Stefan
Moderator
Moderator
 
Posts: 128
Joined: September 27th, 2004, 9:40 am
Location: Tilburg, The Netherlands

Next

Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest