summaryrefslogtreecommitdiff
path: root/src/reportengine
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2012-08-28 16:42:26 +0100
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2012-08-28 16:42:26 +0100
commita929d0f465a989b6a3c098c241a99d82eadd914a (patch)
treee8f03b8dfc053534d409ec0c970225f9f19a4c90 /src/reportengine
parent22c9e3b4d6a415aad2dc4be287165442c1635be7 (diff)
downloadfpGUI-a929d0f465a989b6a3c098c241a99d82eadd914a.tar.xz
pdf: window size is adjust to fit all preview controls and page height.
If the screen is to small for that, it will use the max screen dimentions.
Diffstat (limited to 'src/reportengine')
-rw-r--r--src/reportengine/u_visu.pas17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/reportengine/u_visu.pas b/src/reportengine/u_visu.pas
index dcb6e469..eede74ae 100644
--- a/src/reportengine/u_visu.pas
+++ b/src/reportengine/u_visu.pas
@@ -506,14 +506,25 @@ begin
end;
constructor TF_Visu.Create(AOwner: TComponent; AImprime: T_Report);
+var
+ w: integer;
+ h: integer;
begin
inherited Create(AOwner);
FReport := AImprime;
Name := 'F_Visu';
WindowTitle := 'Preview';
- WindowPosition := wpUser;
- SetPosition(0, 0, fpgApplication.ScreenWidth - 2, fpgApplication.ScreenHeight - 66);
- BackgroundColor := fpgColor(51,51,51); // black/brown or should be use clShadow2 for theming abilities??
+ WindowPosition := wpAuto;
+ if fpgApplication.ScreenWidth < 1055 then
+ w := fpgApplication.ScreenWidth
+ else
+ w := 1055;
+ if fpgApplication.ScreenHeight < 940 then
+ h := fpgApplication.ScreenHeight - 66 { some taskbar height I guess }
+ else
+ h := 940;
+ SetPosition(0, 0, w, h);
+ BackgroundColor := fpgColor(51,51,51); // black/brown or should we use clShadow2 for theming abilities??
MinHeight := 350;
MinWidth := 640;
OnShow := @FormShow;