Changeset 107 for trunk/UCore.pas


Ignore:
Timestamp:
Feb 17, 2016, 1:17:21 PM (9 years ago)
Author:
chronos
Message:
  • Added: Form constraintes which are also scaled for High DPI.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r103 r107  
    5959    procedure SaveConfig;
    6060    procedure CommandLineParams;
     61    procedure ScaleDPI;
    6162  public
    6263    Game: TGame;
     
    196197end;
    197198
     199procedure TCore.ScaleDPI;
     200var
     201  I: Integer;
     202begin
     203  {$ifdef DEBUG}
     204  with Core.ScaleDPI1 do begin
     205    //DesignDPI := Point(144, 144);
     206    if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
     207      //ApplyToAll(DesignDPI);
     208      FormNew.Show;
     209      FormNew.Hide;
     210      for I := 0 to Screen.FormCount - 1 do begin
     211        StoreDimensions(Screen.Forms[I], StoredDimension);
     212        ScaleDimensions(Screen.Forms[I], StoredDimension);
     213      end;
     214      ScaleImageList(Core.ImageListSmall, DesignDPI);
     215      ScaleImageList(Core.ImageListLarge, DesignDPI);
     216    end;
     217  end;
     218  {$endif}
     219end;
     220
    198221procedure TCore.UpdateActions;
    199222begin
     
    351374
    352375  CommandLineParams;
    353 
    354   {$IFDEF DEBUG}
    355   {with Core.ScaleDPI1 do
    356   if (DesignDPI.X <> DPI.X) or (DesignDPI.Y <> DPI.Y) then begin
    357     //ApplyToAll(DesignDPI);
    358     FormNew.Show;
    359     FormNew.Hide;
    360     for I := 0 to Screen.FormCount - 1 do begin
    361       StoreDimensions(Screen.Forms[I], StoredDimension);
    362       ScaleDimensions(Screen.Forms[I], StoredDimension);
    363     end;
    364     ScaleImageList(Core.ImageListSmall, DesignDPI);
    365     ScaleImageList(Core.ImageListLarge, DesignDPI);
    366   end;
    367   }
    368   {$ENDIF}
     376  ScaleDPI;
    369377
    370378  if Game.FileName = '' then begin
Note: See TracChangeset for help on using the changeset viewer.