Design mode "axes" in TeeTree

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
JackLeslie
Newbie
Newbie
Posts: 20
Joined: Sat Oct 04, 2003 4:00 am

Design mode "axes" in TeeTree

Post by JackLeslie » Mon Jan 30, 2006 10:04 pm

Hi
I want to turn off the horizontal and vertical "axes" (from 0,0) that appear when you put the tree in design mode at runtime.

I am happy to patch the code (if need be), but I need to know in which unit the drawing of the axes is done. (I am also using TeeChart Pro, so I want to make sure this change does not affect TeeChart)

thanks

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Sat Feb 04, 2006 8:30 am

Hi,

I'm not sure what you mean with 'axes'... Do you mean the page border?

You can set it of as following:

Code: Select all

  Tree1.Page.Border.Visible := CheckBox1.Checked;
Regards

JackLeslie
Newbie
Newbie
Posts: 20
Joined: Sat Oct 04, 2003 4:00 am

Post by JackLeslie » Mon Feb 06, 2006 5:50 am

The axes are the two dark lines that intersect in the middle of the treeview at coordinates (0,0) when you are in design mode. Design mode is when you can move the nodes around manually (at run time - I am not talking about in the IDE, although you can see these axes there too). Try moving a node left and down .. towards negative x and negative y. Then you will see the axes appear.

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Mon Feb 06, 2006 10:25 am

then I'm sure we are talking about the same stuff. (there are no really axes, it are page borders)

Have you tried the solution I provided before?

Tree1.Page.Border.Visible := false;

JackLeslie
Newbie
Newbie
Posts: 20
Joined: Sat Oct 04, 2003 4:00 am

Post by JackLeslie » Mon Feb 06, 2006 11:53 pm

thanks Tom, that works .. I guess I did not think of the "page" idea (I must admit I had never noticed it before)

Maybe the page is the clue to one of my other problems .. trying to save as a bitmap or jpeg if the tree is too large to be displayed. I only seem to get a portion of it.

Could you post some code that will show me how to save the whole tree - not just the visible bit - as a bitmap?

thanks

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Tue Feb 21, 2006 10:43 am

The export functionality of teeTree is based on the export components of teeTree. That's why you get only the viewed portion when you export the tree.

There is a way to export the complete tree, but therefor you must position the tree in the far top/left corner (otherwise the export starts from the top/left position which is visible in the tree panel).

You could do this programmatically with the following code:

Code: Select all

 Tree1.Perform(WM_VSCROLL, SB_TOP, 0);
 Tree1.Perform(WM_HSCROLL, SB_TOP, 0); 
You then tell the width/height of the image, as in:

Code: Select all

    exportformat.width := tree1.totalbounds.right+5; //margin of 5 pixels
    exportformat.height := tree1.totalbounds.bottom+5;
    exportformat.savetofile(ExtractFilePath(Application.ExeName)+'myTree.bmp');
Since teeTree (standard, as it is now) calculates its boundaries in function of page width/height, the totalbounds right/bottom values are in function of pages/width/height. In some cases, resulting in a lot of white space on the right/bottom of the tree image. TeeTree (as it is now) also allows negative coördinates. This makes it a little more complicated and thus, in some case the above code will fail.

I've made some modifications to the code which can circumvent these problems, but if you don't experience problems with the existing code, then I wouldn't worry to much about these modifications.

These will probably be included in a next update of the code, but are still subject to change.

Best regards,
tom

JackLeslie
Newbie
Newbie
Posts: 20
Joined: Sat Oct 04, 2003 4:00 am

Post by JackLeslie » Wed Feb 22, 2006 10:51 pm

Thanks Tom

I will test that and let you know. btw, I often use negative coordinates, so maybe I will run into problems

Good to know that there will be another release of TeeTree - still the best Tree component around, imho. Any idea when this will happen?

There are a couple of other issues you might take a look at.

1. I often use custom node images (unique ones per node) and under W98 I run into resource problems. The images are in an ImageList (so that part is handled efficiently) but whenever a node is displayed a Bitmap is created and is never, as I understand it, released. It would be nice to think that the bitmap could be destroyed when it was not visible, or more specifically, when the branch it is on is closed, and recreated when needed

2. I think there are problems displaying connections when a tree is sorted. I will post some code to display this problem, if I can demonstrate it

regards

tom
Advanced
Posts: 211
Joined: Mon Dec 01, 2003 5:00 am
Contact:

Post by tom » Tue Feb 28, 2006 12:43 am

Good to know that there will be another release of TeeTree - still the best Tree component around, imho. Any idea when this will happen?
No, sorry, probably together with a new release/update of teeChart. However, this will probably just a maintenance release of teeTree.
It would be nice to think that the bitmap could be destroyed when it was not visible, or more specifically, when the branch it is on is closed, and recreated when needed
Thanks. We'll look into it.
Have you already thought in using the TTreeImagePool component? (Or is this not possible in your case?): The advantage of using the global array of images is that when several nodes share the same image, the image is allocated into memory only once.
I think there are problems displaying connections when a tree is sorted. I will post some code to display this problem, if I can demonstrate it
thanks, we hope you are able to produce some code demonstrating the issue, since this makes it much easier to see/find possible problems

JackLeslie
Newbie
Newbie
Posts: 20
Joined: Sat Oct 04, 2003 4:00 am

Post by JackLeslie » Tue Feb 28, 2006 7:29 am

Thanks. We'll look into it.
Have you already thought in using the TTreeImagePool component? (Or is this not possible in your case?): The advantage of using the global array of images is that when several nodes share the same image, the image is allocated into memory only once
yes, TreeImagePool is cute but the advantages are just the same as an ImageList .. works fine if nodes share images. Actually it is a bit worse than an ImageList because a handle would be allocated for the Tpicture when it is added to the ImagePool

In my case nodes have unique images, but only a small fraction of them is
displayed at any time. Hence the need for dynamic retrieval and kill when no longer displayed.

Post Reply