zooming / resizig problem

TeeTree VCL for Borland Delphi and C++ Builder.
Post Reply
Thomas Klingler
Advanced
Posts: 103
Joined: Tue Mar 02, 2004 5:00 am
Location: Bad Wurzach
Contact:

zooming / resizig problem

Post by Thomas Klingler » Wed Jul 04, 2007 10:55 am

Hi,
project that has a Tree aligned to its client area in a panel and I want to get the tree to resize as the form is resized. I would like to fit the tree picture within the available space, this is to render the best possible image at various screen resolutions. I have tried using Zoom and this looks very promising - I can resize the from and the tree image follows this but I cannot work out how the margins should be calculated - the
horiz and very margins seem to change as the zoom occurs. This gives the problem that the imageshape (and the contianed image) moves out of the panel client area. Btw, the same happens in the TTree feature demo, Tree Features / Zooming, if you zoom in and out several times having not chekced the zoom from center property.

Is zoom the best way to do this? Could someone point me at how to keep the image fitting correctly within the form as the form is resized?


TIA

Markus

P.s.: Tom , I sent you a PM because I didnt't know where to sent the source code example for the transparent image problem - did you get it ?

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

Post by tom » Wed Jul 04, 2007 9:47 pm

Hi Thomas,

Concerning transparent images: I've replied on the PM, but never received a return, so I guess something went wrong. Please send the source example to tom at steema com

Concerning the Zooming/Scrolling and Margins: Well, as designed ttree 'trims' empty spaces at the top and left side of the tree. This might be the issue you are seeing. You can disable this by enabling using the PAGEBOUNDS define (see {$DEFINE PAGEBOUNDS} in teeTree.pas)

(keep in mind that you might experience other issues when disabling, if so, let us know)

Regards,
Tom.

Keith
Newbie
Newbie
Posts: 17
Joined: Tue Mar 09, 2004 5:00 am
Location: South Africa
Contact:

Post by Keith » Thu Jul 12, 2007 7:59 pm

Markus,

I have some autosizing code from Tom that does a reasonable job of sizing a TTree's contents, to fit its current size.

If you want to have a look at it, please drop me an e-mail at: keithb(at)kbsoft(dot)com.


Regards,
Keith

Post Reply