Look good.
I will give it a go.
Thanks
Warren
-----Original Message-----
From: Max Nilson [mailto:[EMAIL PROTECTED]
Sent: Friday, 19 September 2003 08:49 a.m.
To: Multiple recipients of list delphi
Subject: RE: [DUG]: Form size changing/scrolling?
Warren Slater asked re form scaling:
> If any one has a better way of doing this comments would be appreciated.
I found that the most elegant way to fixing the large fonts scaling issue
was to patch the code in Forms so that the scaling code included scaling the
form size as well the controls sizes. By default the code doesn't change the
size of the form only the control on it. So my modified code in
TCustomForm.ReadState reads like:
if FTextHeight <> NewTextHeight then
begin
Scaled := True;
// Added this bit
if (sfWidth in ScalingFlags) and (FClientWidth = 0) then
Width := MulDiv(Width, NewTextHeight, FTextHeight);
if (sfHeight in ScalingFlags) and (FClientHeight = 0) then
Height := MulDiv(Height, NewTextHeight, FTextHeight);
// End of added bit
ScaleScrollBars(NewTextHeight, FTextHeight);
ScaleControls(NewTextHeight, FTextHeight);
if sfWidth in ScalingFlags then
FClientWidth := MulDiv(FClientWidth, NewTextHeight, FTextHeight);
if sfHeight in ScalingFlags then
FClientHeight := MulDiv(FClientHeight, NewTextHeight,
FTextHeight);
end;
end;
This corrects most of the scaling issues to do with large fonts and form
sizing.
Cheers, Max.
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/
#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared
by MailMarshal
For more information please visit www.marshalsoftware.com
#####################################################################################
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"
Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/