Page 1 of 2
TSimpleGraph

Posted:
March 2nd, 2005, 1:16 pm
by perahi
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

Posted:
March 3rd, 2005, 11:03 am
by Stefan
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

Posted:
March 3rd, 2005, 12:50 pm
by perahi
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

Posted:
March 4th, 2005, 1:53 pm
by Stefan
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?

Posted:
March 4th, 2005, 3:04 pm
by perahi
Sorry
Here is a screenshot....

Posted:
March 4th, 2005, 3:14 pm
by Stefan
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

Posted:
March 4th, 2005, 4:31 pm
by perahi
ok...
Thank you for your answers
Perahi

Posted:
March 4th, 2005, 4:33 pm
by Stefan
Any time

I think it is possible...

Posted:
March 12th, 2005, 11:32 pm
by kokkoras
...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).

Posted:
March 14th, 2005, 8:57 am
by perahi
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

Posted:
March 15th, 2005, 9:27 am
by kokkoras
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

Posted:
March 15th, 2005, 10:10 am
by perahi
Thank you mr.
Yes this is possible. You just open the sourcecode in your project and add breakpoint as usual...
perahi

Posted:
April 30th, 2005, 6:14 am
by Vital
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.

Posted:
May 4th, 2005, 2:37 am
by Vital
There is who alive? I want to send You its variant of the expansion SimpleGraph

Posted:
May 4th, 2005, 7:25 am
by Stefan
Hi,
Could you send the proof-of-concept code to my personal address?
My address is stefanmelis(at)yahoo.(c)om.
Regards,
Stefan