| View previous topic :: View next topic |
| Author |
Message |
perahi Member
Joined: 02 Mar 2005 Posts: 8
|
Posted: 02/03/05 13:16 Post subject: TSimpleGraph |
|
|
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 |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 90 Location: Belgium, Antwerp
|
Posted: 03/03/05 11:03 Post subject: |
|
|
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 |
|
 |
perahi Member
Joined: 02 Mar 2005 Posts: 8
|
Posted: 03/03/05 12:50 Post subject: |
|
|
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 |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 90 Location: Belgium, Antwerp
|
Posted: 04/03/05 13:53 Post subject: |
|
|
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 |
|
 |
perahi Member
Joined: 02 Mar 2005 Posts: 8
|
Posted: 04/03/05 15:04 Post subject: |
|
|
Sorry
Here is a screenshot.... |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 90 Location: Belgium, Antwerp
|
Posted: 04/03/05 15:14 Post subject: |
|
|
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 |
|
 |
perahi Member
Joined: 02 Mar 2005 Posts: 8
|
Posted: 04/03/05 16:31 Post subject: |
|
|
ok...
Thank you for your answers
Perahi |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 90 Location: Belgium, Antwerp
|
Posted: 04/03/05 16:33 Post subject: |
|
|
Any time  |
|
| Back to top |
|
 |
kokkoras Member
Joined: 12 Mar 2005 Posts: 2
|
Posted: 12/03/05 23:32 Post subject: I think it is possible... |
|
|
...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 |
|
 |
perahi Member
Joined: 02 Mar 2005 Posts: 8
|
Posted: 14/03/05 08:57 Post subject: |
|
|
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 |
|
 |
kokkoras Member
Joined: 12 Mar 2005 Posts: 2
|
Posted: 15/03/05 09:27 Post subject: |
|
|
| 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 |
|
 |
perahi Member
Joined: 02 Mar 2005 Posts: 8
|
Posted: 15/03/05 10:10 Post subject: |
|
|
Thank you mr.
Yes this is possible. You just open the sourcecode in your project and add breakpoint as usual...
perahi |
|
| Back to top |
|
 |
Vital Member
Joined: 30 Apr 2005 Posts: 5
|
Posted: 30/04/05 06:14 Post subject: |
|
|
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 |
|
 |
Vital Member
Joined: 30 Apr 2005 Posts: 5
|
Posted: 04/05/05 02:37 Post subject: |
|
|
| There is who alive? I want to send You its variant of the expansion SimpleGraph |
|
| Back to top |
|
 |
Stefan Junior Member
Joined: 27 Sep 2004 Posts: 90 Location: Belgium, Antwerp
|
Posted: 04/05/05 07:25 Post subject: |
|
|
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 |
|
 |
|