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/

Reply via email to