Changeset 463


Ignore:
Timestamp:
Nov 29, 2023, 2:35:44 PM (12 months ago)
Author:
chronos
Message:
  • Modified: HighDpi branch updated to trunk version.
Location:
branches/highdpi/Packages
Files:
9 added
18 edited
1 copied
50 moved

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/AsyncProcess2.pas

    r307 r463  
    122122
    123123end.
     124
  • branches/highdpi/Packages/CevoComponents/BaseWin.pas

    r412 r463  
    88
    99type
    10   TShowNewContent = procedure (NewMode: Integer; HelpContext: string) of object;
     10  TWindowMode = (wmNone, wmModal, wmPersistent, wmSubmodal);
     11  TShowNewContent = procedure (NewMode: TWindowMode; HelpContext: string) of object;
    1112
    1213  { TBufferedDrawDlg }
    1314
    1415  TBufferedDrawDlg = class(TDrawDlg)
     16  protected
     17    FWindowMode: TWindowMode;
     18    ModalFrameIndent: Integer;
     19    HelpContext: string;
     20    procedure ShowNewContent(NewMode: TWindowMode; ForceClose: Boolean = False);
     21    procedure MarkUsedOffscreen(xMax, yMax: Integer);
     22    procedure OffscreenPaint; virtual;
     23    procedure VPaint; virtual;
    1524  public
    1625    UserLeft: Integer;
    1726    UserTop: Integer;
     27    UsedOffscreenWidth: Integer;
     28    UsedOffscreenHeight: Integer;
     29    Offscreen: TDpiBitmap;
     30    OffscreenUser: TDpiForm;
    1831    constructor Create(AOwner: TComponent); override;
    1932    destructor Destroy; override;
     
    2235    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    2336    procedure FormDeactivate(Sender: TObject);
    24     procedure SmartUpdateContent(ImmUpdate: Boolean = false);
     37    procedure SmartUpdateContent(ImmUpdate: Boolean = False);
    2538    procedure StayOnTop_Workaround;
    26   protected
    27     FWindowMode: Integer;
    28     ModalFrameIndent: Integer;
    29     HelpContext: string;
    30     procedure ShowNewContent(NewMode: Integer; ForceClose: Boolean = False);
    31     procedure MarkUsedOffscreen(xMax, yMax: Integer);
    32     procedure OffscreenPaint; virtual;
    33     procedure VPaint; virtual;
    34   public
    35     UsedOffscreenWidth: Integer;
    36     UsedOffscreenHeight: Integer;
    37     Offscreen: TDpiBitmap;
    38     OffscreenUser: TDpiForm;
    39     property WindowMode: integer read FWindowMode;
     39    property WindowMode: TWindowMode read FWindowMode;
    4040  end;
    4141
    4242  TFramedDlg = class(TBufferedDrawDlg)
    43   public
    44     constructor Create(AOwner: TComponent); override;
    45     procedure FormCreate(Sender: TObject);
    46     procedure SmartInvalidate; override;
    4743  protected
    4844    CaptionLeft: Integer;
    4945    CaptionRight: Integer;
    5046    InnerWidth: Integer;
    51     InnerHeight: integer;
     47    InnerHeight: Integer;
    5248    WideBottom: Boolean;
    5349    FullCaption: Boolean;
     
    5753    procedure VPaint; override;
    5854    procedure FillOffscreen(Left, Top, Width, Height: Integer);
     55  public
     56    constructor Create(AOwner: TComponent); override;
     57    procedure FormCreate(Sender: TObject);
     58    procedure SmartInvalidate; override;
    5959  end;
    6060
     
    6464
    6565const
    66   // window modes
    67   wmNone = 0;
    68   wmModal = $1;
    69   wmPersistent = $2;
    70   wmSubmodal = $3;
    71 
    7266  yUnused = 161;
    7367  NarrowFrame = 11;
     
    7670
    7771procedure CreateOffscreen(var Offscreen: TDpiBitmap);
     72function WindowModeMakePersistent(Mode: TWindowMode): TWindowMode;
    7873procedure Register;
    7974
     
    8378uses
    8479  ButtonBase, Area;
     80
     81function WindowModeMakePersistent(Mode: TWindowMode): TWindowMode;
     82begin
     83  if Mode = wmModal then Result := wmSubmodal
     84    else Result := wmPersistent;
     85end;
    8586
    8687procedure Register;
     
    118119    UserTop := Top;
    119120  end;
    120   if OffscreenUser = self then
     121  if OffscreenUser = Self then
    121122    OffscreenUser := nil;
    122123end;
     
    124125procedure TBufferedDrawDlg.FormPaint(Sender: TObject);
    125126begin
    126   if OffscreenUser <> self then
     127  if OffscreenUser <> Self then
    127128    OffscreenPaint;
    128129  VPaint;
     
    142143  if Key = VK_F1 then begin
    143144    if Assigned(ShowNewContentProc) then
    144       ShowNewContentProc(FWindowMode or wmPersistent, HelpContext);
     145      ShowNewContentProc(WindowModeMakePersistent(FWindowMode), HelpContext);
    145146  end else
    146147  if FWindowMode = wmPersistent then begin
     
    165166procedure TBufferedDrawDlg.VPaint;
    166167begin
    167   DpiBitCanvas(Canvas, 0, 0, ClientWidth, ClientHeight, Offscreen.Canvas, 0, 0);
    168 end;
    169 
    170 procedure TBufferedDrawDlg.ShowNewContent(NewMode: Integer;
     168  DpiBitBltCanvas(Canvas, 0, 0, ClientWidth, ClientHeight, Offscreen.Canvas, 0, 0);
     169end;
     170
     171procedure TBufferedDrawDlg.ShowNewContent(NewMode: TWindowMode;
    171172  ForceClose: Boolean);
    172173begin
     
    178179      UserLeft := Left;
    179180      UserTop := Top;
    180       Visible := false;
     181      Visible := False;
    181182      FWindowMode := NewMode;
    182183      ShowModal;
     
    184185    else if forceclose then
    185186    begin // make modal
    186       Visible := false;
     187      Visible := False;
    187188      FWindowMode := NewMode;
    188189      Left := UserLeft;
     
    204205    Left := UserLeft;
    205206    Top := UserTop;
    206     if FWindowMode = wmModal then
    207       ShowModal
     207    if FWindowMode = wmModal then begin
     208      Gtk2Fix;
     209      ShowModal;
     210    end
    208211    else
    209212      Show;
     
    268271procedure TFramedDlg.SmartInvalidate;
    269272var
    270   i, BottomFrame: integer;
     273  I, BottomFrame: Integer;
    271274  r0, r1: HRgn;
    272275begin
     
    277280  r0 := DpiCreateRectRgn(SideFrame, TitleHeight, ClientWidth - SideFrame,
    278281    ClientHeight - BottomFrame);
    279   for i := 0 to ControlCount - 1 do
    280     if not(Controls[i] is TArea) and Controls[i].Visible then
     282  for I := 0 to ControlCount - 1 do
     283    if not(Controls[I] is TArea) and Controls[I].Visible then
    281284    begin
    282       with Controls[i].BoundsRect do
     285      with Controls[I].BoundsRect do
    283286        r1 := DpiCreateRectRgn(Left, Top, Right, Bottom);
    284287      CombineRgn(r0, r0, r1, RGN_DIFF);
     
    291294procedure TFramedDlg.VPaint;
    292295
    293   procedure CornerFrame(x0, y0, x1, y1: integer);
     296  procedure CornerFrame(x0, y0, x1, y1: Integer);
    294297  begin
    295298    Frame(Canvas, x0 + 1, y0 + 1, x1 - 2, y1 - 2, MainTexture.ColorBevelLight,
     
    304307
    305308var
    306   i, l, FrameTop, FrameBottom, InnerBottom, Cut, xTexOffset,
    307     yTexOffset: integer;
     309  I, L, FrameTop, FrameBottom, InnerBottom, Cut, xTexOffset,
     310    yTexOffset: Integer;
    308311  R: TRect;
    309312begin
     
    317320  end;
    318321  Canvas.Font.Assign(UniFont[ftCaption]);
    319   l := BiColorTextWidth(Canvas, Caption);
    320   Cut := (ClientWidth - l) div 2;
     322  L := BiColorTextWidth(Canvas, Caption);
     323  Cut := (ClientWidth - L) div 2;
    321324  xTexOffset := (Maintexture.Width - ClientWidth) div 2;
    322325  yTexOffset := (Maintexture.Height - ClientHeight) div 2;
     
    442445  RisedTextOut(Canvas, Cut - 1, 7, Caption);
    443446
    444   for i := 0 to ControlCount - 1 do
    445     if Controls[i].Visible and (Controls[i] is TButtonBase) then
     447  for I := 0 to ControlCount - 1 do
     448    if Controls[I].Visible and (Controls[I] is TButtonBase) then
    446449    begin
    447       R := Controls[i].BoundsRect;
     450      R := Controls[I].BoundsRect;
    448451      if (R.Bottom <= TitleHeight) or (R.Top >= InnerBottom) then
    449452        BtnFrame(Canvas, R, MainTexture);
    450453    end;
    451454
    452   DpiBitCanvas(Canvas, SideFrame, TitleHeight, ClientWidth - 2 * SideFrame,
     455  DpiBitBltCanvas(Canvas, SideFrame, TitleHeight, ClientWidth - 2 * SideFrame,
    453456    InnerBottom - TitleHeight, Offscreen.Canvas, 0, 0);
    454457end;
     
    459462begin
    460463  if FullCaption then
    461     exit;
     464    Exit;
    462465  r0 := DpiCreateRectRgn(0, 0, ClientWidth, ClientHeight);
    463466  r1 := DpiCreateRectRgn(0, 0, CaptionLeft, TitleHeight - NarrowFrame);
     
    509512MainFormKeyDown := nil;
    510513
    511 finalization
    512 
    513514end.
  • branches/highdpi/Packages/CevoComponents/ButtonA.pas

    r349 r463  
    4646  with Canvas do
    4747    if FGraphic <> nil then begin
    48       DpiBitCanvas(Canvas, 0, 0, 100, 25, Graphic.Canvas, 195,
     48      DpiBitBltCanvas(Canvas, 0, 0, 100, 25, Graphic.Canvas, 195,
    4949        243 + 26 * Byte(Down));
    5050      Canvas.Brush.Style := bsClear;
     
    5454    end else begin
    5555      Brush.Color := $0000FF;
    56       FrameRect(Rect(0, 0, 100, 25))
     56      FrameRect(Rect(0, 0, 100, 25));
    5757    end;
    5858end;
  • branches/highdpi/Packages/CevoComponents/ButtonB.pas

    r303 r463  
    1111  private
    1212    FMask: TDpiBitmap;
    13     FIndex: integer;
    14     procedure SetIndex(Text: integer);
     13    FIndex: Integer;
     14    procedure SetIndex(Text: Integer);
    1515  public
    1616    property Mask: TDpiBitmap read FMask write FMask;
    1717  published
    1818    property Visible;
    19     property ButtonIndex: integer read FIndex write SetIndex;
     19    property ButtonIndex: Integer read FIndex write SetIndex;
    2020    property OnClick;
    2121  protected
     
    4747  with Canvas do
    4848    if FGraphic <> nil then begin
    49       DpiBitCanvas(Canvas, 0, 0, 25, 25, FGraphic.Canvas, 169,
     49      DpiBitBltCanvas(Canvas, 0, 0, 25, 25, FGraphic.Canvas, 169,
    5050        243 + 26 * Byte(FDown));
    5151      if FIndex >= 0 then begin
    52         DpiBitCanvas(Canvas, 0, 0, 25, 25, FMask.Canvas,
     52        DpiBitBltCanvas(Canvas, 0, 0, 25, 25, FMask.Canvas,
    5353          1 + FIndex mod 12 * 26, 337 + FIndex div 12 * 26, SRCAND);
    54         DpiBitCanvas(Canvas, 0, 0, 25, 25, FGraphic.Canvas,
     54        DpiBitBltCanvas(Canvas, 0, 0, 25, 25, FGraphic.Canvas,
    5555          1 + FIndex mod 12 * 26, 337 + FIndex div 12 * 26, SRCPAINT);
    56       end
     56      end;
    5757    end else begin
    5858      Brush.Color := $0000FF;
     
    6161end;
    6262
    63 procedure TButtonB.SetIndex(Text: integer);
     63procedure TButtonB.SetIndex(Text: Integer);
    6464begin
    6565  if Text <> FIndex then begin
  • branches/highdpi/Packages/CevoComponents/ButtonBase.pas

    r361 r463  
    99  TButtonBase = class(TDpiGraphicControl)
    1010  protected
    11     FDown, FPermanent: boolean;
     11    FDown: Boolean;
     12    FPermanent: Boolean;
    1213    FGraphic: TDpiBitmap;
    1314    // FDownSound, FUpSound: string;
    1415    ClickProc: TNotifyEvent;
    1516    DownChangedProc: TNotifyEvent;
    16     procedure SetDown(x: boolean);
     17    procedure SetDown(X: Boolean);
    1718    // procedure PlayDownSound;
    1819    // procedure PlayUpSound;
    1920    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    20       x, y: integer); override;
     21      X, Y: Integer); override;
    2122    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
    22       x, y: integer); override;
    23     procedure MouseMove(Shift: TShiftState; x, y: integer); override;
     23      X, Y: Integer); override;
     24    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    2425  private
    25     Active: boolean;
     26    Active: Boolean;
    2627  public
    2728    constructor Create(aOwner: TComponent); override;
     
    3132  published
    3233    property Visible;
    33     property Down: boolean read FDown write SetDown;
    34     property Permanent: boolean read FPermanent write FPermanent;
     34    property Down: Boolean read FDown write SetDown;
     35    property Permanent: Boolean read FPermanent write FPermanent;
    3536    property OnClick: TNotifyEvent read ClickProc write ClickProc;
    3637    property OnDownChanged: TNotifyEvent read DownChangedProc
     
    4950  // FUpSound:='';
    5051  FGraphic := nil;
    51   Active := false;
    52   FDown := false;
    53   FPermanent := false;
     52  Active := False;
     53  FDown := False;
     54  FPermanent := False;
    5455  ClickProc := nil;
    5556end;
    5657
    5758procedure TButtonBase.MouseDown(Button: TMouseButton; Shift: TShiftState;
    58   x, y: integer);
     59  X, Y: Integer);
    5960begin
    60   Active := true;
    61   MouseMove(Shift, x, y)
     61  Active := True;
     62  MouseMove(Shift, X, Y);
    6263end;
    6364
    6465procedure TButtonBase.MouseUp(Button: TMouseButton; Shift: TShiftState;
    65   x, y: integer);
     66  X, Y: Integer);
    6667begin
    6768  if ssLeft in Shift then
    68     exit;
    69   MouseMove(Shift, x, y);
     69    Exit;
     70  MouseMove(Shift, X, Y);
    7071  if Active and FDown then
    7172  begin
    7273    // PlayUpSound;
    73     Active := false;
     74    Active := False;
    7475    if FDown <> FPermanent then
    7576    begin
     
    8586  begin
    8687    // if FDown then PlayUpSound;
    87     Active := false;
     88    Active := False;
    8889    if FDown then
    8990    begin
    90       FDown := false;
     91      FDown := False;
    9192      Invalidate;
    9293      if @DownChangedProc <> nil then
    9394        DownChangedProc(self);
    9495    end;
    95   end
     96  end;
    9697end;
    9798
    98 procedure TButtonBase.MouseMove(Shift: TShiftState; x, y: integer);
     99procedure TButtonBase.MouseMove(Shift: TShiftState; X, Y: Integer);
    99100begin
    100101  if Active then
    101     if (x >= 0) and (x < Width) and (y >= 0) and (y < Height) then
     102    if (X >= 0) and (X < Width) and (Y >= 0) and (Y < Height) then
    102103      if (ssLeft in Shift) and not FDown then
    103104      begin
    104105        { PlayDownSound; }
    105         FDown := true;
     106        FDown := True;
    106107        Paint;
    107108        if @DownChangedProc <> nil then
     
    112113    begin
    113114      { PlayUpSound; }
    114       FDown := false;
     115      FDown := False;
    115116      Paint;
    116117      if @DownChangedProc <> nil then
     
    119120end;
    120121
    121 procedure TButtonBase.SetDown(x: boolean);
     122procedure TButtonBase.SetDown(X: Boolean);
    122123begin
    123   FDown := x;
     124  FDown := X;
    124125  Invalidate;
    125126end;
  • branches/highdpi/Packages/CevoComponents/ButtonC.pas

    r303 r463  
    1414  published
    1515    property Visible;
    16     property ButtonIndex: integer read FIndex write SetIndex;
     16    property ButtonIndex: Integer read FIndex write SetIndex;
    1717    property OnClick;
    1818  protected
     
    4141  with Canvas do
    4242    if FGraphic <> nil then
    43       DpiBitCanvas(Canvas, 0, 0, 12, 12, FGraphic.Canvas,
     43      DpiBitBltCanvas(Canvas, 0, 0, 12, 12, FGraphic.Canvas,
    4444        169 + 13 * Byte(FDown), 159 + 13 * FIndex)
    4545    else
    4646    begin
    4747      Brush.Color := $0000FF;
    48       FrameRect(Rect(0, 0, 12, 12))
     48      FrameRect(Rect(0, 0, 12, 12));
    4949    end;
    5050end;
    5151
    52 procedure TButtonC.SetIndex(Text: integer);
     52procedure TButtonC.SetIndex(Text: Integer);
    5353begin
    5454  if Text <> FIndex then
  • branches/highdpi/Packages/CevoComponents/ButtonN.pas

    r303 r463  
    1010    constructor Create(aOwner: TComponent); override;
    1111  private
    12     FPossible, FLit: boolean;
     12    FPossible, FLit: Boolean;
    1313    FGraphic, FMask, FBackGraphic: TDpiBitmap;
    14     FIndex, BackIndex: integer;
     14    FIndex, BackIndex: Integer;
    1515    FSmartHint: string;
    1616    ChangeProc: TNotifyEvent;
    17     procedure SetPossible(x: boolean);
    18     procedure SetLit(x: boolean);
    19     procedure SetIndex(x: integer);
    20     procedure SetSmartHint(x: string);
     17    procedure SetPossible(X: Boolean);
     18    procedure SetLit(X: Boolean);
     19    procedure SetIndex(X: Integer);
     20    procedure SetSmartHint(X: string);
    2121  published
    22     property Possible: boolean read FPossible write SetPossible;
    23     property Lit: boolean read FLit write SetLit;
     22    property Possible: Boolean read FPossible write SetPossible;
     23    property Lit: Boolean read FLit write SetLit;
    2424    property SmartHint: string read FSmartHint write SetSmartHint;
    2525    property Graphic: TDpiBitmap read FGraphic write FGraphic;
    2626    property Mask: TDpiBitmap read FMask write FMask;
    2727    property BackGraphic: TDpiBitmap read FBackGraphic write FBackGraphic;
    28     property ButtonIndex: integer read FIndex write SetIndex;
     28    property ButtonIndex: Integer read FIndex write SetIndex;
    2929    property OnClick: TNotifyEvent read ChangeProc write ChangeProc;
    3030  protected
    3131    procedure Paint; override;
    3232    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    33       x, y: integer); override;
     33      X, Y: Integer); override;
    3434  end;
    3535
     
    4646begin
    4747  inherited;
    48   ShowHint := true;
     48  ShowHint := True;
    4949  FGraphic := nil;
    5050  FBackGraphic := nil;
    51   FPossible := true;
    52   FLit := false;
     51  FPossible := True;
     52  FLit := False;
    5353  FIndex := -1;
    5454  ChangeProc := nil;
     
    6262    if FGraphic <> nil then
    6363    begin
    64       DpiBitCanvas(Canvas, 1, 1, 40, 40, FBackGraphic.Canvas,
    65         1 + 80 * BackIndex + 40 * byte(FPossible and FLit), 176);
     64      DpiBitBltCanvas(Canvas, 1, 1, 40, 40, FBackGraphic.Canvas,
     65        1 + 80 * BackIndex + 40 * Byte(FPossible and FLit), 176);
    6666      if FPossible then
    6767      begin
    68         DpiBitCanvas(Canvas, 3, 3, 36, 36, FMask.Canvas,
     68        DpiBitBltCanvas(Canvas, 3, 3, 36, 36, FMask.Canvas,
    6969          195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCAND);
    70         DpiBitCanvas(Canvas, 3, 3, 36, 36, FGraphic.Canvas,
     70        DpiBitBltCanvas(Canvas, 3, 3, 36, 36, FGraphic.Canvas,
    7171          195 + 37 * (FIndex mod 3), 21 + 37 * (FIndex div 3), SRCPAINT);
    7272      end;
     
    8383
    8484procedure TButtonN.MouseDown(Button: TMouseButton; Shift: TShiftState;
    85   x, y: integer);
     85  X, Y: Integer);
    8686begin
    8787  if FPossible and (Button = mbLeft) and (@ChangeProc <> nil) then
     
    8989end;
    9090
    91 procedure TButtonN.SetPossible(x: boolean);
     91procedure TButtonN.SetPossible(X: Boolean);
    9292begin
    93   if x <> FPossible then
     93  if X <> FPossible then
    9494  begin
    95     FPossible := x;
    96     if x then
     95    FPossible := X;
     96    if X then
    9797      Hint := FSmartHint
    9898    else
     
    102102end;
    103103
    104 procedure TButtonN.SetLit(x: boolean);
     104procedure TButtonN.SetLit(X: Boolean);
    105105begin
    106   if x <> FLit then
     106  if X <> FLit then
    107107  begin
    108     FLit := x;
     108    FLit := X;
    109109    Invalidate;
    110110  end;
    111111end;
    112112
    113 procedure TButtonN.SetIndex(x: integer);
     113procedure TButtonN.SetIndex(X: Integer);
    114114begin
    115   if x <> FIndex then
     115  if X <> FIndex then
    116116  begin
    117     FIndex := x;
    118     if x < 6 then
     117    FIndex := X;
     118    if X < 6 then
    119119      BackIndex := 1
    120120    else
     
    124124end;
    125125
    126 procedure TButtonN.SetSmartHint(x: string);
     126procedure TButtonN.SetSmartHint(X: string);
    127127begin
    128   if x <> FSmartHint then
     128  if X <> FSmartHint then
    129129  begin
    130     FSmartHint := x;
     130    FSmartHint := X;
    131131    if FPossible then
    132       Hint := x;
     132      Hint := X;
    133133  end;
    134134end;
  • branches/highdpi/Packages/CevoComponents/CevoComponents.lpk

    r405 r463  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    3   <Package Version="4">
     3  <Package Version="5">
    44    <PathDelim Value="\"/>
    55    <Name Value="CevoComponents"/>
     
    103103      </Item14>
    104104      <Item15>
    105         <Filename Value="UGraphicSet.pas"/>
    106         <UnitName Value="UGraphicSet"/>
     105        <Filename Value="GraphicSet.pas"/>
     106        <UnitName Value="GraphicSet"/>
    107107      </Item15>
    108108      <Item16>
    109         <Filename Value="UTexture.pas"/>
    110         <UnitName Value="UTexture"/>
     109        <Filename Value="Texture.pas"/>
     110        <UnitName Value="Texture"/>
    111111      </Item16>
    112112    </Files>
     113    <CompatibilityMode Value="True"/>
    113114    <RequiredPkgs Count="3">
    114115      <Item1>
  • branches/highdpi/Packages/CevoComponents/CevoComponents.pas

    r405 r463  
    1010uses
    1111  Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase, DrawDlg,
    12   Sound, BaseWin, AsyncProcess2, UGraphicSet, UTexture, LazarusPackageIntf;
     12  Sound, BaseWin, AsyncProcess2, GraphicSet, Texture, LazarusPackageIntf;
    1313
    1414implementation
  • branches/highdpi/Packages/CevoComponents/Directories.pas

    r405 r463  
    3333
    3434  if Lang = '' then begin
    35     for i := 1 to Paramcount - 1 do
    36       if (ParamStrUTF8(i) = '--LANG') or (ParamStrUTF8(i) = '-l') or
    37         (ParamStrUTF8(i) = '--lang') then
    38           Lang := ParamStrUTF8(i + 1);
     35    for I := 1 to Paramcount - 1 do
     36      if (ParamStrUTF8(I) = '--LANG') or (ParamStrUTF8(I) = '-l') or
     37        (ParamStrUTF8(I) = '--lang') then
     38          Lang := ParamStrUTF8(I + 1);
    3939  end;
    4040  if Lang = '' then begin
     
    7373        (Dst.Time < Src.Time) then
    7474        CopyFile(SourceDir + DirectorySeparator + Src.Name,
    75           DestinationDir + DirectorySeparator + Src.Name, false);
     75          DestinationDir + DirectorySeparator + Src.Name, False);
    7676      FindClose(Dst);
    7777    until FindNext(Src) <> 0;
  • branches/highdpi/Packages/CevoComponents/DrawDlg.pas

    r413 r463  
    11unit DrawDlg;
    22
    3 {$mode delphi}{$H+}
    4 
    53interface
    64
    75uses
    8   UDpiControls, Classes, SysUtils, Forms, LCLIntf, LCLType, {$IFDEF LINUX}LMessages,{$ENDIF}
     6  UDpiControls, Classes, SysUtils, Forms, LCLIntf, LCLType, {$IFDEF UNIX}LMessages,{$ENDIF}
    97  Messages, Graphics, Controls, ButtonBase, ButtonA, ButtonB, Area, ScreenTools
    108  {$IFDEF LCLGTK2}, Gtk2Globals{$ENDIF};
     
    4846    Lines: Integer;
    4947    TopSpace: Integer;
    50     procedure SplitText(preview: boolean);
     48    procedure SplitText(Preview: Boolean);
    5149    procedure CorrectHeight;
    5250  end;
     
    7674  MoveActive := False;
    7775  AddHandlerOnVisibleChanged(VisibleChangedHandler);
    78   {$IFDEF LINUX}
     76  {$IFDEF UNIX}
    7977  OnDeactivate := DoDeactivate;
    8078  {$ENDIF}
     
    102100  else
    103101  begin
    104     Pos := ScalePointFromNative(Point(Integer(Msg.LParam and $ffff),
    105       Integer((Msg.LParam shr 16) and $ffff)));
     102    Pos := Point(ScaleFromNative(Integer(Msg.LParam and $ffff)),
     103      ScaleFromNative(Integer((Msg.LParam shr 16) and $ffff)));
    106104    if Pos.Y >= Top + TitleHeight then
    107105      Msg.Result := HTCLIENT
     
    131129  MousePos1: TPoint;
    132130  MousePos2: TPoint;
    133 {$IFDEF LINUX}
     131{$IFDEF UNIX}
    134132  MousePosNew: TPoint;
    135133  NewFormPos: TPoint;
    136134{$ENDIF}
    137135begin
    138   MousePos1 := DpiMouse.CursorPos;
    139   inherited;
    140   MousePos2 := DpiMouse.CursorPos;
    141   {$IFDEF LINUX}
     136  MousePos1 := Mouse.CursorPos;
     137  inherited;
     138  MousePos2 := Mouse.CursorPos;
     139  {$IFDEF UNIX}
    142140  // Only if client is not doing own mouse move handling
    143141  if not Assigned(OnMouseDown) or not Assigned(OnMouseMove) or not Assigned(OnMouseUp) then begin
    144142    // HitTest is not supported under Linux GTK2 so use form inside move mechanizm
    145     NewFormPos := ScreenToClient(DpiMouse.CursorPos);
     143    NewFormPos := ScreenToClient(Mouse.CursorPos);
    146144    if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and
    147145      (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) and
     
    149147      MoveMousePos := ClientToScreen(Point(X, Y));
    150148      MoveFormPos := Point(Left, Top);
    151       MousePosNew := DpiMouse.CursorPos;
     149      MousePosNew := Mouse.CursorPos;
    152150      // Activate move only if mouse position was not changed during inherited call
    153151      if (MousePos1.X = MousePos2.X) and (MousePos1.Y = MousePos2.Y) then begin
     
    197195  {$IFDEF LCLGTK2}
    198196  // GTK2 bug workaround https://bugs.freepascal.org/view.php?id=35720
    199   if Visible then LastMouse.WinControl := Self.GetNativeForm;
     197  if Visible then LastMouse.WinControl := Self;
    200198  {$ENDIF}
    201199end;
     
    208206procedure TDrawDlg.InitButtons;
    209207var
    210   cix: integer;
     208  cix: Integer;
    211209  // ButtonDownSound, ButtonUpSound: string;
    212210begin
     
    230228procedure TDrawDlg.SmartInvalidate;
    231229var
    232   i: integer;
     230  i: Integer;
    233231  r0, r1: HRgn;
    234232begin
     
    242240      DeleteObject(r1);
    243241    end;
    244   InvalidateRgn(Handle, r0, false);
     242  InvalidateRgn(Handle, r0, False);
    245243  DeleteObject(r0);
    246244end;
     
    250248procedure TBaseMessgDlg.FormCreate(Sender: TObject);
    251249begin
    252   Left := (DpiScreen.Width - Width) div 2;
     250  Left := (Screen.Width - Width) div 2;
    253251  Canvas.Font.Assign(UniFont[ftNormal]);
    254252  Canvas.Brush.Style := bsClear;
    255253  MessgText := '';
    256254  TopSpace := 0;
    257   TitleHeight := DpiScreen.Height;
     255  TitleHeight := Screen.Height;
    258256  if csDesigning in ComponentState then Exit;
    259257  InitButtons;
     
    262260procedure TBaseMessgDlg.FormPaint(Sender: TObject);
    263261var
    264   i, cix: integer;
     262  i, cix: Integer;
    265263begin
    266264  if csDesigning in ComponentState then Exit;
    267   PaintBackground(self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
     265  PaintBackground(Self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
    268266    ClientHeight - (6 + 2 * Border));
    269267  for i := 0 to Border do
     
    276274    ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
    277275    MainTexture.ColorBevelShade);
    278   SplitText(false);
     276  SplitText(False);
    279277
    280278  for cix := 0 to ControlCount - 1 do
     
    283281end;
    284282
    285 procedure TBaseMessgDlg.SplitText(preview: boolean);
    286 var
    287   Start, Stop, OrdinaryStop, LinesCount: integer;
     283procedure TBaseMessgDlg.SplitText(Preview: Boolean);
     284var
     285  Start, Stop, OrdinaryStop, LinesCount: Integer;
    288286  s: string;
    289287begin
     
    296294      (BiColorTextWidth(Canvas, Copy(MessgText, Start, Stop - Start + 1)) <
    297295      ClientWidth - 56) do
    298       inc(Stop);
     296      Inc(Stop);
    299297    if Stop <> Length(MessgText) then
    300298    begin
     
    305303        (MessgText[OrdinaryStop + 1] = '\');
    306304      if (OrdinaryStop + 1 - Start) * 2 >= Stop - Start then
    307         Stop := OrdinaryStop
    308     end;
    309     if not preview then
     305        Stop := OrdinaryStop;
     306    end;
     307    if not Preview then
    310308    begin
    311309      s := Copy(MessgText, Start, Stop - Start + 1);
     
    315313    end;
    316314    Start := Stop + 2;
    317     inc(LinesCount)
    318   end;
    319   if preview then
     315    inc(LinesCount);
     316  end;
     317  if Preview then
    320318    Lines := LinesCount;
    321319end;
     
    323321procedure TBaseMessgDlg.CorrectHeight;
    324322var
    325   i: integer;
     323  i: Integer;
    326324begin
    327325  ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    328   Top := (DpiScreen.Height - ClientHeight) div 2;
     326  Top := (Screen.Height - ClientHeight) div 2;
    329327  for i := 0 to ControlCount - 1 do
    330328    Controls[i].Top := ClientHeight - (34 + Border);
     
    333331end.
    334332
     333
     334
  • branches/highdpi/Packages/CevoComponents/EOTButton.pas

    r349 r463  
    1919    constructor Create(aOwner: TComponent); override;
    2020    destructor Destroy; override;
    21     procedure SetButtonIndexFast(x: integer);
    22     procedure SetBack(ca: TDpiCanvas; x, y: integer);
     21    procedure SetButtonIndexFast(X: Integer);
     22    procedure SetBack(ca: TDpiCanvas; X, Y: Integer);
    2323  private
    2424    FTemplate: TDpiBitmap;
    25     FIndex: integer;
    26     procedure SetIndex(x: integer);
     25    FIndex: Integer;
     26    procedure SetIndex(X: Integer);
    2727  public
    2828    property Template: TDpiBitmap read FTemplate write FTemplate;
    2929  published
    3030    property Visible;
    31     property ButtonIndex: integer read FIndex write SetIndex;
     31    property ButtonIndex: Integer read FIndex write SetIndex;
    3232    property OnClick;
    3333  protected
     
    6060  Back.SetSize(48, 48);
    6161  Back.Canvas.FillRect(0, 0, Back.Width, Back.Height);
    62   ShowHint := true;
     62  ShowHint := True;
    6363  SetBounds(0, 0, 48, 48);
    6464end;
     
    7676    if FGraphic <> nil then begin
    7777      UnshareBitmap(Buffer);
    78       DpiBitCanvas(Buffer.Canvas, 0, 0, 48, 48, Back.Canvas, 0, 0);
     78      DpiBitBltCanvas(Buffer.Canvas, 0, 0, 48, 48, Back.Canvas, 0, 0);
    7979      ImageOp_CBC(Buffer, Template, 0, 0, 133, 149 + 48 * Byte(FDown), 48, 48,
    8080        $000000, $FFFFFF);
     
    8282        ImageOp_CBC(Buffer, Template, 8, 8, 1 + 32 * Byte(FIndex), 246, 32, 32,
    8383          $000000, $FFFFFF);
    84       DpiBitCanvas(Canvas, 0, 0, 48, 48, Buffer.Canvas, 0, 0);
     84      DpiBitBltCanvas(Canvas, 0, 0, 48, 48, Buffer.Canvas, 0, 0);
    8585    end else begin
    8686      Brush.Color := $0000FF;
     
    8989end;
    9090
    91 procedure TEOTButton.SetIndex(x: integer);
     91procedure TEOTButton.SetIndex(X: Integer);
    9292begin
    93   if x <> FIndex then begin
    94     FIndex := x;
     93  if X <> FIndex then begin
     94    FIndex := X;
    9595    Invalidate;
    9696  end;
    9797end;
    9898
    99 procedure TEOTButton.SetButtonIndexFast(x: integer);
     99procedure TEOTButton.SetButtonIndexFast(X: Integer);
    100100begin
    101   if Visible and (x <> FIndex) then begin
    102     FIndex := x;
     101  if Visible and (X <> FIndex) then begin
     102    FIndex := X;
    103103    try
    104104      Paint;
     
    108108end;
    109109
    110 procedure TEOTButton.SetBack(ca: TDpiCanvas; x, y: integer);
     110procedure TEOTButton.SetBack(ca: TDpiCanvas; X, Y: Integer);
    111111begin
    112   DpiBitCanvas(Back.Canvas, 0, 0, 48, 48, ca, x, y);
     112  DpiBitBltCanvas(Back.Canvas, 0, 0, 48, 48, ca, X, Y);
    113113end;
    114114
  • branches/highdpi/Packages/CevoComponents/GraphicSet.pas

    r462 r463  
    1 unit UGraphicSet;
     1unit GraphicSet;
    22
    33interface
    44
    55uses
    6   UDpiControls, Classes, SysUtils, Graphics, fgl, LCLType, UPixelPointer, DOM, XMLRead,
    7   XMLWrite, UXMLUtils;
     6  UDpiControls, Classes, SysUtils, Graphics, Generics.Collections, LCLType, DOM,
     7  XMLRead, XMLWrite, XML;
    88
    99type
     
    3131  { TGraphicSetItems }
    3232
    33   TGraphicSetItems = class(TFPGObjectList<TGraphicSetItem>)
     33  TGraphicSetItems = class(TObjectList<TGraphicSetItem>)
    3434    GraphicSet: TGraphicSet;
    3535    function SearchByName(Name: string): TGraphicSetItem;
     
    5555  end;
    5656
     57  TGraphicSetClass = class of TGraphicSet;
     58
    5759  { TGraphicSets }
    5860
    59   TGraphicSets = class(TFPGObjectList<TGraphicSet>)
     61  TGraphicSets = class(TObjectList<TGraphicSet>)
    6062    function SearchByName(Name: string): TGraphicSet;
    6163    function AddNew(Name: string): TGraphicSet;
     
    9193procedure TGraphicSetItem.DrawTo(Canvas: TDpiCanvas; Pos: TPoint);
    9294begin
    93 {  DpiBitCanvas(Canvas, Pos.X, Pos.Y, BoundsRect.Width, BoundsRect.Height,
     95{  DpiBitBltCanvas(Canvas, Pos.X, Pos.Y, BoundsRect.Width, BoundsRect.Height,
    9496    GraphicSet.Mask.Canvas, BoundsRect.Left, BoundsRect.Top, SRCAND);
    95   DpiBitCanvas(Canvas, Pos.X, Pos.Y, BoundsRect.Width, BoundsRect.Height,
     97  DpiBitBltCanvas(Canvas, Pos.X, Pos.Y, BoundsRect.Width, BoundsRect.Height,
    9698    GraphicSet.Data.Canvas, BoundsRect.Left, BoundsRect.Top, SRCPAINT);
    9799}
     
    270272end.
    271273
     274
     275
  • branches/highdpi/Packages/CevoComponents/ScreenTools.pas

    r405 r463  
    88  {$ENDIF}
    99  StringTables, LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Math,
    10   Forms, Menus, GraphType, fgl, UGraphicSet, LazFileUtils, UTexture;
     10  Forms, Menus, GraphType, GraphicSet, LazFileUtils, Texture;
    1111
    1212type
     
    1717
    1818{$IFDEF WINDOWS}
    19 function ChangeResolution(x, y, bpp, freq: integer): boolean;
     19function ChangeResolution(X, Y, bpp, freq: Integer): Boolean;
    2020{$ENDIF}
    2121procedure RestoreResolution;
    2222procedure EmptyMenu(MenuItems: TDpiMenuItem; Keep: Integer = 0);
    23 function TurnToYear(Turn: integer): integer;
    24 function TurnToString(Turn: integer): string;
    25 function MovementToString(Movement: integer): string;
    26 procedure BtnFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    27 procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    28 function HexStringToColor(S: string): integer;
     23function TurnToYear(Turn: Integer): Integer;
     24function TurnToString(Turn: Integer): string;
     25function MovementToString(Movement: Integer): string;
     26procedure BtnFrame(Canvas: TDpiCanvas; P: TRect; T: TTexture);
     27procedure EditFrame(Canvas: TDpiCanvas; P: TRect; T: TTexture);
     28function HexStringToColor(S: string): Integer;
    2929function ExtractFileNameWithoutExt(const Filename: string): string;
    30 function LoadGraphicFile(Bmp: TDpiBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean;
    31 function LoadGraphicSet(const Name: string): TGraphicSet;
    32 function LoadGraphicSet2(const Name: string): TGraphicSet;
    33 procedure Dump(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     30function LoadGraphicFile(Bmp: TDpiBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): Boolean;
     31function LoadGraphicSet(const Name: string; Transparency: Boolean = True): TGraphicSet;
     32procedure Dump(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    3433procedure BitmapReplaceColor(Dst: TDpiBitmap; X, Y, Width, Height: Integer; OldColor, NewColor: TColor);
    35 procedure Sprite(Canvas: TDpiCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     34procedure Sprite(Canvas: TDpiCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    3635  overload;
    37 procedure Sprite(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     36procedure Sprite(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    3837  overload;
    3938procedure MakeBlue(Dst: TDpiBitmap; X, Y, Width, Height: Integer);
     
    4645procedure ImageOp_CBC(Dst, Src: TDpiBitmap; xDst, yDst, xSrc, ySrc, Width, Height,
    4746  Color0, Color2: Integer);
    48 procedure ImageOp_CCC(bmp: TDpiBitmap; x, y, Width, Height, Color0, Color1, Color2: Integer);
    49 function DpiBitCanvas(DestCanvas: TDpiCanvas; X, Y, Width, Height: Integer;
     47procedure ImageOp_CCC(bmp: TDpiBitmap; X, Y, Width, Height, Color0, Color1, Color2: Integer);
     48function DpiBitBltCanvas(DestCanvas: TDpiCanvas; X, Y, Width, Height: Integer;
    5049  SrcCanvas: TDpiCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; overload;
    51 function DpiBitCanvas(Dest: TDpiCanvas; DestRect: TRect;
     50function DpiBitBltCanvas(Dest: TDpiCanvas; DestRect: TRect;
    5251  Src: TDpiCanvas; SrcPos: TPoint; Rop: DWORD = SRCCOPY): Boolean; overload;
    5352function BitBltBitmap(Dest: TDpiBitmap; X, Y, Width, Height: Integer;
     
    5554function BitBltBitmap(Dest: TDpiBitmap; DestRect: TRect;
    5655  Src: TDpiBitmap; SrcPos: TPoint; Rop: DWORD = SRCCOPY): Boolean; overload;
    57 procedure SLine(ca: TDpiCanvas; x0, x1, y: integer; cl: TColor);
    58 procedure DLine(ca: TDpiCanvas; x0, x1, y: integer; cl0, cl1: TColor);
    59 procedure Frame(ca: TDpiCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
    60 procedure RFrame(ca: TDpiCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
    61 procedure CFrame(ca: TDpiCanvas; x0, y0, x1, y1, Corner: integer; cl: TColor);
    62 procedure FrameImage(ca: TDpiCanvas; Src: TDpiBitmap;
    63   x, y, Width, Height, xSrc, ySrc: integer; IsControl: boolean = False);
    64 procedure GlowFrame(Dst: TDpiBitmap; x0, y0, Width, Height: integer; cl: TColor);
     56procedure SLine(Canvas: TDpiCanvas; x0, x1, Y: Integer; cl: TColor);
     57procedure DLine(Canvas: TDpiCanvas; x0, x1, Y: Integer; cl0, cl1: TColor);
     58procedure Frame(Canvas: TDpiCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
     59procedure RFrame(Canvas: TDpiCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
     60procedure CFrame(Canvas: TDpiCanvas; x0, y0, x1, y1, Corner: Integer; cl: TColor);
     61procedure FrameImage(Canvas: TDpiCanvas; Src: TDpiBitmap;
     62  X, Y, Width, Height, xSrc, ySrc: Integer; IsControl: Boolean = False);
     63procedure GlowFrame(Dst: TDpiBitmap; x0, y0, Width, Height: Integer; cl: TColor);
    6564procedure InitOrnament;
    66 procedure InitCityMark(T: TTexture);
    67 procedure Fill(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: integer); overload;
     65procedure InitCityMark(Texture: TTexture);
     66procedure Fill(Canvas: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer); overload;
    6867procedure Fill(Canvas: TDpiCanvas; Rect: TRect; Offset: TPoint); overload;
    69 procedure FillLarge(ca: TDpiCanvas; x0, y0, x1, y1, xm: integer);
    70 procedure FillSeamless(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: integer;
     68procedure FillLarge(Canvas: TDpiCanvas; x0, y0, x1, y1, xm: Integer);
     69procedure FillSeamless(Canvas: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer;
    7170  const Texture: TDpiBitmap);
    72 procedure FillRectSeamless(ca: TDpiCanvas; x0, y0, x1, y1, xOffset, yOffset: integer;
     71procedure FillRectSeamless(Canvas: TDpiCanvas; x0, y0, x1, y1, xOffset, yOffset: Integer;
    7372  const Texture: TDpiBitmap);
    74 procedure PaintBackground(Form: TDpiForm; Left, Top, Width, Height: integer);
    75 procedure Corner(ca: TDpiCanvas; x, y, Kind: integer; T: TTexture);
    76 procedure BiColorTextOut(ca: TDpiCanvas; clMain, clBack: TColor; x, y: integer; s: string);
    77 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; T: TTexture;
    78   x, y: integer; s: string);
    79 function BiColorTextWidth(ca: TDpiCanvas; s: string): integer;
    80 procedure RisedTextOut(ca: TDpiCanvas; x, y: integer; s: string);
    81 procedure LightGradient(ca: TDpiCanvas; x, y, Width, Color: integer);
    82 procedure DarkGradient(ca: TDpiCanvas; x, y, Width, Kind: integer);
    83 procedure VLightGradient(ca: TDpiCanvas; x, y, Height, Color: integer);
    84 procedure VDarkGradient(ca: TDpiCanvas; x, y, Height, Kind: integer);
     73procedure PaintBackground(Form: TDpiForm; Left, Top, Width, Height: Integer);
     74procedure Corner(Canvas: TDpiCanvas; X, Y, Kind: Integer; T: TTexture);
     75procedure BiColorTextOut(Canvas: TDpiCanvas; clMain, clBack: TColor; X, Y: Integer; S: string);
     76procedure LoweredTextOut(Canvas: TDpiCanvas; cl: TColor; T: TTexture;
     77  X, Y: Integer; S: string);
     78function BiColorTextWidth(Canvas: TDpiCanvas; S: string): Integer;
     79procedure RisedTextOut(Canvas: TDpiCanvas; X, Y: Integer; S: string);
     80procedure LightGradient(Canvas: TDpiCanvas; X, Y, Width, Color: Integer);
     81procedure DarkGradient(Canvas: TDpiCanvas; X, Y, Width, Kind: Integer);
     82procedure VLightGradient(Canvas: TDpiCanvas; X, Y, Height, Color: Integer);
     83procedure VDarkGradient(Canvas: TDpiCanvas; X, Y, Height, Kind: Integer);
    8584procedure UnderlinedTitleValue(Canvas: TDpiCanvas; Title, Value: string; X, Y, Width: Integer);
    86 procedure NumberBar(dst: TDpiBitmap; x, y: integer; Cap: string; val: integer;
     85procedure NumberBar(dst: TDpiBitmap; X, Y: Integer; Cap: string; val: Integer;
    8786  T: TTexture);
    88 procedure CountBar(dst: TDpiBitmap; x, y, w: integer; Kind: integer;
    89   Cap: string; val: integer; T: TTexture);
    90 procedure PaintProgressBar(ca: TDpiCanvas; Kind, x, y, pos, Growth, max: integer;
     87procedure CountBar(dst: TDpiBitmap; X, Y, W: Integer; Kind: Integer;
     88  Cap: string; val: Integer; T: TTexture);
     89procedure PaintProgressBar(Canvas: TDpiCanvas; Kind, X, Y, Pos, Growth, Max: Integer;
    9190  T: TTexture);
    92 procedure PaintRelativeProgressBar(ca: TDpiCanvas;
    93   Kind, x, y, size, pos, Growth, max: integer; IndicateComplete: boolean;
     91procedure PaintRelativeProgressBar(Canvas: TDpiCanvas;
     92  Kind, X, Y, size, Pos, Growth, Max: Integer; IndicateComplete: Boolean;
    9493  T: TTexture);
    95 procedure PaintLogo(Canvas: TDpiCanvas; X, Y, LightColor, ShadeColor: integer);
     94procedure PaintLogo(Canvas: TDpiCanvas; X, Y, LightColor, ShadeColor: Integer);
    9695procedure LoadPhrases;
    9796procedure Texturize(Dest, Texture: TDpiBitmap; TransparentColor: Cardinal);
     
    149148  Phrases2: TStringTable;
    150149  GrExt: TGraphicSets;
     150
    151151  HGrSystem: TGraphicSet;
    152   HGrSystem2: TGraphicSet;
    153   ClickFrameColor: Integer;
    154   MainTexture: TTexture;
    155   Templates: TGraphicSet;
    156   Colors: TDpiBitmap;
    157   Paper: TDpiBitmap;
    158   BigImp: TDpiBitmap;
    159   LogoBuffer: TDpiBitmap;
    160   FullScreen: Boolean;
    161   GenerateNames: Boolean;
    162   InitOrnamentDone: Boolean;
    163   Phrases2FallenBackToEnglish: Boolean;
    164 
    165   // Graphic set items
    166152  CityMark1: TGraphicSetItem;
    167153  CityMark2: TGraphicSetItem;
     154
     155  HGrSystem2: TGraphicSet;
    168156  Ornament: TGraphicSetItem;
     157  GBrainNoTerm: TGraphicSetItem;
     158  GBrainSuperVirtual: TGraphicSetItem;
     159  GBrainTerm: TGraphicSetItem;
     160  GBrainRandom: TGraphicSetItem;
     161
     162  Templates: TGraphicSet;
    169163  Logo: TGraphicSetItem;
    170164  BigBook: TGraphicSetItem;
     
    180174  WeightOff: TGraphicSetItem;
    181175
     176  ClickFrameColor: Integer;
     177  MainTexture: TTexture;
     178  Colors: TDpiBitmap;
     179  Paper: TDpiBitmap;
     180  BigImp: TDpiBitmap;
     181  LogoBuffer: TDpiBitmap;
     182  FullScreen: Boolean;
     183  GenerateNames: Boolean;
     184  InitOrnamentDone: Boolean;
     185  Phrases2FallenBackToEnglish: Boolean;
     186
    182187  UniFont: array [TFontType] of TDpiFont;
    183188  Gamma: Integer; // global gamma correction (cent)
     
    192197
    193198uses
    194   Directories, Sound, UPixelPointer;
     199  Directories, Sound, PixelPointer;
    195200
    196201var
    197202  {$IFDEF WINDOWS}
    198203  StartResolution: TDeviceMode;
    199   ResolutionChanged: boolean;
     204  ResolutionChanged: Boolean;
    200205  {$ENDIF}
    201206
     
    203208
    204209{$IFDEF WINDOWS}
    205 function ChangeResolution(x, y, bpp, freq: integer): boolean;
     210function ChangeResolution(X, Y, bpp, freq: Integer): Boolean;
    206211var
    207212  DevMode: TDeviceMode;
     
    210215  DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or DM_BITSPERPEL or
    211216    DM_DISPLAYFREQUENCY;
    212   DevMode.dmPelsWidth := x;
    213   DevMode.dmPelsHeight := y;
     217  DevMode.dmPelsWidth := X;
     218  DevMode.dmPelsHeight := Y;
    214219  DevMode.dmBitsPerPel := bpp;
    215220  DevMode.dmDisplayFrequency := freq;
     
    311316end;
    312317
    313 procedure BtnFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    314 begin
    315   RFrame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, T.ColorBevelShade,
     318procedure BtnFrame(Canvas: TDpiCanvas; P: TRect; T: TTexture);
     319begin
     320  RFrame(Canvas, P.Left - 1, P.Top - 1, P.Right, P.Bottom, T.ColorBevelShade,
    316321    T.ColorBevelLight);
    317322end;
    318323
    319 procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    320 begin
    321   Frame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, $000000, $000000);
    322   Frame(ca, p.Left - 2, p.Top - 2, p.Right + 1, p.Bottom + 1, $000000, $000000);
    323   Frame(ca, p.Left - 3, p.Top - 3, p.Right + 2, p.Bottom + 1, $000000, $000000);
    324   RFrame(ca, p.Left - 4, p.Top - 4, p.Right + 3, p.Bottom + 2, T.ColorBevelShade,
     324procedure EditFrame(Canvas: TDpiCanvas; P: TRect; T: TTexture);
     325begin
     326  Frame(Canvas, P.Left - 1, P.Top - 1, P.Right, P.Bottom, $000000, $000000);
     327  Frame(Canvas, P.Left - 2, P.Top - 2, P.Right + 1, P.Bottom + 1, $000000, $000000);
     328  Frame(Canvas, P.Left - 3, P.Top - 3, P.Right + 2, P.Bottom + 1, $000000, $000000);
     329  RFrame(Canvas, P.Left - 4, P.Top - 4, P.Right + 3, P.Bottom + 2, T.ColorBevelShade,
    325330    T.ColorBevelLight);
    326331end;
     
    328333function HexCharToInt(X: Char): Integer;
    329334begin
    330   case x of
     335  case X of
    331336    '0' .. '9': Result := Ord(X) - Ord('0');
    332337    'A' .. 'F': Result := Ord(X) - Ord('A') + 10;
     
    364369begin
    365370  Bitmap.BeginUpdate;
    366   PixelPtr := PixelPointer(Bitmap);
     371  PixelPtr := TPixelPointer.Create(Bitmap);
    367372  for Y := 0 to ScaleToNative(Bitmap.Height) - 1 do begin
    368373    for X := 0 to ScaleToNative(Bitmap.Width) - 1 do begin
     
    381386begin
    382387  //Dst.SetSize(Src.Width, Src.Height);
    383   SrcPtr := PixelPointer(Src);
    384   DstPtr := PixelPointer(Dst);
     388  SrcPtr := TPixelPointer.Create(Src);
     389  DstPtr := TPixelPointer.Create(Dst);
    385390  for Y := 0 to ScaleToNative(Src.Height - 1) do begin
    386391    for X := 0 to ScaleToNative(Src.Width - 1) do begin
     
    483488end;
    484489
    485 function LoadGraphicSet(const Name: string): TGraphicSet;
    486 var
    487   x: Integer;
    488   y: Integer;
     490function LoadGraphicSet(const Name: string; Transparency: Boolean = True): TGraphicSet;
     491var
     492  X: Integer;
     493  Y: Integer;
    489494  OriginalColor: Integer;
    490495  FileName: string;
     
    508513    Result.ResetPixUsed;
    509514
    510     Result.Mask.SetSize(Result.Data.Width, Result.Data.Height);
    511 
    512     Result.Data.BeginUpdate;
    513     Result.Mask.BeginUpdate;
    514     DataPixel := PixelPointer(Result.Data);
    515     MaskPixel := PixelPointer(Result.Mask);
    516     for y := 0 to ScaleToNative(Result.Data.Height) - 1 do begin
    517       for x := 0 to ScaleToNative(Result.Data.Width) - 1 do begin
    518         OriginalColor := DataPixel.Pixel^.ARGB and $FFFFFF;
    519         if (OriginalColor = TransparentColor1) or (OriginalColor = TransparentColor2) then begin
    520           MaskPixel.Pixel^.R := $FF;
    521           MaskPixel.Pixel^.G := $FF;
    522           MaskPixel.Pixel^.B := $FF;
    523           DataPixel.Pixel^.R := 0;
    524           DataPixel.Pixel^.G := 0;
    525           DataPixel.Pixel^.B := 0;
    526         end else begin
    527           MaskPixel.Pixel^.R := $00;
    528           MaskPixel.Pixel^.G := $00;
    529           MaskPixel.Pixel^.B := $00;
     515    if Transparency then begin
     516      Result.Mask.SetSize(Result.Data.Width, Result.Data.Height);
     517
     518      Result.Data.BeginUpdate;
     519      Result.Mask.BeginUpdate;
     520      DataPixel := TPixelPointer.Create(Result.Data);
     521      MaskPixel := TPixelPointer.Create(Result.Mask);
     522      for Y := 0 to ScaleToNative(Result.Data.Height) - 1 do begin
     523        for X := 0 to ScaleToNative(Result.Data.Width) - 1 do begin
     524          OriginalColor := DataPixel.Pixel^.ARGB and $FFFFFF;
     525          if (OriginalColor = TransparentColor1) or (OriginalColor = TransparentColor2) then begin
     526            MaskPixel.Pixel^.R := $FF;
     527            MaskPixel.Pixel^.G := $FF;
     528            MaskPixel.Pixel^.B := $FF;
     529            DataPixel.Pixel^.R := 0;
     530            DataPixel.Pixel^.G := 0;
     531            DataPixel.Pixel^.B := 0;
     532          end else begin
     533            MaskPixel.Pixel^.R := $00;
     534            MaskPixel.Pixel^.G := $00;
     535            MaskPixel.Pixel^.B := $00;
     536          end;
     537          DataPixel.NextPixel;
     538          MaskPixel.NextPixel;
    530539        end;
    531         DataPixel.NextPixel;
    532         MaskPixel.NextPixel;
     540        DataPixel.NextLine;
     541        MaskPixel.NextLine;
    533542      end;
    534       DataPixel.NextLine;
    535       MaskPixel.NextLine;
    536     end;
    537     Result.Data.EndUpdate;
    538     Result.Mask.EndUpdate;
    539 
    540     if Gamma <> 100 then
    541       ApplyGammaToBitmap(Result.Data);
    542   end;
    543 end;
    544 
    545 function LoadGraphicSet2(const Name: string): TGraphicSet;
    546 var
    547   FileName: string;
    548 begin
    549   Result := GrExt.SearchByName(Name);
    550   if not Assigned(Result) then begin
    551     Result := GrExt.AddNew(Name);
    552     FileName := GetGraphicsDir + DirectorySeparator + Name;
    553     if not LoadGraphicFile(Result.Data, FileName, [gfNoGamma]) then begin
    554       Result := nil;
    555       Exit;
    556     end;
    557 
    558     FileName := ExtractFileNameWithoutExt(FileName) + GraphicSetFileExt;
    559     if FileExists(FileName) then
    560       Result.LoadFromFile(FileName);
    561 
    562     Result.ResetPixUsed;
    563   end;
    564 end;
    565 
    566 procedure Dump(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
    567 begin
    568   DpiBitCanvas(dst.Canvas, xDst, yDst, Width, Height,
     543      Result.Data.EndUpdate;
     544      Result.Mask.EndUpdate;
     545
     546      if Gamma <> 100 then
     547        ApplyGammaToBitmap(Result.Data);
     548    end;
     549  end;
     550end;
     551
     552procedure Dump(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
     553begin
     554  DpiBitBltCanvas(dst.Canvas, xDst, yDst, Width, Height,
    569555    HGr.Data.Canvas, xGr, yGr);
    570556end;
     
    576562begin
    577563  Dst.BeginUpdate;
    578   PixelPtr := PixelPointer(Dst, ScaleToNative(X), ScaleToNative(Y));
     564  PixelPtr := TPixelPointer.Create(Dst, ScaleToNative(X), ScaleToNative(Y));
    579565  for YY := 0 to ScaleToNative(Height) - 1 do begin
    580566    for XX := 0 to ScaleToNative(Width) - 1 do begin
     
    595581begin
    596582  Dst.BeginUpdate;
    597   PixelPtr := PixelPointer(Dst, ScaleToNative(X), ScaleToNative(Y));
     583  PixelPtr := TPixelPointer.Create(Dst, ScaleToNative(X), ScaleToNative(Y));
    598584  for yy := 0 to ScaleToNative(Height) - 1 do begin
    599585    for xx := 0 to ScaleToNative(Width) - 1 do begin
     
    615601begin
    616602  Dst.BeginUpdate;
    617   PixelPtr := PixelPointer(Dst, ScaleToNative(X), ScaleToNative(Y));
     603  PixelPtr := TPixelPointer.Create(Dst, ScaleToNative(X), ScaleToNative(Y));
    618604  for YY := 0 to ScaleToNative(Height) - 1 do begin
    619605    for XX := 0 to ScaleToNative(Width) - 1 do begin
     
    662648    Height := ScaleToNative(dst.Height) - yDst;
    663649  if (Width < 0) or (Height < 0) then
    664     exit;
     650    Exit;
    665651
    666652  dst.BeginUpdate;
    667653  Src.BeginUpdate;
    668   PixelDst := PixelPointer(Dst, xDst, yDst);
    669   PixelSrc := PixelPointer(Src, xSrc, ySrc);
     654  PixelDst := TPixelPointer.Create(Dst, xDst, yDst);
     655  PixelSrc := TPixelPointer.Create(Src, xSrc, ySrc);
    670656  for Y := 0 to Height - 1 do begin
    671657    for X := 0 to Width - 1 do  begin
    672658      Brightness := PixelSrc.Pixel^.B; // One byte for 8-bit color
    673       test := (PixelDst.Pixel^.R * Brightness) shr 7;
    674       if test >= 256 then
     659      Test := (PixelDst.Pixel^.R * Brightness) shr 7;
     660      if Test >= 256 then
    675661        PixelDst.Pixel^.R := 255
    676662      else
    677         PixelDst.Pixel^.R := test; // Red
    678       test := (PixelDst.Pixel^.G * Brightness) shr 7;
    679       if test >= 256 then
     663        PixelDst.Pixel^.R := Test; // Red
     664      Test := (PixelDst.Pixel^.G * Brightness) shr 7;
     665      if Test >= 256 then
    680666        PixelDst.Pixel^.G := 255
    681667      else
    682         PixelDst.Pixel^.G := test; // Green
    683       test := (PixelDst.Pixel^.B * Brightness) shr 7;
    684       if test >= 256 then
     668        PixelDst.Pixel^.G := Test; // Green
     669      Test := (PixelDst.Pixel^.B * Brightness) shr 7;
     670      if Test >= 256 then
    685671        PixelDst.Pixel^.R := 255
    686672      else
     
    728714    Height := ScaleToNative(dst.Height) - yDst;
    729715  if (Width < 0) or (Height < 0) then
    730     exit;
     716    Exit;
    731717
    732718  Src.BeginUpdate;
    733719  dst.BeginUpdate;
    734   SrcPixel := PixelPointer(Src, xSrc, ySrc);
    735   DstPixel := PixelPointer(Dst, xDst, yDst);
     720  SrcPixel := TPixelPointer.Create(Src, xSrc, ySrc);
     721  DstPixel := TPixelPointer.Create(Dst, xDst, yDst);
    736722  for iy := 0 to Height - 1 do begin
    737723    for ix := 0 to Width - 1 do begin
     
    777763// R channel = Color2 amp
    778764var
    779   ix, iy, amp0, amp1, trans, Value: integer;
     765  ix, iy, amp0, amp1, trans, Value: Integer;
    780766  SrcPixel: TPixelPointer;
    781767  DstPixel: TPixelPointer;
     
    789775  Src.BeginUpdate;
    790776  Dst.BeginUpdate;
    791   SrcPixel := PixelPointer(Src, xSrc, ySrc);
    792   DstPixel := PixelPointer(Dst, xDst, yDst);
     777  SrcPixel := TPixelPointer.Create(Src, xSrc, ySrc);
     778  DstPixel := TPixelPointer.Create(Dst, xDst, yDst);
    793779  for iy := 0 to Height - 1 do begin
    794780    for ix := 0 to Width - 1 do begin
     
    819805end;
    820806
    821 procedure ImageOp_CCC(bmp: TDpiBitmap; x, y, Width, Height, Color0, Color1, Color2: Integer);
     807procedure ImageOp_CCC(bmp: TDpiBitmap; X, Y, Width, Height, Color0, Color1, Color2: Integer);
    822808// Bmp is template
    823809// B channel = Color0 amp, 128=original brightness
     
    825811// R channel = Color2 amp, 128=original brightness
    826812var
    827   i, Red, Green: Integer;
     813  I, Red, Green: Integer;
    828814  PixelPtr: TPixelPointer;
    829815begin
     
    833819  Y := ScaleToNative(Y);
    834820  bmp.BeginUpdate;
    835   assert(bmp.PixelFormat = pf24bit);
    836   Height := y + Height;
    837   PixelPtr := PixelPointer(Bmp, x, y);
    838   while y < Height do begin
    839     for i := 0 to Width - 1 do begin
     821  Assert(bmp.PixelFormat = pf24bit);
     822  Height := Y + Height;
     823  PixelPtr := TPixelPointer.Create(Bmp, X, Y);
     824  while Y < Height do begin
     825    for I := 0 to Width - 1 do begin
    840826      Red := ((PixelPtr.Pixel^.B * (Color0 and $0000FF) + PixelPtr.Pixel^.G *
    841827        (Color1 and $0000FF) + PixelPtr.Pixel^.R * (Color2 and $0000FF)) shr 8) and $ff;
     
    850836      PixelPtr.NextPixel;
    851837    end;
    852     Inc(y);
     838    Inc(Y);
    853839    PixelPtr.NextLine;
    854840  end;
     
    856842end;
    857843
    858 procedure Sprite(Canvas: TDpiCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
    859 begin
    860   DpiBitCanvas(Canvas, xDst, yDst, Width, Height,
     844procedure Sprite(Canvas: TDpiCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
     845begin
     846  DpiBitBltCanvas(Canvas, xDst, yDst, Width, Height,
    861847    HGr.Mask.Canvas, xGr, yGr, SRCAND);
    862   DpiBitCanvas(Canvas, xDst, yDst, Width, Height,
     848  DpiBitBltCanvas(Canvas, xDst, yDst, Width, Height,
    863849    HGr.Data.Canvas, xGr, yGr, SRCPAINT);
    864850end;
    865851
    866 procedure Sprite(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
    867 begin
    868   DpiBitCanvas(dst.Canvas, xDst, yDst, Width, Height,
     852procedure Sprite(dst: TDpiBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
     853begin
     854  DpiBitBltCanvas(dst.Canvas, xDst, yDst, Width, Height,
    869855    HGr.Mask.Canvas, xGr, yGr, SRCAND);
    870   DpiBitCanvas(dst.Canvas, xDst, yDst, Width, Height,
     856  DpiBitBltCanvas(dst.Canvas, xDst, yDst, Width, Height,
    871857    HGr.Data.Canvas, xGr, yGr, SRCPAINT);
    872858end;
    873859
    874 function DpiBitCanvas(DestCanvas: TDpiCanvas; X, Y, Width, Height: Integer;
     860function DpiBitBltCanvas(DestCanvas: TDpiCanvas; X, Y, Width, Height: Integer;
    875861  SrcCanvas: TDpiCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
    876862begin
     
    883869end;
    884870
    885 function DpiBitCanvas(Dest: TDpiCanvas; DestRect: TRect; Src: TDpiCanvas;
     871function DpiBitBltCanvas(Dest: TDpiCanvas; DestRect: TRect; Src: TDpiCanvas;
    886872  SrcPos: TPoint; Rop: DWORD): Boolean;
    887873begin
    888   Result := DpiBitCanvas(Dest, DestRect.Left, DestRect.Top, DestRect.Width, DestRect.Height,
     874  Result := DpiBitBltCanvas(Dest, DestRect.Left, DestRect.Top, DestRect.Width, DestRect.Height,
    889875    Src, SrcPos.X, SrcPos.Y, Rop);
    890876end;
     
    893879  Src: TDpiBitmap; XSrc, YSrc: Integer; Rop: DWORD): Boolean;
    894880begin
    895   Result := DpiBitCanvas(Dest.Canvas, X, Y, Width, Height, Src.Canvas, XSrc, YSrc, Rop);
     881  Result := DpiBitBltCanvas(Dest.Canvas, X, Y, Width, Height, Src.Canvas, XSrc, YSrc, Rop);
    896882end;
    897883
     
    899885  SrcPos: TPoint; Rop: DWORD): Boolean;
    900886begin
    901   Result := DpiBitCanvas(Dest.Canvas, DestRect, Src.Canvas, SrcPos, Rop);
    902 end;
    903 
    904 procedure SLine(ca: TDpiCanvas; x0, x1, y: integer; cl: TColor);
    905 begin
    906   with ca do begin
     887  Result := DpiBitBltCanvas(Dest.Canvas, DestRect, Src.Canvas, SrcPos, Rop);
     888end;
     889
     890procedure SLine(Canvas: TDpiCanvas; x0, x1, Y: Integer; cl: TColor);
     891begin
     892  with Canvas do begin
    907893    Pen.Color := cl;
    908     MoveTo(x0, y);
    909     LineTo(x1 + 1, y);
    910   end;
    911 end;
    912 
    913 procedure DLine(ca: TDpiCanvas; x0, x1, y: integer; cl0, cl1: TColor);
    914 begin
    915   with ca do begin
     894    MoveTo(x0, Y);
     895    LineTo(x1 + 1, Y);
     896  end;
     897end;
     898
     899procedure DLine(Canvas: TDpiCanvas; x0, x1, Y: Integer; cl0, cl1: TColor);
     900begin
     901  with Canvas do begin
    916902    Pen.Color := cl0;
    917     MoveTo(x0, y);
    918     LineTo(x1, y);
     903    MoveTo(x0, Y);
     904    LineTo(x1, Y);
    919905    Pen.Color := cl1;
    920     MoveTo(x0 + 1, y + 1);
    921     LineTo(x1 + 1, y + 1);
    922     Pixels[x0, y + 1] := cl0;
    923     Pixels[x1, y] := cl1;
    924   end;
    925 end;
    926 
    927 procedure Frame(ca: TDpiCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
    928 begin
    929   with ca do begin
     906    MoveTo(x0 + 1, Y + 1);
     907    LineTo(x1 + 1, Y + 1);
     908    Pixels[x0, Y + 1] := cl0;
     909    Pixels[x1, Y] := cl1;
     910  end;
     911end;
     912
     913procedure Frame(Canvas: TDpiCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
     914begin
     915  with Canvas do begin
    930916    MoveTo(x0, y1);
    931917    Pen.Color := cl0;
     
    938924end;
    939925
    940 procedure RFrame(ca: TDpiCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
    941 begin
    942   with ca do begin
     926procedure RFrame(Canvas: TDpiCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
     927begin
     928  with Canvas do begin
    943929    Pen.Color := cl0;
    944930    MoveTo(x0, y0 + 1);
     
    954940end;
    955941
    956 procedure CFrame(ca: TDpiCanvas; x0, y0, x1, y1, Corner: integer; cl: TColor);
    957 begin
    958   with ca do begin
     942procedure CFrame(Canvas: TDpiCanvas; x0, y0, x1, y1, Corner: Integer; cl: TColor);
     943begin
     944  with Canvas do begin
    959945    Pen.Color := cl;
    960946    MoveTo(x0, y0 + Corner - 1);
     
    973959end;
    974960
    975 procedure FrameImage(ca: TDpiCanvas; Src: TDpiBitmap;
    976   x, y, Width, Height, xSrc, ySrc: integer; IsControl: boolean = False);
     961procedure FrameImage(Canvas: TDpiCanvas; Src: TDpiBitmap;
     962  X, Y, Width, Height, xSrc, ySrc: Integer; IsControl: Boolean = False);
    977963begin
    978964  if IsControl then begin
    979     Frame(ca, x - 1, y - 1, x + Width, y + Height, $B0B0B0, $FFFFFF);
    980     RFrame(ca, x - 2, y - 2, x + Width + 1, y + Height + 1, $FFFFFF, $B0B0B0);
     965    Frame(Canvas, X - 1, Y - 1, X + Width, Y + Height, $B0B0B0, $FFFFFF);
     966    RFrame(Canvas, X - 2, Y - 2, X + Width + 1, Y + Height + 1, $FFFFFF, $B0B0B0);
    981967  end else
    982     Frame(ca, x - 1, y - 1, x + Width, y + Height, $000000, $000000);
    983   DpiBitCanvas(ca, x, y, Width, Height, Src.Canvas, xSrc, ySrc);
     968    Frame(Canvas, X - 1, Y - 1, X + Width, Y + Height, $000000, $000000);
     969  DpiBitBltCanvas(Canvas, X, Y, Width, Height, Src.Canvas, xSrc, ySrc);
    984970end;
    985971
    986972procedure GlowFrame(Dst: TDpiBitmap; x0, y0, Width, Height: Integer; cl: TColor);
    987973var
    988   x, y, ch, r: Integer;
     974  X, Y, ch, R: Integer;
    989975  DstPtr: TPixelPointer;
    990976  DpiGlowRange: Integer;
     
    996982  Height := ScaleToNative(Height);
    997983  Dst.BeginUpdate;
    998   DstPtr := PixelPointer(Dst, x0 - DpiGlowRange + 1, y0 - DpiGlowRange + 1);
    999   for y := -DpiGlowRange + 1 to Height - 1 + DpiGlowRange - 1 do begin
    1000     for x := -DpiGlowRange + 1 to Width - 1 + DpiGlowRange - 1 do begin
    1001       if x < 0 then
    1002         if y < 0 then
    1003           r := round(sqrt(sqr(x) + sqr(y)))
    1004         else if y >= Height then
    1005           r := round(sqrt(sqr(x) + sqr(y - (Height - 1))))
     984  DstPtr := TPixelPointer.Create(Dst, x0 - DpiGlowRange + 1, y0 - DpiGlowRange + 1);
     985  for Y := -DpiGlowRange + 1 to Height - 1 + DpiGlowRange - 1 do begin
     986    for X := -DpiGlowRange + 1 to Width - 1 + DpiGlowRange - 1 do begin
     987      if X < 0 then
     988        if Y < 0 then
     989          R := round(sqrt(sqr(X) + sqr(Y)))
     990        else if Y >= Height then
     991          R := round(sqrt(sqr(X) + sqr(Y - (Height - 1))))
    1006992        else
    1007           r := -x
    1008       else if x >= Width then
    1009         if y < 0 then
    1010           r := round(sqrt(sqr(x - (Width - 1)) + sqr(y)))
    1011         else if y >= Height then
    1012           r := round(sqrt(sqr(x - (Width - 1)) + sqr(y - (Height - 1))))
     993          R := -X
     994      else if X >= Width then
     995        if Y < 0 then
     996          R := round(sqrt(sqr(X - (Width - 1)) + sqr(Y)))
     997        else if Y >= Height then
     998          R := round(sqrt(sqr(X - (Width - 1)) + sqr(Y - (Height - 1))))
    1013999        else
    1014           r := x - (Width - 1)
    1015       else if y < 0 then
    1016         r := -y
    1017       else if y >= Height then
    1018         r := y - (Height - 1)
     1000          R := X - (Width - 1)
     1001      else if Y < 0 then
     1002        R := -Y
     1003      else if Y >= Height then
     1004        R := Y - (Height - 1)
    10191005      else begin
    10201006        DstPtr.NextPixel;
    10211007        continue;
    10221008      end;
    1023       if r = 0 then
    1024         r := 1;
    1025       if r < DpiGlowRange then
     1009      if R = 0 then
     1010        R := 1;
     1011      if R < DpiGlowRange then
    10261012        for ch := 0 to 2 do
    10271013          DstPtr.Pixel^.Planes[2 - ch] :=
    1028             (DstPtr.Pixel^.Planes[2 - ch] * (r - 1) + (cl shr (8 * ch) and $FF) *
    1029             (DpiGlowRange - r)) div (DpiGlowRange - 1);
     1014            (DstPtr.Pixel^.Planes[2 - ch] * (R - 1) + (cl shr (8 * ch) and $FF) *
     1015            (DpiGlowRange - R)) div (DpiGlowRange - 1);
    10301016      DstPtr.NextPixel;
    10311017    end;
     
    10481034    MainTexture.ColorBevelLight and $FCFCFC shr 2);
    10491035  HGrSystem2.Data.BeginUpdate;
    1050   PixelPtr := PixelPointer(HGrSystem2.Data, ScaleToNative(Ornament.Left), ScaleToNative(Ornament.Top));
     1036  PixelPtr := TPixelPointer.Create(HGrSystem2.Data, ScaleToNative(Ornament.Left),
     1037    ScaleToNative(Ornament.Top));
    10511038  if PixelPtr.BytesPerPixel = 3 then begin
    10521039    for Y := 0 to ScaleToNative(Ornament.Height) - 1 do begin
     
    10741061end;
    10751062
    1076 procedure InitCityMark(T: TTexture);
    1077 var
    1078   x: Integer;
    1079   y: Integer;
     1063procedure InitCityMark(Texture: TTexture);
     1064var
     1065  X: Integer;
     1066  Y: Integer;
    10801067  Intensity: Integer;
    10811068begin
    1082   for x := 0 to CityMark1.Width - 1 do begin
    1083     for y := 0 to CityMark1.Height - 1 do begin
    1084       if HGrSystem.Mask.Canvas.Pixels[CityMark1.Left + x, CityMark1.Top + y] = 0 then
     1069  for X := 0 to CityMark1.Width - 1 do begin
     1070    for Y := 0 to CityMark1.Height - 1 do begin
     1071      if HGrSystem.Mask.Canvas.Pixels[CityMark1.Left + X, CityMark1.Top + Y] = 0 then
    10851072      begin
    10861073        Intensity := HGrSystem.Data.Canvas.Pixels[CityMark1.Left +
    1087           x, CityMark1.Top + y] and $FF;
    1088         HGrSystem.Data.Canvas.Pixels[CityMark2.Left + x, CityMark2.Top + y] :=
    1089           T.ColorMark and $FF * Intensity div $FF + T.ColorMark shr 8 and
    1090           $FF * Intensity div $FF shl 8 + T.ColorMark shr 16 and
     1074          X, CityMark1.Top + Y] and $FF;
     1075        HGrSystem.Data.Canvas.Pixels[CityMark2.Left + X, CityMark2.Top + Y] :=
     1076          Texture.ColorMark and $FF * Intensity div $FF + Texture.ColorMark shr 8 and
     1077          $FF * Intensity div $FF shl 8 + Texture.ColorMark shr 16 and
    10911078          $FF * Intensity div $FF shl 16;
    10921079      end;
    10931080    end;
    10941081  end;
    1095   DpiBitCanvas(HGrSystem.Mask.Canvas, CityMark2.Left, CityMark2.Top, CityMark1.Width, CityMark1.Width,
     1082  DpiBitBltCanvas(HGrSystem.Mask.Canvas, CityMark2.Left, CityMark2.Top, CityMark1.Width, CityMark1.Width,
    10961083    HGrSystem.Mask.Canvas, CityMark1.Left, CityMark1.Top);
    10971084end;
    10981085
    1099 procedure Fill(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer);
    1100 begin
    1101   Assert((Left + xOffset >= 0) and (Left + xOffset + Width <= MainTexture.Width) and
    1102     (Top + yOffset >= 0) and (Top + yOffset + Height <= MainTexture.Height));
    1103   DpiBitCanvas(ca, Left, Top, Width, Height, MainTexture.Image.Canvas,
     1086procedure Fill(Canvas: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer);
     1087begin
     1088  //Assert((Left + xOffset >= 0) and (Left + xOffset + Width <= MainTexture.Width) and
     1089  //  (Top + yOffset >= 0) and (Top + yOffset + Height <= MainTexture.Height));
     1090  DpiBitBltCanvas(Canvas, Left, Top, Width, Height, MainTexture.Image.Canvas,
    11041091    Left + xOffset, Top + yOffset);
    11051092end;
     
    11101097end;
    11111098
    1112 procedure FillLarge(ca: TDpiCanvas; x0, y0, x1, y1, xm: Integer);
     1099procedure FillLarge(Canvas: TDpiCanvas; x0, y0, x1, y1, xm: Integer);
    11131100
    11141101  function Band(I: Integer): Integer;
    11151102  var
    1116     n: integer;
     1103    N: Integer;
    11171104  begin
    1118     n := ((MainTexture.Height div 2) div (y1 - y0)) * 2;
     1105    N := ((MainTexture.Height div 2) div (y1 - y0)) * 2;
    11191106    while MainTexture.Height div 2 + (I + 1) * (y1 - y0) > MainTexture.Height do
    1120       Dec(I, n);
     1107      Dec(I, N);
    11211108    while MainTexture.Height div 2 + I * (y1 - y0) < 0 do
    1122       Inc(I, n);
     1109      Inc(I, N);
    11231110    Result := I;
    11241111  end;
     
    11281115begin
    11291116  for I := 0 to (x1 - xm) div MainTexture.Width - 1 do
    1130     DpiBitCanvas(ca, xm + I * MainTexture.Width, y0, MainTexture.Width, y1 - y0,
     1117    DpiBitBltCanvas(Canvas, xm + I * MainTexture.Width, y0, MainTexture.Width, y1 - y0,
    11311118      MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + Band(I) *
    11321119      (y1 - y0));
    1133   DpiBitCanvas(ca, xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width, y0,
     1120  DpiBitBltCanvas(Canvas, xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width, y0,
    11341121    x1 - (xm + ((x1 - xm) div MainTexture.Width) * MainTexture.Width), y1 - y0,
    11351122    MainTexture.Image.Canvas, 0, MainTexture.Height div 2 + Band(
    11361123    (x1 - xm) div MainTexture.Width) * (y1 - y0));
    11371124  for I := 0 to (xm - x0) div MainTexture.Width - 1 do
    1138     DpiBitCanvas(ca, xm - (I + 1) * MainTexture.Width, y0, MainTexture.Width, y1 - y0,
     1125    DpiBitBltCanvas(Canvas, xm - (I + 1) * MainTexture.Width, y0, MainTexture.Width, y1 - y0,
    11391126      MainTexture.Image.Canvas, 0, MainTexture.Height div 2 +
    11401127      Band(-I - 1) * (y1 - y0));
    1141   DpiBitCanvas(ca, x0, y0, xm - ((xm - x0) div MainTexture.Width) *
     1128  DpiBitBltCanvas(Canvas, x0, y0, xm - ((xm - x0) div MainTexture.Width) *
    11421129    MainTexture.Width - x0, y1 - y0, MainTexture.Image.Canvas,
    11431130    ((xm - x0) div MainTexture.Width + 1) * MainTexture.Width - (xm - x0),
     
    11451132end;
    11461133
    1147 procedure FillSeamless(ca: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer;
     1134procedure FillSeamless(Canvas: TDpiCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer;
    11481135  const Texture: TDpiBitmap);
    11491136var
    1150   x, y, x0cut, y0cut, x1cut, y1cut: Integer;
     1137  X, Y, x0cut, y0cut, x1cut, y1cut: Integer;
    11511138begin
    11521139  while xOffset < 0 do
     
    11541141  while yOffset < 0 do
    11551142    Inc(yOffset, Texture.Height);
    1156   for y := (Top + yOffset) div Texture.Height to (Top + yOffset + Height - 1) div
     1143  for Y := (Top + yOffset) div Texture.Height to (Top + yOffset + Height - 1) div
    11571144    Texture.Height do
    11581145  begin
    1159     y0cut := Top + yOffset - y * Texture.Height;
     1146    y0cut := Top + yOffset - Y * Texture.Height;
    11601147    if y0cut < 0 then
    11611148      y0cut := 0;
    1162     y1cut := (y + 1) * Texture.Height - (Top + yOffset + Height);
     1149    y1cut := (Y + 1) * Texture.Height - (Top + yOffset + Height);
    11631150    if y1cut < 0 then
    11641151      y1cut := 0;
    1165     for x := (Left + xOffset) div Texture.Width to (Left + xOffset + Width - 1) div
     1152    for X := (Left + xOffset) div Texture.Width to (Left + xOffset + Width - 1) div
    11661153      Texture.Width do
    11671154    begin
    1168       x0cut := Left + xOffset - x * Texture.Width;
     1155      x0cut := Left + xOffset - X * Texture.Width;
    11691156      if x0cut < 0 then
    11701157        x0cut := 0;
    1171       x1cut := (x + 1) * Texture.Width - (Left + xOffset + Width);
     1158      x1cut := (X + 1) * Texture.Width - (Left + xOffset + Width);
    11721159      if x1cut < 0 then
    11731160        x1cut := 0;
    1174       DpiBitCanvas(ca, x * Texture.Width + x0cut - xOffset,
    1175         y * Texture.Height + y0cut - yOffset, Texture.Width - x0cut - x1cut,
     1161      DpiBitBltCanvas(Canvas, X * Texture.Width + x0cut - xOffset,
     1162        Y * Texture.Height + y0cut - yOffset, Texture.Width - x0cut - x1cut,
    11761163        Texture.Height - y0cut - y1cut, Texture.Canvas, x0cut, y0cut);
    11771164    end;
     
    11791166end;
    11801167
    1181 procedure FillRectSeamless(ca: TDpiCanvas; x0, y0, x1, y1, xOffset, yOffset: Integer;
     1168procedure FillRectSeamless(Canvas: TDpiCanvas; x0, y0, x1, y1, xOffset, yOffset: Integer;
    11821169  const Texture: TDpiBitmap);
    11831170begin
    1184   FillSeamless(ca, x0, y0, x1 - x0, y1 - y0, xOffset, yOffset, Texture);
     1171  FillSeamless(Canvas, x0, y0, x1 - x0, y1 - y0, xOffset, yOffset, Texture);
    11851172end;
    11861173
     
    11911178end;
    11921179
    1193 procedure Corner(ca: TDpiCanvas; x, y, Kind: Integer; T: TTexture);
    1194 begin
    1195   { DpiBitCanvas(ca,x,y,8,8,T.HGr.Mask.Canvas,
     1180procedure Corner(Canvas: TDpiCanvas; X, Y, Kind: Integer; T: TTexture);
     1181begin
     1182  { DpiBitBltCanvas(Canvas,x,y,8,8,T.HGr.Mask.Canvas,
    11961183    T.xGr+29+Kind*9,T.yGr+89,SRCAND);
    1197     DpiBitCanvas(ca,x,y,8,8,T.HGr.Data.Canvas,
     1184    DpiBitBltCanvas(Canvas,X,Y,8,8,T.HGr.Data.Canvas,
    11981185    T.xGr+29+Kind*9,T.yGr+89,SRCPAINT); }
    11991186end;
    12001187
    1201 procedure BiColorTextOut(ca: TDpiCanvas; clMain, clBack: TColor; x, y: Integer; s: string);
    1202 
    1203   procedure PaintIcon(x, y, Kind: Integer);
     1188procedure BiColorTextOut(Canvas: TDpiCanvas; clMain, clBack: TColor; X, Y: Integer; S: string);
     1189
     1190  procedure PaintIcon(X, Y, Kind: Integer);
    12041191  begin
    1205     DpiBitCanvas(ca, x, y + 6, 10, 10, HGrSystem.Mask.Canvas,
     1192    DpiBitBltCanvas(Canvas, X, Y + 6, 10, 10, HGrSystem.Mask.Canvas,
    12061193      66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCAND);
    1207     DpiBitCanvas(ca, x, y + 6, 10, 10, HGrSystem.Data.Canvas,
     1194    DpiBitBltCanvas(Canvas, X, Y + 6, 10, 10, HGrSystem.Data.Canvas,
    12081195      66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCPAINT);
    12091196  end;
    12101197
    12111198var
    1212   p, xp: Integer;
     1199  P, xp: Integer;
    12131200  sp: string;
    12141201  shadow: Boolean;
    12151202  Text: string;
    12161203begin
    1217   Inc(x);
    1218   Inc(y);
     1204  Inc(X);
     1205  Inc(Y);
    12191206  for shadow := True downto False do
    1220     with ca do
     1207    with Canvas do
    12211208      if not shadow or (clBack <> $7F007F) then
    12221209      begin
     
    12251212        else
    12261213          Font.Color := clMain;
    1227         sp := s;
    1228         xp := x;
     1214        sp := S;
     1215        xp := X;
    12291216        repeat
    1230           p := pos('%', sp);
    1231           if (p = 0) or (p + 1 > Length(sp)) or not
    1232             (sp[p + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w']) then
     1217          P := Pos('%', sp);
     1218          if (P = 0) or (P + 1 > Length(sp)) or not
     1219            (sp[P + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w']) then
    12331220          begin
    1234             ca.Textout(xp, y, sp);
     1221            Canvas.Textout(xp, Y, sp);
    12351222            Break;
    12361223          end
    12371224          else
    12381225          begin
    1239             Text := Copy(sp, 1, p - 1);
    1240             Textout(xp, y, Text);
    1241             Inc(xp, ca.TextWidth(Text));
     1226            Text := Copy(sp, 1, P - 1);
     1227            Textout(xp, Y, Text);
     1228            Inc(xp, Canvas.TextWidth(Text));
    12421229            if not shadow then
    1243               case sp[p + 1] of
    1244                 'c': PaintIcon(xp + 1, y, 6);
    1245                 'f': PaintIcon(xp + 1, y, 0);
    1246                 'l': PaintIcon(xp + 1, y, 8);
    1247                 'm': PaintIcon(xp + 1, y, 17);
    1248                 'n': PaintIcon(xp + 1, y, 7);
    1249                 'o': PaintIcon(xp + 1, y, 16);
    1250                 'p': PaintIcon(xp + 1, y, 2);
    1251                 'r': PaintIcon(xp + 1, y, 12);
    1252                 't': PaintIcon(xp + 1, y, 4);
    1253                 'w': PaintIcon(xp + 1, y, 13);
     1230              case sp[P + 1] of
     1231                'c': PaintIcon(xp + 1, Y, 6);
     1232                'f': PaintIcon(xp + 1, Y, 0);
     1233                'l': PaintIcon(xp + 1, Y, 8);
     1234                'm': PaintIcon(xp + 1, Y, 17);
     1235                'n': PaintIcon(xp + 1, Y, 7);
     1236                'o': PaintIcon(xp + 1, Y, 16);
     1237                'p': PaintIcon(xp + 1, Y, 2);
     1238                'r': PaintIcon(xp + 1, Y, 12);
     1239                't': PaintIcon(xp + 1, Y, 4);
     1240                'w': PaintIcon(xp + 1, Y, 13);
    12541241              end;
    12551242            Inc(xp, 10);
    1256             Delete(sp, 1, p + 1);
     1243            Delete(sp, 1, P + 1);
    12571244          end;
    12581245        until False;
    1259         Dec(x);
    1260         Dec(y);
     1246        Dec(X);
     1247        Dec(Y);
    12611248      end;
    12621249end;
    12631250
    1264 function BiColorTextWidth(ca: TDpiCanvas; s: string): Integer;
     1251function BiColorTextWidth(Canvas: TDpiCanvas; S: string): Integer;
    12651252var
    12661253  P: Integer;
     
    12681255  Result := 1;
    12691256  repeat
    1270     P := Pos('%', s);
    1271     if (P = 0) or (P = Length(s)) then
     1257    P := Pos('%', S);
     1258    if (P = 0) or (P = Length(S)) then
    12721259    begin
    1273       Inc(Result, ca.TextWidth(s));
     1260      Inc(Result, Canvas.TextWidth(S));
    12741261      Break;
    12751262    end
    12761263    else
    12771264    begin
    1278       if not (s[P + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w'])
     1265      if not (S[P + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w'])
    12791266      then
    1280         Inc(Result, ca.TextWidth(copy(s, 1, P + 1)))
     1267        Inc(Result, Canvas.TextWidth(Copy(S, 1, P + 1)))
    12811268      else
    1282         Inc(Result, ca.TextWidth(copy(s, 1, P - 1)) + 10);
    1283       Delete(s, 1, P + 1);
     1269        Inc(Result, Canvas.TextWidth(Copy(S, 1, P - 1)) + 10);
     1270      Delete(S, 1, P + 1);
    12841271    end;
    12851272  until False;
    12861273end;
    12871274
    1288 procedure LoweredTextOut(ca: TDpiCanvas; cl: TColor; T: TTexture;
    1289   x, y: Integer; s: string);
     1275procedure LoweredTextOut(Canvas: TDpiCanvas; cl: TColor; T: TTexture;
     1276  X, Y: Integer; S: string);
    12901277begin
    12911278  if cl = -2 then
    1292     BiColorTextOut(ca, (T.ColorBevelShade and $FEFEFE) shr 1,
    1293       T.ColorBevelLight, x, y, s)
     1279    BiColorTextOut(Canvas, (T.ColorBevelShade and $FEFEFE) shr 1,
     1280      T.ColorBevelLight, X, Y, S)
    12941281  else if cl < 0 then
    1295     BiColorTextOut(ca, T.ColorTextShade, T.ColorTextLight, x, y, s)
     1282    BiColorTextOut(Canvas, T.ColorTextShade, T.ColorTextLight, X, Y, S)
    12961283  else
    1297     BiColorTextOut(ca, cl, T.ColorTextLight, x, y, s);
    1298 end;
    1299 
    1300 procedure RisedTextOut(ca: TDpiCanvas; x, y: integer; s: string);
    1301 begin
    1302   BiColorTextOut(ca, $FFFFFF, $000000, x, y, s);
    1303 end;
    1304 
    1305 procedure Gradient(ca: TDpiCanvas; x, y, dx, dy, Width, Height, Color: Integer;
    1306   Brightness: array of integer);
    1307 var
    1308   i, r, g, b: Integer;
    1309 begin
    1310   for i := 0 to Length(Brightness) - 1 do begin // gradient
    1311     r := Color and $FF + Brightness[i];
    1312     if r < 0 then
    1313       r := 0
    1314     else if r >= 256 then
    1315       r := 255;
    1316     g := Color shr 8 and $FF + Brightness[i];
    1317     if g < 0 then
    1318       g := 0
    1319     else if g >= 256 then
    1320       g := 255;
    1321     b := Color shr 16 and $FF + Brightness[i];
    1322     if b < 0 then
    1323       b := 0
    1324     else if b >= 256 then
    1325       b := 255;
    1326     ca.Pen.Color := r + g shl 8 + b shl 16;
    1327     ca.MoveTo(x + dx * i, y + dy * i);
    1328     ca.LineTo(x + dx * i + Width, y + dy * i + Height);
    1329   end;
    1330   ca.Pen.Color := $000000;
    1331   ca.MoveTo(x + 1, y + 16 * dy + Height);
    1332   ca.LineTo(x + 16 * dx + Width, y + 16 * dy + Height);
    1333   ca.LineTo(x + 16 * dx + Width, y);
    1334 end;
    1335 
    1336 procedure LightGradient(ca: TDpiCanvas; x, y, Width, Color: Integer);
     1284    BiColorTextOut(Canvas, cl, T.ColorTextLight, X, Y, S);
     1285end;
     1286
     1287procedure RisedTextOut(Canvas: TDpiCanvas; X, Y: Integer; S: string);
     1288begin
     1289  BiColorTextOut(Canvas, $FFFFFF, $000000, X, Y, S);
     1290end;
     1291
     1292procedure Gradient(Canvas: TDpiCanvas; X, Y, dx, dy, Width, Height, Color: Integer;
     1293  Brightness: array of Integer);
     1294var
     1295  I, R, G, B: Integer;
     1296begin
     1297  for I := 0 to Length(Brightness) - 1 do begin // gradient
     1298    R := Color and $FF + Brightness[I];
     1299    if R < 0 then
     1300      R := 0
     1301    else if R >= 256 then
     1302      R := 255;
     1303    G := Color shr 8 and $FF + Brightness[I];
     1304    if G < 0 then
     1305      G := 0
     1306    else if G >= 256 then
     1307      G := 255;
     1308    B := Color shr 16 and $FF + Brightness[I];
     1309    if B < 0 then
     1310      B := 0
     1311    else if B >= 256 then
     1312      B := 255;
     1313    Canvas.Pen.Color := R + G shl 8 + B shl 16;
     1314    Canvas.MoveTo(X + dx * I, Y + dy * I);
     1315    Canvas.LineTo(X + dx * I + Width, Y + dy * I + Height);
     1316  end;
     1317  Canvas.Pen.Color := $000000;
     1318  Canvas.MoveTo(X + 1, Y + 16 * dy + Height);
     1319  Canvas.LineTo(X + 16 * dx + Width, Y + 16 * dy + Height);
     1320  Canvas.LineTo(X + 16 * dx + Width, Y);
     1321end;
     1322
     1323procedure LightGradient(Canvas: TDpiCanvas; X, Y, Width, Color: Integer);
    13371324const
    1338   Brightness: array [0 .. 15] of integer =
     1325  Brightness: array [0 .. 15] of Integer =
    13391326    (16, 12, 8, 4, 0, -4, -8, -12, -16, -20, -24, -28, -32, -36, -40, -44);
    13401327begin
    1341   Gradient(ca, x, y, 0, 1, Width, 0, Color, Brightness);
    1342 end;
    1343 
    1344 procedure DarkGradient(ca: TDpiCanvas; x, y, Width, Kind: Integer);
     1328  Gradient(Canvas, X, Y, 0, 1, Width, 0, Color, Brightness);
     1329end;
     1330
     1331procedure DarkGradient(Canvas: TDpiCanvas; X, Y, Width, Kind: Integer);
    13451332const
    1346   Brightness: array [0 .. 15] of integer =
     1333  Brightness: array [0 .. 15] of Integer =
    13471334    (16, 12, 8, 4, 0, -4, -8, -12 - 24, -16 + 16, -20, -24, -28, -32, -36, -40, -44);
    13481335begin
    1349   Gradient(ca, x, y, 0, 1, Width, 0, HGrSystem.Data.Canvas.Pixels
     1336  Gradient(Canvas, X, Y, 0, 1, Width, 0, HGrSystem.Data.Canvas.Pixels
    13501337    [187, 137 + Kind], Brightness);
    13511338end;
    13521339
    1353 procedure VLightGradient(ca: TDpiCanvas; x, y, Height, Color: Integer);
     1340procedure VLightGradient(Canvas: TDpiCanvas; X, Y, Height, Color: Integer);
    13541341const
    1355   Brightness: array [0 .. 15] of integer =
     1342  Brightness: array [0 .. 15] of Integer =
    13561343    (16, 12, 8, 4, 0, -4, -8, -12, -16, -20, -24, -28, -32, -36, -40, -44);
    13571344begin
    1358   Gradient(ca, x, y, 1, 0, 0, Height, Color, Brightness);
    1359 end;
    1360 
    1361 procedure VDarkGradient(ca: TDpiCanvas; x, y, Height, Kind: Integer);
     1345  Gradient(Canvas, X, Y, 1, 0, 0, Height, Color, Brightness);
     1346end;
     1347
     1348procedure VDarkGradient(Canvas: TDpiCanvas; X, Y, Height, Kind: Integer);
    13621349const
    1363   Brightness: array [0 .. 15] of integer =
     1350  Brightness: array [0 .. 15] of Integer =
    13641351    (16, 12, 8, 4, 0, -4, -8, -12 - 24, -16 + 16, -20, -24, -28, -32, -36, -40, -44);
    13651352begin
    1366   Gradient(ca, x, y, 1, 0, 0, Height,
     1353  Gradient(Canvas, X, Y, 1, 0, 0, Height,
    13671354    HGrSystem.Data.Canvas.Pixels[187, 137 + Kind], Brightness);
    13681355end;
     
    13751362end;
    13761363
    1377 procedure NumberBar(dst: TDpiBitmap; x, y: integer; Cap: string;
     1364procedure NumberBar(dst: TDpiBitmap; X, Y: Integer; Cap: string;
    13781365  val: Integer; T: TTexture);
    13791366var
    1380   s: string;
     1367  S: string;
    13811368begin
    13821369  if val > 0 then
    13831370  begin
    1384     DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade,
     1371    DLine(dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade,
    13851372      T.ColorBevelLight);
    1386     LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap);
    1387     s := IntToStr(val);
    1388     RisedTextOut(dst.Canvas, x + 170 - BiColorTextWidth(dst.Canvas,
    1389       s), y, s);
    1390   end;
    1391 end;
    1392 
    1393 procedure CountBar(dst: TDpiBitmap; x, y, w: Integer; Kind: Integer;
     1373    LoweredTextOut(dst.Canvas, -1, T, X - 2, Y, Cap);
     1374    S := IntToStr(val);
     1375    RisedTextOut(dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas,
     1376      S), Y, S);
     1377  end;
     1378end;
     1379
     1380procedure CountBar(dst: TDpiBitmap; X, Y, W: Integer; Kind: Integer;
    13941381  Cap: string; val: Integer; T: TTexture);
    13951382var
    1396   i, sd, ld, cl, xIcon, yIcon: Integer;
    1397   s: string;
     1383  I, sd, ld, cl, xIcon, yIcon: Integer;
     1384  S: string;
    13981385begin
    13991386  // val:=random(40); //!!!
     
    14071394    // DLine(dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight);
    14081395
    1409     xIcon := x - 5;
    1410     yIcon := y + 15;
    1411     DLine(dst.Canvas, x - 2, xIcon + w + 2, yIcon + 16, T.ColorBevelShade,
     1396    xIcon := X - 5;
     1397    yIcon := Y + 15;
     1398    DLine(dst.Canvas, X - 2, xIcon + W + 2, yIcon + 16, T.ColorBevelShade,
    14121399      T.ColorBevelLight);
    14131400
    1414     s := IntToStr(val);
     1401    S := IntToStr(val);
    14151402    if val < 0 then
    14161403      cl := $0000FF
    14171404    else
    14181405      cl := -1;
    1419     LoweredTextOut(dst.Canvas, cl, T, x - 2, y, Cap);
     1406    LoweredTextOut(dst.Canvas, cl, T, X - 2, Y, Cap);
    14201407    LoweredTextOut(dst.Canvas, cl, T,
    1421       xIcon + w + 2 - BiColorTextWidth(dst.Canvas, s), yIcon, s);
     1408      xIcon + W + 2 - BiColorTextWidth(dst.Canvas, S), yIcon, S);
    14221409
    14231410    if (Kind = 12) and (val >= 100) then
     
    14271414      if sd = 0 then
    14281415        sd := 1;
    1429       if sd < w - 44 then
     1416      if sd < W - 44 then
    14301417        ld := sd
    14311418      else
    1432         ld := w - 44;
    1433       for i := 0 to val mod 10 - 1 do
     1419        ld := W - 44;
     1420      for I := 0 to val mod 10 - 1 do
    14341421      begin
    1435         DpiBitCanvas(dst.Canvas, xIcon + 4 + i * (14 * ld div sd), yIcon + 2 + 1, 14,
     1422        DpiBitBltCanvas(dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 2 + 1, 14,
    14361423          14, HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15,
    14371424          70 + Kind div 8 * 15, SRCAND);
    1438         Sprite(dst, HGrSystem, xIcon + 3 + i * (14 * ld div sd), yIcon + 2,
     1425        Sprite(dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2,
    14391426          14, 14, 67 + Kind mod 8 * 15, 70 + Kind div 8 * 15);
    14401427      end;
    1441       for i := 0 to val div 10 - 1 do
     1428      for I := 0 to val div 10 - 1 do
    14421429      begin
    1443         DpiBitCanvas(dst.Canvas, xIcon + 4 + (val mod 10) *
    1444           (14 * ld div sd) + i * (14 * ld div sd), yIcon + 3, 14, 14,
     1430        DpiBitBltCanvas(dst.Canvas, xIcon + 4 + (val mod 10) *
     1431          (14 * ld div sd) + I * (14 * ld div sd), yIcon + 3, 14, 14,
    14451432          HGrSystem.Mask.Canvas, 67 + 7 mod 8 * 15,
    14461433          70 + 7 div 8 * 15, SRCAND);
    14471434        Sprite(dst, HGrSystem, xIcon + 3 + (val mod 10) *
    1448           (14 * ld div sd) + i * (14 * ld div sd), yIcon + 2, 14,
     1435          (14 * ld div sd) + I * (14 * ld div sd), yIcon + 2, 14,
    14491436          14, 67 + 7 mod 8 * 15,
    14501437          70 + 7 div 8 * 15);
     
    14601447      if sd = 0 then
    14611448        sd := 1;
    1462       if sd < w - 44 then
     1449      if sd < W - 44 then
    14631450        ld := sd
    14641451      else
    1465         ld := w - 44;
    1466       for i := 0 to val div 10 - 1 do
     1452        ld := W - 44;
     1453      for I := 0 to val div 10 - 1 do
    14671454      begin
    1468         DpiBitCanvas(dst.Canvas, xIcon + 4 + i * (14 * ld div sd), yIcon + 3, 14, 14,
     1455        DpiBitBltCanvas(dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 3, 14, 14,
    14691456          HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15,
    14701457          70 + Kind div 8 * 15, SRCAND);
    1471         Sprite(dst, HGrSystem, xIcon + 3 + i * (14 * ld div sd), yIcon + 2,
     1458        Sprite(dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2,
    14721459          14, 14, 67 + Kind mod 8 * 15, 70 + Kind div 8 * 15);
    14731460      end;
    1474       for i := 0 to val mod 10 - 1 do
     1461      for I := 0 to val mod 10 - 1 do
    14751462      begin
    1476         DpiBitCanvas(dst.Canvas, xIcon + 4 + (val div 10) *
    1477           (14 * ld div sd) + i * (10 * ld div sd), yIcon + 7, 10, 10,
     1463        DpiBitBltCanvas(dst.Canvas, xIcon + 4 + (val div 10) *
     1464          (14 * ld div sd) + I * (10 * ld div sd), yIcon + 7, 10, 10,
    14781465          HGrSystem.Mask.Canvas, 66 + Kind mod 11 * 11,
    14791466          115 + Kind div 11 * 11, SRCAND);
    14801467        Sprite(dst, HGrSystem, xIcon + 3 + (val div 10) *
    1481           (14 * ld div sd) + i * (10 * ld div sd), yIcon + 6, 10,
     1468          (14 * ld div sd) + I * (10 * ld div sd), yIcon + 6, 10,
    14821469          10, 66 + Kind mod 11 * 11,
    14831470          115 + Kind div 11 * 11);
     
    14871474end;
    14881475
    1489 procedure PaintProgressBar(ca: TDpiCanvas; Kind, x, y, pos, Growth, max: Integer;
     1476procedure PaintProgressBar(Canvas: TDpiCanvas; Kind, X, Y, Pos, Growth, Max: Integer;
    14901477  T: TTexture);
    14911478var
    1492   i: Integer;
    1493 begin
    1494   if pos > max then
    1495     pos := max;
     1479  I: Integer;
     1480begin
     1481  if Pos > Max then
     1482    Pos := Max;
    14961483  if Growth < 0 then
    14971484  begin
    1498     pos := pos + Growth;
    1499     if pos < 0 then
     1485    Pos := Pos + Growth;
     1486    if Pos < 0 then
    15001487    begin
    1501       Growth := Growth - pos;
    1502       pos := 0;
     1488      Growth := Growth - Pos;
     1489      Pos := 0;
    15031490    end;
    15041491  end
    1505   else if pos + Growth > max then
    1506     Growth := max - pos;
    1507   Frame(ca, x - 1, y - 1, x + max, y + 7, $000000, $000000);
    1508   RFrame(ca, x - 2, y - 2, x + max + 1, y + 8, T.ColorBevelShade,
     1492  else if Pos + Growth > Max then
     1493    Growth := Max - Pos;
     1494  Frame(Canvas, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000);
     1495  RFrame(Canvas, X - 2, Y - 2, X + Max + 1, Y + 8, T.ColorBevelShade,
    15091496    T.ColorBevelLight);
    1510   with ca do
     1497  with Canvas do
    15111498  begin
    1512     for i := 0 to pos div 8 - 1 do
    1513       DpiBitCanvas(ca, x + i * 8, y, 8, 7,
     1499    for I := 0 to Pos div 8 - 1 do
     1500      DpiBitBltCanvas(Canvas, X + I * 8, Y, 8, 7,
    15141501        HGrSystem.Data.Canvas, 104, 9 + 8 * Kind);
    1515     DpiBitCanvas(ca, x + 8 * (pos div 8), y, pos - 8 * (pos div 8), 7,
     1502    DpiBitBltCanvas(Canvas, X + 8 * (Pos div 8), Y, Pos - 8 * (Pos div 8), 7,
    15161503      HGrSystem.Data.Canvas, 104, 9 + 8 * Kind);
    15171504    if Growth > 0 then
    15181505    begin
    1519       for i := 0 to Growth div 8 - 1 do
    1520         DpiBitCanvas(ca, x + pos + i * 8, y, 8, 7,
     1506      for I := 0 to Growth div 8 - 1 do
     1507        DpiBitBltCanvas(Canvas, X + Pos + I * 8, Y, 8, 7,
    15211508          HGrSystem.Data.Canvas, 112, 9 + 8 * Kind);
    1522       DpiBitCanvas(ca, x + pos + 8 * (Growth div 8), y,
     1509      DpiBitBltCanvas(Canvas, X + Pos + 8 * (Growth div 8), Y,
    15231510        Growth - 8 * (Growth div 8), 7, HGrSystem.Data.Canvas,
    15241511        112, 9 + 8 * Kind);
     
    15261513    else if Growth < 0 then
    15271514    begin
    1528       for i := 0 to -Growth div 8 - 1 do
    1529         DpiBitCanvas(ca, x + pos + i * 8, y, 8, 7,
     1515      for I := 0 to -Growth div 8 - 1 do
     1516        DpiBitBltCanvas(Canvas, X + Pos + I * 8, Y, 8, 7,
    15301517          HGrSystem.Data.Canvas, 104, 1);
    1531       DpiBitCanvas(ca, x + pos + 8 * (-Growth div 8), y, -Growth -
     1518      DpiBitBltCanvas(Canvas, X + Pos + 8 * (-Growth div 8), Y, -Growth -
    15321519        8 * (-Growth div 8), 7,
    15331520        HGrSystem.Data.Canvas, 104, 1);
    15341521    end;
    15351522    Brush.Color := $000000;
    1536     FillRect(Rect(x + pos + abs(Growth), y, x + max, y + 7));
     1523    FillRect(Rect(X + Pos + abs(Growth), Y, X + Max, Y + 7));
    15371524    Brush.Style := bsClear;
    15381525  end;
     
    15401527
    15411528// pos and growth are relative to max, set size independent
    1542 procedure PaintRelativeProgressBar(ca: TDpiCanvas;
    1543   Kind, x, y, size, pos, Growth, max: Integer; IndicateComplete: Boolean;
     1529procedure PaintRelativeProgressBar(Canvas: TDpiCanvas;
     1530  Kind, X, Y, size, Pos, Growth, Max: Integer; IndicateComplete: Boolean;
    15441531  T: TTexture);
    15451532begin
    15461533  if Growth > 0 then
    1547     PaintProgressBar(ca, Kind, x, y, pos * size div max,
    1548       (Growth * size + max div 2) div max, size, T)
     1534    PaintProgressBar(Canvas, Kind, X, Y, Pos * size div Max,
     1535      (Growth * size + Max div 2) div Max, size, T)
    15491536  else
    1550     PaintProgressBar(ca, Kind, x, y, pos * size div max,
    1551       (Growth * size - max div 2) div max, size, T);
    1552   if IndicateComplete and (pos + Growth >= max) then
    1553     Sprite(ca, HGrSystem, x + size - 10, y - 7, 23, 16, 1, 129);
     1537    PaintProgressBar(Canvas, Kind, X, Y, Pos * size div Max,
     1538      (Growth * size - Max div 2) div Max, size, T);
     1539  if IndicateComplete and (Pos + Growth >= Max) then
     1540    Sprite(Canvas, HGrSystem, X + size - 10, Y - 7, 23, 16, 1, 129);
    15541541end;
    15551542
     
    15571544begin
    15581545  UnshareBitmap(LogoBuffer);
    1559   DpiBitCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y);
     1546  DpiBitBltCanvas(LogoBuffer.Canvas, 0, 0, Logo.Width, Logo.Height, Canvas, X, Y);
    15601547  ImageOp_BCC(LogoBuffer, Templates.Data, Point(0, 0), Logo.BoundsRect,
    15611548    LightColor, ShadeColor);
    1562   DpiBitCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
     1549  DpiBitBltCanvas(Canvas, X, Y, Logo.Width, Logo.Height, LogoBuffer.Canvas, 0, 0);
    15631550end;
    15641551
     
    16021589  TexWidth := Texture.Width;
    16031590  TexHeight := Texture.Height;
    1604   DstPixel := PixelPointer(Dest);
    1605   SrcPixel := PixelPointer(Texture);
     1591  DstPixel := TPixelPointer.Create(Dest);
     1592  SrcPixel := TPixelPointer.Create(Texture);
    16061593  for Y := 0 to ScaleToNative(Dest.Height) - 1 do begin
    16071594    for X := 0 to ScaleToNative(Dest.Width) - 1 do begin
     
    16211608procedure DarkenImage(Bitmap: TDpiBitmap; Change: Integer);
    16221609var
    1623   x, y: integer;
     1610  X, Y: Integer;
    16241611  PicturePixel: TPixelPointer;
    16251612begin
    16261613  Bitmap.BeginUpdate;
    1627   PicturePixel := PixelPointer(Bitmap);
    1628   for y := 0 to ScaleToNative(Bitmap.Height) - 1 do begin
    1629     for x := 0 to ScaleToNative(Bitmap.Width) - 1 do begin
     1614  PicturePixel := TPixelPointer.Create(Bitmap);
     1615  for Y := 0 to ScaleToNative(Bitmap.Height) - 1 do begin
     1616    for X := 0 to ScaleToNative(Bitmap.Width) - 1 do begin
    16301617      PicturePixel.Pixel^.B := Max(PicturePixel.Pixel^.B - Change, 0);
    16311618      PicturePixel.Pixel^.G := Max(PicturePixel.Pixel^.G - Change, 0);
     
    16451632
    16461633procedure Gtk2Fix;
     1634{$IFDEF UNIX}
    16471635var
    16481636  I: Integer;
    1649 begin
    1650   {$IFDEF LINUX}
     1637{$ENDIF}
     1638begin
     1639  {$IFDEF UNIX}
    16511640  // Wait and process messages little bit to avoid crash or force repaint under Gtk2
    16521641  for I := 0 to 10 do begin
     
    16611650  Section: TFontType;
    16621651  FontScript: TextFile;
    1663   Size: integer;
     1652  Size: Integer;
    16641653  S: string;
    1665   I: integer;
    1666   P: integer;
     1654  I: Integer;
     1655  P: Integer;
    16671656begin
    16681657  Section := ftNormal;
     
    16711660    Reset(FontScript);
    16721661    while not Eof(FontScript) do begin
    1673       ReadLn(FontScript, s);
    1674       if s <> '' then
    1675         if s[1] = '#' then begin
    1676           s := TrimRight(s);
    1677           if s = '#SMALL' then Section := ftSmall
    1678           else if s = '#TINY' then Section := ftTiny
    1679           else if s = '#CAPTION' then Section := ftCaption
    1680           else if s = '#BUTTON' then Section := ftButton
     1662      ReadLn(FontScript, S);
     1663      if S <> '' then
     1664        if S[1] = '#' then begin
     1665          S := TrimRight(S);
     1666          if S = '#SMALL' then Section := ftSmall
     1667          else if S = '#TINY' then Section := ftTiny
     1668          else if S = '#CAPTION' then Section := ftCaption
     1669          else if S = '#BUTTON' then Section := ftButton
    16811670          else Section := ftNormal;
    16821671        end else begin
    1683           p := Pos(',', s);
    1684           if p > 0 then begin
    1685             UniFont[section].Name := Trim(Copy(s, 1, p - 1));
     1672          P := Pos(',', S);
     1673          if P > 0 then begin
     1674            UniFont[section].Name := Trim(Copy(S, 1, P - 1));
    16861675            Size := 0;
    1687             for i := p + 1 to Length(s) do
    1688               case s[i] of
     1676            for I := P + 1 to Length(S) do
     1677              case S[I] of
    16891678                '0' .. '9':
    1690                   Size := Size * 10 + Byte(s[i]) - 48;
     1679                  Size := Size * 10 + Byte(S[I]) - 48;
    16911680                'B', 'b':
    16921681                  UniFont[section].Style := UniFont[section].Style + [fsBold];
     
    17311720  LoadPhrases;
    17321721  LoadFonts;
    1733   Templates := LoadGraphicSet2('Templates.png');
     1722  Templates := LoadGraphicSet('Templates.png', False);
    17341723  with Templates do begin
    17351724    Logo := GetItem('Logo');
     
    17701759
    17711760  HGrSystem := LoadGraphicSet('System.png');
    1772   CityMark1 := HGrSystem.GetItem('CityMark1');
    1773   CityMark2 := HGrSystem.GetItem('CityMark2');
     1761  with HGrSystem do begin
     1762    CityMark1 := GetItem('CityMark1');
     1763    CityMark2 := GetItem('CityMark2');
     1764  end;
    17741765
    17751766  HGrSystem2 := LoadGraphicSet('System2.png');
    1776   Ornament := HGrSystem2.GetItem('Ornament');
     1767  with HGrSystem2 do begin
     1768    Ornament := GetItem('Ornament');
     1769    GBrainNoTerm := GetItem('BrainNoTerm');
     1770    GBrainSuperVirtual := GetItem('BrainSuperVirtual');
     1771    GBrainTerm := GetItem('BrainTerm');
     1772    GBrainRandom := GetItem('BrainRandom');
     1773  end;
    17771774
    17781775  Colors := TDpiBitmap.Create;
  • branches/highdpi/Packages/CevoComponents/Sound.pas

    r405 r463  
    44
    55uses
    6   UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, fgl, FileUtil,
     6  UDpiControls, SysUtils, Classes, Graphics, Controls, Forms, Generics.Collections, FileUtil,
    77  StringTables, Directories, LCLType
    88  {$IFDEF WINDOWS}, MMSystem, Windows{$ENDIF}
    9   {$IFDEF LINUX}, Process, AsyncProcess2{$ENDIF};
     9  {$IFDEF UNIX}, Process, AsyncProcess2{$ENDIF};
    1010
    1111type
     
    2929  TSound = class
    3030  private
    31     {$IFDEF LINUX}
     31    {$IFDEF UNIX}
    3232    PlayCommand: string;
    3333    SoundPlayerAsyncProcess: TAsyncProcess;
     
    5555  SoundMode: TSoundMode;
    5656  SoundPlayer: TSoundPlayer;
    57   SoundList: TFPGObjectList<TSound>;
     57  SoundList: TObjectList<TSound>;
    5858  PlayingSound: TSound;
    5959
     
    6363{$R *.lfm}
    6464
    65 {$IFDEF LINUX}
     65{$IFDEF UNIX}
    6666resourcestring
    6767  SUnableToPlay = 'PlayStyle=%s: Unable to play %s Message:%s';
     
    8888  end
    8989  {$ENDIF}
    90   {$IFDEF LINUX}
     90  {$IFDEF UNIX}
    9191  PlayCommand := GetNonWindowsPlayCommand;
    9292  FDeviceID := 1;
     
    100100    mciSendCommand(FDeviceID, MCI_CLOSE, MCI_WAIT, 0);
    101101  {$ENDIF}
    102   {$IFDEF LINUX}
     102  {$IFDEF UNIX}
    103103  FreeAndNil(SoundPlayerSyncProcess);
    104104  FreeAndNil(SoundPlayerAsyncProcess);
     
    162162  PlayParm: TMCI_Play_Parms;
    163163{$ENDIF}
    164 {$IFDEF LINUX}
     164{$IFDEF UNIX}
    165165var
    166166  L: TStringList;
     
    175175  end
    176176  {$ENDIF}
    177   {$IFDEF LINUX}
     177  {$IFDEF UNIX}
    178178  // How to play in Linux? Use generic Linux commands
    179179  // Use asyncprocess to play sound as SND_ASYNC
     
    232232  mciSendCommand(FDeviceID, MCI_STOP, 0, 0);
    233233  {$ENDIF}
    234   {$IFDEF LINUX}
     234  {$IFDEF UNIX}
    235235  if SoundPlayerSyncProcess <> nil then SoundPlayerSyncProcess.Terminate(1);
    236236  if SoundPlayerAsyncProcess <> nil then SoundPlayerAsyncProcess.Terminate(1);
     
    280280begin
    281281  Result := 0;
    282   while (Result < SoundList.Count) and (SoundList[result].FFileName <> FileName) do
     282  while (Result < SoundList.Count) and (SoundList[Result].FFileName <> FileName) do
    283283    Inc(Result);
    284284  if Result = SoundList.Count then begin
     
    333333procedure UnitInit;
    334334begin
    335   SoundList := TFPGObjectList<TSound>.Create;
     335  SoundList := TObjectList<TSound>.Create;
    336336  PlayingSound := nil;
    337337  SoundPlayer := nil;
  • branches/highdpi/Packages/CevoComponents/StringTables.pas

    r303 r463  
    1616    constructor Create;
    1717    destructor Destroy; override;
    18     function LoadFromFile(const FileName: String): boolean;
    19     function GetHandle(const Item: string): integer;
    20     function LookupByHandle(Handle: integer; Index: integer = -1): string;
     18    function LoadFromFile(const FileName: String): Boolean;
     19    function GetHandle(const Item: string): Integer;
     20    function LookupByHandle(Handle: Integer; Index: Integer = -1): string;
    2121    function Lookup(const Item: string; Index: Integer = -1): string;
    22     function Search(const Content: string; var Handle, Index: integer): boolean;
     22    function Search(const Content: string; var Handle, Index: Integer): Boolean;
    2323  end;
    2424
     
    4545end;
    4646
    47 function TStringTable.LoadFromFile(const FileName: String): boolean;
     47function TStringTable.LoadFromFile(const FileName: String): Boolean;
    4848begin
    4949  Result := True;
     
    5656end;
    5757
    58 function TStringTable.GetHandle(const Item: string): integer;
     58function TStringTable.GetHandle(const Item: string): Integer;
    5959var
    6060  I: Integer;
     
    6767end;
    6868
    69 function TStringTable.LookupByHandle(Handle: integer; Index: integer): string;
     69function TStringTable.LookupByHandle(Handle: Integer; Index: Integer): string;
    7070var
    71   s: string;
     71  S: string;
    7272begin
    7373  if Index < 0 then begin
     
    7777    end else begin
    7878      if Pos(' ', Lines[Handle]) = 0 then S := ''
    79         else s := Copy(Lines[Handle], Pos(' ', Lines[Handle]) + 1, MaxInt);
     79        else S := Copy(Lines[Handle], Pos(' ', Lines[Handle]) + 1, MaxInt);
    8080      while ((Handle + 1) < Lines.Count) and (Copy(Lines[Handle + 1], 1, 1) <> '#') do begin
    8181        Inc(Handle);
    8282        if (Length(Lines[Handle]) > 0) and (Lines[Handle][1] <> '''') then begin
    83           if (s <> '') and (s[Length(s)] <> '\') then
    84             s := s + ' ';
    85           s := s + Lines[Handle];
     83          if (S <> '') and (S[Length(S)] <> '\') then
     84            S := S + ' ';
     85          S := S + Lines[Handle];
    8686        end;
    8787      end;
     
    116116{ might become necessary for 1.3
    117117
    118   function TStringTable.Lookup(const Fallback: TStringTable; const Item: string; Index: integer): string;
     118  function TStringTable.Lookup(const Fallback: TStringTable; const Item: string; Index: Integer): string;
    119119  var
    120   Handle: integer;
     120  Handle: Integer;
    121121  begin
    122122  Handle:=Gethandle(Item);
    123   if Handle>=0 then result:=LookupByHandle(Handle, Index)
    124   else result:='';
    125   if result='' then
    126   result:=Fallback.Lookup(Item, Index);
     123  if Handle>=0 then Result:=LookupByHandle(Handle, Index)
     124  else Result:='';
     125  if Result='' then
     126  Result:=Fallback.Lookup(Item, Index);
    127127  end;
    128128
    129   function TStringTable.TryLookup(const Item: string; Index: integer): string;
     129  function TStringTable.TryLookup(const Item: string; Index: Integer): string;
    130130  var
    131   Handle: integer;
     131  Handle: Integer;
    132132  begin
    133133  Handle:=Gethandle(Item);
    134   if Handle>=0 then result:=LookupByHandle(Handle, Index)
    135   else result:='';
     134  if Handle>=0 then Result:=LookupByHandle(Handle, Index)
     135  else Result:='';
    136136  end; }
    137137
    138138function TStringTable.Search(const Content: string;
    139   var Handle, Index: integer): boolean;
     139  var Handle, Index: Integer): Boolean;
    140140var
    141   h, i: integer;
     141  H, I: Integer;
    142142  UContent: string;
    143143begin
    144144  UContent := UpperCase(Content);
    145   h := Handle;
    146   if h < 0 then
    147     i := 0
     145  H := Handle;
     146  if H < 0 then
     147    I := 0
    148148  else
    149     i := Index + 1;
     149    I := Index + 1;
    150150  repeat
    151     if h + i + 1 >= Lines.Count then
     151    if H + I + 1 >= Lines.Count then
    152152    begin
    153       result := false;
    154       exit;
     153      Result := False;
     154      Exit;
    155155    end;
    156     if Copy(Lines[h + i + 1], 1, 1) = '#' then
     156    if Copy(Lines[H + I + 1], 1, 1) = '#' then
    157157    begin
    158       h := h + i + 1;
    159       i := -1;
     158      H := H + I + 1;
     159      I := -1;
    160160    end;
    161     if (h >= 0) and not ((Length(Lines[h + i + 1]) > 0) and (Lines[h + i + 1][1] in ['#', ':', ';'])) and
    162       (Pos(UContent, UpperCase(Lines[h + i + 1])) > 0) then
     161    if (H >= 0) and not ((Length(Lines[H + I + 1]) > 0) and (Lines[H + I + 1][1] in ['#', ':', ';'])) and
     162      (Pos(UContent, UpperCase(Lines[H + I + 1])) > 0) then
    163163    begin
    164       Index := i;
    165       Handle := h;
     164      Index := I;
     165      Handle := H;
    166166      Result := True;
    167167      Exit;
  • branches/highdpi/Packages/CevoComponents/Texture.pas

    r462 r463  
    1 unit UTexture;
    2 
    3 {$mode objfpc}{$H+}
     1unit Texture;
    42
    53interface
     
    9795end.
    9896
     97
     98
  • branches/highdpi/Packages/Common/AboutDialog.pas

    r462 r463  
    1 unit UAboutDialog;
    2 
    3 {$mode delphi}
     1unit AboutDialog;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme, UFormAbout;
     7  ExtCtrls, ApplicationInfo, Common, Translator, Theme, FormAbout;
    108
    119type
     
    1614  private
    1715    FApplicationInfo: TApplicationInfo;
    18     FCoolTranslator: TTranslator;
     16    FTranslator: TTranslator;
    1917    FThemeManager: TThemeManager;
    2018  public
     
    2220    procedure Show;
    2321  published
    24     property CoolTranslator: TTranslator read FCoolTranslator write FCoolTranslator;
     22    property Translator: TTranslator read FTranslator write FTranslator;
    2523    property ThemeManager: TThemeManager read FThemeManager write FThemeManager;
    2624    property ApplicationInfo: TApplicationInfo read FApplicationInfo write
     
    5250
    5351end.
    54 
  • branches/highdpi/Packages/Common/ApplicationInfo.pas

    r462 r463  
    1 unit UApplicationInfo;
    2 
    3 {$mode delphi}
     1unit ApplicationInfo;
    42
    53interface
    64
    75uses
    8   UDpiControls, SysUtils, Classes, Forms, URegistry, Controls, Graphics, LCLType;
     6  UDpiControls, SysUtils, Classes, Forms, RegistryEx, Controls, Graphics, LCLType;
    97
    108type
     
    5957procedure Register;
    6058
     59
    6160implementation
    6261
  • branches/highdpi/Packages/Common/Common.Delay.pas

    r462 r463  
    1 unit UDelay;
    2 
    3 {$mode delphi}
     1unit Common.Delay;
    42
    53interface
     
    7371
    7472end.
    75 
  • branches/highdpi/Packages/Common/Common.lpk

    r405 r463  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<CONFIG>
    3   <Package Version="4">
     3  <Package Version="5">
    44    <PathDelim Value="\"/>
    55    <Name Value="Common"/>
     
    3333      <Other>
    3434        <CompilerMessages>
    35           <IgnoredMessages idx5024="True"/>
     35          <IgnoredMessages idx6058="True" idx5071="True" idx5024="True" idx3124="True" idx3123="True"/>
    3636        </CompilerMessages>
    3737      </Other>
     
    4141Source: https://svn.zdechov.net/PascalClassLibrary/Common/"/>
    4242    <License Value="Copy left."/>
    43     <Version Minor="8"/>
    44     <Files Count="27">
     43    <Version Minor="11"/>
     44    <Files Count="33">
    4545      <Item1>
    4646        <Filename Value="StopWatch.pas"/>
     
    4848      </Item1>
    4949      <Item2>
    50         <Filename Value="UCommon.pas"/>
    51         <UnitName Value="UCommon"/>
     50        <Filename Value="Common.pas"/>
     51        <UnitName Value="Common"/>
    5252      </Item2>
    5353      <Item3>
    54         <Filename Value="UDebugLog.pas"/>
    55         <HasRegisterProc Value="True"/>
    56         <UnitName Value="UDebugLog"/>
     54        <Filename Value="DebugLog.pas"/>
     55        <HasRegisterProc Value="True"/>
     56        <UnitName Value="DebugLog"/>
    5757      </Item3>
    5858      <Item4>
    59         <Filename Value="UDelay.pas"/>
    60         <UnitName Value="UDelay"/>
     59        <Filename Value="Common.Delay.pas"/>
     60        <UnitName Value="Common.Delay"/>
    6161      </Item4>
    6262      <Item5>
    63         <Filename Value="UPrefixMultiplier.pas"/>
    64         <HasRegisterProc Value="True"/>
    65         <UnitName Value="UPrefixMultiplier"/>
     63        <Filename Value="PrefixMultiplier.pas"/>
     64        <HasRegisterProc Value="True"/>
     65        <UnitName Value="PrefixMultiplier"/>
    6666      </Item5>
    6767      <Item6>
    68         <Filename Value="UURI.pas"/>
    69         <UnitName Value="UURI"/>
     68        <Filename Value="URI.pas"/>
     69        <UnitName Value="URI"/>
    7070      </Item6>
    7171      <Item7>
    72         <Filename Value="UThreading.pas"/>
    73         <UnitName Value="UThreading"/>
     72        <Filename Value="Threading.pas"/>
     73        <UnitName Value="Threading"/>
    7474      </Item7>
    7575      <Item8>
    76         <Filename Value="UMemory.pas"/>
    77         <UnitName Value="UMemory"/>
     76        <Filename Value="Memory.pas"/>
     77        <UnitName Value="Memory"/>
    7878      </Item8>
    7979      <Item9>
    80         <Filename Value="UResetableThread.pas"/>
    81         <UnitName Value="UResetableThread"/>
     80        <Filename Value="ResetableThread.pas"/>
     81        <UnitName Value="ResetableThread"/>
    8282      </Item9>
    8383      <Item10>
    84         <Filename Value="UPool.pas"/>
    85         <UnitName Value="UPool"/>
     84        <Filename Value="Pool.pas"/>
     85        <UnitName Value="Pool"/>
    8686      </Item10>
    8787      <Item11>
    88         <Filename Value="ULastOpenedList.pas"/>
    89         <HasRegisterProc Value="True"/>
    90         <UnitName Value="ULastOpenedList"/>
     88        <Filename Value="LastOpenedList.pas"/>
     89        <HasRegisterProc Value="True"/>
     90        <UnitName Value="LastOpenedList"/>
    9191      </Item11>
    9292      <Item12>
    93         <Filename Value="URegistry.pas"/>
    94         <UnitName Value="URegistry"/>
     93        <Filename Value="RegistryEx.pas"/>
     94        <UnitName Value="RegistryEx"/>
    9595      </Item12>
    9696      <Item13>
    97         <Filename Value="UJobProgressView.pas"/>
    98         <HasRegisterProc Value="True"/>
    99         <UnitName Value="UJobProgressView"/>
     97        <Filename Value="JobProgressView.pas"/>
     98        <HasRegisterProc Value="True"/>
     99        <UnitName Value="JobProgressView"/>
    100100      </Item13>
    101101      <Item14>
    102         <Filename Value="UXMLUtils.pas"/>
    103         <UnitName Value="UXMLUtils"/>
     102        <Filename Value="XML.pas"/>
     103        <UnitName Value="XML"/>
    104104      </Item14>
    105105      <Item15>
    106         <Filename Value="UApplicationInfo.pas"/>
    107         <HasRegisterProc Value="True"/>
    108         <UnitName Value="UApplicationInfo"/>
     106        <Filename Value="ApplicationInfo.pas"/>
     107        <HasRegisterProc Value="True"/>
     108        <UnitName Value="ApplicationInfo"/>
    109109      </Item15>
    110110      <Item16>
    111         <Filename Value="USyncCounter.pas"/>
    112         <UnitName Value="USyncCounter"/>
     111        <Filename Value="SyncCounter.pas"/>
     112        <UnitName Value="SyncCounter"/>
    113113      </Item16>
    114114      <Item17>
    115         <Filename Value="UPersistentForm.pas"/>
    116         <HasRegisterProc Value="True"/>
    117         <UnitName Value="UPersistentForm"/>
     115        <Filename Value="ListViewSort.pas"/>
     116        <HasRegisterProc Value="True"/>
     117        <UnitName Value="ListViewSort"/>
    118118      </Item17>
    119119      <Item18>
    120         <Filename Value="UFindFile.pas"/>
    121         <HasRegisterProc Value="True"/>
    122         <UnitName Value="UFindFile"/>
     120        <Filename Value="PersistentForm.pas"/>
     121        <HasRegisterProc Value="True"/>
     122        <UnitName Value="PersistentForm"/>
    123123      </Item18>
    124124      <Item19>
    125         <Filename Value="UScaleDPI.pas"/>
    126         <HasRegisterProc Value="True"/>
    127         <UnitName Value="UScaleDPI"/>
     125        <Filename Value="FindFile.pas"/>
     126        <HasRegisterProc Value="True"/>
     127        <UnitName Value="FindFile"/>
    128128      </Item19>
    129129      <Item20>
    130         <Filename Value="UTheme.pas"/>
    131         <HasRegisterProc Value="True"/>
    132         <UnitName Value="UTheme"/>
     130        <Filename Value="ScaleDPI.pas"/>
     131        <HasRegisterProc Value="True"/>
     132        <UnitName Value="ScaleDPI"/>
    133133      </Item20>
    134134      <Item21>
    135         <Filename Value="UStringTable.pas"/>
    136         <UnitName Value="UStringTable"/>
     135        <Filename Value="Theme.pas"/>
     136        <HasRegisterProc Value="True"/>
     137        <UnitName Value="Theme"/>
    137138      </Item21>
    138139      <Item22>
    139         <Filename Value="UGeometric.pas"/>
    140         <UnitName Value="UGeometric"/>
     140        <Filename Value="StringTable.pas"/>
     141        <UnitName Value="StringTable"/>
    141142      </Item22>
    142143      <Item23>
    143         <Filename Value="UTranslator.pas"/>
    144         <HasRegisterProc Value="True"/>
    145         <UnitName Value="UTranslator"/>
     144        <Filename Value="MetaCanvas.pas"/>
     145        <UnitName Value="MetaCanvas"/>
    146146      </Item23>
    147147      <Item24>
    148         <Filename Value="ULanguages.pas"/>
    149         <UnitName Value="ULanguages"/>
     148        <Filename Value="Geometric.pas"/>
     149        <UnitName Value="Geometric"/>
    150150      </Item24>
    151151      <Item25>
    152         <Filename Value="UFormAbout.pas"/>
    153         <UnitName Value="UFormAbout"/>
     152        <Filename Value="Translator.pas"/>
     153        <HasRegisterProc Value="True"/>
     154        <UnitName Value="Translator"/>
    154155      </Item25>
    155156      <Item26>
    156         <Filename Value="UAboutDialog.pas"/>
    157         <HasRegisterProc Value="True"/>
    158         <UnitName Value="UAboutDialog"/>
     157        <Filename Value="Languages.pas"/>
     158        <UnitName Value="Languages"/>
    159159      </Item26>
    160160      <Item27>
    161         <Filename Value="UPixelPointer.pas"/>
    162         <UnitName Value="UPixelPointer"/>
     161        <Filename Value="FormAbout.pas"/>
     162        <UnitName Value="FormAbout"/>
    163163      </Item27>
     164      <Item28>
     165        <Filename Value="AboutDialog.pas"/>
     166        <HasRegisterProc Value="True"/>
     167        <UnitName Value="AboutDialog"/>
     168      </Item28>
     169      <Item29>
     170        <Filename Value="PixelPointer.pas"/>
     171        <UnitName Value="PixelPointer"/>
     172      </Item29>
     173      <Item30>
     174        <Filename Value="DataFile.pas"/>
     175        <UnitName Value="DataFile"/>
     176      </Item30>
     177      <Item31>
     178        <Filename Value="TestCase.pas"/>
     179        <UnitName Value="TestCase"/>
     180      </Item31>
     181      <Item32>
     182        <Filename Value="Generics.pas"/>
     183        <UnitName Value="Generics"/>
     184      </Item32>
     185      <Item33>
     186        <Filename Value="CommonPackage.pas"/>
     187        <Type Value="Main Unit"/>
     188        <UnitName Value="CommonPackage"/>
     189      </Item33>
    164190    </Files>
     191    <CompatibilityMode Value="True"/>
    165192    <i18n>
    166193      <EnableI18N Value="True"/>
  • branches/highdpi/Packages/Common/Common.pas

    r462 r463  
    1 unit UCommon;
    2 
    3 {$mode delphi}
     1unit Common;
    42
    53interface
    64
    75uses
    8   {$ifdef Windows}Windows,{$endif}
    9   {$ifdef Linux}baseunix,{$endif}
    10   Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf,
    11   FileUtil; //, ShFolder, ShellAPI;
     6  {$IFDEF WINDOWS}Windows,{$ENDIF}
     7  {$IFDEF UNIX}baseunix,{$ENDIF}
     8  Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, Graphics,
     9  FileUtil, Generics.Collections; //, ShFolder, ShellAPI;
    1210
    1311type
    1412  TArrayOfByte = array of Byte;
    15   TArrayOfString = array of string;
    1613  TExceptionEvent = procedure(Sender: TObject; E: Exception) of object;
    1714
     
    3532  DLLHandle1: HModule;
    3633
    37 {$IFDEF Windows}
    38   GetUserNameEx: procedure (NameFormat: DWORD;
    39     lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
    40 {$ENDIF}
    41 
    42 function IntToBin(Data: Int64; Count: Byte): string;
     34  {$IFDEF WINDOWS}
     35    GetUserNameEx: procedure (NameFormat: DWORD;
     36      lpNameBuffer: LPSTR; nSize: PULONG); stdcall;
     37  {$ENDIF}
     38
     39const
     40  clLightBlue = TColor($FF8080);
     41  clLightGreen = TColor($80FF80);
     42  clLightRed = TColor($8080FF);
     43
     44function AddLeadingZeroes(const aNumber, Length : integer) : string;
    4345function BinToInt(BinStr: string): Int64;
    44 function TryHexToInt(Data: string; var Value: Integer): Boolean;
    45 function TryBinToInt(Data: string; var Value: Integer): Boolean;
    4646function BinToHexString(Source: AnsiString): string;
    4747//function DelTree(DirName : string): Boolean;
     
    4949function BCDToInt(Value: Byte): Byte;
    5050function CompareByteArray(Data1, Data2: TArrayOfByte): Boolean;
     51procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     52function CombinePaths(Path1, Path2: string): string;
     53function ComputerName: string;
     54procedure DeleteFiles(APath, AFileSpec: string);
     55function Explode(Separator: Char; Data: string): TStringArray;
     56procedure ExecuteProgram(Executable: string; Parameters: array of string);
     57procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
     58procedure FreeThenNil(var Obj);
     59function GetDirCount(Dir: string): Integer;
    5160function GetUserName: string;
    52 function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    53 function SplitString(var Text: string; Count: Word): string;
    5461function GetBitCount(Variable: QWord; MaxIndex: Integer): Integer;
    5562function GetBit(Variable: QWord; Index: Byte): Boolean;
     63function GetStringPart(var Text: string; Separator: string): string;
     64function GenerateNewName(OldName: string): string;
     65function GetFileFilterItemExt(Filter: string; Index: Integer): string;
     66function IntToBin(Data: Int64; Count: Byte): string;
     67function Implode(Separator: Char; List: TList<string>): string;
     68function LastPos(const SubStr: String; const S: String): Integer;
     69function LoadFileToStr(const FileName: TFileName): AnsiString;
     70function LoggedOnUserNameEx(Format: TUserNameFormat): string;
     71function MergeArray(A, B: array of string): TStringArray;
     72function OccurenceOfChar(What: Char; Where: string): Integer;
     73procedure OpenWebPage(URL: string);
     74procedure OpenEmail(Email: string);
     75procedure OpenFileInShell(FileName: string);
     76function PosFromIndex(SubStr: string; Text: string;
     77  StartIndex: Integer): Integer;
     78function PosFromIndexReverse(SubStr: string; Text: string;
     79  StartIndex: Integer): Integer;
     80function RemoveQuotes(Text: string): string;
     81procedure SaveStringToFile(S, FileName: string);
    5682procedure SetBit(var Variable: Int64; Index: Byte; State: Boolean); overload;
    5783procedure SetBit(var Variable: QWord; Index: Byte; State: Boolean); overload;
    5884procedure SetBit(var Variable: Cardinal; Index: Byte; State: Boolean); overload;
    5985procedure SetBit(var Variable: Word; Index: Byte; State: Boolean); overload;
    60 function AddLeadingZeroes(const aNumber, Length : integer) : string;
    61 function LastPos(const SubStr: String; const S: String): Integer;
    62 function GenerateNewName(OldName: string): string;
    63 function GetFileFilterItemExt(Filter: string; Index: Integer): string;
    64 procedure FileDialogUpdateFilterFileType(FileDialog: TOpenDialog);
    65 procedure DeleteFiles(APath, AFileSpec: string);
    66 procedure OpenWebPage(URL: string);
    67 procedure OpenFileInShell(FileName: string);
    68 procedure ExecuteProgram(Executable: string; Parameters: array of string);
    69 procedure FreeThenNil(var Obj);
    70 function RemoveQuotes(Text: string): string;
    71 function ComputerName: string;
    72 function OccurenceOfChar(What: Char; Where: string): Integer;
    73 function GetDirCount(Dir: string): Integer;
    74 function MergeArray(A, B: array of string): TArrayOfString;
    75 function LoadFileToStr(const FileName: TFileName): AnsiString;
    76 procedure SaveStringToFile(S, FileName: string);
    7786procedure SearchFiles(AList: TStrings; Dir: string;
    7887  FilterMethod: TFilterMethod = nil; FileNameMethod: TFileNameMethod = nil);
    79 function GetStringPart(var Text: string; Separator: string): string;
     88function SplitString(var Text: string; Count: Word): string;
    8089function StripTags(const S: string): string;
    81 function PosFromIndex(SubStr: string; Text: string;
    82   StartIndex: Integer): Integer;
    83 function PosFromIndexReverse(SubStr: string; Text: string;
    84   StartIndex: Integer): Integer;
    85 procedure CopyStringArray(Dest: TStringArray; Source: array of string);
     90function TryHexToInt(Data: string; out Value: Integer): Boolean;
     91function TryBinToInt(Data: string; out Value: Integer): Boolean;
     92procedure SortStrings(Strings: TStrings);
    8693
    8794
     
    244251end;
    245252
    246 function TryHexToInt(Data: string; var Value: Integer): Boolean;
     253function TryHexToInt(Data: string; out Value: Integer): Boolean;
    247254var
    248255  I: Integer;
     
    260267end;
    261268
    262 function TryBinToInt(Data: string; var Value: Integer): Boolean;
     269function TryBinToInt(Data: string; out Value: Integer): Boolean;
    263270var
    264271  I: Integer;
     
    288295end;
    289296
    290 function Explode(Separator: char; Data: string): TArrayOfString;
    291 begin
    292   SetLength(Result, 0);
    293   while Pos(Separator, Data) > 0 do begin
     297function Explode(Separator: Char; Data: string): TStringArray;
     298var
     299  Index: Integer;
     300begin
     301  Result := Default(TStringArray);
     302  repeat
     303    Index := Pos(Separator, Data);
     304    if Index > 0 then begin
     305      SetLength(Result, Length(Result) + 1);
     306      Result[High(Result)] := Copy(Data, 1, Index - 1);
     307      Delete(Data, 1, Index);
     308    end else Break;
     309  until False;
     310  if Data <> '' then begin
    294311    SetLength(Result, Length(Result) + 1);
    295     Result[High(Result)] := Copy(Data, 1, Pos(Separator, Data) - 1);
    296     Delete(Data, 1, Pos(Separator, Data));
    297   end;
    298   SetLength(Result, Length(Result) + 1);
    299   Result[High(Result)] := Data;
    300 end;
    301 
    302 {$IFDEF Windows}
     312    Result[High(Result)] := Data;
     313  end;
     314end;
     315
     316function Implode(Separator: Char; List: TList<string>): string;
     317var
     318  I: Integer;
     319begin
     320  Result := '';
     321  for I := 0 to List.Count - 1 do begin
     322    Result := Result + List[I];
     323    if I < List.Count - 1 then Result := Result + Separator;
     324  end;
     325end;
     326
     327{$IFDEF WINDOWS}
    303328function GetUserName: string;
    304329const
     
    308333begin
    309334  L := MAX_USERNAME_LENGTH + 2;
     335  Result := Default(string);
    310336  SetLength(Result, L);
    311337  if Windows.GetUserName(PChar(Result), L) and (L > 0) then begin
     
    321347  end;
    322348end;
    323 {$endif}
     349{$ENDIF}
    324350
    325351function ComputerName: string;
    326 {$ifdef mswindows}
     352{$IFDEF WINDOWS}
    327353const
    328354 INFO_BUFFER_SIZE = 32767;
     
    339365  end;
    340366end;
    341 {$endif}
    342 {$ifdef unix}
     367{$ENDIF}
     368{$IFDEF UNIX}
    343369var
    344370  Name: UtsName;
    345371begin
     372  Name := Default(UtsName);
    346373  fpuname(Name);
    347374  Result := Name.Nodename;
    348375end;
    349 {$endif}
    350 
    351 {$ifdef windows}
     376{$ENDIF}
     377
     378{$IFDEF WINDOWS}
    352379function LoggedOnUserNameEx(Format: TUserNameFormat): string;
    353380const
     
    427454procedure LoadLibraries;
    428455begin
    429   {$IFDEF Windows}
     456  {$IFDEF WINDOWS}
    430457  DLLHandle1 := LoadLibrary('secur32.dll');
    431458  if DLLHandle1 <> 0 then
     
    438465procedure FreeLibraries;
    439466begin
    440   {$IFDEF Windows}
     467  {$IFDEF WINDOWS}
    441468  if DLLHandle1 <> 0 then FreeLibrary(DLLHandle1);
    442469  {$ENDIF}
     
    471498end;
    472499
     500procedure OpenEmail(Email: string);
     501begin
     502  OpenURL('mailto:' + Email);
     503end;
     504
    473505procedure OpenFileInShell(FileName: string);
    474506begin
     
    499531end;
    500532
    501 function MergeArray(A, B: array of string): TArrayOfString;
    502 var
    503   I: Integer;
    504 begin
     533function MergeArray(A, B: array of string): TStringArray;
     534var
     535  I: Integer;
     536begin
     537  Result := Default(TStringArray);
    505538  SetLength(Result, Length(A) + Length(B));
    506539  for I := 0 to Length(A) - 1 do
     
    669702end;
    670703
     704function CombinePaths(Path1, Path2: string): string;
     705begin
     706  Result := Path1;
     707  if Result <> '' then Result := Result + DirectorySeparator + Path2
     708    else Result := Path2;
     709end;
     710
     711procedure SortStrings(Strings: TStrings);
     712var
     713  Tmp: TStringList;
     714begin
     715  Strings.BeginUpdate;
     716  try
     717    if Strings is TStringList then begin
     718      TStringList(Strings).Sort;
     719    end else begin
     720      Tmp := TStringList.Create;
     721      try
     722        Tmp.Assign(Strings);
     723        Tmp.Sort;
     724        Strings.Assign(Tmp);
     725      finally
     726        Tmp.Free;
     727      end;
     728    end;
     729  finally
     730    Strings.EndUpdate;
     731  end;
     732end;
     733
    671734
    672735initialization
     
    680743
    681744end.
     745
  • branches/highdpi/Packages/Common/CommonPackage.pas

    r462 r463  
    33 }
    44
    5 unit Common;
     5unit CommonPackage;
    66
    77{$warn 5023 off : no warning about unused units}
     
    99
    1010uses
    11   StopWatch, UCommon, UDebugLog, UDelay, UPrefixMultiplier, UURI, UThreading,
    12   UMemory, UResetableThread, UPool, ULastOpenedList, URegistry,
    13   UJobProgressView, UXMLUtils, UApplicationInfo, USyncCounter,
    14   UPersistentForm, UFindFile, UScaleDPI, UTheme, UStringTable, UGeometric,
    15   UTranslator, ULanguages, UFormAbout, UAboutDialog, UPixelPointer,
     11  StopWatch, Common, DebugLog, Common.Delay, PrefixMultiplier, URI, Threading,
     12  Memory, ResetableThread, Pool, LastOpenedList, RegistryEx, JobProgressView,
     13  XML, ApplicationInfo, SyncCounter, ListViewSort, PersistentForm, FindFile,
     14  ScaleDPI, Theme, StringTable, MetaCanvas, Geometric, Translator, Languages,
     15  FormAbout, AboutDialog, PixelPointer, DataFile, TestCase, Generics,
    1616  LazarusPackageIntf;
    1717
     
    2020procedure Register;
    2121begin
    22   RegisterUnit('UDebugLog', @UDebugLog.Register);
    23   RegisterUnit('UPrefixMultiplier', @UPrefixMultiplier.Register);
    24   RegisterUnit('ULastOpenedList', @ULastOpenedList.Register);
    25   RegisterUnit('UJobProgressView', @UJobProgressView.Register);
    26   RegisterUnit('UApplicationInfo', @UApplicationInfo.Register);
    27   RegisterUnit('UPersistentForm', @UPersistentForm.Register);
    28   RegisterUnit('UFindFile', @UFindFile.Register);
    29   RegisterUnit('UScaleDPI', @UScaleDPI.Register);
    30   RegisterUnit('UTheme', @UTheme.Register);
    31   RegisterUnit('UTranslator', @UTranslator.Register);
    32   RegisterUnit('UAboutDialog', @UAboutDialog.Register);
     22  RegisterUnit('DebugLog', @DebugLog.Register);
     23  RegisterUnit('PrefixMultiplier', @PrefixMultiplier.Register);
     24  RegisterUnit('LastOpenedList', @LastOpenedList.Register);
     25  RegisterUnit('JobProgressView', @JobProgressView.Register);
     26  RegisterUnit('ApplicationInfo', @ApplicationInfo.Register);
     27  RegisterUnit('ListViewSort', @ListViewSort.Register);
     28  RegisterUnit('PersistentForm', @PersistentForm.Register);
     29  RegisterUnit('FindFile', @FindFile.Register);
     30  RegisterUnit('ScaleDPI', @ScaleDPI.Register);
     31  RegisterUnit('Theme', @Theme.Register);
     32  RegisterUnit('Translator', @Translator.Register);
     33  RegisterUnit('AboutDialog', @AboutDialog.Register);
    3334end;
    3435
  • branches/highdpi/Packages/Common/DebugLog.pas

    r462 r463  
    1 unit UDebugLog;
    2 
    3 {$mode delphi}
     1unit DebugLog;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, FileUtil, fgl, SyncObjs;
     6  Classes, SysUtils, FileUtil, Generics.Collections, SyncObjs;
    97
    108type
     
    1513    Group: string;
    1614    Text: string;
     15  end;
     16
     17  TDebugLogItems = class(TObjectList<TDebugLogItem>)
    1718  end;
    1819
     
    2930    procedure SetMaxCount(const AValue: Integer);
    3031  public
    31     Items: TFPGObjectList<TDebugLogItem>;
     32    Items: TDebugLogItems;
    3233    Lock: TCriticalSection;
    3334    procedure Add(Text: string; Group: string = '');
     
    4445
    4546procedure Register;
     47
    4648
    4749implementation
     
    117119begin
    118120  inherited;
    119   Items := TFPGObjectList<TDebugLogItem>.Create;
     121  Items := TDebugLogItems.Create;
    120122  Lock := TCriticalSection.Create;
    121123  MaxCount := 100;
     
    126128destructor TDebugLog.Destroy;
    127129begin
    128   Items.Free;
    129   Lock.Free;
     130  FreeAndNil(Items);
     131  FreeAndNil(Lock);
    130132  inherited;
    131133end;
    132134
    133135end.
    134 
  • branches/highdpi/Packages/Common/FindFile.pas

    r462 r463  
    1919}
    2020
    21 unit UFindFile;
     21unit FindFile;
    2222
    2323interface
     
    3535  private
    3636    s : TStringList;
    37 
    3837    fSubFolder : boolean;
    3938    fAttr: TFileAttrib;
    4039    fPath : string;
    4140    fFileMask : string;
    42 
    4341    procedure SetPath(Value: string);
    4442    procedure FileSearch(const inPath : string);
     
    4644    constructor Create(AOwner: TComponent); override;
    4745    destructor Destroy; override;
    48 
    4946    function SearchForFiles: TStringList;
    5047  published
     
    5956  FilterAll = '*.*';
    6057{$ENDIF}
    61 {$IFDEF LINUX}
     58{$IFDEF UNIX}
    6259  FilterAll = '*';
    6360{$ENDIF}
    6461
    6562procedure Register;
     63
    6664
    6765implementation
     
    8785begin
    8886  s.Free;
    89   inherited Destroy;
     87  inherited;
    9088end;
    9189
     
    145143    SysUtils.FindClose(Rec);
    146144  end;
    147 end; 
     145end;
    148146
    149147end.
    150 
  • branches/highdpi/Packages/Common/FormAbout.lfm

    r462 r463  
    11object FormAbout: TDpiFormAbout
    22  Left = 1014
    3   Height = 402
     3  Height = 349
    44  Top = 577
    5   Width = 702
     5  Width = 609
    66  Caption = 'About'
    7   ClientHeight = 402
    8   ClientWidth = 702
    9   DesignTimePPI = 144
    10   OnCreate = FormCreate
     7  ClientHeight = 349
     8  ClientWidth = 609
     9  DesignTimePPI = 125
    1110  OnShow = FormShow
    1211  Position = poScreenCenter
    13   LCLVersion = '2.0.10.0'
     12  LCLVersion = '2.2.4.0'
    1413  object LabelDescription: TLabel
    15     Left = 30
    16     Height = 24
    17     Top = 135
    18     Width = 642
     14    Left = 26
     15    Height = 22
     16    Top = 117
     17    Width = 557
    1918    Align = alTop
    20     BorderSpacing.Left = 30
    21     BorderSpacing.Right = 30
    22     BorderSpacing.Bottom = 30
     19    BorderSpacing.Left = 26
     20    BorderSpacing.Right = 26
     21    BorderSpacing.Bottom = 26
    2322    Caption = 'Description'
    2423    ParentColor = False
     
    2726  end
    2827  object LabelContent: TLabel
    29     Left = 30
    30     Height = 24
    31     Top = 189
    32     Width = 642
     28    Left = 26
     29    Height = 22
     30    Top = 165
     31    Width = 557
    3332    Align = alTop
    34     BorderSpacing.Around = 30
     33    BorderSpacing.Around = 26
    3534    Caption = '   '
    3635    ParentColor = False
     
    3938  object PanelTop: TDpiPanel
    4039    Left = 0
    41     Height = 135
     40    Height = 117
    4241    Top = 0
    43     Width = 702
     42    Width = 609
    4443    Align = alTop
    4544    BevelOuter = bvNone
    46     ClientHeight = 135
    47     ClientWidth = 702
     45    ClientHeight = 117
     46    ClientWidth = 609
    4847    FullRepaint = False
    4948    ParentFont = False
    5049    TabOrder = 0
    5150    object LabelAppName: TLabel
    52       Left = 108
    53       Height = 84
    54       Top = 20
    55       Width = 564
     51      Left = 94
     52      Height = 73
     53      Top = 17
     54      Width = 489
    5655      Anchors = [akTop, akLeft, akRight]
    5756      AutoSize = False
    58       BorderSpacing.Around = 30
     57      BorderSpacing.Around = 26
    5958      Caption = 'Title'
    60       Font.Height = -60
     59      Font.Height = -52
    6160      ParentColor = False
    6261      ParentFont = False
     
    6463    end
    6564    object ImageLogo: TImage
    66       Left = 24
    67       Height = 74
    68       Top = 30
    69       Width = 72
     65      Left = 21
     66      Height = 64
     67      Top = 26
     68      Width = 62
    7069      Proportional = True
    7170      Stretch = True
     
    7473  object PanelButtons: TDpiPanel
    7574    Left = 0
    76     Height = 75
    77     Top = 327
    78     Width = 702
     75    Height = 65
     76    Top = 284
     77    Width = 609
    7978    Align = alBottom
    8079    BevelOuter = bvNone
    81     ClientHeight = 75
    82     ClientWidth = 702
     80    ClientHeight = 65
     81    ClientWidth = 609
    8382    TabOrder = 1
    8483    object ButtonHomePage: TButton
    85       Left = 24
    86       Height = 38
    87       Top = 24
    88       Width = 264
     84      Left = 21
     85      Height = 33
     86      Top = 21
     87      Width = 229
    8988      Anchors = [akLeft, akBottom]
    9089      Caption = 'Home page'
     
    9493    end
    9594    object ButtonClose: TButton
    96       Left = 532
    97       Height = 38
    98       Top = 24
    99       Width = 140
     95      Left = 461
     96      Height = 33
     97      Top = 21
     98      Width = 122
    10099      Anchors = [akRight, akBottom]
    101100      Caption = 'Close'
  • branches/highdpi/Packages/Common/FormAbout.pas

    r462 r463  
    1 unit UFormAbout;
    2 
    3 {$mode delphi}
     1unit FormAbout;
    42
    53interface
     
    75uses
    86  UDpiControls, Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   StdCtrls, ExtCtrls, UApplicationInfo, UCommon, UTranslator, UTheme;
     7  StdCtrls, ExtCtrls, ApplicationInfo, Common, Translator, Theme;
    108
    119type
     
    2220    PanelButtons: TDpiPanel;
    2321    procedure ButtonHomePageClick(Sender: TObject);
    24     procedure FormCreate(Sender: TObject);
    2522    procedure FormShow(Sender: TObject);
    26   private
    27     { private declarations }
    2823  public
    2924    AboutDialog: TObject; //TAboutDialog
     
    3732
    3833uses
    39   UAboutDialog;
     34  AboutDialog;
    4035
    4136resourcestring
     
    5045  if Assigned(AboutDialog) then
    5146  with TAboutDialog(AboutDialog) do begin
    52     if Assigned(CoolTranslator) then
    53       CoolTranslator.TranslateComponentRecursive(Self);
     47    if Assigned(Translator) then
     48      Translator.TranslateComponentRecursive(Self);
    5449    if Assigned(ThemeManager) then
    5550      ThemeManager.UseTheme(Self);
     
    7974end;
    8075
    81 procedure TFormAbout.FormCreate(Sender: TObject);
    82 begin
    83 end;
    84 
    8576end.
    86 
  • branches/highdpi/Packages/Common/Geometric.pas

    r462 r463  
    1 unit UGeometric;
    2 
    3 {$mode delphi}
     1unit Geometric;
    42
    53interface
     
    108type
    119  TPointArray = array of TPoint;
     10
     11  { TVector }
     12
     13  TVector = record
     14    Position: TPoint;
     15    Direction: TPoint;
     16    function GetLength: Double;
     17    function GetAngle: Double;
     18    procedure SetLength(Value: Double);
     19    class function Create(P1, P2: TPoint): TVector; static;
     20  end;
    1221
    1322function Distance(P1, P2: TPoint): Integer;
     
    1524function AddPoint(const P1, P2: TPoint): TPoint;
    1625function SubPoint(const P1, P2: TPoint): TPoint;
    17 function PointToLineDistance(const P, V, W: TPoint): Integer;
     26function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer;
    1827function ComparePoint(P1, P2: TPoint): Boolean;
    1928function RotatePoint(Center, P: TPoint; Angle: Double): TPoint;
     
    2736function ShiftRect(ARect: TRect; Delta: TPoint): TRect;
    2837
     38
    2939implementation
    3040
     
    5161end;
    5262
    53 function PointToLineDistance(const P, V, W: TPoint): Integer;
     63function PointToLineDistance(const P, V, W: TPoint; out Intersect: TPoint): Integer;
    5464var
    5565  l2, t: Double;
     
    6979  if T < 0 then begin
    7080    Result := Distance(P, V);       // Beyond the 'v' end of the segment
    71     exit;
     81    Intersect := V;
     82    Exit;
    7283  end
    7384  else if T > 1 then begin
    7485    Result := Distance(P, W);  // Beyond the 'w' end of the segment
     86    Intersect := W;
    7587    Exit;
    7688  end;
     
    7890  TT.Y := Trunc(V.Y + T * (W.Y - V.Y));
    7991  Result := Distance(P, TT);
     92  Intersect := TT;
    8093end;
    8194
     
    96109  I: Integer;
    97110begin
     111  Result := Default(TPointArray);
    98112  SetLength(Result, Length(P));
    99113  for I := 0 to High(P) do
     
    162176end;
    163177
     178{ TVector }
     179
     180function TVector.GetLength: Double;
     181begin
     182  Result := Sqrt(Sqr(Direction.X) + Sqr(Direction.Y));
     183end;
     184
     185function TVector.GetAngle: Double;
     186begin
     187  Result := ArcTan2(Direction.Y, Direction.X);
     188end;
     189
     190procedure TVector.SetLength(Value: Double);
     191var
     192  Angle: Double;
     193begin
     194  Angle := GetAngle;
     195  Direction := Point(Round(Cos(Angle) * Value),
     196    Round(Sin(Angle) * Value));
     197end;
     198
     199class function TVector.Create(P1, P2: TPoint): TVector;
     200begin
     201  Result.Position := P1;
     202  Result.Direction := Point(P2.X - P1.X, P2.Y - P1.Y);
     203end;
    164204
    165205end.
  • branches/highdpi/Packages/Common/JobProgressView.lfm

    r462 r463  
    11object FormJobProgressView: TDpiFormJobProgressView
    22  Left = 467
    3   Height = 345
     3  Height = 414
    44  Top = 252
    5   Width = 539
     5  Width = 647
    66  BorderIcons = [biSystemMenu]
    7   ClientHeight = 345
    8   ClientWidth = 539
    9   DesignTimePPI = 120
     7  ClientHeight = 414
     8  ClientWidth = 647
     9  DesignTimePPI = 144
    1010  OnClose = FormClose
    1111  OnCloseQuery = FormCloseQuery
    1212  OnCreate = FormCreate
    13   OnDestroy = FormDestroy
    1413  OnHide = FormHide
    1514  OnShow = FormShow
    1615  Position = poScreenCenter
    17   LCLVersion = '2.0.2.0'
     16  LCLVersion = '2.2.0.4'
    1817  object PanelOperationsTitle: TDpiPanel
    1918    Left = 0
    20     Height = 32
     19    Height = 38
    2120    Top = 0
    22     Width = 539
     21    Width = 647
    2322    Align = alTop
    2423    BevelOuter = bvNone
    25     ClientHeight = 32
    26     ClientWidth = 539
     24    ClientHeight = 38
     25    ClientWidth = 647
    2726    FullRepaint = False
    2827    TabOrder = 0
    2928    object LabelOperation: TLabel
    30       Left = 8
    31       Height = 20
    32       Top = 8
    33       Width = 76
     29      Left = 10
     30      Height = 26
     31      Top = 10
     32      Width = 99
    3433      Caption = 'Operations:'
    35       ParentColor = False
    3634      ParentFont = False
    3735    end
     
    3937  object PanelLog: TDpiPanel
    4038    Left = 0
    41     Height = 133
    42     Top = 212
    43     Width = 539
     39    Height = 161
     40    Top = 253
     41    Width = 647
    4442    Align = alClient
    4543    BevelOuter = bvSpace
    46     ClientHeight = 133
    47     ClientWidth = 539
     44    ClientHeight = 161
     45    ClientWidth = 647
    4846    TabOrder = 1
    4947    object MemoLog: TDpiMemo
    50       Left = 8
    51       Height = 117
    52       Top = 8
    53       Width = 523
     48      Left = 10
     49      Height = 141
     50      Top = 10
     51      Width = 627
    5452      Anchors = [akTop, akLeft, akRight, akBottom]
    5553      ReadOnly = True
     
    6058  object PanelProgress: TDpiPanel
    6159    Left = 0
    62     Height = 54
    63     Top = 106
    64     Width = 539
     60    Height = 65
     61    Top = 126
     62    Width = 647
    6563    Align = alTop
    6664    BevelOuter = bvNone
    67     ClientHeight = 54
    68     ClientWidth = 539
     65    ClientHeight = 65
     66    ClientWidth = 647
    6967    TabOrder = 2
    7068    object ProgressBarPart: TProgressBar
    71       Left = 10
    72       Height = 24
    73       Top = 24
    74       Width = 523
     69      Left = 12
     70      Height = 29
     71      Top = 29
     72      Width = 628
    7573      Anchors = [akTop, akLeft, akRight]
    7674      TabOrder = 0
    7775    end
    7876    object LabelEstimatedTimePart: TLabel
    79       Left = 8
    80       Height = 20
     77      Left = 10
     78      Height = 26
    8179      Top = -2
    82       Width = 103
     80      Width = 132
    8381      Caption = 'Estimated time:'
    84       ParentColor = False
    8582    end
    8683  end
    8784  object PanelOperations: TDpiPanel
    8885    Left = 0
    89     Height = 42
    90     Top = 64
    91     Width = 539
     86    Height = 50
     87    Top = 76
     88    Width = 647
    9289    Align = alTop
    9390    BevelOuter = bvNone
    94     ClientHeight = 42
    95     ClientWidth = 539
     91    ClientHeight = 50
     92    ClientWidth = 647
    9693    FullRepaint = False
    9794    TabOrder = 3
    9895    object ListViewJobs: TDpiListView
    99       Left = 8
    100       Height = 32
    101       Top = 5
    102       Width = 523
     96      Left = 10
     97      Height = 38
     98      Top = 6
     99      Width = 627
    103100      Anchors = [akTop, akLeft, akRight, akBottom]
    104101      AutoWidthLastColumn = True
     
    107104      Columns = <     
    108105        item
    109           Width = 523
     106          Width = 614
    110107        end>
    111108      OwnerData = True
     
    120117  object PanelProgressTotal: TDpiPanel
    121118    Left = 0
    122     Height = 52
    123     Top = 160
    124     Width = 539
     119    Height = 62
     120    Top = 191
     121    Width = 647
    125122    Align = alTop
    126123    BevelOuter = bvNone
    127     ClientHeight = 52
    128     ClientWidth = 539
     124    ClientHeight = 62
     125    ClientWidth = 647
    129126    TabOrder = 4
    130127    object LabelEstimatedTimeTotal: TLabel
    131       Left = 8
    132       Height = 20
     128      Left = 10
     129      Height = 26
    133130      Top = 0
    134       Width = 141
     131      Width = 178
    135132      Caption = 'Total estimated time:'
    136       ParentColor = False
    137133    end
    138134    object ProgressBarTotal: TProgressBar
    139       Left = 8
    140       Height = 24
    141       Top = 24
    142       Width = 523
     135      Left = 10
     136      Height = 29
     137      Top = 29
     138      Width = 627
    143139      Anchors = [akTop, akLeft, akRight]
    144140      TabOrder = 0
     
    147143  object PanelText: TDpiPanel
    148144    Left = 0
    149     Height = 32
    150     Top = 32
    151     Width = 539
     145    Height = 38
     146    Top = 38
     147    Width = 647
    152148    Align = alTop
    153149    BevelOuter = bvNone
    154     ClientHeight = 32
    155     ClientWidth = 539
     150    ClientHeight = 38
     151    ClientWidth = 647
    156152    TabOrder = 5
    157153    object LabelText: TLabel
    158       Left = 8
    159       Height = 24
    160       Top = 8
    161       Width = 525
     154      Left = 10
     155      Height = 29
     156      Top = 10
     157      Width = 630
    162158      Anchors = [akTop, akLeft, akRight]
    163159      AutoSize = False
    164       ParentColor = False
    165160    end
    166161  end
    167162  object ImageList1: TDpiImageList
    168     BkColor = clForeground
    169     left = 200
    170     top = 8
     163    Left = 240
     164    Top = 10
    171165    Bitmap = {
    172       4C69020000001000000010000000FF00FF00FF00FF00FF00FF00FF00FF00FF00
    173       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    174       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    175       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    176       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    177       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    178       FF00000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    179       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000
    180       00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    181       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000
    182       00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    183       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF0000
    184       00FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    185       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    186       00FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00
    187       FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00
    188       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FFFF00
    189       FF00FF00FF00FF00FF00000000FF000000FF000000FF000000FFFF00FF00FF00
    190       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    191       00FFFF00FF00000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00
    192       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF0000
    193       00FF000000FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00
    194       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000
    195       00FF000000FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00
    196       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF000000
    197       00FF000000FF000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    198       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    199       FF00000000FFFF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    200       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    201       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    202       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    203       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    204       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    205       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    206       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    207       FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00FF00FF00FF00FF00
    208       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    209       FF00FF00FF00FF00FF00FF00FF00000000FF000000FFFF00FF00FF00FF00FF00
    210       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    211       FF00FF00FF00FF00FF00FF00FF00000000FF000084FF000000FFFF00FF00FF00
    212       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    213       00FF000000FF000000FF000000FF000000FF0000FFFF000084FF000000FFFF00
    214       FF00FF00FF00FF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    215       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000084FF0000
    216       00FFFF00FF00FF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    217       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000
    218       84FF000000FFFF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    219       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000
    220       FFFF000084FF000000FFFF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    221       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000
    222       84FF000000FFFF00FF00FF00FF00FF00FF00000000FF0000FFFF0000FFFF0000
    223       FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF0000FFFF000084FF0000
    224       00FFFF00FF00FF00FF00FF00FF00FF00FF00000000FF000000FF000000FF0000
    225       00FF000000FF000000FF000000FF000000FF0000FFFF000084FF000000FFFF00
    226       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    227       FF00FF00FF00FF00FF00FF00FF00000000FF000084FF000000FFFF00FF00FF00
    228       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    229       FF00FF00FF00FF00FF00FF00FF00000000FF000000FFFF00FF00FF00FF00FF00
    230       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    231       FF00FF00FF00FF00FF00FF00FF00000000FFFF00FF00FF00FF00FF00FF00FF00
    232       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    233       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    234       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    235       FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00FF00
    236       FF00FF00FF00FF00FF00FF00FF00
     166      4C7A0200000010000000100000006A0000000000000078DAE593490E00100C45
     167      7B78F72E5684A63A1142C382BE4F0708F89C955117F4B016BE67B5FC6E96DB97
     168      B0D4B9F4CD949F36DED1DF922B0F1BD11FAB5AFC68DE5C44D40220A9FA779EC8
     169      6A349FD5A435E43CADA1E3678D73F773F1DBF3EFADFFEEFEBBF97F6696BE9D36
    237170    }
    238171  end
     
    241174    Interval = 100
    242175    OnTimer = TimerUpdateTimer
    243     left = 320
    244     top = 8
     176    Left = 384
     177    Top = 10
    245178  end
    246179end
  • branches/highdpi/Packages/Common/JobProgressView.pas

    r462 r463  
    1 unit UJobProgressView;
    2 
    3 {$MODE Delphi}
     1unit JobProgressView;
    42
    53interface
     
    75uses
    86  UDpiControls, SysUtils, Variants, Classes, Graphics, Controls, Forms, Syncobjs,
    9   Dialogs, ComCtrls, StdCtrls, ExtCtrls, Contnrs, UThreading, Math,
     7  Dialogs, ComCtrls, StdCtrls, ExtCtrls, Generics.Collections, Threading, Math,
    108  DateUtils;
    119
     
    7169  end;
    7270
    73   TJobs = class(TObjectList)
     71  TJobs = class(TObjectList<TJob>)
    7472  end;
    7573
     
    105103    procedure ReloadJobList;
    106104    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    107     procedure FormDestroy(Sender: TObject);
    108105    procedure ListViewJobsData(Sender: TObject; Item: TListItem);
    109106    procedure TimerUpdateTimer(Sender: TObject);
     
    157154  end;
    158155
    159   //var
    160   //  FormJobProgressView: TFormJobProgressView;
    161 
    162156procedure Register;
    163157
    164158resourcestring
    165159  SExecuted = 'Executed';
     160
    166161
    167162implementation
     
    187182  try
    188183    try
    189       //raise Exception.Create('Exception in job');
    190184      ProgressView.CurrentJob.Method(Job);
    191185    except
     
    286280end;
    287281
    288 procedure TFormJobProgressView.FormDestroy(Sender:TObject);
    289 begin
    290 end;
    291 
    292282procedure TFormJobProgressView.ListViewJobsData(Sender: TObject; Item: TListItem);
    293283begin
    294284  if (Item.Index >= 0) and (Item.Index < JobProgressView.Jobs.Count) then
    295   with TJob(JobProgressView.Jobs[Item.Index]) do begin
     285  with JobProgressView.Jobs[Item.Index] do begin
    296286    Item.Caption := Title;
    297287    if Item.Index = JobProgressView.CurrentJobIndex then Item.ImageIndex := 1
     
    311301  Caption := SPleaseWait;
    312302  try
    313     //Animate1.FileName := ExtractFileDir(UTF8Encode(DpiApplication.ExeName)) +
     303    //Animate1.FileName := ExtractFileDir(UTF8Encode(Application.ExeName)) +
    314304    //  DirectorySeparator + 'horse.avi';
    315305    //Animate1.Active := True;
     
    405395    I := 0;
    406396    while I < Jobs.Count do
    407     with TJob(Jobs[I]) do begin
     397    with Jobs[I] do begin
    408398      CurrentJobIndex := I;
    409       CurrentJob := TJob(Jobs[I]);
     399      CurrentJob := Jobs[I];
    410400      JobProgressChange(Self);
    411401      StartTime := Now;
     
    420410        Method(CurrentJob);
    421411      end else begin
     412        Thread := TJobThread.Create(True);
    422413        try
    423           Thread := TJobThread.Create(True);
    424414          with Thread do begin
    425415            FreeOnTerminate := False;
     
    494484  if AValue = FTerminate then Exit;
    495485  for I := 0 to Jobs.Count - 1 do
    496     TJob(Jobs[I]).Terminate := AValue;
     486    Jobs[I].Terminate := AValue;
    497487  FTerminate := AValue;
    498488end;
     
    620610procedure TProgress.Increment;
    621611begin
    622   try
    623     FLock.Acquire;
     612  FLock.Acquire;
     613  try
    624614    Value := Value + 1;
    625615  finally
     
    630620procedure TProgress.Reset;
    631621begin
    632   try
    633     FLock.Acquire;
     622  FLock.Acquire;
     623  try
    634624    FValue := 0;
    635625  finally
     
    647637begin
    648638  FLock.Free;
    649   inherited Destroy;
     639  inherited;
    650640end;
    651641
     
    678668destructor TJob.Destroy;
    679669begin
    680   Progress.Free;
     670  FreeAndNil(Progress);
    681671  inherited;
    682672end;
  • branches/highdpi/Packages/Common/Languages.pas

    r462 r463  
    1 unit ULanguages;
    2 
    3 {$mode objfpc}{$H+}
     1unit Languages;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, Contnrs;
     6  Classes, SysUtils, Generics.Collections;
    97
    108type
     
    1513  end;
    1614
    17   { TLanguageList }
    18 
    19   TLanguageList = class(TObjectList)
     15  { TLanguages }
     16
     17  TLanguages = class(TObjectList<TLanguage>)
    2018    function SearchByCode(ACode: string): TLanguage;
    2119    procedure AddNew(Code: string; Name: string);
    22     constructor Create;
     20    constructor Create(FreeObjects: Boolean = True);
    2321  end;
    2422
     
    218216  SLang_za = 'Zhuang';
    219217  SLang_zh = 'Chinese';
     218  SLang_zh_Hans = 'Simplified Chinese';
     219  SLang_zh_Hant = 'Traditional Chinese';
    220220  SLang_zu = 'Zulu';
    221221
     222
    222223implementation
    223224
    224225
    225 { TLanguageList }
    226 
    227 function TLanguageList.SearchByCode(ACode: string): TLanguage;
     226{ TLanguages }
     227
     228function TLanguages.SearchByCode(ACode: string): TLanguage;
    228229var
    229230  I: Integer;
    230231begin
    231232  I := 0;
    232   while (I < Count) and (TLanguage(Items[I]).Code < ACode) do Inc(I);
    233   if I < Count then Result := TLanguage(Items[I])
     233  while (I < Count) and (Items[I].Code <> ACode) do Inc(I);
     234  if I < Count then Result := Items[I]
    234235    else Result := nil;
    235236end;
    236237
    237 procedure TLanguageList.AddNew(Code: string; Name: string);
     238procedure TLanguages.AddNew(Code: string; Name: string);
    238239var
    239240  NewItem: TLanguage;
     
    245246end;
    246247
    247 constructor TLanguageList.Create;
     248constructor TLanguages.Create(FreeObjects: Boolean);
    248249begin
    249   inherited Create;
     250  inherited;
    250251  AddNew('', SLangAuto);
    251252  AddNew('aa', SLang_aa);
     
    441442  AddNew('za', SLang_za);
    442443  AddNew('zh', SLang_zh);
     444  AddNew('zh-Hant', SLang_zh_Hant);
     445  AddNew('zh-Hans', SLang_zh_Hans);
    443446  AddNew('zu', SLang_zu);
    444447end;
    445448
    446449end.
    447 
  • branches/highdpi/Packages/Common/Languages/DebugLog.cs.po

    r462 r463  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111
    12 #: udebuglog.sfilenamenotdefined
     12#: debuglog.sfilenamenotdefined
     13#, fuzzy
     14msgctxt "debuglog.sfilenamenotdefined"
    1315msgid "Filename not defined"
    1416msgstr "Neurčen soubor"
  • branches/highdpi/Packages/Common/Languages/DebugLog.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: udebuglog.sfilenamenotdefined
     4#: debuglog.sfilenamenotdefined
    55msgid "Filename not defined"
    6 msgstr "Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8"
     6msgstr ""
    77
  • branches/highdpi/Packages/Common/Languages/FindFile.cs.po

    r462 r463  
    1212"X-Generator: Poedit 1.8.9\n"
    1313
    14 #: ufindfile.sdirnotfound
     14#: findfile.sdirnotfound
     15#, fuzzy
     16msgctxt "findfile.sdirnotfound"
    1517msgid "Directory not found"
    1618msgstr "Adresář nenalezen"
  • branches/highdpi/Packages/Common/Languages/FindFile.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: ufindfile.sdirnotfound
     4#: findfile.sdirnotfound
    55msgid "Directory not found"
    66msgstr ""
  • branches/highdpi/Packages/Common/Languages/FormAbout.cs.po

    r462 r463  
    1212"X-Generator: Poedit 2.4.1\n"
    1313
    14 #: uformabout.slicense
     14#: formabout.slicense
     15#, fuzzy
     16msgctxt "formabout.slicense"
    1517msgid "License"
    1618msgstr "Licence"
    1719
    18 #: uformabout.sreleasedate
     20#: formabout.sreleasedate
     21#, fuzzy
     22msgctxt "formabout.sreleasedate"
    1923msgid "Release date"
    2024msgstr "Datum uvolnění"
    2125
    22 #: uformabout.sversion
     26#: formabout.sversion
     27#, fuzzy
     28msgctxt "formabout.sversion"
    2329msgid "Version"
    2430msgstr "Verze"
  • branches/highdpi/Packages/Common/Languages/FormAbout.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: uformabout.slicense
     4#: formabout.slicense
    55msgid "License"
    66msgstr ""
    77
    8 #: uformabout.sreleasedate
     8#: formabout.sreleasedate
    99msgid "Release date"
    1010msgstr ""
    1111
    12 #: uformabout.sversion
     12#: formabout.sversion
    1313msgid "Version"
    1414msgstr ""
  • branches/highdpi/Packages/Common/Languages/JobProgressView.cs.po

    r462 r463  
    1212"X-Generator: Poedit 2.2\n"
    1313
    14 #: ujobprogressview.sestimatedtime
     14#: jobprogressview.sestimatedtime
     15#, object-pascal-format, fuzzy
     16msgctxt "jobprogressview.sestimatedtime"
    1517msgid "Estimated time: %s"
    1618msgstr "Odhadovaný čas: %s"
    1719
    18 #: ujobprogressview.sexecuted
     20#: jobprogressview.sexecuted
     21#, fuzzy
     22msgctxt "jobprogressview.sexecuted"
    1923msgid "Executed"
    2024msgstr "Vykonané"
    2125
    22 #: ujobprogressview.sfinished
     26#: jobprogressview.sfinished
     27#, fuzzy
     28msgctxt "jobprogressview.sfinished"
    2329msgid "Finished"
    2430msgstr "Dokončené"
    2531
    26 #: ujobprogressview.spleasewait
     32#: jobprogressview.spleasewait
     33#, fuzzy
     34msgctxt "jobprogressview.spleasewait"
    2735msgid "Please wait..."
    2836msgstr "Prosím čekejte..."
    2937
    30 #: ujobprogressview.sterminate
     38#: jobprogressview.sterminate
     39#, fuzzy
     40msgctxt "jobprogressview.sterminate"
    3141msgid "Termination"
    3242msgstr "Přerušení"
    3343
    34 #: ujobprogressview.stotalestimatedtime
     44#: jobprogressview.stotalestimatedtime
     45#, object-pascal-format, fuzzy
     46msgctxt "jobprogressview.stotalestimatedtime"
    3547msgid "Total estimated time: %s"
    3648msgstr "Celkový odhadovaný čas: %s"
  • branches/highdpi/Packages/Common/Languages/JobProgressView.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: ujobprogressview.sestimatedtime
     4#: jobprogressview.sestimatedtime
     5#, object-pascal-format
    56msgid "Estimated time: %s"
    67msgstr ""
    78
    8 #: ujobprogressview.sexecuted
     9#: jobprogressview.sexecuted
    910msgid "Executed"
    1011msgstr ""
    1112
    12 #: ujobprogressview.sfinished
     13#: jobprogressview.sfinished
    1314msgid "Finished"
    1415msgstr ""
    1516
    16 #: ujobprogressview.spleasewait
     17#: jobprogressview.spleasewait
    1718msgid "Please wait..."
    1819msgstr ""
    1920
    20 #: ujobprogressview.sterminate
     21#: jobprogressview.sterminate
    2122msgid "Termination"
    2223msgstr ""
    2324
    24 #: ujobprogressview.stotalestimatedtime
     25#: jobprogressview.stotalestimatedtime
     26#, object-pascal-format
    2527msgid "Total estimated time: %s"
    2628msgstr ""
  • branches/highdpi/Packages/Common/Languages/Languages.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: ulanguages.slangauto
     4#: languages.slangauto
    55msgid "Automatic"
    66msgstr ""
    77
    8 #: ulanguages.slang_aa
     8#: languages.slang_aa
    99msgid "Afar"
    1010msgstr ""
    1111
    12 #: ulanguages.slang_ab
     12#: languages.slang_ab
    1313msgid "Abkhazian"
    1414msgstr ""
    1515
    16 #: ulanguages.slang_ae
     16#: languages.slang_ae
    1717msgid "Avestan"
    1818msgstr ""
    1919
    20 #: ulanguages.slang_af
     20#: languages.slang_af
    2121msgid "Afrikaans"
    2222msgstr ""
    2323
    24 #: ulanguages.slang_ak
     24#: languages.slang_ak
    2525msgid "Akan"
    2626msgstr ""
    2727
    28 #: ulanguages.slang_am
     28#: languages.slang_am
    2929msgid "Amharic"
    3030msgstr ""
    3131
    32 #: ulanguages.slang_an
     32#: languages.slang_an
    3333msgid "Aragonese"
    3434msgstr ""
    3535
    36 #: ulanguages.slang_ar
     36#: languages.slang_ar
    3737msgid "Arabic"
    3838msgstr ""
    3939
    40 #: ulanguages.slang_as
     40#: languages.slang_as
    4141msgid "Assamese"
    4242msgstr ""
    4343
    44 #: ulanguages.slang_av
     44#: languages.slang_av
    4545msgid "Avaric"
    4646msgstr ""
    4747
    48 #: ulanguages.slang_ay
     48#: languages.slang_ay
    4949msgid "Aymara"
    5050msgstr ""
    5151
    52 #: ulanguages.slang_az
     52#: languages.slang_az
    5353msgid "Azerbaijani"
    5454msgstr ""
    5555
    56 #: ulanguages.slang_ba
     56#: languages.slang_ba
    5757msgid "Bashkir"
    5858msgstr ""
    5959
    60 #: ulanguages.slang_be
     60#: languages.slang_be
    6161msgid "Belarusian"
    6262msgstr ""
    6363
    64 #: ulanguages.slang_bg
     64#: languages.slang_bg
    6565msgid "Bulgarian"
    6666msgstr ""
    6767
    68 #: ulanguages.slang_bh
     68#: languages.slang_bh
    6969msgid "Bihari"
    7070msgstr ""
    7171
    72 #: ulanguages.slang_bi
     72#: languages.slang_bi
    7373msgid "Bislama"
    7474msgstr ""
    7575
    76 #: ulanguages.slang_bm
     76#: languages.slang_bm
    7777msgid "Bambara"
    7878msgstr ""
    7979
    80 #: ulanguages.slang_bn
     80#: languages.slang_bn
    8181msgid "Bengali"
    8282msgstr ""
    8383
    84 #: ulanguages.slang_bo
     84#: languages.slang_bo
    8585msgid "Tibetan"
    8686msgstr ""
    8787
    88 #: ulanguages.slang_br
     88#: languages.slang_br
    8989msgid "Breton"
    9090msgstr ""
    9191
    92 #: ulanguages.slang_bs
     92#: languages.slang_bs
    9393msgid "Bosnian"
    9494msgstr ""
    9595
    96 #: ulanguages.slang_ca
     96#: languages.slang_ca
    9797msgid "Catalan"
    9898msgstr ""
    9999
    100 #: ulanguages.slang_ce
     100#: languages.slang_ce
    101101msgid "Chechen"
    102102msgstr ""
    103103
    104 #: ulanguages.slang_ch
     104#: languages.slang_ch
    105105msgid "Chamorro"
    106106msgstr ""
    107107
    108 #: ulanguages.slang_co
     108#: languages.slang_co
    109109msgid "Corsican"
    110110msgstr ""
    111111
    112 #: ulanguages.slang_cr
     112#: languages.slang_cr
    113113msgid "Cree"
    114114msgstr ""
    115115
    116 #: ulanguages.slang_cs
     116#: languages.slang_cs
    117117msgid "Czech"
    118118msgstr ""
    119119
    120 #: ulanguages.slang_cv
     120#: languages.slang_cv
    121121msgid "Chuvash"
    122122msgstr ""
    123123
    124 #: ulanguages.slang_cy
     124#: languages.slang_cy
    125125msgid "Welsh"
    126126msgstr ""
    127127
    128 #: ulanguages.slang_da
     128#: languages.slang_da
    129129msgid "Danish"
    130130msgstr ""
    131131
    132 #: ulanguages.slang_de
     132#: languages.slang_de
    133133msgid "German"
    134134msgstr ""
    135135
    136 #: ulanguages.slang_de_at
     136#: languages.slang_de_at
    137137msgid "Austrian German"
    138138msgstr ""
    139139
    140 #: ulanguages.slang_de_ch
     140#: languages.slang_de_ch
    141141msgid "Swiss German"
    142142msgstr ""
    143143
    144 #: ulanguages.slang_dv
     144#: languages.slang_dv
    145145msgid "Divehi"
    146146msgstr ""
    147147
    148 #: ulanguages.slang_dz
     148#: languages.slang_dz
    149149msgid "Dzongkha"
    150150msgstr ""
    151151
    152 #: ulanguages.slang_ee
     152#: languages.slang_ee
    153153msgid "Ewe"
    154154msgstr ""
    155155
    156 #: ulanguages.slang_el
     156#: languages.slang_el
    157157msgid "Greek"
    158158msgstr ""
    159159
    160 #: ulanguages.slang_en
     160#: languages.slang_en
    161161msgid "English"
    162162msgstr ""
    163163
    164 #: ulanguages.slang_en_au
     164#: languages.slang_en_au
    165165msgid "Australian English"
    166166msgstr ""
    167167
    168 #: ulanguages.slang_en_ca
     168#: languages.slang_en_ca
    169169msgid "Canadian English"
    170170msgstr ""
    171171
    172 #: ulanguages.slang_en_gb
     172#: languages.slang_en_gb
    173173msgid "British English"
    174174msgstr ""
    175175
    176 #: ulanguages.slang_en_us
     176#: languages.slang_en_us
    177177msgid "American English"
    178178msgstr ""
    179179
    180 #: ulanguages.slang_eo
     180#: languages.slang_eo
    181181msgid "Esperanto"
    182182msgstr ""
    183183
    184 #: ulanguages.slang_es
     184#: languages.slang_es
    185185msgid "Spanish"
    186186msgstr ""
    187187
    188 #: ulanguages.slang_et
     188#: languages.slang_et
    189189msgid "Estonian"
    190190msgstr ""
    191191
    192 #: ulanguages.slang_eu
     192#: languages.slang_eu
    193193msgid "Basque"
    194194msgstr ""
    195195
    196 #: ulanguages.slang_fa
     196#: languages.slang_fa
    197197msgid "Persian"
    198198msgstr ""
    199199
    200 #: ulanguages.slang_ff
     200#: languages.slang_ff
    201201msgid "Fulah"
    202202msgstr ""
    203203
    204 #: ulanguages.slang_fi
     204#: languages.slang_fi
    205205msgid "Finnish"
    206206msgstr ""
    207207
    208 #: ulanguages.slang_fj
     208#: languages.slang_fj
    209209msgid "Fijian"
    210210msgstr ""
    211211
    212 #: ulanguages.slang_fo
     212#: languages.slang_fo
    213213msgid "Faroese"
    214214msgstr ""
    215215
    216 #: ulanguages.slang_fr
     216#: languages.slang_fr
    217217msgid "French"
    218218msgstr ""
    219219
    220 #: ulanguages.slang_fr_be
    221 msgctxt "ulanguages.slang_fr_be"
     220#: languages.slang_fr_be
     221msgctxt "languages.slang_fr_be"
    222222msgid "Walloon"
    223223msgstr ""
    224224
    225 #: ulanguages.slang_fy
     225#: languages.slang_fy
    226226msgid "Frisian"
    227227msgstr ""
    228228
    229 #: ulanguages.slang_ga
     229#: languages.slang_ga
    230230msgid "Irish"
    231231msgstr ""
    232232
    233 #: ulanguages.slang_gd
     233#: languages.slang_gd
    234234msgid "Gaelic"
    235235msgstr ""
    236236
    237 #: ulanguages.slang_gl
     237#: languages.slang_gl
    238238msgid "Gallegan"
    239239msgstr ""
    240240
    241 #: ulanguages.slang_gn
     241#: languages.slang_gn
    242242msgid "Guarani"
    243243msgstr ""
    244244
    245 #: ulanguages.slang_gu
     245#: languages.slang_gu
    246246msgid "Gujarati"
    247247msgstr ""
    248248
    249 #: ulanguages.slang_gv
     249#: languages.slang_gv
    250250msgid "Manx"
    251251msgstr ""
    252252
    253 #: ulanguages.slang_ha
     253#: languages.slang_ha
    254254msgid "Hausa"
    255255msgstr ""
    256256
    257 #: ulanguages.slang_he
     257#: languages.slang_he
    258258msgid "Hebrew"
    259259msgstr ""
    260260
    261 #: ulanguages.slang_hi
     261#: languages.slang_hi
    262262msgid "Hindi"
    263263msgstr ""
    264264
    265 #: ulanguages.slang_ho
     265#: languages.slang_ho
    266266msgid "Hiri Motu"
    267267msgstr ""
    268268
    269 #: ulanguages.slang_hr
     269#: languages.slang_hr
    270270msgid "Croatian"
    271271msgstr ""
    272272
    273 #: ulanguages.slang_ht
     273#: languages.slang_ht
    274274msgid "Haitian"
    275275msgstr ""
    276276
    277 #: ulanguages.slang_hu
     277#: languages.slang_hu
    278278msgid "Hungarian"
    279279msgstr ""
    280280
    281 #: ulanguages.slang_hy
     281#: languages.slang_hy
    282282msgid "Armenian"
    283283msgstr ""
    284284
    285 #: ulanguages.slang_hz
     285#: languages.slang_hz
    286286msgid "Herero"
    287287msgstr ""
    288288
    289 #: ulanguages.slang_ia
     289#: languages.slang_ia
    290290msgid "Interlingua"
    291291msgstr ""
    292292
    293 #: ulanguages.slang_id
     293#: languages.slang_id
    294294msgid "Indonesian"
    295295msgstr ""
    296296
    297 #: ulanguages.slang_ie
     297#: languages.slang_ie
    298298msgid "Interlingue"
    299299msgstr ""
    300300
    301 #: ulanguages.slang_ig
     301#: languages.slang_ig
    302302msgid "Igbo"
    303303msgstr ""
    304304
    305 #: ulanguages.slang_ii
     305#: languages.slang_ii
    306306msgid "Sichuan Yi"
    307307msgstr ""
    308308
    309 #: ulanguages.slang_ik
     309#: languages.slang_ik
    310310msgid "Inupiaq"
    311311msgstr ""
    312312
    313 #: ulanguages.slang_io
     313#: languages.slang_io
    314314msgid "Ido"
    315315msgstr ""
    316316
    317 #: ulanguages.slang_is
     317#: languages.slang_is
    318318msgid "Icelandic"
    319319msgstr ""
    320320
    321 #: ulanguages.slang_it
     321#: languages.slang_it
    322322msgid "Italian"
    323323msgstr ""
    324324
    325 #: ulanguages.slang_iu
     325#: languages.slang_iu
    326326msgid "Inuktitut"
    327327msgstr ""
    328328
    329 #: ulanguages.slang_ja
     329#: languages.slang_ja
    330330msgid "Japanese"
    331331msgstr ""
    332332
    333 #: ulanguages.slang_jv
     333#: languages.slang_jv
    334334msgid "Javanese"
    335335msgstr ""
    336336
    337 #: ulanguages.slang_ka
     337#: languages.slang_ka
    338338msgid "Georgian"
    339339msgstr ""
    340340
    341 #: ulanguages.slang_kg
     341#: languages.slang_kg
    342342msgid "Kongo"
    343343msgstr ""
    344344
    345 #: ulanguages.slang_ki
     345#: languages.slang_ki
    346346msgid "Kikuyu"
    347347msgstr ""
    348348
    349 #: ulanguages.slang_kj
     349#: languages.slang_kj
    350350msgid "Kuanyama"
    351351msgstr ""
    352352
    353 #: ulanguages.slang_kk
     353#: languages.slang_kk
    354354msgid "Kazakh"
    355355msgstr ""
    356356
    357 #: ulanguages.slang_kl
     357#: languages.slang_kl
    358358msgid "Greenlandic"
    359359msgstr ""
    360360
    361 #: ulanguages.slang_km
     361#: languages.slang_km
    362362msgid "Khmer"
    363363msgstr ""
    364364
    365 #: ulanguages.slang_kn
     365#: languages.slang_kn
    366366msgid "Kannada"
    367367msgstr ""
    368368
    369 #: ulanguages.slang_ko
     369#: languages.slang_ko
    370370msgid "Korean"
    371371msgstr ""
    372372
    373 #: ulanguages.slang_kr
     373#: languages.slang_kr
    374374msgid "Kanuri"
    375375msgstr ""
    376376
    377 #: ulanguages.slang_ks
     377#: languages.slang_ks
    378378msgid "Kashmiri"
    379379msgstr ""
    380380
    381 #: ulanguages.slang_ku
     381#: languages.slang_ku
    382382msgid "Kurdish"
    383383msgstr ""
    384384
    385 #: ulanguages.slang_kv
     385#: languages.slang_kv
    386386msgid "Komi"
    387387msgstr ""
    388388
    389 #: ulanguages.slang_kw
     389#: languages.slang_kw
    390390msgid "Cornish"
    391391msgstr ""
    392392
    393 #: ulanguages.slang_ky
     393#: languages.slang_ky
    394394msgid "Kirghiz"
    395395msgstr ""
    396396
    397 #: ulanguages.slang_la
     397#: languages.slang_la
    398398msgid "Latin"
    399399msgstr ""
    400400
    401 #: ulanguages.slang_lb
     401#: languages.slang_lb
    402402msgid "Luxembourgish"
    403403msgstr ""
    404404
    405 #: ulanguages.slang_lg
     405#: languages.slang_lg
    406406msgid "Ganda"
    407407msgstr ""
    408408
    409 #: ulanguages.slang_li
     409#: languages.slang_li
    410410msgid "Limburgan"
    411411msgstr ""
    412412
    413 #: ulanguages.slang_ln
     413#: languages.slang_ln
    414414msgid "Lingala"
    415415msgstr ""
    416416
    417 #: ulanguages.slang_lo
     417#: languages.slang_lo
    418418msgid "Lao"
    419419msgstr ""
    420420
    421 #: ulanguages.slang_lt
     421#: languages.slang_lt
    422422msgid "Lithuanian"
    423423msgstr ""
    424424
    425 #: ulanguages.slang_lu
     425#: languages.slang_lu
    426426msgid "Luba-Katanga"
    427427msgstr ""
    428428
    429 #: ulanguages.slang_lv
     429#: languages.slang_lv
    430430msgid "Latvian"
    431431msgstr ""
    432432
    433 #: ulanguages.slang_mg
     433#: languages.slang_mg
    434434msgid "Malagasy"
    435435msgstr ""
    436436
    437 #: ulanguages.slang_mh
     437#: languages.slang_mh
    438438msgid "Marshallese"
    439439msgstr ""
    440440
    441 #: ulanguages.slang_mi
     441#: languages.slang_mi
    442442msgid "Maori"
    443443msgstr ""
    444444
    445 #: ulanguages.slang_mk
     445#: languages.slang_mk
    446446msgid "Macedonian"
    447447msgstr ""
    448448
    449 #: ulanguages.slang_ml
     449#: languages.slang_ml
    450450msgid "Malayalam"
    451451msgstr ""
    452452
    453 #: ulanguages.slang_mn
     453#: languages.slang_mn
    454454msgid "Mongolian"
    455455msgstr ""
    456456
    457 #: ulanguages.slang_mo
     457#: languages.slang_mo
    458458msgid "Moldavian"
    459459msgstr ""
    460460
    461 #: ulanguages.slang_mr
     461#: languages.slang_mr
    462462msgid "Marathi"
    463463msgstr ""
    464464
    465 #: ulanguages.slang_ms
     465#: languages.slang_ms
    466466msgid "Malay"
    467467msgstr ""
    468468
    469 #: ulanguages.slang_mt
     469#: languages.slang_mt
    470470msgid "Maltese"
    471471msgstr ""
    472472
    473 #: ulanguages.slang_my
     473#: languages.slang_my
    474474msgid "Burmese"
    475475msgstr ""
    476476
    477 #: ulanguages.slang_na
     477#: languages.slang_na
    478478msgid "Nauru"
    479479msgstr ""
    480480
    481 #: ulanguages.slang_nb
     481#: languages.slang_nb
    482482msgid "Norwegian Bokmaal"
    483483msgstr ""
    484484
    485 #: ulanguages.slang_nd
     485#: languages.slang_nd
    486486msgid "Ndebele, North"
    487487msgstr ""
    488488
    489 #: ulanguages.slang_ne
     489#: languages.slang_ne
    490490msgid "Nepali"
    491491msgstr ""
    492492
    493 #: ulanguages.slang_ng
     493#: languages.slang_ng
    494494msgid "Ndonga"
    495495msgstr ""
    496496
    497 #: ulanguages.slang_nl
     497#: languages.slang_nl
    498498msgid "Dutch"
    499499msgstr ""
    500500
    501 #: ulanguages.slang_nl_be
     501#: languages.slang_nl_be
    502502msgid "Flemish"
    503503msgstr ""
    504504
    505 #: ulanguages.slang_nn
     505#: languages.slang_nn
    506506msgid "Norwegian Nynorsk"
    507507msgstr ""
    508508
    509 #: ulanguages.slang_no
     509#: languages.slang_no
    510510msgid "Norwegian"
    511511msgstr ""
    512512
    513 #: ulanguages.slang_nr
     513#: languages.slang_nr
    514514msgid "Ndebele, South"
    515515msgstr ""
    516516
    517 #: ulanguages.slang_nv
     517#: languages.slang_nv
    518518msgid "Navajo"
    519519msgstr ""
    520520
    521 #: ulanguages.slang_ny
     521#: languages.slang_ny
    522522msgid "Chichewa"
    523523msgstr ""
    524524
    525 #: ulanguages.slang_oc
     525#: languages.slang_oc
    526526msgid "Occitan"
    527527msgstr ""
    528528
    529 #: ulanguages.slang_oj
     529#: languages.slang_oj
    530530msgid "Ojibwa"
    531531msgstr ""
    532532
    533 #: ulanguages.slang_om
     533#: languages.slang_om
    534534msgid "Oromo"
    535535msgstr ""
    536536
    537 #: ulanguages.slang_or
     537#: languages.slang_or
    538538msgid "Oriya"
    539539msgstr ""
    540540
    541 #: ulanguages.slang_os
     541#: languages.slang_os
    542542msgid "Ossetian"
    543543msgstr ""
    544544
    545 #: ulanguages.slang_pa
     545#: languages.slang_pa
    546546msgid "Panjabi"
    547547msgstr ""
    548548
    549 #: ulanguages.slang_pi
     549#: languages.slang_pi
    550550msgid "Pali"
    551551msgstr ""
    552552
    553 #: ulanguages.slang_pl
     553#: languages.slang_pl
    554554msgid "Polish"
    555555msgstr ""
    556556
    557 #: ulanguages.slang_ps
     557#: languages.slang_ps
    558558msgid "Pushto"
    559559msgstr ""
    560560
    561 #: ulanguages.slang_pt
     561#: languages.slang_pt
    562562msgid "Portuguese"
    563563msgstr ""
    564564
    565 #: ulanguages.slang_pt_br
     565#: languages.slang_pt_br
    566566msgid "Brazilian Portuguese"
    567567msgstr ""
    568568
    569 #: ulanguages.slang_qu
     569#: languages.slang_qu
    570570msgid "Quechua"
    571571msgstr ""
    572572
    573 #: ulanguages.slang_rm
     573#: languages.slang_rm
    574574msgid "Raeto-Romance"
    575575msgstr ""
    576576
    577 #: ulanguages.slang_rn
     577#: languages.slang_rn
    578578msgid "Rundi"
    579579msgstr ""
    580580
    581 #: ulanguages.slang_ro
     581#: languages.slang_ro
    582582msgid "Romanian"
    583583msgstr ""
    584584
    585 #: ulanguages.slang_ru
     585#: languages.slang_ru
    586586msgid "Russian"
    587587msgstr ""
    588588
    589 #: ulanguages.slang_rw
     589#: languages.slang_rw
    590590msgid "Kinyarwanda"
    591591msgstr ""
    592592
    593 #: ulanguages.slang_sa
     593#: languages.slang_sa
    594594msgid "Sanskrit"
    595595msgstr ""
    596596
    597 #: ulanguages.slang_sc
     597#: languages.slang_sc
    598598msgid "Sardinian"
    599599msgstr ""
    600600
    601 #: ulanguages.slang_sd
     601#: languages.slang_sd
    602602msgid "Sindhi"
    603603msgstr ""
    604604
    605 #: ulanguages.slang_se
     605#: languages.slang_se
    606606msgid "Northern Sami"
    607607msgstr ""
    608608
    609 #: ulanguages.slang_sg
     609#: languages.slang_sg
    610610msgid "Sango"
    611611msgstr ""
    612612
    613 #: ulanguages.slang_si
     613#: languages.slang_si
    614614msgid "Sinhalese"
    615615msgstr ""
    616616
    617 #: ulanguages.slang_sk
     617#: languages.slang_sk
    618618msgid "Slovak"
    619619msgstr ""
    620620
    621 #: ulanguages.slang_sl
     621#: languages.slang_sl
    622622msgid "Slovenian"
    623623msgstr ""
    624624
    625 #: ulanguages.slang_sm
     625#: languages.slang_sm
    626626msgid "Samoan"
    627627msgstr ""
    628628
    629 #: ulanguages.slang_sn
     629#: languages.slang_sn
    630630msgid "Shona"
    631631msgstr ""
    632632
    633 #: ulanguages.slang_so
     633#: languages.slang_so
    634634msgid "Somali"
    635635msgstr ""
    636636
    637 #: ulanguages.slang_sq
     637#: languages.slang_sq
    638638msgid "Albanian"
    639639msgstr ""
    640640
    641 #: ulanguages.slang_sr
     641#: languages.slang_sr
    642642msgid "Serbian"
    643643msgstr ""
    644644
    645 #: ulanguages.slang_ss
     645#: languages.slang_ss
    646646msgid "Swati"
    647647msgstr ""
    648648
    649 #: ulanguages.slang_st
     649#: languages.slang_st
    650650msgid "Sotho, Southern"
    651651msgstr ""
    652652
    653 #: ulanguages.slang_su
     653#: languages.slang_su
    654654msgid "Sundanese"
    655655msgstr ""
    656656
    657 #: ulanguages.slang_sv
     657#: languages.slang_sv
    658658msgid "Swedish"
    659659msgstr ""
    660660
    661 #: ulanguages.slang_sw
     661#: languages.slang_sw
    662662msgid "Swahili"
    663663msgstr ""
    664664
    665 #: ulanguages.slang_ta
     665#: languages.slang_ta
    666666msgid "Tamil"
    667667msgstr ""
    668668
    669 #: ulanguages.slang_te
     669#: languages.slang_te
    670670msgid "Telugu"
    671671msgstr ""
    672672
    673 #: ulanguages.slang_tg
     673#: languages.slang_tg
    674674msgid "Tajik"
    675675msgstr ""
    676676
    677 #: ulanguages.slang_th
     677#: languages.slang_th
    678678msgid "Thai"
    679679msgstr ""
    680680
    681 #: ulanguages.slang_ti
     681#: languages.slang_ti
    682682msgid "Tigrinya"
    683683msgstr ""
    684684
    685 #: ulanguages.slang_tk
     685#: languages.slang_tk
    686686msgid "Turkmen"
    687687msgstr ""
    688688
    689 #: ulanguages.slang_tl
     689#: languages.slang_tl
    690690msgid "Tagalog"
    691691msgstr ""
    692692
    693 #: ulanguages.slang_tn
     693#: languages.slang_tn
    694694msgid "Tswana"
    695695msgstr ""
    696696
    697 #: ulanguages.slang_to
     697#: languages.slang_to
    698698msgid "Tonga"
    699699msgstr ""
    700700
    701 #: ulanguages.slang_tr
     701#: languages.slang_tr
    702702msgid "Turkish"
    703703msgstr ""
    704704
    705 #: ulanguages.slang_ts
     705#: languages.slang_ts
    706706msgid "Tsonga"
    707707msgstr ""
    708708
    709 #: ulanguages.slang_tt
     709#: languages.slang_tt
    710710msgid "Tatar"
    711711msgstr ""
    712712
    713 #: ulanguages.slang_tw
     713#: languages.slang_tw
    714714msgid "Twi"
    715715msgstr ""
    716716
    717 #: ulanguages.slang_ty
     717#: languages.slang_ty
    718718msgid "Tahitian"
    719719msgstr ""
    720720
    721 #: ulanguages.slang_ug
     721#: languages.slang_ug
    722722msgid "Uighur"
    723723msgstr ""
    724724
    725 #: ulanguages.slang_uk
     725#: languages.slang_uk
    726726msgid "Ukrainian"
    727727msgstr ""
    728728
    729 #: ulanguages.slang_ur
     729#: languages.slang_ur
    730730msgid "Urdu"
    731731msgstr ""
    732732
    733 #: ulanguages.slang_uz
     733#: languages.slang_uz
    734734msgid "Uzbek"
    735735msgstr ""
    736736
    737 #: ulanguages.slang_ve
     737#: languages.slang_ve
    738738msgid "Venda"
    739739msgstr ""
    740740
    741 #: ulanguages.slang_vi
     741#: languages.slang_vi
    742742msgid "Vietnamese"
    743743msgstr ""
    744744
    745 #: ulanguages.slang_vo
     745#: languages.slang_vo
    746746msgid "Volapuk"
    747747msgstr ""
    748748
    749 #: ulanguages.slang_wa
    750 msgctxt "ulanguages.slang_wa"
     749#: languages.slang_wa
     750msgctxt "languages.slang_wa"
    751751msgid "Walloon"
    752752msgstr ""
    753753
    754 #: ulanguages.slang_wo
     754#: languages.slang_wo
    755755msgid "Wolof"
    756756msgstr ""
    757757
    758 #: ulanguages.slang_xh
     758#: languages.slang_xh
    759759msgid "Xhosa"
    760760msgstr ""
    761761
    762 #: ulanguages.slang_yi
     762#: languages.slang_yi
    763763msgid "Yiddish"
    764764msgstr ""
    765765
    766 #: ulanguages.slang_yo
     766#: languages.slang_yo
    767767msgid "Yoruba"
    768768msgstr ""
    769769
    770 #: ulanguages.slang_za
     770#: languages.slang_za
    771771msgid "Zhuang"
    772772msgstr ""
    773773
    774 #: ulanguages.slang_zh
     774#: languages.slang_zh
    775775msgid "Chinese"
    776776msgstr ""
    777777
    778 #: ulanguages.slang_zu
     778#: languages.slang_zh_hans
     779msgid "Simplified Chinese"
     780msgstr ""
     781
     782#: languages.slang_zh_hant
     783msgid "Traditional Chinese"
     784msgstr ""
     785
     786#: languages.slang_zu
    779787msgid "Zulu"
    780788msgstr ""
  • branches/highdpi/Packages/Common/Languages/Pool.cs.po

    r462 r463  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111
    12 #: upool.sobjectpoolempty
     12#: pool.sobjectpoolempty
     13#, fuzzy
     14msgctxt "pool.sobjectpoolempty"
    1315msgid "Object pool is empty"
    1416msgstr "Zásobník objektů je prázdný"
    1517
    16 #: upool.sreleaseerror
     18#: pool.sreleaseerror
     19#, fuzzy
     20msgctxt "pool.sreleaseerror"
    1721msgid "Unknown object for release from pool"
    1822msgstr "Neznýmý objekt pro uvolnění ze zásobníku"
  • branches/highdpi/Packages/Common/Languages/Pool.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: upool.sobjectpoolempty
     4#: pool.sobjectpoolempty
    55msgid "Object pool is empty"
    6 msgstr "Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8"
     6msgstr ""
    77
    8 #: upool.sreleaseerror
     8#: pool.sreleaseerror
    99msgid "Unknown object for release from pool"
    1010msgstr ""
  • branches/highdpi/Packages/Common/Languages/ResetableThread.cs.po

    r462 r463  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111
    12 #: uresetablethread.swaiterror
     12#: resetablethread.swaiterror
     13#, fuzzy
     14msgctxt "resetablethread.swaiterror"
    1315msgid "WaitFor error"
    1416msgstr "Chyba WaitFor"
  • branches/highdpi/Packages/Common/Languages/ResetableThread.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: uresetablethread.swaiterror
     4#: resetablethread.swaiterror
    55msgid "WaitFor error"
    6 msgstr "Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8"
     6msgstr ""
    77
  • branches/highdpi/Packages/Common/Languages/ScaleDPI.cs.po

    r462 r463  
    1212"X-Generator: Poedit 1.8.9\n"
    1313
    14 #: uscaledpi.swrongdpi
     14#: scaledpi.swrongdpi
     15#, object-pascal-format, fuzzy
     16msgctxt "scaledpi.swrongdpi"
    1517msgid "Wrong DPI [%d,%d]"
    1618msgstr "Chybné DPI [%d,%d]"
  • branches/highdpi/Packages/Common/Languages/ScaleDPI.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: uscaledpi.swrongdpi
     4#: scaledpi.swrongdpi
     5#, object-pascal-format
    56msgid "Wrong DPI [%d,%d]"
    67msgstr ""
  • branches/highdpi/Packages/Common/Languages/Threading.cs.po

    r462 r463  
    1010"Content-Transfer-Encoding: 8bit\n"
    1111
    12 #: uthreading.scurrentthreadnotfound
     12#: threading.scurrentthreadnotfound
     13#, object-pascal-format, fuzzy
     14msgctxt "threading.scurrentthreadnotfound"
    1315msgid "Current thread ID %d not found in virtual thread list."
    1416msgstr "Aktuální vlákno ID %d nenalezeno v seznamu virtuálních vláken."
  • branches/highdpi/Packages/Common/Languages/Threading.pot

    r462 r463  
    22msgstr "Content-Type: text/plain; charset=UTF-8"
    33
    4 #: uthreading.scurrentthreadnotfound
    5 #, fuzzy,badformat
     4#: threading.scurrentthreadnotfound
     5#, object-pascal-format
    66msgid "Current thread ID %d not found in virtual thread list."
    7 msgstr "Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8Content-Type: text/plain; charset=UTF-8"
     7msgstr ""
    88
  • branches/highdpi/Packages/Common/LastOpenedList.pas

    r462 r463  
    1 unit ULastOpenedList;
    2 
    3 {$mode delphi}
     1unit LastOpenedList;
    42
    53interface
    64
    75uses
    8   UDpiControls, Classes, SysUtils, Registry, URegistry, Menus, XMLConf, DOM;
     6  UDpiControls, Classes, SysUtils, Registry, RegistryEx, Menus, XMLConf, DOM;
    97
    108type
     
    8482destructor TLastOpenedList.Destroy;
    8583begin
    86   Items.Free;
     84  FreeAndNil(Items);
    8785  inherited;
    8886end;
     
    9492begin
    9593  if Assigned(MenuItem) then begin
    96     MenuItem.Clear;
     94    while MenuItem.Count > Items.Count do
     95      MenuItem.Delete(MenuItem.Count - 1);
     96    while MenuItem.Count < Items.Count do begin
     97      NewMenuItem := TDpiMenuItem.Create(MenuItem);
     98      MenuItem.Add(NewMenuItem);
     99    end;
    97100    for I := 0 to Items.Count - 1 do begin
    98       NewMenuItem := TDpiMenuItem.Create(MenuItem);
    99       NewMenuItem.Caption := Items[I];
    100       NewMenuItem.OnClick := ClickAction;
    101       MenuItem.Add(NewMenuItem);
     101      MenuItem.Items[I].Caption := Items[I];
     102      MenuItem.Items[I].OnClick := ClickAction;
    102103    end;
    103104  end;
     
    193194
    194195end.
    195 
  • branches/highdpi/Packages/Common/ListViewSort.pas

    r462 r463  
    1 unit UListViewSort;
     1unit ListViewSort;
    22
    33// Date: 2019-05-17
    4 
    5 {$mode delphi}
    64
    75interface
     
    97uses
    108  UDpiControls, {$IFDEF Windows}Windows, CommCtrl, LMessages, {$ENDIF}Classes, Graphics, ComCtrls, SysUtils,
    11   Controls, DateUtils, Dialogs, fgl, Forms, Grids, StdCtrls, ExtCtrls,
    12   LclIntf, LclType, LResources;
     9  Controls, DateUtils, Dialogs, Forms, Grids, StdCtrls, ExtCtrls,
     10  LclIntf, LclType, LResources, Generics.Collections, Generics.Defaults;
    1311
    1412type
     
    1917  TCompareEvent = function (Item1, Item2: TObject): Integer of object;
    2018  TListFilterEvent = procedure (ListViewSort: TListViewSort) of object;
     19
     20  TObjects = TObjectList<TObject>;
    2121
    2222  { TListViewSort }
     
    2727    FOnCompareItem: TCompareEvent;
    2828    FOnFilter: TListFilterEvent;
    29     FOnCustomDraw: TLVCustomDrawItemEvent;
     29    FOnCustomDraw: TDpiLVCustomDrawItemEvent;
    3030    {$IFDEF Windows}FHeaderHandle: HWND;{$ENDIF}
    3131    FColumn: Integer;
     
    4242    procedure GetCheckBias(var XBias, YBias, BiasTop, BiasLeft: Integer;
    4343      const ListView: TDpiListView);
    44     procedure ListViewCustomDrawItem(Sender: TCustomListView;
     44    procedure ListViewCustomDrawItem(Sender: TDpiCustomListView;
    4545      Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
    4646    procedure ListViewClick(Sender: TObject);
     
    5252    {$ENDIF}
    5353  public
    54     List: TFPGObjectList<TObject>;
    55     Source: TFPGObjectList<TObject>;
     54    Source: TObjects;
     55    List: TObjects;
    5656    constructor Create(AOwner: TComponent); override;
    5757    destructor Destroy; override;
     
    6767    property OnFilter: TListFilterEvent read FOnFilter
    6868      write FOnFilter;
    69     property OnCustomDraw: TLVCustomDrawItemEvent read FOnCustomDraw
     69    property OnCustomDraw: TDpiLVCustomDrawItemEvent read FOnCustomDraw
    7070      write FOnCustomDraw;
    7171    property OnColumnWidthChanged: TNotifyEvent read FOnColumnWidthChanged
     
    8181    FOnChange: TNotifyEvent;
    8282    FStringGrid1: TDpiStringGrid;
     83    procedure DoOnChange;
    8384    procedure GridDoOnKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
    8485    procedure GridDoOnResize(Sender: TObject);
     
    9091    function TextEnteredColumn(Index: Integer): Boolean;
    9192    function GetColValue(Index: Integer): string;
     93    procedure Reset;
    9294    property StringGrid: TDpiStringGrid read FStringGrid1 write FStringGrid1;
    9395  published
     
    147149destructor TListViewEx.Destroy;
    148150begin
    149   inherited Destroy;
     151  inherited;
    150152end;
    151153
    152154{ TListViewFilter }
     155
     156procedure TListViewFilter.DoOnChange;
     157begin
     158  if Assigned(FOnChange) then FOnChange(Self);
     159end;
    153160
    154161procedure TListViewFilter.GridDoOnKeyUp(Sender: TObject; var Key: Word;
    155162  Shift: TShiftState);
    156163begin
    157   if Assigned(FOnChange) then
    158     FOnChange(Self);
     164  DoOnChange;
    159165end;
    160166
     
    229235end;
    230236
     237procedure TListViewFilter.Reset;
     238var
     239  I: Integer;
     240begin
     241  with StringGrid do
     242  for I := 0 to ColCount - 1 do
     243    Cells[I, 0] := '';
     244  DoOnChange;
     245end;
     246
    231247{ TListViewSort }
    232248
     
    322338  ListViewSortCompare: TCompareEvent;
    323339
    324 function ListViewCompare(const Item1, Item2: TObject): Integer;
     340function ListViewCompare(constref Item1, Item2: TObject): Integer;
    325341begin
    326342  Result := ListViewSortCompare(Item1, Item2);
     
    333349  ListViewSortCompare := Compare;
    334350  if (List.Count > 0) then
    335     List.Sort(ListViewCompare);
     351    List.Sort(TComparer<TObject>.Construct(ListViewCompare));
    336352end;
    337353
     
    339355begin
    340356  if Assigned(FOnFilter) then FOnFilter(Self)
    341   else if Assigned(Source) then
    342     List.Assign(Source) else
     357  else if Assigned(Source) then begin
    343358    List.Clear;
     359    List.AddRange(Source);
     360  end else List.Clear;
    344361  if ListView.Items.Count <> List.Count then
    345362    ListView.Items.Count := List.Count;
     
    396413begin
    397414  inherited;
    398   List := TFPGObjectList<TObject>.Create;
    399   List.FreeObjects := False;
     415  List := TObjects.Create;
     416  List.OwnsObjects := False;
    400417end;
    401418
    402419destructor TListViewSort.Destroy;
    403420begin
    404   List.Free;
     421  FreeAndNil(List);
    405422  inherited;
    406423end;
     
    491508end;
    492509
    493 procedure TListViewSort.ListViewCustomDrawItem(Sender: TCustomListView;
     510procedure TListViewSort.ListViewCustomDrawItem(Sender: TDpiCustomListView;
    494511  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
    495512begin
  • branches/highdpi/Packages/Common/Memory.pas

    r462 r463  
    1 unit UMemory;
    2 
    3 {$mode Delphi}{$H+}
     1unit Memory;
    42
    53interface
     
    4442  end;
    4543
     44
    4645implementation
    4746
     
    5049procedure TPositionMemory.SetSize(AValue: Integer);
    5150begin
    52   inherited SetSize(AValue);
     51  inherited;
    5352  if FPosition > FSize then FPosition := FSize;
    5453end;
     
    107106begin
    108107  Size := 0;
    109   inherited Destroy;
     108  inherited;
    110109end;
    111110
     
    121120
    122121end.
    123 
  • branches/highdpi/Packages/Common/PersistentForm.pas

    r462 r463  
    1 unit UPersistentForm;
    2 
    3 {$mode delphi}
    4 
    5 // Date: 2020-11-26
     1unit PersistentForm;
    62
    73interface
    84
    95uses
    10   UDpiControls, Classes, SysUtils, Forms, URegistry, LCLIntf, Registry, Controls, ComCtrls,
     6  UDpiControls, Classes, SysUtils, Forms, RegistryEx, LCLIntf, Registry, Controls, ComCtrls,
    117  ExtCtrls, LCLType;
    128
     
    2319    procedure SaveControl(Control: TDpiControl);
    2420  public
    25     FormNormalSize: TRect;
    2621    FormRestoredSize: TRect;
    2722    FormWindowState: TWindowState;
     
    157152    RootKey := RegistryContext.RootKey;
    158153    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
    159     // Normal size
    160     FormNormalSize.Left := ReadIntegerWithDefault('NormalLeft', FormNormalSize.Left);
    161     FormNormalSize.Top := ReadIntegerWithDefault('NormalTop', FormNormalSize.Top);
    162     FormNormalSize.Right := ReadIntegerWithDefault('NormalWidth', FormNormalSize.Right - FormNormalSize.Left)
    163       + FormNormalSize.Left;
    164     FormNormalSize.Bottom := ReadIntegerWithDefault('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top)
    165       + FormNormalSize.Top;
     154
    166155    // Restored size
    167156    FormRestoredSize.Left := ReadIntegerWithDefault('RestoredLeft', FormRestoredSize.Left);
     
    171160    FormRestoredSize.Bottom := ReadIntegerWithDefault('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top)
    172161      + FormRestoredSize.Top;
     162
    173163    // Other state
    174164    FormWindowState := TWindowState(ReadIntegerWithDefault('WindowState', Integer(FormWindowState)));
     
    185175    RootKey := RegistryContext.RootKey;
    186176    OpenKey(RegistryContext.Key + '\Forms\' + Form.Name, True);
    187     // Normal state
    188     WriteInteger('NormalWidth', FormNormalSize.Right - FormNormalSize.Left);
    189     WriteInteger('NormalHeight', FormNormalSize.Bottom - FormNormalSize.Top);
    190     WriteInteger('NormalTop', FormNormalSize.Top);
    191     WriteInteger('NormalLeft', FormNormalSize.Left);
    192     // Restored state
     177
     178    // Restored size
    193179    WriteInteger('RestoredWidth', FormRestoredSize.Right - FormRestoredSize.Left);
    194180    WriteInteger('RestoredHeight', FormRestoredSize.Bottom - FormRestoredSize.Top);
    195181    WriteInteger('RestoredTop', FormRestoredSize.Top);
    196182    WriteInteger('RestoredLeft', FormRestoredSize.Left);
     183
    197184    // Other state
    198185    WriteInteger('WindowState', Integer(FormWindowState));
     
    259246begin
    260247  Self.Form := Form;
     248
    261249  // Set default
    262   FormNormalSize := Bounds((DpiScreen.Width - Form.Width) div 2,
    263     (DpiScreen.Height - Form.Height) div 2, Form.Width, Form.Height);
    264250  FormRestoredSize := Bounds((DpiScreen.Width - Form.Width) div 2,
    265251    (DpiScreen.Height - Form.Height) div 2, Form.Width, Form.Height);
     
    269255  LoadFromRegistry(RegistryContext);
    270256
    271   if not EqualRect(FormNormalSize, FormRestoredSize) or
    272     DefaultMaximized then begin
     257  if (FormWindowState = wsMaximized) or DefaultMaximized then begin
    273258    // Restore to maximized state
    274259    Form.WindowState := wsNormal;
     
    279264    // Restore to normal state
    280265    Form.WindowState := wsNormal;
    281     if FEntireVisible then FormNormalSize := CheckEntireVisible(FormNormalSize)
     266    if FEntireVisible then FormRestoredSize := CheckEntireVisible(FormRestoredSize)
    282267      else if FMinVisiblePart > 0 then
    283     FormNormalSize := CheckPartVisible(FormNormalSize, FMinVisiblePart);
    284     if not EqualRect(FormNormalSize, Form.BoundsRect) then
    285       Form.BoundsRect := FormNormalSize;
     268        FormRestoredSize := CheckPartVisible(FormRestoredSize, FMinVisiblePart);
     269    if not EqualRect(FormRestoredSize, Form.BoundsRect) then
     270      Form.BoundsRect := FormRestoredSize;
    286271  end;
    287272  if FormFullScreen then SetFullScreen(True);
     
    292277begin
    293278  Self.Form := Form;
    294   FormNormalSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
    295   if not FormFullScreen then
    296     FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    297       Form.RestoredHeight);
    298   FormWindowState := Form.WindowState;
     279  if not FormFullScreen then begin
     280    FormWindowState := Form.WindowState;
     281    if FormWindowState = wsMaximized then begin
     282      FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
     283        Form.RestoredHeight);
     284    end else
     285    if FormWindowState = wsNormal then begin
     286      FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
     287    end;
     288  end;
    299289  SaveToRegistry(RegistryContext);
    300290  SaveControl(Form);
     
    314304  if State then begin
    315305    FormFullScreen := True;
    316     FormNormalSize := Form.BoundsRect;
    317     FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
    318       Form.RestoredHeight);
     306    if Form.WindowState = wsMaximized then begin
     307      FormRestoredSize := Bounds(Form.RestoredLeft, Form.RestoredTop, Form.RestoredWidth,
     308        Form.RestoredHeight);
     309    end else
     310    if Form.WindowState = wsNormal then begin
     311      FormRestoredSize := Bounds(Form.Left, Form.Top, Form.Width, Form.Height);
     312    end;
    319313    FormWindowState := Form.WindowState;
     314    Form.WindowState := wsMaximized;
     315    Form.WindowState := wsNormal;
    320316    ShowWindow(Form.Handle, SW_SHOWFULLSCREEN);
    321317    {$IFDEF WINDOWS}
     
    329325    ShowWindow(Form.Handle, SW_SHOWNORMAL);
    330326    if FormWindowState = wsNormal then begin
    331       Form.BoundsRect := FormNormalSize;
     327      Form.WindowState := wsNormal;
     328      Form.BoundsRect := FormRestoredSize;
    332329    end else
    333330    if FormWindowState = wsMaximized then begin
     
    339336
    340337end.
    341 
  • branches/highdpi/Packages/Common/PixelPointer.pas

    r462 r463  
    1 unit UPixelPointer;
     1unit PixelPointer;
    22
    33interface
     
    1515  private
    1616    procedure SetRGB(AValue: Cardinal);
    17     function GetRGB: Cardinal;   
     17    function GetRGB: Cardinal;
    1818  public
    1919    property RGB: Cardinal read GetRGB write SetRGB;
     
    4141    procedure SetXY(X, Y: Integer); inline; // Set pixel position relative to base
    4242    procedure SetX(X: Integer); inline; // Set horizontal pixel position relative to base
     43    class function Create(Bitmap: TDpiRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline; static;
    4344  end;
    4445  PPixelPointer = ^TPixelPointer;
    4546
    46   function PixelPointer(Bitmap: TDpiRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline;
    4747  function SwapRedBlue(Color: TColor32): TColor32;
    4848  procedure BitmapCopyRect(DstBitmap: TDpiRasterImage; DstRect: TRect; SrcBitmap: TDpiRasterImage; SrcPos: TPoint);
     
    6060  function ColorToColor32(Color: TColor): TColor32;
    6161
     62
    6263implementation
    6364
     
    119120  SrcBitmap.BeginUpdate(True);
    120121  DstBitmap.BeginUpdate(True);
    121   SrcPtr := PixelPointer(SrcBitmap, SrcPos.X, SrcPos.Y);
    122   DstPtr := PixelPointer(DstBitmap, DstRect.Left, DstRect.Top);
     122  SrcPtr := TPixelPointer.Create(SrcBitmap, SrcPos.X, SrcPos.Y);
     123  DstPtr := TPixelPointer.Create(DstBitmap, DstRect.Left, DstRect.Top);
    123124  for Y := 0 to DstRect.Height - 1 do begin
    124125    for X := 0 to DstRect.Width - 1 do begin
     
    138139var
    139140  SrcPtr, DstPtr: TPixelPointer;
    140   SubPtr: TPixelPointer;
    141141  X, Y: Integer;
    142142  XX, YY: Integer;
     
    150150  SrcBitmap.BeginUpdate(True);
    151151  DstBitmap.BeginUpdate(True);
    152   SrcPtr := PixelPointer(SrcBitmap, SrcRect.Left, SrcRect.Top);
    153   DstPtr := PixelPointer(DstBitmap, DstRect.Left, DstRect.Top);
     152  SrcPtr := TPixelPointer.Create(SrcBitmap, SrcRect.Left, SrcRect.Top);
     153  DstPtr := TPixelPointer.Create(DstBitmap, DstRect.Left, DstRect.Top);
    154154  for Y := 0 to DstRect.Height - 1 do begin
    155155    for X := 0 to DstRect.Width - 1 do begin
     
    181181begin
    182182  Bitmap.BeginUpdate(True);
    183   Ptr := PixelPointer(Bitmap);
     183  Ptr := TPixelPointer.Create(Bitmap);
    184184  for Y := 0 to Bitmap.Height - 1 do begin
    185185    for X := 0 to Bitmap.Width - 1 do begin
     
    198198begin
    199199  Bitmap.BeginUpdate(True);
    200   Ptr := PixelPointer(Bitmap, Rect.Left, Rect.Top);
     200  Ptr := TPixelPointer.Create(Bitmap, Rect.Left, Rect.Top);
    201201  for Y := 0 to Rect.Height - 1 do begin
    202202    for X := 0 to Rect.Width - 1 do begin
     
    215215begin
    216216  Bitmap.BeginUpdate(True);
    217   Ptr := PixelPointer(Bitmap);
     217  Ptr := TPixelPointer.Create(Bitmap);
    218218  for Y := 0 to Bitmap.Height - 1 do begin
    219219    for X := 0 to Bitmap.Width - 1 do begin
     
    232232begin
    233233  Bitmap.BeginUpdate(True);
    234   Ptr := PixelPointer(Bitmap);
     234  Ptr := TPixelPointer.Create(Bitmap);
    235235  for Y := 0 to Bitmap.Height - 1 do begin
    236236    for X := 0 to Bitmap.Width - 1 do begin
     
    252252  Pixel := Color32ToPixel32(Color);
    253253  Bitmap.BeginUpdate(True);
    254   Ptr := PixelPointer(Bitmap);
     254  Ptr := TPixelPointer.Create(Bitmap);
    255255  for Y := 0 to Bitmap.Height - 1 do begin
    256256    for X := 0 to Bitmap.Width - 1 do begin
     
    295295end;
    296296
    297 function PixelPointer(Bitmap: TDpiRasterImage; BaseX: Integer;
     297class function TPixelPointer.Create(Bitmap: TDpiRasterImage; BaseX: Integer;
    298298  BaseY: Integer): TPixelPointer;
    299299begin
     
    310310end;
    311311
    312 
    313312end.
    314 
  • branches/highdpi/Packages/Common/Pool.pas

    r462 r463  
    1 unit UPool;
    2 
    3 {$mode Delphi}{$H+}
     1unit Pool;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, syncobjs, fgl, UThreading;
     6  Classes, SysUtils, syncobjs, Generics.Collections, Threading;
    97
    108type
     
    2220    function NewItemObject: TObject; virtual;
    2321  public
    24     Items: TFPGObjectList<TObject>;
    25     FreeItems: TFPGObjectList<TObject>;
     22    Items: TObjectList<TObject>;
     23    FreeItems: TObjectList<TObject>;
    2624    function Acquire: TObject; virtual;
    2725    procedure Release(Item: TObject); virtual;
     
    108106constructor TThreadedPool.Create;
    109107begin
    110   inherited Create;
     108  inherited;
    111109  Lock := TCriticalSection.Create;
    112110end;
     
    116114  TotalCount := 0;
    117115  Lock.Free;
    118   inherited Destroy;
     116  inherited;
    119117end;
    120118
     
    185183begin
    186184  inherited;
    187   Items := TFPGObjectList<TObject>.Create;
    188   FreeItems := TFPGObjectList<TObject>.Create;
    189   FreeItems.FreeObjects := False;
     185  Items := TObjectList<TObject>.Create;
     186  FreeItems := TObjectList<TObject>.Create;
     187  FreeItems.OwnsObjects := False;
    190188  FReleaseEvent := TEvent.Create(nil, False, False, '');
    191189end;
     
    201199
    202200end.
    203 
  • branches/highdpi/Packages/Common/PrefixMultiplier.pas

    r462 r463  
    1 unit UPrefixMultiplier;
     1unit PrefixMultiplier;
    22
    33// Date: 2010-06-01
    4 
    5 {$mode delphi}
    64
    75interface
     
    3331  (
    3432    (ShortText: 'y'; FullText: 'yocto'; Value: 1e-24),
    35           (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
     33      (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
    3634    (ShortText: 'a'; FullText: 'atto'; Value: 1e-18),
    3735    (ShortText: 'f'; FullText: 'femto'; Value: 1e-15),
     
    5452  (
    5553    (ShortText: 'ys'; FullText: 'yocto'; Value: 1e-24),
    56           (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
     54      (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
    5755    (ShortText: 'as'; FullText: 'atto'; Value: 1e-18),
    5856    (ShortText: 'fs'; FullText: 'femto'; Value: 1e-15),
     
    126124
    127125end.
    128 
  • branches/highdpi/Packages/Common/RegistryEx.pas

    r462 r463  
    1 unit URegistry;
    2 
    3 {$MODE delphi}
     1unit RegistryEx;
    42
    53interface
     
    4846    HKEY_CURRENT_CONFIG, HKEY_DYN_DATA);
    4947
     48
    5049implementation
    51 
    5250
    5351{ TRegistryContext }
     
    132130function TRegistryEx.OpenKey(const Key: string; CanCreate: Boolean): Boolean;
    133131begin
    134   {$IFDEF Linux}
     132  {$IFDEF UNIX}
    135133  //CloseKey;
    136134  {$ENDIF}
     
    140138function TRegistryEx.GetCurrentContext: TRegistryContext;
    141139begin
    142   Result.Key := CurrentPath;
     140  Result.Key := String(CurrentPath);
    143141  Result.RootKey := RootKey;
    144142end;
  • branches/highdpi/Packages/Common/ResetableThread.pas

    r462 r463  
    1 unit UResetableThread;
    2 
    3 {$mode Delphi}{$H+}
     1unit ResetableThread;
    42
    53interface
    64
    75uses
    8   Classes, SysUtils, syncobjs, UThreading, UPool;
     6  Classes, SysUtils, syncobjs, Threading, Pool;
    97
    108type
     
    167165  FreeAndNil(FStopEvent);
    168166  FreeAndNil(FLock);
    169   inherited Destroy;
     167  inherited;
    170168end;
    171169
     
    286284constructor TThreadPool.Create;
    287285begin
    288   inherited Create;
     286  inherited;
    289287end;
    290288
     
    293291  TotalCount := 0;
    294292  WaitForEmpty;
    295   inherited Destroy;
     293  inherited;
    296294end;
    297295
  • branches/highdpi/Packages/Common/ScaleDPI.pas

    r462 r463  
    1 unit UScaleDPI;
     1unit ScaleDPI;
    22
    33{ See: http://wiki.lazarus.freepascal.org/High_DPI }
    44
    5 {$mode delphi}{$H+}
    6 
    75interface
    86
    97uses
    10   UDpiControls, Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils, StdCtrls,
    11   Contnrs;
     8  UDpiControls, Classes, Forms, Graphics, Controls, ComCtrls, LCLType, SysUtils,
     9  Generics.Collections;
    1210
    1311type
     12  TControlDimensions = class;
    1413
    1514  { TControlDimension }
     
    1817    BoundsRect: TRect;
    1918    FontHeight: Integer;
    20     Controls: TObjectList; // TList<TControlDimension>
     19    Controls: TControlDimensions;
    2120    // Class specifics
    2221    ButtonSize: TPoint; // TToolBar
     
    2625    constructor Create;
    2726    destructor Destroy; override;
     27  end;
     28
     29  TControlDimensions = class(TObjectList<TControlDimension>)
    2830  end;
    2931
     
    7375constructor TControlDimension.Create;
    7476begin
    75   Controls := TObjectList.Create;
     77  Controls := TControlDimensions.Create;
    7678end;
    7779
     
    7981begin
    8082  FreeAndNil(Controls);
    81   inherited Destroy;
     83  inherited;
    8284end;
    8385
     
    212214  TempBmp: TDpiBitmap;
    213215  Temp: array of TDpiBitmap;
    214   NewWidth, NewHeight: integer;
     216  NewWidth: Integer;
     217  NewHeight: Integer;
    215218  I: Integer;
    216219begin
    217220  ImgList.BeginUpdate;
    218   NewWidth := ScaleX(ImgList.Width, FromDPI.X);
    219   NewHeight := ScaleY(ImgList.Height, FromDPI.Y);
    220 
    221   SetLength(Temp, ImgList.Count);
    222   for I := 0 to ImgList.Count - 1 do
    223   begin
    224     TempBmp := TDpiBitmap.Create;
    225     TempBmp.PixelFormat := pf32bit;
    226     ImgList.GetBitmap(I, TempBmp);
    227     Temp[I] := TDpiBitmap.Create;
    228     Temp[I].SetSize(NewWidth, NewHeight);
    229     Temp[I].PixelFormat := pf32bit;
    230     Temp[I].TransparentColor := TempBmp.TransparentColor;
    231     //Temp[I].TransparentMode := TempBmp.TransparentMode;
    232     Temp[I].Transparent := True;
    233     Temp[I].Canvas.Brush.Style := bsSolid;
    234     Temp[I].Canvas.Brush.Color := Temp[I].TransparentColor;
    235     Temp[I].Canvas.FillRect(0, 0, Temp[I].Width, Temp[I].Height);
    236 
    237     if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue;
    238     Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp);
    239     TempBmp.Free;
    240   end;
    241 
    242   ImgList.Clear;
    243   ImgList.Width := NewWidth;
    244   ImgList.Height := NewHeight;
    245 
    246   for I := 0 to High(Temp) do
    247   begin
    248     ImgList.Add(Temp[I], nil);
    249     Temp[i].Free;
    250   end;
    251   ImgList.EndUpdate;
     221  try
     222    NewWidth := ScaleX(ImgList.Width, FromDPI.X);
     223    NewHeight := ScaleY(ImgList.Height, FromDPI.Y);
     224
     225    Temp := nil;
     226    SetLength(Temp, ImgList.Count);
     227    for I := 0 to ImgList.Count - 1 do
     228    begin
     229      TempBmp := TDpiBitmap.Create;
     230      try
     231        TempBmp.PixelFormat := pf32bit;
     232        ImgList.GetBitmap(I, TempBmp);
     233        Temp[I] := TDpiBitmap.Create;
     234        Temp[I].SetSize(NewWidth, NewHeight);
     235        {$IFDEF UNIX}
     236        Temp[I].PixelFormat := pf24bit;
     237        {$ELSE}
     238        Temp[I].PixelFormat := pf32bit;
     239        {$ENDIF}
     240        Temp[I].TransparentColor := TempBmp.TransparentColor;
     241        //Temp[I].TransparentMode := TempBmp.TransparentMode;
     242        Temp[I].Transparent := True;
     243        Temp[I].Canvas.Brush.Style := bsSolid;
     244        Temp[I].Canvas.Brush.Color := Temp[I].TransparentColor;
     245        Temp[I].Canvas.FillRect(0, 0, Temp[I].Width, Temp[I].Height);
     246
     247        if (Temp[I].Width = 0) or (Temp[I].Height = 0) then Continue;
     248        Temp[I].Canvas.StretchDraw(Rect(0, 0, Temp[I].Width, Temp[I].Height), TempBmp);
     249      finally
     250        TempBmp.Free;
     251      end;
     252    end;
     253
     254    ImgList.Clear;
     255    ImgList.Width := NewWidth;
     256    ImgList.Height := NewHeight;
     257
     258    for I := 0 to High(Temp) do
     259    begin
     260      ImgList.Add(Temp[I], nil);
     261      Temp[i].Free;
     262    end;
     263  finally
     264    ImgList.EndUpdate;
     265  end;
    252266end;
    253267
     
    303317
    304318  //if Control is TMemo then Exit;
    305   //if Control is TDpiForm then
     319  //if Control is TForm then
    306320  //  Control.DisableAutoSizing;
    307321  with Control do begin
     
    327341  with TDpiCoolBar(Control) do begin
    328342    BeginUpdate;
    329     for I := 0 to Bands.Count - 1 do
    330       with Bands[I] do begin
    331         MinWidth := ScaleX(MinWidth, FromDPI.X);
    332         MinHeight := ScaleY(MinHeight, FromDPI.Y);
    333         // Workaround to bad band width auto sizing
    334         //Width := ScaleX(Width, FromDPI.X);
    335         Width := ScaleX(Control.Width + 28, FromDPI.X);
    336         //Control.Invalidate;
     343    try
     344      for I := 0 to Bands.Count - 1 do
     345        with Bands[I] do begin
     346          MinWidth := ScaleX(MinWidth, FromDPI.X);
     347          MinHeight := ScaleY(MinHeight, FromDPI.Y);
     348          // Workaround to bad band width auto sizing
     349          //Width := ScaleX(Width, FromDPI.X);
     350          Width := ScaleX(Control.Width + 28, FromDPI.X);
     351          //Control.Invalidate;
     352        end;
     353      // Workaround for bad autosizing of coolbar
     354      if AutoSize then begin
     355        AutoSize := False;
     356        Height := ScaleY(Height, FromDPI.Y);
     357        AutoSize := True;
    337358      end;
    338     // Workaround for bad autosizing of coolbar
    339     if AutoSize then begin
    340       AutoSize := False;
    341       Height := ScaleY(Height, FromDPI.Y);
    342       AutoSize := True;
    343     end;
    344     EndUpdate;
     359    finally
     360      EndUpdate;
     361    end;
    345362  end;
    346363
     
    353370  end;
    354371
    355   //if Control is TDpiForm then
     372  //if Control is TForm then
    356373  //  Control.EnableAutoSizing;
    357374end;
  • branches/highdpi/Packages/Common/StopWatch.pas

    r405 r463  
    55
    66uses
    7   {$IFDEF Windows}Windows,{$ENDIF}
     7  {$IFDEF WINDOWS}Windows,{$ENDIF}
    88  SysUtils, DateUtils;
    99
     
    3232  end;
    3333
     34
    3435implementation
    3536
     
    4041  fIsRunning := False;
    4142
    42   {$IFDEF Windows}
     43  {$IFDEF WINDOWS}
    4344  fIsHighResolution := QueryPerformanceFrequency(fFrequency) ;
    4445  {$ELSE}
     
    9293
    9394end.
     95
  • branches/highdpi/Packages/Common/StringTable.pas

    r462 r463  
    1 unit UStringTable;
    2 
    3 {$mode objfpc}{$H+}
     1unit StringTable;
    42
    53interface
     
    7169end;
    7270
    73 
    7471end.
    75 
  • branches/highdpi/Packages/Common/SyncCounter.pas

    r462 r463  
    1 unit USyncCounter;
    2 
    3 {$mode delphi}
     1unit SyncCounter;
    42
    53interface
     
    2523    procedure Assign(Source: TSyncCounter);
    2624  end;
     25
    2726
    2827implementation
     
    6968begin
    7069  Lock.Free;
    71   inherited Destroy;
     70  inherited;
    7271end;
    7372
     
    7978
    8079end.
    81 
  • branches/highdpi/Packages/Common/Theme.pas

    r462 r463  
    1 unit UTheme;
     1unit Theme;
    22
    33interface
     
    55uses
    66  UDpiControls, Classes, SysUtils, Graphics, ComCtrls, Controls, ExtCtrls, Menus, StdCtrls,
    7   Spin, Forms, Contnrs, Grids;
     7  Spin, Forms, Generics.Collections, Grids;
    88
    99type
     
    1919  { TThemes }
    2020
    21   TThemes = class(TObjectList)
     21  TThemes = class(TObjectList<TTheme>)
    2222    function AddNew(Name: string): TTheme;
    2323    function FindByName(Name: string): TTheme;
     
    4242  end;
    4343
     44const
     45  ThemeNameSystem = 'System';
     46  ThemeNameLight = 'Light';
     47  ThemeNameDark = 'Dark';
     48
    4449procedure Register;
     50
    4551
    4652implementation
     
    7480procedure TThemes.LoadToStrings(Strings: TStrings);
    7581var
    76   Theme: TTheme;
     82  I: Integer;
    7783begin
    78   Strings.Clear;
    79   for Theme in Self do
    80     Strings.AddObject(Theme.Name, Theme);
     84  Strings.BeginUpdate;
     85  try
     86    while Strings.Count < Count do Strings.Add('');
     87    while Strings.Count > Count do Strings.Delete(Strings.Count - 1);
     88    for I := 0 to Count - 1 do begin
     89      Strings[I] := Items[I].Name;
     90      Strings.Objects[I] := Items[I];
     91    end;
     92  finally
     93    Strings.EndUpdate;
     94  end;
    8195end;
    8296
     
    97111  inherited;
    98112  Themes := TThemes.Create;
    99   with Themes.AddNew('System') do begin
     113  with Themes.AddNew(ThemeNameSystem) do begin
    100114    ColorWindow := clWindow;
    101115    ColorWindowText := clWindowText;
     
    105119  end;
    106120  Theme := TTheme(Themes.First);
    107   with Themes.AddNew('Dark') do begin
     121  with Themes.AddNew(ThemeNameDark) do begin
    108122    ColorWindow := RGBToColor($20, $20, $20);
    109123    ColorWindowText := clWhite;
     
    112126    ColorControlSelected := RGBToColor(96, 125, 155);
    113127  end;
    114   with Themes.AddNew('Light') do begin
     128  with Themes.AddNew(ThemeNameLight) do begin
    115129    ColorWindow := clWhite;
    116130    ColorWindowText := clBlack;
     
    123137destructor TThemeManager.Destroy;
    124138begin
    125   Themes.Free;
    126   inherited Destroy;
     139  FreeAndNil(Themes);
     140  inherited;
    127141end;
    128142
     
    167181procedure TThemeManager.UseTheme(Form: TDpiForm);
    168182begin
    169   if not Used and (FTheme.Name = 'System') then Exit;
     183  if not Used and (FTheme.Name = ThemeNameSystem) then Exit;
    170184  ApplyTheme(Form);
    171185  Used := True;
    172186end;
    173187
     188end.
    174189
    175 end.
  • branches/highdpi/Packages/Common/Threading.pas

    r462 r463  
    1 unit UThreading;
    2 
    3 {$mode delphi}
     1unit Threading;
    42
    53interface
    64
    75uses
    8   UDpiControls, Classes, SysUtils, Forms, Contnrs, SyncObjs;
     6  UDpiControls, Classes, SysUtils, Forms, Generics.Collections, SyncObjs;
    97
    108type
    119  TExceptionEvent = procedure (Sender: TObject; E: Exception) of object;
    1210  TMethodCall = procedure of object;
    13 
    1411
    1512  { TVirtualThread }
     
    2219    function GetSuspended: Boolean; virtual; abstract;
    2320    function GetTerminated: Boolean; virtual; abstract;
    24     function GetThreadId: Integer; virtual; abstract;
     21    function GetThreadId: TThreadID; virtual; abstract;
    2522    procedure SetFreeOnTerminate(const AValue: Boolean); virtual; abstract;
    2623    procedure SetPriority(const AValue: TThreadPriority); virtual; abstract;
     
    4239    property Terminated: Boolean read GetTerminated write SetTerminated;
    4340    property Finished: Boolean read GetFinished;
    44     property ThreadId: Integer read GetThreadId;
     41    property ThreadId: TThreadID read GetThreadId;
    4542  end;
    4643
     
    6865    function GetSuspended: Boolean; override;
    6966    function GetTerminated: Boolean; override;
    70     function GetThreadId: Integer; override;
     67    function GetThreadId: TThreadID; override;
    7168    procedure SetFreeOnTerminate(const AValue: Boolean); override;
    7269    procedure SetPriority(const AValue: TThreadPriority); override;
     
    10299  { TThreadList }
    103100
    104   TThreadList = class(TObjectList)
    105     function FindById(Id: Integer): TVirtualThread;
     101  TThreadList = class(TObjectList<TVirtualThread>)
     102    function FindById(Id: TThreadID): TVirtualThread;
    106103    constructor Create; virtual;
    107104  end;
     
    164161  if MainThreadID = ThreadID then Method
    165162  else begin
    166     Thread := ThreadList.FindById(ThreadID);
     163    try
     164      ThreadListLock.Acquire;
     165      Thread := ThreadList.FindById(ThreadID);
     166    finally
     167      ThreadListLock.Release;
     168    end;
    167169    if Assigned(Thread) then begin
    168170      Thread.Synchronize(Method);
     
    173175{ TThreadList }
    174176
    175 function TThreadList.FindById(Id: Integer): TVirtualThread;
     177function TThreadList.FindById(Id: TThreadID): TVirtualThread;
    176178var
    177179  I: Integer;
    178180begin
    179181  I := 0;
    180   while (I < ThreadList.Count) and (TVirtualThread(ThreadList[I]).ThreadID <> Id) do
     182  while (I < ThreadList.Count) and (ThreadList[I].ThreadID <> Id) do
    181183    Inc(I);
    182   if I < ThreadList.Count then Result := TVirtualThread(ThreadList[I])
     184  if I < ThreadList.Count then Result := ThreadList[I]
    183185    else Result := nil;
    184186end;
     
    233235end;
    234236
    235 function TListedThread.GetThreadId: Integer;
     237function TListedThread.GetThreadId: TThreadID;
    236238begin
    237239  Result := FThread.ThreadID;
     
    290292  end;
    291293  FThread.Free;
    292   inherited Destroy;
     294  inherited;
    293295end;
    294296
     
    364366
    365367end.
    366 
  • branches/highdpi/Packages/Common/Translator.pas

    r462 r463  
    1 unit UTranslator;
    2 
    3 {$mode Delphi}{$H+}
     1unit Translator;
    42
    53interface
    64
    75uses
    8   UDpiControls, Classes, SysUtils, Forms, ExtCtrls, Controls, Contnrs, LazFileUtils, LazUTF8,
    9   Translations, TypInfo, Dialogs, FileUtil, LCLProc, ULanguages, LCLType,
    10   LCLVersion;
     6  UDpiControls, Classes, SysUtils, Forms, ExtCtrls, Controls, LazFileUtils, LazUTF8,
     7  Translations, TypInfo, Dialogs, FileUtil, LCLProc, Languages, LCLType,
     8  LCLVersion, Generics.Collections;
    119
    1210type
    1311  THandleStringEvent = function (AValue: string): string of object;
     12
     13  TPoFiles = class(TObjectList<TPOFile>)
     14  end;
    1415
    1516  { TComponentExcludes }
     
    2425  { TComponentExcludesList }
    2526
    26   TComponentExcludesList = class(TObjectList)
     27  TComponentExcludesList = class(TObjectList<TComponentExcludes>)
    2728    function FindByClassType(AClassType: TClass): TComponentExcludes;
    2829    procedure DumpToStrings(Strings: TStrings);
     
    3637    FOnAutomaticLanguage: THandleStringEvent;
    3738    FOnTranslate: TNotifyEvent;
    38     FPOFilesFolder: string;
    39     FPOFiles: TObjectList; // TObjectList<TPOFile>;
     39    FPoFilesFolder: string;
     40    FPoFiles: TPoFiles;
    4041    function GetLocale: string;
    4142    function GetLocaleShort: string;
     
    5051  public
    5152    ComponentExcludes: TComponentExcludesList;
    52     Languages: TLanguageList;
     53    Languages: TLanguages;
    5354    procedure Translate;
    54     procedure LanguageListToStrings(Strings: TStrings);
     55    procedure LanguageListToStrings(Strings: TStrings; WithCode: Boolean = True);
    5556    procedure TranslateResourceStrings(PoFileName: string);
    5657    procedure TranslateUnitResourceStrings(UnitName: string; PoFileName: string);
     
    6364    destructor Destroy; override;
    6465  published
    65     property POFilesFolder: string read FPOFilesFolder write SetPOFilesFolder;
     66    property POFilesFolder: string read FPoFilesFolder write SetPOFilesFolder;
    6667    property Language: TLanguage read FLanguage write SetLanguage;
    6768    property OnTranslate: TNotifyEvent read FOnTranslate write FOnTranslate;
     
    7172
    7273procedure Register;
     74
    7375
    7476implementation
     
    117119destructor TComponentExcludes.Destroy;
    118120begin
    119   PropertyExcludes.Free;
    120   inherited Destroy;
     121  FreeAndNil(PropertyExcludes);
     122  inherited;
    121123end;
    122124
     
    128130  I, J: Integer;
    129131  Po: TPoFile;
    130   Item: TPOFileItem;
     132  Item: TPoFileItem;
    131133begin
    132134  TranslateComponentRecursive(DpiApplication);
     
    134136  // Merge files to single translation file
    135137  try
    136     Po := TPOFile.Create;
    137     for I := 0 to FPOFiles.Count - 1 do
     138    Po := TPoFile.Create;
     139    for I := 0 to FPoFiles.Count - 1 do
    138140    with TPoFile(FPoFiles[I]) do
    139141      for J := 0 to Items.Count - 1 do
     
    162164  SearchMask: string;
    163165begin
    164   FPOFiles.Clear;
     166  FPoFiles.Clear;
    165167  if Assigned(FLanguage) then
    166168  try
    167169    LocaleShort := GetLocaleShort;
    168     //ShowMessage(ExtractFileDir(DpiApplication.ExeName) +
     170    //ShowMessage(ExtractFileDir(Application.ExeName) +
    169171    //  DirectorySeparator + 'Languages' + ' ' + '*.' + LocaleShort + '.po');
    170172    SearchMask := '*';
     
    177179      if FileExists(FileName) and (
    178180      ((LocaleShort = '') and (Pos('.', FileName) = Pos('.po', FileName))) or
    179       (LocaleShort <> '')) then FPOFiles.Add(TPOFile.Create(FileName));
     181      (LocaleShort <> '')) then FPoFiles.Add(TPOFile.Create(FileName));
    180182    end;
    181183  finally
     
    281283var
    282284  Item: TClass;
    283 
    284285  Excludes: TComponentExcludes;
    285286begin
     
    287288  Item := Component.ClassType;
    288289  while Assigned(Item) do begin
    289     //ShowMessage(Component.Name + ', ' + Component.ClassName + ', ' + Item.ClassName + ', ' + PropertyName);
    290290    Excludes := ComponentExcludes.FindByClassType(Item.ClassType);
    291291    if Assigned(Excludes) then begin
     
    301301function TTranslator.GetLangFileDir: string;
    302302begin
    303   Result := FPOFilesFolder;
     303  Result := FPoFilesFolder;
    304304  if Copy(Result, 1, 1) <> DirectorySeparator then
    305305    Result := ExtractFileDir(DpiApplication.ExeName) +
     
    307307end;
    308308
    309 procedure TTranslator.LanguageListToStrings(Strings: TStrings);
     309procedure TTranslator.LanguageListToStrings(Strings: TStrings; WithCode: Boolean = True);
    310310var
    311311  I: Integer;
     
    313313begin
    314314  with Strings do begin
    315     Clear;
    316     for I := 0 to Languages.Count - 1 do
    317     with TLanguage(Languages[I]) do
    318       if Available then begin
    319         ItemName := Name;
    320         if Code <> '' then ItemName := ItemName + ' (' + Code + ')';
    321         AddObject(ItemName, Languages[I]);
    322       end;
     315    BeginUpdate;
     316    try
     317      Clear;
     318      for I := 0 to Languages.Count - 1 do
     319      with Languages[I] do
     320        if Available then begin
     321          ItemName := Name;
     322          if WithCode and (Code <> '') then ItemName := ItemName + ' (' + Code + ')';
     323          AddObject(ItemName, Languages[I]);
     324        end;
     325    finally
     326      EndUpdate;
     327    end;
    323328  end;
    324329end;
     
    342347  if Text <> '' then begin
    343348    for I := 0 to FPoFiles.Count - 1 do begin
    344       Result := TPoFile(FPOFiles[I]).Translate(Identifier, Text);
     349      Result := TPoFile(FPoFiles[I]).Translate(Identifier, Text);
    345350      if Result <> Text then Break;
    346351    end;
     
    369374begin
    370375  LangDir := GetLangFileDir;
    371   TLanguage(Languages[0]).Available := True; // Automatic
     376  Languages.SearchByCode('').Available := True; // Automatic
    372377
    373378  for I := 1 to Languages.Count - 1 do
    374   with TLanguage(Languages[I]) do begin
     379  with Languages[I] do begin
    375380    Available := FileExists(LangDir + DirectorySeparator + ExtractFileNameOnly(DpiApplication.ExeName) +
    376381      '.' + Code + ExtensionSeparator + 'po') or (Code = 'en');
     
    381386begin
    382387  inherited;
    383   FPOFiles := TObjectList.Create;
     388  FPoFiles := TPoFiles.Create;
    384389  ComponentExcludes := TComponentExcludesList.Create;
    385   Languages := TLanguageList.Create;
     390  Languages := TLanguages.Create;
    386391  POFilesFolder := 'Languages';
    387392  CheckLanguageFiles;
     
    395400destructor TTranslator.Destroy;
    396401begin
    397   FPOFiles.Free;
    398   Languages.Free;
    399   ComponentExcludes.Free;
    400   inherited Destroy;
     402  FreeAndNil(FPoFiles);
     403  FreeAndNil(Languages);
     404  FreeAndNil(ComponentExcludes);
     405  inherited;
    401406end;
    402407
     
    564569end;
    565570
    566 
    567571end.
    568 
  • branches/highdpi/Packages/Common/URI.pas

    r462 r463  
    1 unit UURI;
     1unit URI;
    22
    33// Date: 2011-04-04
    4 
    5 {$mode delphi}
    64
    75interface
     
    8583  end;
    8684
     85
    8786implementation
    8887
     
    183182begin
    184183  Items.Free;
    185   inherited Destroy;
     184  inherited;
    186185end;
    187186
     
    232231begin
    233232  Path.Free;
    234   inherited Destroy;
     233  inherited;
    235234end;
    236235
     
    243242    Fragment := TURI(Source).Fragment;
    244243    Query := TURI(Source).Query;
    245   end else inherited Assign(Source);
     244  end else inherited;
    246245end;
    247246
     
    291290destructor TURL.Destroy;
    292291begin
    293   inherited Destroy;
     292  inherited;
    294293end;
    295294
     
    344343begin
    345344  Directory.Free;
    346   inherited Destroy;
    347 end;
    348 
     345  inherited;
     346end;
    349347
    350348end.
    351 
  • branches/highdpi/Packages/Common/XML.pas

    r462 r463  
    1 unit UXMLUtils;
    2 
    3 {$mode delphi}
     1unit XML;
    42
    53interface
     
    1614procedure WriteString(Node: TDOMNode; Name: string; Value: string);
    1715procedure WriteDateTime(Node: TDOMNode; Name: string; Value: TDateTime);
     16procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double);
    1817function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer;
    1918function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64;
     
    2120function ReadString(Node: TDOMNode; Name: string; DefaultValue: string): string;
    2221function ReadDateTime(Node: TDOMNode; Name: string; DefaultValue: TDateTime): TDateTime;
     22function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double;
    2323procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
    2424
    2525
    2626implementation
     27
     28function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double;
     29var
     30  NewNode: TDOMNode;
     31begin
     32  Result := DefaultValue;
     33  NewNode := Node.FindNode(DOMString(Name));
     34  if Assigned(NewNode) then
     35    Result := StrToFloat(string(NewNode.TextContent));
     36end;
    2737
    2838procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string);
     
    202212end;
    203213
     214procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double);
     215var
     216  NewNode: TDOMNode;
     217begin
     218  NewNode := Node.OwnerDocument.CreateElement(DOMString(Name));
     219  NewNode.TextContent := DOMString(FloatToStr(Value));
     220  Node.AppendChild(NewNode);
     221end;
     222
    204223function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer;
    205224var
     
    254273
    255274end.
    256 
  • branches/highdpi/Packages/DpiControls/UDpiControls.pas

    r412 r463  
    175175    function GetShowHint: Boolean;
    176176    function GetVisible: Boolean;
     177    function GetWindowProc: TWndMethod;
    177178    function IsAnchorsStored: Boolean;
    178179    procedure SetAlign(AValue: TAlign);
     
    207208    procedure MouseLeaveHandler(Sender: TObject); virtual;
    208209    procedure MouseEnterHandler(Sender: TObject); virtual;
     210    procedure SetWindowProc(AValue: TWndMethod);
    209211  protected
    210212    procedure DoBorderSpacingChange(Sender: TObject; InnerSpaceChanged: Boolean); virtual;
     
    255257    property Anchors: TAnchors read GetAnchors write SetAnchors stored IsAnchorsStored default [akLeft, akTop];
    256258    property BorderSpacing: TDpiControlBorderSpacing read FBorderSpacing write SetBorderSpacing;
     259    property WindowProc: TWndMethod read GetWindowProc write SetWindowProc;
    257260  published
    258261    property AutoSize: Boolean read GetAutoSize write SetAutoSize default False;
     
    373376    destructor Destroy; override;
    374377    function GetNativePen: TPen;
     378    procedure Assign(Source: TDpiPen);
    375379    property NativePen: TPen read FNativePen write SetNativePen;
    376380  published
     
    395399    constructor Create;
    396400    destructor Destroy; override;
     401    procedure Assign(Source: TDpiBrush);
    397402    property NativeBrush: TBrush read FNativeBrush write SetNativeBrush;
    398403  published
     
    422427    procedure SetNativeCanvas(AValue: TCanvas);
    423428  protected
     429    procedure DoLine(X1, Y1, X2, Y2: Integer); virtual;
     430    procedure DoTextOut(X, Y: Integer; Text: string); virtual;
     431    procedure DoRectangle(const Bounds: TRect); virtual;
     432    procedure DoRectangleFill(const Bounds: TRect); virtual;
     433    procedure DoPolygon(const Points: array of TPoint); virtual;
     434    procedure CreateHandle; virtual;
     435    procedure DoEllipse(const Bounds: TRect); virtual;
     436    procedure DoMoveTo(X, Y: Integer); virtual;
     437    procedure DoLineTo(X, Y: Integer); virtual;
     438    procedure DoPolyline(const Points: array of TPoint); virtual;
     439    procedure DoPolyBezier(Points: PPoint; NumPts: Integer;
     440      Filled: Boolean = False; Continuous: Boolean = False); virtual;
    424441    procedure SetHeight(AValue: Integer); virtual;
    425442    procedure SetWidth(AValue: Integer); virtual;
     
    429446  public
    430447    property NativeCanvas: TCanvas read FNativeCanvas write SetNativeCanvas;
     448    procedure RoundRect(const Rect: TRect; RX, RY: Integer);
     449    procedure RoundRect(X1, Y1, X2, Y2: Integer; RX,RY: Integer); overload; virtual;
     450    procedure Polygon(const Points: array of TPoint; Winding: Boolean;
     451      StartIndex: Integer = 0; NumPts: Integer = -1);
     452    procedure Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean = False); virtual;
     453    procedure Polygon(const Points: array of TPoint);
     454    procedure PolyBezier(const Points: array of TPoint;
     455      Filled: Boolean = False; Continuous: boolean = True);
     456    procedure PolyBezier(Points: PPoint; NumPts: Integer;
     457      Filled: Boolean = False; Continuous: Boolean = True); virtual;
     458    procedure Polyline(const Points: array of TPoint);
     459    procedure Polyline(Points: PPoint; NumPts: Integer); virtual;
     460    procedure Ellipse(x1, y1, x2, y2: Integer); virtual;
     461    procedure Ellipse(const ARect: TRect); virtual;
     462    procedure StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic); virtual;
     463    procedure Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2,
     464      StartX, StartY, EndX, EndY: Integer); virtual;
    431465    procedure StretchDraw(const DestRect: TRect; SrcGraphic: TDpiGraphic); virtual;
    432466    procedure FrameRect(Rect: TRect);
    433467    procedure Rectangle(X1, Y1, X2, Y2: Integer); overload;
    434468    procedure Rectangle(const ARect: TRect); overload;
    435     function TextWidth(Text: string): Integer;
    436     function TextHeight(Text: string): Integer;
    437     function TextExtent(Text: string): TSize;
     469    function TextWidth(const Text: string): Integer;
     470    function TextHeight(const Text: string): Integer;
     471    function TextExtent(const Text: string): TSize; virtual;
    438472    procedure TextOut(X, Y: Integer; const Text: string); virtual;
    439473    procedure TextRect(ARect: TRect; X, Y: Integer; Text: string);
    440474    procedure MoveTo(X, Y: Integer);
    441475    procedure LineTo(X, Y: Integer);
     476    procedure Line(const p1, p2: TPoint);
    442477    procedure FillRect(const ARect: TRect); virtual;
    443478    procedure FillRect(X1, Y1, X2, Y2: Integer);
     
    598633    function GetRestoredTop: Integer;
    599634    function GetRestoredWidth: Integer;
     635    function GetShowInTaskbar: TShowInTaskbar;
    600636    function GetWindowState: TWindowState;
    601637    procedure SetBorderIcons(AValue: TBorderIcons);
     
    615651    procedure FormMessageHandler(var TheMessage: TLMessage);
    616652    procedure SetPosition(AValue: TPosition);
     653    procedure SetShowInTaskBar(AValue: TShowInTaskbar);
    617654    procedure SetWindowState(AValue: TWindowState);
    618655    procedure ActivateHandler(Sender: TObject);
     
    667704    property OnMouseDown;
    668705    property OnMouseMove;
     706    property ShowInTaskBar: TShowInTaskbar read GetShowInTaskbar write SetShowInTaskBar
     707                                        default stDefault;
    669708  end;
    670709
     
    873912  end;
    874913
     914  TDpiCustomListView = class(TDpiWinControl)
     915
     916  end;
     917
     918  TDpiLVCustomDrawItemEvent = procedure(Sender: TDpiCustomListView; Item: TListItem;
     919    State: TCustomDrawState; var DefaultDraw: Boolean) of object;
     920
    875921  { TDpiListView }
    876922
    877   TDpiListView = class(TDpiWinControl)
     923  TDpiListView = class(TDpiCustomListView)
    878924  private
     925    FOnCustomDrawItem: TDpiLVCustomDrawItemEvent;
    879926    NativeListView: TListView;
     927    function GetCanvas: TCanvas;
    880928    function GetColumns: TListColumns;
    881929    function GetItems: TListItems;
     930    function GetOnChange: TLVChangeEvent;
     931    function GetOnColumnClick: TLVColumnClickEvent;
     932    function GetOnCustomDrawItem: TDpiLVCustomDrawItemEvent;
     933    function GetProperty(AIndex: Integer): Boolean;
     934    function GetViewStyle: TViewStyle;
    882935    procedure SetColumns(AValue: TListColumns);
    883936    procedure SetItems(AValue: TListItems);
     937    procedure SetOnChange(AValue: TLVChangeEvent);
     938    procedure SetOnColumnClick(AValue: TLVColumnClickEvent);
     939    procedure SetOnCustomDrawItem(AValue: TDpiLVCustomDrawItemEvent);
     940    procedure SetProperty(AIndex: Integer; AValue: Boolean);
     941    procedure SetViewStyle(AValue: TViewStyle);
     942    procedure DoCustomDrawItem(Sender: TCustomListView; Item: TListItem;
     943      State: TCustomDrawState; var DefaultDraw: Boolean);
    884944  public
     945    function GetItemAt(x,y: integer): TListItem;
    885946    function GetNativeListView: TListView;
    886947    constructor Create(TheOwner: TComponent); override;
     
    888949    property Columns: TListColumns read GetColumns write SetColumns;
    889950    property Items: TListItems read GetItems write SetItems;
     951    property Canvas: TCanvas read GetCanvas;
     952    property Checkboxes: Boolean index Ord(lvpCheckboxes) read GetProperty write SetProperty default False;
    890953  published
     954    property OnColumnClick: TLVColumnClickEvent read GetOnColumnClick
     955      write SetOnColumnClick;
     956    property OnCustomDrawItem: TDpiLVCustomDrawItemEvent read GetOnCustomDrawItem
     957      write SetOnCustomDrawItem;
     958    property ViewStyle: TViewStyle read GetViewStyle write SetViewStyle default vsList;
     959    property OnChange: TLVChangeEvent read GetOnChange write SetOnChange;
    891960  end;
    892961
     
    11001169    NativeStringGrid: TStringGrid;
    11011170    function DefaultRowHeightIsStored: Boolean;
     1171    function GetCells(ACol, ARow: Integer): string;
     1172    function GetColCount: Integer;
     1173    function GetColumns: TGridColumns;
    11021174    function GetDefRowHeight: Integer;
     1175    function GetEditor: TWinControl;
     1176    function GetFixedCols: Integer;
     1177    function GetFixedRows: Integer;
     1178    function GetOptions: TGridOptions;
     1179    function GetRowCount: Integer;
     1180    function GetScrollBars: TScrollStyle;
     1181    function GetSelection: TGridRect;
     1182    function IsColumnsStored: Boolean;
     1183    procedure SetCells(ACol, ARow: Integer; AValue: string);
     1184    procedure SetColCount(AValue: Integer);
     1185    procedure SetColumns(AValue: TGridColumns);
    11031186    procedure SetDefRowHeight(AValue: Integer);
     1187    procedure SetEditor(AValue: TWinControl);
     1188    procedure SetFixedCols(AValue: Integer);
     1189    procedure SetFixedRows(AValue: Integer);
     1190    procedure SetOptions(AValue: TGridOptions);
     1191    procedure SetRowCount(AValue: Integer);
     1192    procedure SetScrollBars(AValue: TScrollStyle);
     1193    procedure SetSelection(AValue: TGridRect);
    11041194  public
    11051195    function GetNativeStringGrid: TStringGrid;
     1196    function CellRect(ACol, ARow: Integer): TRect;
    11061197    constructor Create(TheOwner: TComponent); override;
    11071198    destructor Destroy; override;
     1199    property Selection: TGridRect read GetSelection write SetSelection;
     1200    property Cells[ACol, ARow: Integer]: string read GetCells write SetCells;
    11081201  published
    11091202    property DefaultRowHeight: Integer read GetDefRowHeight write SetDefRowHeight stored DefaultRowHeightIsStored;
     1203    property ScrollBars: TScrollStyle read GetScrollBars write SetScrollBars default ssAutoBoth;
     1204    property FixedCols: Integer read GetFixedCols write SetFixedCols default 1;
     1205    property FixedRows: Integer read GetFixedRows write SetFixedRows default 1;
     1206    property RowCount: Integer read GetRowCount write SetRowCount default 5;
     1207    property ColCount: Integer read GetColCount write SetColCount default 5;
     1208    property Options: TGridOptions read GetOptions write SetOptions default DefaultGridOptions;
     1209    property Columns: TGridColumns read GetColumns write SetColumns stored IsColumnsStored;
     1210    property Editor: TWinControl read GetEditor write SetEditor;
    11101211  end;
    11111212
     
    11931294    function GetExeName: string;
    11941295    function GetShowMainForm: Boolean;
     1296    function GetTaskBarBehavior: TTaskBarBehavior;
    11951297    function GetTitle: string;
    11961298    procedure SetMainForm(AValue: TDpiForm);
    11971299    function GetMainForm: TDpiForm;
    11981300    procedure SetShowMainForm(AValue: Boolean);
     1301    procedure SetTaskBarBehavior(AValue: TTaskBarBehavior);
    11991302    procedure SetTitle(AValue: string);
    12001303  protected
     
    12161319    property Active: Boolean read GetActive;
    12171320    property ExeName: string read GetExeName;
     1321    property TaskBarBehavior: TTaskBarBehavior read GetTaskBarBehavior write SetTaskBarBehavior;
    12181322  end;
    12191323
     
    12761380    property Count: Integer read GetCount;
    12771381    procedure Clear;
     1382    procedure Click; virtual;
    12781383  published
    12791384    property RadioItem: Boolean read GetRadioItem write SetRadioItem default False;
     
    13561461  SDpiFormTitle = 'DpiForm form';
    13571462  SDpiFormDescription = 'DPI aware form';
     1463  SNotImplemented = 'Not implemented';
    13581464
    13591465procedure Register;
     
    19712077function TDpiStringGrid.DefaultRowHeightIsStored: Boolean;
    19722078begin
    1973   Result := GetDefRowHeight>=0;
     2079  Result := GetDefRowHeight >= 0;
     2080end;
     2081
     2082function TDpiStringGrid.GetCells(ACol, ARow: Integer): string;
     2083begin
     2084  Result := GetNativeStringGrid.Cells[ACol, ARow];
     2085end;
     2086
     2087function TDpiStringGrid.GetColCount: Integer;
     2088begin
     2089  Result := GetNativeStringGrid.ColCount;
     2090end;
     2091
     2092function TDpiStringGrid.GetColumns: TGridColumns;
     2093begin
     2094  Result := GetNativeStringGrid.Columns;
    19742095end;
    19752096
     
    19792100end;
    19802101
     2102function TDpiStringGrid.GetEditor: TWinControl;
     2103begin
     2104  Result := GetNativeStringGrid.Editor;
     2105end;
     2106
     2107function TDpiStringGrid.GetFixedCols: Integer;
     2108begin
     2109  Result := GetNativeStringGrid.FixedCols;
     2110end;
     2111
     2112function TDpiStringGrid.GetFixedRows: Integer;
     2113begin
     2114  Result := GetNativeStringGrid.FixedRows;
     2115end;
     2116
     2117function TDpiStringGrid.GetOptions: TGridOptions;
     2118begin
     2119  Result := GetNativeStringGrid.Options;
     2120end;
     2121
     2122function TDpiStringGrid.GetRowCount: Integer;
     2123begin
     2124  Result := GetNativeStringGrid.RowCount;
     2125end;
     2126
     2127function TDpiStringGrid.GetScrollBars: TScrollStyle;
     2128begin
     2129  Result := GetNativeStringGrid.ScrollBars;
     2130end;
     2131
     2132function TDpiStringGrid.GetSelection: TGridRect;
     2133begin
     2134  Result := GetNativeStringGrid.Selection;
     2135end;
     2136
     2137function TDpiStringGrid.IsColumnsStored: Boolean;
     2138begin
     2139  Result := GetNativeStringGrid.Columns.Enabled;
     2140end;
     2141
     2142procedure TDpiStringGrid.SetCells(ACol, ARow: Integer; AValue: string);
     2143begin
     2144  GetNativeStringGrid.Cells[ACol, ARow] := AValue;
     2145end;
     2146
     2147procedure TDpiStringGrid.SetColCount(AValue: Integer);
     2148begin
     2149  GetNativeStringGrid.ColCount := AValue;
     2150end;
     2151
     2152procedure TDpiStringGrid.SetColumns(AValue: TGridColumns);
     2153begin
     2154  GetNativeStringGrid.Columns := AValue;
     2155end;
     2156
    19812157procedure TDpiStringGrid.SetDefRowHeight(AValue: Integer);
    19822158begin
    19832159  GetNativeStringGrid.DefaultRowHeight := AValue;
     2160end;
     2161
     2162procedure TDpiStringGrid.SetEditor(AValue: TWinControl);
     2163begin
     2164  GetNativeStringGrid.Editor := AValue;
     2165end;
     2166
     2167procedure TDpiStringGrid.SetFixedCols(AValue: Integer);
     2168begin
     2169  GetNativeStringGrid.FixedCols := AValue;
     2170end;
     2171
     2172procedure TDpiStringGrid.SetFixedRows(AValue: Integer);
     2173begin
     2174  GetNativeStringGrid.FixedRows := AValue;
     2175end;
     2176
     2177procedure TDpiStringGrid.SetOptions(AValue: TGridOptions);
     2178begin
     2179  GetNativeStringGrid.Options := AValue;
     2180end;
     2181
     2182procedure TDpiStringGrid.SetRowCount(AValue: Integer);
     2183begin
     2184  GetNativeStringGrid.RowCount := AValue;
     2185end;
     2186
     2187procedure TDpiStringGrid.SetScrollBars(AValue: TScrollStyle);
     2188begin
     2189  GetNativeStringGrid.ScrollBars := AValue;
     2190end;
     2191
     2192procedure TDpiStringGrid.SetSelection(AValue: TGridRect);
     2193begin
     2194  GetNativeStringGrid.Selection := AValue;
    19842195end;
    19852196
     
    19902201end;
    19912202
     2203function TDpiStringGrid.CellRect(ACol, ARow: Integer): TRect;
     2204begin
     2205  Result := GetNativeStringGrid.CellRect(ACol, ARow);
     2206end;
     2207
    19922208constructor TDpiStringGrid.Create(TheOwner: TComponent);
    19932209begin
     
    20082224end;
    20092225
     2226function TDpiListView.GetOnChange: TLVChangeEvent;
     2227begin
     2228  Result := GetNativeListView.OnChange;
     2229end;
     2230
     2231function TDpiListView.GetOnColumnClick: TLVColumnClickEvent;
     2232begin
     2233  Result := GetNativeListView.OnColumnClick;
     2234end;
     2235
     2236function TDpiListView.GetOnCustomDrawItem: TDpiLVCustomDrawItemEvent;
     2237begin
     2238  Result := FOnCustomDrawItem;
     2239end;
     2240
     2241function TDpiListView.GetProperty(AIndex: Integer): Boolean;
     2242begin
     2243  Result := GetNativeListView.Checkboxes;
     2244end;
     2245
     2246function TDpiListView.GetViewStyle: TViewStyle;
     2247begin
     2248  Result := GetNativeListView.ViewStyle;
     2249end;
     2250
    20102251function TDpiListView.GetColumns: TListColumns;
    20112252begin
    2012   Result := NativeListView.Columns;
     2253  Result := GetNativeListView.Columns;
     2254end;
     2255
     2256function TDpiListView.GetCanvas: TCanvas;
     2257begin
     2258  Result := GetNativeListView.Canvas;
    20132259end;
    20142260
    20152261procedure TDpiListView.SetColumns(AValue: TListColumns);
    20162262begin
    2017   NativeListView.Columns := AValue;
     2263  GetNativeListView.Columns := AValue;
    20182264end;
    20192265
     
    20232269end;
    20242270
     2271procedure TDpiListView.SetOnChange(AValue: TLVChangeEvent);
     2272begin
     2273  GetNativeListView.OnChange := AValue;
     2274end;
     2275
     2276procedure TDpiListView.SetOnColumnClick(AValue: TLVColumnClickEvent);
     2277begin
     2278  GetNativeListView.OnColumnClick := AValue;
     2279end;
     2280
     2281procedure TDpiListView.SetOnCustomDrawItem(AValue: TDpiLVCustomDrawItemEvent);
     2282begin
     2283  FOnCustomDrawItem := AValue;
     2284end;
     2285
     2286procedure TDpiListView.SetProperty(AIndex: Integer; AValue: Boolean);
     2287begin
     2288  GetNativeListView.Checkboxes := AValue;
     2289end;
     2290
     2291procedure TDpiListView.SetViewStyle(AValue: TViewStyle);
     2292begin
     2293  GetNativeListView.ViewStyle := AValue;
     2294end;
     2295
     2296procedure TDpiListView.DoCustomDrawItem(Sender: TCustomListView; Item: TListItem;
     2297  State: TCustomDrawState; var DefaultDraw: Boolean);
     2298begin
     2299  if Assigned(FOnCustomDrawItem) then
     2300    FOnCustomDrawItem(Self, Item, State, DefaultDraw);
     2301end;
     2302
     2303function TDpiListView.GetItemAt(x, y: integer): TListItem;
     2304begin
     2305  Result := GetNativeListView.GetItemAt(X, Y);
     2306end;
     2307
    20252308function TDpiListView.GetNativeListView: TListView;
    20262309begin
    2027   if not Assigned(NativeListView) then NativeListView := TListView.Create(nil);
    2028     Result := NativeListView;
     2310  if not Assigned(NativeListView) then begin
     2311    NativeListView := TListView.Create(nil);
     2312    NativeListView.OnCustomDrawItem := @DoCustomDrawItem;
     2313  end;
     2314  Result := NativeListView;
    20292315end;
    20302316
     
    21012387end;
    21022388
     2389procedure TDpiPen.Assign(Source: TDpiPen);
     2390begin
     2391  FWidth := Source.FWidth;
     2392  GetNativePen.Assign(Source.GetNativePen);
     2393end;
     2394
    21032395{ TDpiBrush }
    21042396
     
    21462438  if FNativeBrushFree then FreeAndNil(FNativeBrush);
    21472439  inherited;
     2440end;
     2441
     2442procedure TDpiBrush.Assign(Source: TDpiBrush);
     2443begin
     2444  GetNativeBrush.Assign(Source.GetNativeBrush);
    21482445end;
    21492446
     
    24722769begin
    24732770  GetNativeMenuItem.Clear;
     2771end;
     2772
     2773procedure TDpiMenuItem.Click;
     2774begin
     2775  GetNativeMenuItem.Click;
    24742776end;
    24752777
     
    26792981end;
    26802982
     2983function TDpiApplication.GetTaskBarBehavior: TTaskBarBehavior;
     2984begin
     2985  Result := GetNativeApplication.TaskBarBehavior;
     2986end;
     2987
    26812988function TDpiApplication.GetActive: Boolean;
    26822989begin
    2683   Result := Application.Active;
     2990  Result := GetNativeApplication.Active;
    26842991end;
    26852992
     
    26973004begin
    26983005  GetNativeApplication.ShowMainForm := AValue;
     3006end;
     3007
     3008procedure TDpiApplication.SetTaskBarBehavior(AValue: TTaskBarBehavior);
     3009begin
     3010  GetNativeApplication.TaskBarBehavior := AValue;
    26993011end;
    27003012
     
    35263838end;
    35273839
     3840procedure TDpiCanvas.DoLine(X1, Y1, X2, Y2: Integer);
     3841begin
     3842  raise ENotImplemented.Create(SNotImplemented);
     3843end;
     3844
     3845procedure TDpiCanvas.DoTextOut(X, Y: Integer; Text: string);
     3846begin
     3847  raise ENotImplemented.Create(SNotImplemented);
     3848end;
     3849
     3850procedure TDpiCanvas.DoRectangle(const Bounds: TRect);
     3851begin
     3852  raise ENotImplemented.Create(SNotImplemented);
     3853end;
     3854
     3855procedure TDpiCanvas.DoRectangleFill(const Bounds: TRect);
     3856begin
     3857  raise ENotImplemented.Create(SNotImplemented);
     3858end;
     3859
     3860procedure TDpiCanvas.DoPolygon(const Points: array of TPoint);
     3861begin
     3862  raise ENotImplemented.Create(SNotImplemented);
     3863end;
     3864
     3865procedure TDpiCanvas.CreateHandle;
     3866begin
     3867  raise ENotImplemented.Create(SNotImplemented);
     3868end;
     3869
     3870procedure TDpiCanvas.DoEllipse(const Bounds: TRect);
     3871begin
     3872  raise ENotImplemented.Create(SNotImplemented);
     3873end;
     3874
     3875procedure TDpiCanvas.DoMoveTo(X, Y: Integer);
     3876begin
     3877  raise ENotImplemented.Create(SNotImplemented);
     3878end;
     3879
     3880procedure TDpiCanvas.DoLineTo(X, Y: Integer);
     3881begin
     3882  raise ENotImplemented.Create(SNotImplemented);
     3883end;
     3884
     3885procedure TDpiCanvas.DoPolyline(const Points: array of TPoint);
     3886begin
     3887  raise ENotImplemented.Create(SNotImplemented);
     3888end;
     3889
     3890procedure TDpiCanvas.DoPolyBezier(Points: PPoint; NumPts: Integer;
     3891  Filled: Boolean; Continuous: Boolean);
     3892begin
     3893  raise ENotImplemented.Create(SNotImplemented);
     3894end;
     3895
    35283896function TDpiCanvas.GetNativeCanvas: TCanvas;
    35293897begin
    35303898  Result := NativeCanvas;
     3899end;
     3900
     3901procedure TDpiCanvas.RoundRect(const Rect: TRect; RX, RY: Integer);
     3902begin
     3903  GetNativeCanvas.RoundRect(Rect, RX, RY);
     3904end;
     3905
     3906procedure TDpiCanvas.RoundRect(X1, Y1, X2, Y2: Integer; RX, RY: Integer);
     3907begin
     3908  GetNativeCanvas.RoundRect(X1, Y1, X2, Y2, RX, RY);
     3909end;
     3910
     3911procedure TDpiCanvas.Polygon(const Points: array of TPoint; Winding: Boolean;
     3912  StartIndex: Integer; NumPts: Integer);
     3913begin
     3914  GetNativeCanvas.Polygon(Points, Winding, StartIndex, NumPts);
     3915end;
     3916
     3917procedure TDpiCanvas.Polygon(Points: PPoint; NumPts: Integer; Winding: Boolean);
     3918begin
     3919  GetNativeCanvas.Polygon(Points, NumPts, Winding);
     3920end;
     3921
     3922procedure TDpiCanvas.Polygon(const Points: array of TPoint);
     3923begin
     3924  GetNativeCanvas.Polygon(Points);
     3925end;
     3926
     3927procedure TDpiCanvas.PolyBezier(const Points: array of TPoint; Filled: Boolean;
     3928  Continuous: boolean);
     3929begin
     3930  GetNativeCanvas.Polyline(Points);
     3931end;
     3932
     3933procedure TDpiCanvas.PolyBezier(Points: PPoint; NumPts: Integer;
     3934  Filled: Boolean; Continuous: Boolean);
     3935begin
     3936  GetNativeCanvas.PolyBezier(Points, NumPts, Filled, Continuous);
     3937end;
     3938
     3939procedure TDpiCanvas.Polyline(const Points: array of TPoint);
     3940begin
     3941  GetNativeCanvas.Polyline(Points);
     3942end;
     3943
     3944procedure TDpiCanvas.Polyline(Points: PPoint; NumPts: Integer);
     3945begin
     3946  GetNativeCanvas.Polyline(Points, NumPts);
     3947end;
     3948
     3949procedure TDpiCanvas.Ellipse(x1, y1, x2, y2: Integer);
     3950begin
     3951  GetNativeCanvas.Ellipse(X1, Y1, X2, Y2);
     3952end;
     3953
     3954procedure TDpiCanvas.Ellipse(const ARect: TRect);
     3955begin
     3956  Ellipse(ARect.Left, ARect.Top, ARect.Right, ARect.Bottom);
     3957end;
     3958
     3959procedure TDpiCanvas.StretchDraw(const DestRect: TRect; SrcGraphic: TGraphic);
     3960begin
     3961  GetNativeCanvas.StretchDraw(DestRect, SrcGraphic);
     3962end;
     3963
     3964procedure TDpiCanvas.Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX,
     3965  StartY, EndX, EndY: Integer);
     3966begin
     3967  GetNativeCanvas.Pie(EllipseX1, EllipseY1, EllipseX2, EllipseY2, StartX, StartY,
     3968    EndX, EndY);
    35313969end;
    35323970
     
    35523990end;
    35533991
    3554 function TDpiCanvas.TextWidth(Text: string): Integer;
     3992function TDpiCanvas.TextWidth(const Text: string): Integer;
    35553993begin
    35563994  Result := ScaleFromNative(GetNativeCanvas.TextWidth(Text));
    35573995end;
    35583996
    3559 function TDpiCanvas.TextHeight(Text: string): Integer;
     3997function TDpiCanvas.TextHeight(const Text: string): Integer;
    35603998begin
    35613999  Result := ScaleFromNative(GetNativeCanvas.TextHeight(Text));
    35624000end;
    35634001
    3564 function TDpiCanvas.TextExtent(Text: string): TSize;
     4002function TDpiCanvas.TextExtent(const Text: string): TSize;
    35654003begin
    35664004  Result := ScaleSizeFromNative(GetNativeCanvas.TextExtent(Text));
     
    35854023begin
    35864024  GetNativeCanvas.LineTo(ScaleToNative(X), ScaleToNative(Y));
     4025end;
     4026
     4027procedure TDpiCanvas.Line(const p1, p2: TPoint);
     4028begin
     4029  GetNativeCanvas.Line(P1, P2);
    35874030end;
    35884031
     
    41394582  FreeAndNil(FForms);
    41404583  FreeAndNil(FPrevActiveForms);
    4141   inherited Destroy;
     4584  inherited;
    41424585end;
    41434586
     
    42564699  MouseEnter;
    42574700  if Assigned(FOnMouseEnter) then FOnMouseEnter(Self);
     4701end;
     4702
     4703procedure TDpiControl.SetWindowProc(AValue: TWndMethod);
     4704begin
     4705  GetNativeControl.WindowProc := AValue;
    42584706end;
    42594707
     
    45224970end;
    45234971
     4972function TDpiControl.GetWindowProc: TWndMethod;
     4973begin
     4974  Result := GetNativeControl.WindowProc;
     4975end;
     4976
    45244977function TDpiControl.IsAnchorsStored: Boolean;
    45254978begin
     
    47915244end;
    47925245
     5246function TDpiForm.GetShowInTaskbar: TShowInTaskbar;
     5247begin
     5248  Result := GetNativeForm.ShowInTaskBar;
     5249end;
     5250
    47935251function TDpiForm.GetWindowState: TWindowState;
    47945252begin
     
    48755333begin
    48765334  GetNativeForm.Position := AValue;
     5335end;
     5336
     5337procedure TDpiForm.SetShowInTaskBar(AValue: TShowInTaskbar);
     5338begin
     5339  GetNativeForm.ShowInTaskBar := AValue;
    48775340end;
    48785341
Note: See TracChangeset for help on using the changeset viewer.