Setting proportional print margins with TTeePreviewPanel
Posted: Fri Sep 09, 2016 5:23 am
First a little background. I didn't find the TChartPreviewer component suitable for my program. It has a number of unnecessary controls for my purposes. Also, I don't like that it is a modal form -- I would have preferred a panel embedded in my own form. Therefore, I am trying to make use of the TTeePreviewPanel, which I can embed nicely into my form.
The TTeePreviewPanel has no controls other than the chart preview itself and some draggable margins. Therefore, I have to add the controls I need.
I have added four spin edit controls for setting the print margins. I have set TeePreviewPanel1.PrintProportional = True. The question is, how to adjust the print margins when one of my fours spin edits is changed? It appears that it is not as simple as transferring the spin edit values to the TeePreviewPanel1.PrintMargins rectangle because of the PrintProportional constraint. It appears that the function CalcProportionalMargins comes into it somewhere, but I cannot figure out how to do it! Help please!
The TTeePreviewPanel has no controls other than the chart preview itself and some draggable margins. Therefore, I have to add the controls I need.
I have added four spin edit controls for setting the print margins. I have set TeePreviewPanel1.PrintProportional = True. The question is, how to adjust the print margins when one of my fours spin edits is changed? It appears that it is not as simple as transferring the spin edit values to the TeePreviewPanel1.PrintMargins rectangle because of the PrintProportional constraint. It appears that the function CalcProportionalMargins comes into it somewhere, but I cannot figure out how to do it! Help please!