Design mode "axes" in TeeTree
-
- Newbie
- Posts: 20
- Joined: Sat Oct 04, 2003 4:00 am
Design mode "axes" in TeeTree
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
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
Hi,
I'm not sure what you mean with 'axes'... Do you mean the page border?
You can set it of as following:
Regards
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;
-
- Newbie
- Posts: 20
- Joined: Sat Oct 04, 2003 4:00 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.
-
- Newbie
- Posts: 20
- Joined: Sat Oct 04, 2003 4:00 am
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
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
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:
You then tell the width/height of the image, as in:
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
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);
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');
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
-
- Newbie
- Posts: 20
- Joined: Sat Oct 04, 2003 4:00 am
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
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
No, sorry, probably together with a new release/update of teeChart. However, this will probably just a maintenance release of teeTree.Good to know that there will be another release of TeeTree - still the best Tree component around, imho. Any idea when this will happen?
Thanks. We'll look into it.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
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.
thanks, we hope you are able to produce some code demonstrating the issue, since this makes it much easier to see/find possible problemsI 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
-
- Newbie
- Posts: 20
- Joined: Sat Oct 04, 2003 4:00 am
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 ImagePoolThanks. 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
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.