Changeset 59 for trunk/UCore.pas


Ignore:
Timestamp:
Dec 3, 2014, 9:09:42 PM (10 years ago)
Author:
chronos
Message:
  • Added: Support for high DPI screens. If not detected automatically correctly then user can specify desired values.
  • Updated: Common package to newer version.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r55 r59  
    77uses
    88  Classes, SysUtils, FileUtil, UApplicationInfo, ULastOpenedList,
    9   UCoolTranslator, UTarget, URegistry, Registry;
     9  UCoolTranslator, UTarget, URegistry, Registry, XMLConf, Graphics, UScaleDPI;
    1010
    1111type
     
    2121  private
    2222  public
     23    ScaleDPI: TScaleDPI;
    2324    Modified: Boolean;
    2425    ProjectFileName: string;
     
    3132var
    3233  Core: TCore;
     34
    3335
    3436implementation
     
    4446procedure TCore.DataModuleCreate(Sender: TObject);
    4547begin
     48  ScaleDPI := TScaleDPI.Create;
    4649  Targets := TTargetList.Create;
    4750  Targets.Add(TTargetInterpretter.Create);
     
    5760  SaveToRegistry(HKEY(ApplicationInfo.RegistryRoot), ApplicationInfo.RegistryKey);
    5861  Targets.Free;
     62  ScaleDPI.Free;
    5963end;
    6064
     
    7175      CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
    7276      else CoolTranslator1.Language := CoolTranslator1.Languages.SearchByCode('');
     77    ScaleDPI.DPI := Point(ReadIntegerWithDefault('DPIX', 96),
     78      ReadIntegerWithDefault('DPIY', 96));
     79    ScaleDPI.AutoDetect := ReadBoolWithDefault('DPIAuto', True);
    7380  finally
    7481    Free;
     
    8794    OpenKey(Key, True);
    8895    WriteBool('OpenProjectOnStart', OpenProjectOnStart);
     96    WriteBool('DPIAuto', ScaleDPI.AutoDetect);
     97    WriteInteger('DPIX', ScaleDPI.DPI.X);
     98    WriteInteger('DPIY', ScaleDPI.DPI.Y);
    8999    if Assigned(CoolTranslator1.Language) and (CoolTranslator1.Language.Code <> '') then
    90100      WriteString('LanguageCode', CoolTranslator1.Language.Code)
Note: See TracChangeset for help on using the changeset viewer.