Changeset 447 for trunk/Packages


Ignore:
Timestamp:
May 19, 2022, 10:39:34 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Use first capital letter in identifiers.
Location:
trunk/Packages
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/AsyncProcess2.pas

    r290 r447  
    122122
    123123end.
     124
  • trunk/Packages/CevoComponents/BaseWin.pas

    r442 r447  
    2323    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    2424    procedure FormDeactivate(Sender: TObject);
    25     procedure SmartUpdateContent(ImmUpdate: Boolean = false);
     25    procedure SmartUpdateContent(ImmUpdate: Boolean = False);
    2626    procedure StayOnTop_Workaround;
    2727  protected
     
    5050    CaptionRight: Integer;
    5151    InnerWidth: Integer;
    52     InnerHeight: integer;
     52    InnerHeight: Integer;
    5353    WideBottom: Boolean;
    5454    FullCaption: Boolean;
     
    180180      UserLeft := Left;
    181181      UserTop := Top;
    182       Visible := false;
     182      Visible := False;
    183183      FWindowMode := NewMode;
    184184      ShowModal;
     
    186186    else if forceclose then
    187187    begin // make modal
    188       Visible := false;
     188      Visible := False;
    189189      FWindowMode := NewMode;
    190190      Left := UserLeft;
     
    272272procedure TFramedDlg.SmartInvalidate;
    273273var
    274   i, BottomFrame: integer;
     274  I, BottomFrame: Integer;
    275275  r0, r1: HRgn;
    276276begin
     
    281281  r0 := CreateRectRgn(SideFrame, TitleHeight, ClientWidth - SideFrame,
    282282    ClientHeight - BottomFrame);
    283   for i := 0 to ControlCount - 1 do
    284     if not(Controls[i] is TArea) and Controls[i].Visible then
     283  for I := 0 to ControlCount - 1 do
     284    if not(Controls[I] is TArea) and Controls[I].Visible then
    285285    begin
    286       with Controls[i].BoundsRect do
     286      with Controls[I].BoundsRect do
    287287        r1 := CreateRectRgn(Left, Top, Right, Bottom);
    288288      CombineRgn(r0, r0, r1, RGN_DIFF);
     
    295295procedure TFramedDlg.VPaint;
    296296
    297   procedure CornerFrame(x0, y0, x1, y1: integer);
     297  procedure CornerFrame(x0, y0, x1, y1: Integer);
    298298  begin
    299299    Frame(Canvas, x0 + 1, y0 + 1, x1 - 2, y1 - 2, MainTexture.ColorBevelLight,
     
    308308
    309309var
    310   i, l, FrameTop, FrameBottom, InnerBottom, Cut, xTexOffset,
    311     yTexOffset: integer;
     310  I, L, FrameTop, FrameBottom, InnerBottom, Cut, xTexOffset,
     311    yTexOffset: Integer;
    312312  R: TRect;
    313313begin
     
    321321  end;
    322322  Canvas.Font.Assign(UniFont[ftCaption]);
    323   l := BiColorTextWidth(Canvas, Caption);
    324   Cut := (ClientWidth - l) div 2;
     323  L := BiColorTextWidth(Canvas, Caption);
     324  Cut := (ClientWidth - L) div 2;
    325325  xTexOffset := (Maintexture.Width - ClientWidth) div 2;
    326326  yTexOffset := (Maintexture.Height - ClientHeight) div 2;
     
    446446  RisedTextOut(Canvas, Cut - 1, 7, Caption);
    447447
    448   for i := 0 to ControlCount - 1 do
    449     if Controls[i].Visible and (Controls[i] is TButtonBase) then
     448  for I := 0 to ControlCount - 1 do
     449    if Controls[I].Visible and (Controls[I] is TButtonBase) then
    450450    begin
    451       R := Controls[i].BoundsRect;
     451      R := Controls[I].BoundsRect;
    452452      if (R.Bottom <= TitleHeight) or (R.Top >= InnerBottom) then
    453453        BtnFrame(Canvas, R, MainTexture);
     
    463463begin
    464464  if FullCaption then
    465     exit;
     465    Exit;
    466466  r0 := CreateRectRgn(0, 0, ClientWidth, ClientHeight);
    467467  r1 := CreateRectRgn(0, 0, CaptionLeft, TitleHeight - NarrowFrame);
  • trunk/Packages/CevoComponents/ButtonB.pas

    r290 r447  
    1111  private
    1212    FMask: TBitmap;
    13     FIndex: integer;
    14     procedure SetIndex(Text: integer);
     13    FIndex: Integer;
     14    procedure SetIndex(Text: Integer);
    1515  public
    1616    property Mask: TBitmap 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
     
    6161end;
    6262
    63 procedure TButtonB.SetIndex(Text: integer);
     63procedure TButtonB.SetIndex(Text: Integer);
    6464begin
    6565  if Text <> FIndex then begin
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r431 r447  
    1515    ClickProc: TNotifyEvent;
    1616    DownChangedProc: TNotifyEvent;
    17     procedure SetDown(x: boolean);
     17    procedure SetDown(X: Boolean);
    1818    // procedure PlayDownSound;
    1919    // procedure PlayUpSound;
    2020    procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
    21       x, y: integer); override;
     21      X, Y: Integer); override;
    2222    procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
    23       x, y: integer); override;
    24     procedure MouseMove(Shift: TShiftState; x, y: integer); override;
     23      X, Y: Integer); override;
     24    procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
    2525  private
    26     Active: boolean;
     26    Active: Boolean;
    2727  public
    2828    constructor Create(aOwner: TComponent); override;
     
    3232  published
    3333    property Visible;
    34     property Down: boolean read FDown write SetDown;
    35     property Permanent: boolean read FPermanent write FPermanent;
     34    property Down: Boolean read FDown write SetDown;
     35    property Permanent: Boolean read FPermanent write FPermanent;
    3636    property OnClick: TNotifyEvent read ClickProc write ClickProc;
    3737    property OnDownChanged: TNotifyEvent read DownChangedProc
     
    5050  // FUpSound:='';
    5151  FGraphic := nil;
    52   Active := false;
    53   FDown := false;
    54   FPermanent := false;
     52  Active := False;
     53  FDown := False;
     54  FPermanent := False;
    5555  ClickProc := nil;
    5656end;
    5757
    5858procedure TButtonBase.MouseDown(Button: TMouseButton; Shift: TShiftState;
    59   x, y: integer);
     59  X, Y: Integer);
    6060begin
    61   Active := true;
    62   MouseMove(Shift, x, y);
     61  Active := True;
     62  MouseMove(Shift, X, Y);
    6363end;
    6464
    6565procedure TButtonBase.MouseUp(Button: TMouseButton; Shift: TShiftState;
    66   x, y: integer);
     66  X, Y: Integer);
    6767begin
    6868  if ssLeft in Shift then
    69     exit;
    70   MouseMove(Shift, x, y);
     69    Exit;
     70  MouseMove(Shift, X, Y);
    7171  if Active and FDown then
    7272  begin
    7373    // PlayUpSound;
    74     Active := false;
     74    Active := False;
    7575    if FDown <> FPermanent then
    7676    begin
     
    8686  begin
    8787    // if FDown then PlayUpSound;
    88     Active := false;
     88    Active := False;
    8989    if FDown then
    9090    begin
    91       FDown := false;
     91      FDown := False;
    9292      Invalidate;
    9393      if @DownChangedProc <> nil then
     
    9797end;
    9898
    99 procedure TButtonBase.MouseMove(Shift: TShiftState; x, y: integer);
     99procedure TButtonBase.MouseMove(Shift: TShiftState; X, Y: Integer);
    100100begin
    101101  if Active then
    102     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
    103103      if (ssLeft in Shift) and not FDown then
    104104      begin
    105105        { PlayDownSound; }
    106         FDown := true;
     106        FDown := True;
    107107        Paint;
    108108        if @DownChangedProc <> nil then
     
    113113    begin
    114114      { PlayUpSound; }
    115       FDown := false;
     115      FDown := False;
    116116      Paint;
    117117      if @DownChangedProc <> nil then
     
    120120end;
    121121
    122 procedure TButtonBase.SetDown(x: boolean);
     122procedure TButtonBase.SetDown(X: Boolean);
    123123begin
    124   FDown := x;
     124  FDown := X;
    125125  Invalidate;
    126126end;
  • trunk/Packages/CevoComponents/ButtonC.pas

    r431 r447  
    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
     
    5050end;
    5151
    52 procedure TButtonC.SetIndex(Text: integer);
     52procedure TButtonC.SetIndex(Text: Integer);
    5353begin
    5454  if Text <> FIndex then
  • trunk/Packages/CevoComponents/ButtonN.pas

    r290 r447  
    1010    constructor Create(aOwner: TComponent); override;
    1111  private
    12     FPossible, FLit: boolean;
     12    FPossible, FLit: Boolean;
    1313    FGraphic, FMask, FBackGraphic: TBitmap;
    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: TBitmap read FGraphic write FGraphic;
    2626    property Mask: TBitmap read FMask write FMask;
    2727    property BackGraphic: TBitmap 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;
     
    6363    begin
    6464      BitBltCanvas(Canvas, 1, 1, 40, 40, FBackGraphic.Canvas,
    65         1 + 80 * BackIndex + 40 * byte(FPossible and FLit), 176);
     65        1 + 80 * BackIndex + 40 * Byte(FPossible and FLit), 176);
    6666      if FPossible then
    6767      begin
     
    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;
  • trunk/Packages/CevoComponents/CevoComponents.pas

    r396 r447  
    2929  RegisterPackage('CevoComponents', @Register);
    3030end.
     31
  • trunk/Packages/CevoComponents/Directories.pas

    r381 r447  
    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;
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r423 r447  
    331331end.
    332332
     333
  • trunk/Packages/CevoComponents/EOTButton.pas

    r330 r447  
    1919    constructor Create(aOwner: TComponent); override;
    2020    destructor Destroy; override;
    21     procedure SetButtonIndexFast(x: integer);
    22     procedure SetBack(ca: TCanvas; x, y: integer);
     21    procedure SetButtonIndexFast(X: Integer);
     22    procedure SetBack(ca: TCanvas; X, Y: Integer);
    2323  private
    2424    FTemplate: TBitmap;
    25     FIndex: integer;
    26     procedure SetIndex(x: integer);
     25    FIndex: Integer;
     26    procedure SetIndex(X: Integer);
    2727  public
    2828    property Template: TBitmap 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;
     
    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: TCanvas; x, y: integer);
     110procedure TEOTButton.SetBack(ca: TCanvas; X, Y: Integer);
    111111begin
    112   BitBltCanvas(Back.Canvas, 0, 0, 48, 48, ca, x, y);
     112  BitBltCanvas(Back.Canvas, 0, 0, 48, 48, ca, X, Y);
    113113end;
    114114
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r442 r447  
    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: TMenuItem; 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: TCanvas; p: TRect; T: TTexture);
    27 procedure EditFrame(ca: TCanvas; 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(ca: TCanvas; P: TRect; T: TTexture);
     27procedure EditFrame(ca: TCanvas; P: TRect; T: TTexture);
     28function HexStringToColor(S: string): Integer;
    2929function ExtractFileNameWithoutExt(const Filename: string): string;
    30 function LoadGraphicFile(Bmp: TBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean;
     30function LoadGraphicFile(Bmp: TBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): Boolean;
    3131function LoadGraphicSet(const Name: string; Transparency: Boolean = True): TGraphicSet;
    32 procedure Dump(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     32procedure Dump(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    3333procedure BitmapReplaceColor(Dst: TBitmap; X, Y, Width, Height: Integer; OldColor, NewColor: TColor);
    34 procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     34procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    3535  overload;
    36 procedure Sprite(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     36procedure Sprite(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    3737  overload;
    3838procedure MakeBlue(Dst: TBitmap; X, Y, Width, Height: Integer);
     
    4545procedure ImageOp_CBC(Dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, Width, Height,
    4646  Color0, Color2: Integer);
    47 procedure ImageOp_CCC(bmp: TBitmap; x, y, Width, Height, Color0, Color1, Color2: Integer);
     47procedure ImageOp_CCC(bmp: TBitmap; X, Y, Width, Height, Color0, Color1, Color2: Integer);
    4848function BitBltCanvas(DestCanvas: TCanvas; X, Y, Width, Height: Integer;
    4949  SrcCanvas: TCanvas; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean; overload;
     
    5454function BitBltBitmap(Dest: TBitmap; DestRect: TRect;
    5555  Src: TBitmap; SrcPos: TPoint; Rop: DWORD = SRCCOPY): Boolean; overload;
    56 procedure SLine(ca: TCanvas; x0, x1, y: integer; cl: TColor);
    57 procedure DLine(ca: TCanvas; x0, x1, y: integer; cl0, cl1: TColor);
    58 procedure Frame(ca: TCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
    59 procedure RFrame(ca: TCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
    60 procedure CFrame(ca: TCanvas; x0, y0, x1, y1, Corner: integer; cl: TColor);
     56procedure SLine(ca: TCanvas; x0, x1, Y: Integer; cl: TColor);
     57procedure DLine(ca: TCanvas; x0, x1, Y: Integer; cl0, cl1: TColor);
     58procedure Frame(ca: TCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
     59procedure RFrame(ca: TCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
     60procedure CFrame(ca: TCanvas; x0, y0, x1, y1, Corner: Integer; cl: TColor);
    6161procedure FrameImage(ca: TCanvas; Src: TBitmap;
    62   x, y, Width, Height, xSrc, ySrc: integer; IsControl: boolean = False);
    63 procedure GlowFrame(Dst: TBitmap; x0, y0, Width, Height: integer; cl: TColor);
     62  X, Y, Width, Height, xSrc, ySrc: Integer; IsControl: Boolean = False);
     63procedure GlowFrame(Dst: TBitmap; x0, y0, Width, Height: Integer; cl: TColor);
    6464procedure InitOrnament;
    6565procedure InitCityMark(T: TTexture);
    66 procedure Fill(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: integer); overload;
     66procedure Fill(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer); overload;
    6767procedure Fill(Canvas: TCanvas; Rect: TRect; Offset: TPoint); overload;
    68 procedure FillLarge(ca: TCanvas; x0, y0, x1, y1, xm: integer);
    69 procedure FillSeamless(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: integer;
     68procedure FillLarge(ca: TCanvas; x0, y0, x1, y1, xm: Integer);
     69procedure FillSeamless(ca: TCanvas; Left, Top, Width, Height, xOffset, yOffset: Integer;
    7070  const Texture: TBitmap);
    71 procedure FillRectSeamless(ca: TCanvas; x0, y0, x1, y1, xOffset, yOffset: integer;
     71procedure FillRectSeamless(ca: TCanvas; x0, y0, x1, y1, xOffset, yOffset: Integer;
    7272  const Texture: TBitmap);
    73 procedure PaintBackground(Form: TForm; Left, Top, Width, Height: integer);
    74 procedure Corner(ca: TCanvas; x, y, Kind: integer; T: TTexture);
    75 procedure BiColorTextOut(ca: TCanvas; clMain, clBack: TColor; x, y: integer; s: string);
     73procedure PaintBackground(Form: TForm; Left, Top, Width, Height: Integer);
     74procedure Corner(ca: TCanvas; X, Y, Kind: Integer; T: TTexture);
     75procedure BiColorTextOut(ca: TCanvas; clMain, clBack: TColor; X, Y: Integer; S: string);
    7676procedure LoweredTextOut(ca: TCanvas; cl: TColor; T: TTexture;
    77   x, y: integer; s: string);
    78 function BiColorTextWidth(ca: TCanvas; s: string): integer;
    79 procedure RisedTextOut(ca: TCanvas; x, y: integer; s: string);
    80 procedure LightGradient(ca: TCanvas; x, y, Width, Color: integer);
    81 procedure DarkGradient(ca: TCanvas; x, y, Width, Kind: integer);
    82 procedure VLightGradient(ca: TCanvas; x, y, Height, Color: integer);
    83 procedure VDarkGradient(ca: TCanvas; x, y, Height, Kind: integer);
     77  X, Y: Integer; S: string);
     78function BiColorTextWidth(ca: TCanvas; S: string): Integer;
     79procedure RisedTextOut(ca: TCanvas; X, Y: Integer; S: string);
     80procedure LightGradient(ca: TCanvas; X, Y, Width, Color: Integer);
     81procedure DarkGradient(ca: TCanvas; X, Y, Width, Kind: Integer);
     82procedure VLightGradient(ca: TCanvas; X, Y, Height, Color: Integer);
     83procedure VDarkGradient(ca: TCanvas; X, Y, Height, Kind: Integer);
    8484procedure UnderlinedTitleValue(Canvas: TCanvas; Title, Value: string; X, Y, Width: Integer);
    85 procedure NumberBar(dst: TBitmap; x, y: integer; Cap: string; val: integer;
     85procedure NumberBar(dst: TBitmap; X, Y: Integer; Cap: string; val: Integer;
    8686  T: TTexture);
    87 procedure CountBar(dst: TBitmap; x, y, w: integer; Kind: integer;
    88   Cap: string; val: integer; T: TTexture);
    89 procedure PaintProgressBar(ca: TCanvas; Kind, x, y, pos, Growth, max: integer;
     87procedure CountBar(dst: TBitmap; X, Y, W: Integer; Kind: Integer;
     88  Cap: string; val: Integer; T: TTexture);
     89procedure PaintProgressBar(ca: TCanvas; Kind, X, Y, Pos, Growth, Max: Integer;
    9090  T: TTexture);
    9191procedure PaintRelativeProgressBar(ca: TCanvas;
    92   Kind, x, y, size, pos, Growth, max: integer; IndicateComplete: boolean;
     92  Kind, X, Y, size, Pos, Growth, Max: Integer; IndicateComplete: Boolean;
    9393  T: TTexture);
    94 procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: integer);
     94procedure PaintLogo(Canvas: TCanvas; X, Y, LightColor, ShadeColor: Integer);
    9595procedure LoadPhrases;
    9696procedure Texturize(Dest, Texture: TBitmap; TransparentColor: Cardinal);
     
    204204  {$IFDEF WINDOWS}
    205205  StartResolution: TDeviceMode;
    206   ResolutionChanged: boolean;
     206  ResolutionChanged: Boolean;
    207207  {$ENDIF}
    208208
     
    210210
    211211{$IFDEF WINDOWS}
    212 function ChangeResolution(x, y, bpp, freq: integer): boolean;
     212function ChangeResolution(X, Y, bpp, freq: Integer): Boolean;
    213213var
    214214  DevMode: TDeviceMode;
     
    217217  DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or DM_BITSPERPEL or
    218218    DM_DISPLAYFREQUENCY;
    219   DevMode.dmPelsWidth := x;
    220   DevMode.dmPelsHeight := y;
     219  DevMode.dmPelsWidth := X;
     220  DevMode.dmPelsHeight := Y;
    221221  DevMode.dmBitsPerPel := bpp;
    222222  DevMode.dmDisplayFrequency := freq;
     
    318318end;
    319319
    320 procedure BtnFrame(ca: TCanvas; p: TRect; T: TTexture);
    321 begin
    322   RFrame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, T.ColorBevelShade,
     320procedure BtnFrame(ca: TCanvas; P: TRect; T: TTexture);
     321begin
     322  RFrame(ca, P.Left - 1, P.Top - 1, P.Right, P.Bottom, T.ColorBevelShade,
    323323    T.ColorBevelLight);
    324324end;
    325325
    326 procedure EditFrame(ca: TCanvas; p: TRect; T: TTexture);
    327 begin
    328   Frame(ca, p.Left - 1, p.Top - 1, p.Right, p.Bottom, $000000, $000000);
    329   Frame(ca, p.Left - 2, p.Top - 2, p.Right + 1, p.Bottom + 1, $000000, $000000);
    330   Frame(ca, p.Left - 3, p.Top - 3, p.Right + 2, p.Bottom + 1, $000000, $000000);
    331   RFrame(ca, p.Left - 4, p.Top - 4, p.Right + 3, p.Bottom + 2, T.ColorBevelShade,
     326procedure EditFrame(ca: TCanvas; P: TRect; T: TTexture);
     327begin
     328  Frame(ca, P.Left - 1, P.Top - 1, P.Right, P.Bottom, $000000, $000000);
     329  Frame(ca, P.Left - 2, P.Top - 2, P.Right + 1, P.Bottom + 1, $000000, $000000);
     330  Frame(ca, P.Left - 3, P.Top - 3, P.Right + 2, P.Bottom + 1, $000000, $000000);
     331  RFrame(ca, P.Left - 4, P.Top - 4, P.Right + 3, P.Bottom + 2, T.ColorBevelShade,
    332332    T.ColorBevelLight);
    333333end;
     
    335335function HexCharToInt(X: Char): Integer;
    336336begin
    337   case x of
     337  case X of
    338338    '0' .. '9': Result := Ord(X) - Ord('0');
    339339    'A' .. 'F': Result := Ord(X) - Ord('A') + 10;
     
    492492function LoadGraphicSet(const Name: string; Transparency: Boolean = True): TGraphicSet;
    493493var
    494   x: Integer;
    495   y: Integer;
     494  X: Integer;
     495  Y: Integer;
    496496  OriginalColor: Integer;
    497497  FileName: string;
     
    522522      DataPixel := PixelPointer(Result.Data);
    523523      MaskPixel := PixelPointer(Result.Mask);
    524       for y := 0 to ScaleToNative(Result.Data.Height) - 1 do begin
    525         for x := 0 to ScaleToNative(Result.Data.Width) - 1 do begin
     524      for Y := 0 to ScaleToNative(Result.Data.Height) - 1 do begin
     525        for X := 0 to ScaleToNative(Result.Data.Width) - 1 do begin
    526526          OriginalColor := DataPixel.Pixel^.ARGB and $FFFFFF;
    527527          if (OriginalColor = TransparentColor1) or (OriginalColor = TransparentColor2) then begin
     
    552552end;
    553553
    554 procedure Dump(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     554procedure Dump(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    555555begin
    556556  BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height,
     
    650650    Height := ScaleToNative(dst.Height) - yDst;
    651651  if (Width < 0) or (Height < 0) then
    652     exit;
     652    Exit;
    653653
    654654  dst.BeginUpdate;
     
    659659    for X := 0 to Width - 1 do  begin
    660660      Brightness := PixelSrc.Pixel^.B; // One byte for 8-bit color
    661       test := (PixelDst.Pixel^.R * Brightness) shr 7;
    662       if test >= 256 then
     661      Test := (PixelDst.Pixel^.R * Brightness) shr 7;
     662      if Test >= 256 then
    663663        PixelDst.Pixel^.R := 255
    664664      else
    665         PixelDst.Pixel^.R := test; // Red
    666       test := (PixelDst.Pixel^.G * Brightness) shr 7;
    667       if test >= 256 then
     665        PixelDst.Pixel^.R := Test; // Red
     666      Test := (PixelDst.Pixel^.G * Brightness) shr 7;
     667      if Test >= 256 then
    668668        PixelDst.Pixel^.G := 255
    669669      else
    670         PixelDst.Pixel^.G := test; // Green
    671       test := (PixelDst.Pixel^.B * Brightness) shr 7;
    672       if test >= 256 then
     670        PixelDst.Pixel^.G := Test; // Green
     671      Test := (PixelDst.Pixel^.B * Brightness) shr 7;
     672      if Test >= 256 then
    673673        PixelDst.Pixel^.R := 255
    674674      else
     
    716716    Height := ScaleToNative(dst.Height) - yDst;
    717717  if (Width < 0) or (Height < 0) then
    718     exit;
     718    Exit;
    719719
    720720  Src.BeginUpdate;
     
    765765// R channel = Color2 amp
    766766var
    767   ix, iy, amp0, amp1, trans, Value: integer;
     767  ix, iy, amp0, amp1, trans, Value: Integer;
    768768  SrcPixel: TPixelPointer;
    769769  DstPixel: TPixelPointer;
     
    807807end;
    808808
    809 procedure ImageOp_CCC(bmp: TBitmap; x, y, Width, Height, Color0, Color1, Color2: Integer);
     809procedure ImageOp_CCC(bmp: TBitmap; X, Y, Width, Height, Color0, Color1, Color2: Integer);
    810810// Bmp is template
    811811// B channel = Color0 amp, 128=original brightness
     
    813813// R channel = Color2 amp, 128=original brightness
    814814var
    815   i, Red, Green: Integer;
     815  I, Red, Green: Integer;
    816816  PixelPtr: TPixelPointer;
    817817begin
     
    821821  Height := ScaleToNative(Height);
    822822  bmp.BeginUpdate;
    823   assert(bmp.PixelFormat = pf24bit);
    824   Height := y + Height;
    825   PixelPtr := PixelPointer(Bmp, x, y);
    826   while y < Height do begin
    827     for i := 0 to Width - 1 do begin
     823  Assert(bmp.PixelFormat = pf24bit);
     824  Height := Y + Height;
     825  PixelPtr := PixelPointer(Bmp, X, Y);
     826  while Y < Height do begin
     827    for I := 0 to Width - 1 do begin
    828828      Red := ((PixelPtr.Pixel^.B * (Color0 and $0000FF) + PixelPtr.Pixel^.G *
    829829        (Color1 and $0000FF) + PixelPtr.Pixel^.R * (Color2 and $0000FF)) shr 8) and $ff;
     
    838838      PixelPtr.NextPixel;
    839839    end;
    840     Inc(y);
     840    Inc(Y);
    841841    PixelPtr.NextLine;
    842842  end;
     
    844844end;
    845845
    846 procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     846procedure Sprite(Canvas: TCanvas; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    847847begin
    848848  BitBltCanvas(Canvas, xDst, yDst, Width, Height,
     
    852852end;
    853853
    854 procedure Sprite(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
     854procedure Sprite(dst: TBitmap; HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: Integer);
    855855begin
    856856  BitBltCanvas(dst.Canvas, xDst, yDst, Width, Height,
     
    890890end;
    891891
    892 procedure SLine(ca: TCanvas; x0, x1, y: integer; cl: TColor);
     892procedure SLine(ca: TCanvas; x0, x1, Y: Integer; cl: TColor);
    893893begin
    894894  with ca do begin
    895895    Pen.Color := cl;
    896     MoveTo(x0, y);
    897     LineTo(x1 + 1, y);
    898   end;
    899 end;
    900 
    901 procedure DLine(ca: TCanvas; x0, x1, y: integer; cl0, cl1: TColor);
     896    MoveTo(x0, Y);
     897    LineTo(x1 + 1, Y);
     898  end;
     899end;
     900
     901procedure DLine(ca: TCanvas; x0, x1, Y: Integer; cl0, cl1: TColor);
    902902begin
    903903  with ca do begin
    904904    Pen.Color := cl0;
    905     MoveTo(x0, y);
    906     LineTo(x1, y);
     905    MoveTo(x0, Y);
     906    LineTo(x1, Y);
    907907    Pen.Color := cl1;
    908     MoveTo(x0 + 1, y + 1);
    909     LineTo(x1 + 1, y + 1);
    910     Pixels[x0, y + 1] := cl0;
    911     Pixels[x1, y] := cl1;
    912   end;
    913 end;
    914 
    915 procedure Frame(ca: TCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
     908    MoveTo(x0 + 1, Y + 1);
     909    LineTo(x1 + 1, Y + 1);
     910    Pixels[x0, Y + 1] := cl0;
     911    Pixels[x1, Y] := cl1;
     912  end;
     913end;
     914
     915procedure Frame(ca: TCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
    916916begin
    917917  with ca do begin
     
    926926end;
    927927
    928 procedure RFrame(ca: TCanvas; x0, y0, x1, y1: integer; cl0, cl1: TColor);
     928procedure RFrame(ca: TCanvas; x0, y0, x1, y1: Integer; cl0, cl1: TColor);
    929929begin
    930930  with ca do begin
     
    942942end;
    943943
    944 procedure CFrame(ca: TCanvas; x0, y0, x1, y1, Corner: integer; cl: TColor);
     944procedure CFrame(ca: TCanvas; x0, y0, x1, y1, Corner: Integer; cl: TColor);
    945945begin
    946946  with ca do begin
     
    962962
    963963procedure FrameImage(ca: TCanvas; Src: TBitmap;
    964   x, y, Width, Height, xSrc, ySrc: integer; IsControl: boolean = False);
     964  X, Y, Width, Height, xSrc, ySrc: Integer; IsControl: Boolean = False);
    965965begin
    966966  if IsControl then begin
    967     Frame(ca, x - 1, y - 1, x + Width, y + Height, $B0B0B0, $FFFFFF);
    968     RFrame(ca, x - 2, y - 2, x + Width + 1, y + Height + 1, $FFFFFF, $B0B0B0);
     967    Frame(ca, X - 1, Y - 1, X + Width, Y + Height, $B0B0B0, $FFFFFF);
     968    RFrame(ca, X - 2, Y - 2, X + Width + 1, Y + Height + 1, $FFFFFF, $B0B0B0);
    969969  end else
    970     Frame(ca, x - 1, y - 1, x + Width, y + Height, $000000, $000000);
    971   BitBltCanvas(ca, x, y, Width, Height, Src.Canvas, xSrc, ySrc);
     970    Frame(ca, X - 1, Y - 1, X + Width, Y + Height, $000000, $000000);
     971  BitBltCanvas(ca, X, Y, Width, Height, Src.Canvas, xSrc, ySrc);
    972972end;
    973973
    974974procedure GlowFrame(Dst: TBitmap; x0, y0, Width, Height: Integer; cl: TColor);
    975975var
    976   x, y, ch, r: Integer;
     976  X, Y, ch, R: Integer;
    977977  DstPtr: TPixelPointer;
    978978  DpiGlowRange: Integer;
     
    985985  Dst.BeginUpdate;
    986986  DstPtr := PixelPointer(Dst, x0 - DpiGlowRange + 1, y0 - DpiGlowRange + 1);
    987   for y := -DpiGlowRange + 1 to Height - 1 + DpiGlowRange - 1 do begin
    988     for x := -DpiGlowRange + 1 to Width - 1 + DpiGlowRange - 1 do begin
    989       if x < 0 then
    990         if y < 0 then
    991           r := round(sqrt(sqr(x) + sqr(y)))
    992         else if y >= Height then
    993           r := round(sqrt(sqr(x) + sqr(y - (Height - 1))))
     987  for Y := -DpiGlowRange + 1 to Height - 1 + DpiGlowRange - 1 do begin
     988    for X := -DpiGlowRange + 1 to Width - 1 + DpiGlowRange - 1 do begin
     989      if X < 0 then
     990        if Y < 0 then
     991          R := round(sqrt(sqr(X) + sqr(Y)))
     992        else if Y >= Height then
     993          R := round(sqrt(sqr(X) + sqr(Y - (Height - 1))))
    994994        else
    995           r := -x
    996       else if x >= Width then
    997         if y < 0 then
    998           r := round(sqrt(sqr(x - (Width - 1)) + sqr(y)))
    999         else if y >= Height then
    1000           r := round(sqrt(sqr(x - (Width - 1)) + sqr(y - (Height - 1))))
     995          R := -X
     996      else if X >= Width then
     997        if Y < 0 then
     998          R := round(sqrt(sqr(X - (Width - 1)) + sqr(Y)))
     999        else if Y >= Height then
     1000          R := round(sqrt(sqr(X - (Width - 1)) + sqr(Y - (Height - 1))))
    10011001        else
    1002           r := x - (Width - 1)
    1003       else if y < 0 then
    1004         r := -y
    1005       else if y >= Height then
    1006         r := y - (Height - 1)
     1002          R := X - (Width - 1)
     1003      else if Y < 0 then
     1004        R := -Y
     1005      else if Y >= Height then
     1006        R := Y - (Height - 1)
    10071007      else begin
    10081008        DstPtr.NextPixel;
    10091009        continue;
    10101010      end;
    1011       if r = 0 then
    1012         r := 1;
    1013       if r < DpiGlowRange then
     1011      if R = 0 then
     1012        R := 1;
     1013      if R < DpiGlowRange then
    10141014        for ch := 0 to 2 do
    10151015          DstPtr.Pixel^.Planes[2 - ch] :=
    1016             (DstPtr.Pixel^.Planes[2 - ch] * (r - 1) + (cl shr (8 * ch) and $FF) *
    1017             (DpiGlowRange - r)) div (DpiGlowRange - 1);
     1016            (DstPtr.Pixel^.Planes[2 - ch] * (R - 1) + (cl shr (8 * ch) and $FF) *
     1017            (DpiGlowRange - R)) div (DpiGlowRange - 1);
    10181018      DstPtr.NextPixel;
    10191019    end;
     
    10651065procedure InitCityMark(T: TTexture);
    10661066var
    1067   x: Integer;
    1068   y: Integer;
     1067  X: Integer;
     1068  Y: Integer;
    10691069  Intensity: Integer;
    10701070begin
    1071   for x := 0 to CityMark1.Width - 1 do begin
    1072     for y := 0 to CityMark1.Height - 1 do begin
    1073       if HGrSystem.Mask.Canvas.Pixels[CityMark1.Left + x, CityMark1.Top + y] = 0 then
     1071  for X := 0 to CityMark1.Width - 1 do begin
     1072    for Y := 0 to CityMark1.Height - 1 do begin
     1073      if HGrSystem.Mask.Canvas.Pixels[CityMark1.Left + X, CityMark1.Top + Y] = 0 then
    10741074      begin
    10751075        Intensity := HGrSystem.Data.Canvas.Pixels[CityMark1.Left +
    1076           x, CityMark1.Top + y] and $FF;
    1077         HGrSystem.Data.Canvas.Pixels[CityMark2.Left + x, CityMark2.Top + y] :=
     1076          X, CityMark1.Top + Y] and $FF;
     1077        HGrSystem.Data.Canvas.Pixels[CityMark2.Left + X, CityMark2.Top + Y] :=
    10781078          T.ColorMark and $FF * Intensity div $FF + T.ColorMark shr 8 and
    10791079          $FF * Intensity div $FF shl 8 + T.ColorMark shr 16 and
     
    11031103  function Band(I: Integer): Integer;
    11041104  var
    1105     n: integer;
     1105    N: Integer;
    11061106  begin
    1107     n := ((MainTexture.Height div 2) div (y1 - y0)) * 2;
     1107    N := ((MainTexture.Height div 2) div (y1 - y0)) * 2;
    11081108    while MainTexture.Height div 2 + (I + 1) * (y1 - y0) > MainTexture.Height do
    1109       Dec(I, n);
     1109      Dec(I, N);
    11101110    while MainTexture.Height div 2 + I * (y1 - y0) < 0 do
    1111       Inc(I, n);
     1111      Inc(I, N);
    11121112    Result := I;
    11131113  end;
     
    11371137  const Texture: TBitmap);
    11381138var
    1139   x, y, x0cut, y0cut, x1cut, y1cut: Integer;
     1139  X, Y, x0cut, y0cut, x1cut, y1cut: Integer;
    11401140begin
    11411141  while xOffset < 0 do
     
    11431143  while yOffset < 0 do
    11441144    Inc(yOffset, Texture.Height);
    1145   for y := (Top + yOffset) div Texture.Height to (Top + yOffset + Height - 1) div
     1145  for Y := (Top + yOffset) div Texture.Height to (Top + yOffset + Height - 1) div
    11461146    Texture.Height do
    11471147  begin
    1148     y0cut := Top + yOffset - y * Texture.Height;
     1148    y0cut := Top + yOffset - Y * Texture.Height;
    11491149    if y0cut < 0 then
    11501150      y0cut := 0;
    1151     y1cut := (y + 1) * Texture.Height - (Top + yOffset + Height);
     1151    y1cut := (Y + 1) * Texture.Height - (Top + yOffset + Height);
    11521152    if y1cut < 0 then
    11531153      y1cut := 0;
    1154     for x := (Left + xOffset) div Texture.Width to (Left + xOffset + Width - 1) div
     1154    for X := (Left + xOffset) div Texture.Width to (Left + xOffset + Width - 1) div
    11551155      Texture.Width do
    11561156    begin
    1157       x0cut := Left + xOffset - x * Texture.Width;
     1157      x0cut := Left + xOffset - X * Texture.Width;
    11581158      if x0cut < 0 then
    11591159        x0cut := 0;
    1160       x1cut := (x + 1) * Texture.Width - (Left + xOffset + Width);
     1160      x1cut := (X + 1) * Texture.Width - (Left + xOffset + Width);
    11611161      if x1cut < 0 then
    11621162        x1cut := 0;
    1163       BitBltCanvas(ca, x * Texture.Width + x0cut - xOffset,
    1164         y * Texture.Height + y0cut - yOffset, Texture.Width - x0cut - x1cut,
     1163      BitBltCanvas(ca, X * Texture.Width + x0cut - xOffset,
     1164        Y * Texture.Height + y0cut - yOffset, Texture.Width - x0cut - x1cut,
    11651165        Texture.Height - y0cut - y1cut, Texture.Canvas, x0cut, y0cut);
    11661166    end;
     
    11801180end;
    11811181
    1182 procedure Corner(ca: TCanvas; x, y, Kind: Integer; T: TTexture);
     1182procedure Corner(ca: TCanvas; X, Y, Kind: Integer; T: TTexture);
    11831183begin
    11841184  { BitBltCanvas(ca,x,y,8,8,T.HGr.Mask.Canvas,
    11851185    T.xGr+29+Kind*9,T.yGr+89,SRCAND);
    1186     BitBltCanvas(ca,x,y,8,8,T.HGr.Data.Canvas,
     1186    BitBltCanvas(ca,X,Y,8,8,T.HGr.Data.Canvas,
    11871187    T.xGr+29+Kind*9,T.yGr+89,SRCPAINT); }
    11881188end;
    11891189
    1190 procedure BiColorTextOut(ca: TCanvas; clMain, clBack: TColor; x, y: Integer; s: string);
    1191 
    1192   procedure PaintIcon(x, y, Kind: Integer);
     1190procedure BiColorTextOut(ca: TCanvas; clMain, clBack: TColor; X, Y: Integer; S: string);
     1191
     1192  procedure PaintIcon(X, Y, Kind: Integer);
    11931193  begin
    1194     BitBltCanvas(ca, x, y + 6, 10, 10, HGrSystem.Mask.Canvas,
     1194    BitBltCanvas(ca, X, Y + 6, 10, 10, HGrSystem.Mask.Canvas,
    11951195      66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCAND);
    1196     BitBltCanvas(ca, x, y + 6, 10, 10, HGrSystem.Data.Canvas,
     1196    BitBltCanvas(ca, X, Y + 6, 10, 10, HGrSystem.Data.Canvas,
    11971197      66 + Kind mod 11 * 11, 115 + Kind div 11 * 11, SRCPAINT);
    11981198  end;
    11991199
    12001200var
    1201   p, xp: Integer;
     1201  P, xp: Integer;
    12021202  sp: string;
    12031203  shadow: Boolean;
    12041204  Text: string;
    12051205begin
    1206   Inc(x);
    1207   Inc(y);
     1206  Inc(X);
     1207  Inc(Y);
    12081208  for shadow := True downto False do
    12091209    with ca do
     
    12141214        else
    12151215          Font.Color := clMain;
    1216         sp := s;
    1217         xp := x;
     1216        sp := S;
     1217        xp := X;
    12181218        repeat
    1219           p := pos('%', sp);
    1220           if (p = 0) or (p + 1 > Length(sp)) or not
    1221             (sp[p + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w']) then
     1219          P := Pos('%', sp);
     1220          if (P = 0) or (P + 1 > Length(sp)) or not
     1221            (sp[P + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w']) then
    12221222          begin
    1223             ca.Textout(xp, y, sp);
     1223            ca.Textout(xp, Y, sp);
    12241224            Break;
    12251225          end
    12261226          else
    12271227          begin
    1228             Text := Copy(sp, 1, p - 1);
    1229             Textout(xp, y, Text);
     1228            Text := Copy(sp, 1, P - 1);
     1229            Textout(xp, Y, Text);
    12301230            Inc(xp, ca.TextWidth(Text));
    12311231            if not shadow then
    1232               case sp[p + 1] of
    1233                 'c': PaintIcon(xp + 1, y, 6);
    1234                 'f': PaintIcon(xp + 1, y, 0);
    1235                 'l': PaintIcon(xp + 1, y, 8);
    1236                 'm': PaintIcon(xp + 1, y, 17);
    1237                 'n': PaintIcon(xp + 1, y, 7);
    1238                 'o': PaintIcon(xp + 1, y, 16);
    1239                 'p': PaintIcon(xp + 1, y, 2);
    1240                 'r': PaintIcon(xp + 1, y, 12);
    1241                 't': PaintIcon(xp + 1, y, 4);
    1242                 'w': PaintIcon(xp + 1, y, 13);
     1232              case sp[P + 1] of
     1233                'c': PaintIcon(xp + 1, Y, 6);
     1234                'f': PaintIcon(xp + 1, Y, 0);
     1235                'l': PaintIcon(xp + 1, Y, 8);
     1236                'm': PaintIcon(xp + 1, Y, 17);
     1237                'n': PaintIcon(xp + 1, Y, 7);
     1238                'o': PaintIcon(xp + 1, Y, 16);
     1239                'p': PaintIcon(xp + 1, Y, 2);
     1240                'r': PaintIcon(xp + 1, Y, 12);
     1241                't': PaintIcon(xp + 1, Y, 4);
     1242                'w': PaintIcon(xp + 1, Y, 13);
    12431243              end;
    12441244            Inc(xp, 10);
    1245             Delete(sp, 1, p + 1);
     1245            Delete(sp, 1, P + 1);
    12461246          end;
    12471247        until False;
    1248         Dec(x);
    1249         Dec(y);
     1248        Dec(X);
     1249        Dec(Y);
    12501250      end;
    12511251end;
    12521252
    1253 function BiColorTextWidth(ca: TCanvas; s: string): Integer;
     1253function BiColorTextWidth(ca: TCanvas; S: string): Integer;
    12541254var
    12551255  P: Integer;
     
    12571257  Result := 1;
    12581258  repeat
    1259     P := Pos('%', s);
    1260     if (P = 0) or (P = Length(s)) then
     1259    P := Pos('%', S);
     1260    if (P = 0) or (P = Length(S)) then
    12611261    begin
    1262       Inc(Result, ca.TextWidth(s));
     1262      Inc(Result, ca.TextWidth(S));
    12631263      Break;
    12641264    end
    12651265    else
    12661266    begin
    1267       if not (s[P + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w'])
     1267      if not (S[P + 1] in ['c', 'f', 'l', 'm', 'n', 'o', 'p', 'r', 't', 'w'])
    12681268      then
    1269         Inc(Result, ca.TextWidth(copy(s, 1, P + 1)))
     1269        Inc(Result, ca.TextWidth(Copy(S, 1, P + 1)))
    12701270      else
    1271         Inc(Result, ca.TextWidth(copy(s, 1, P - 1)) + 10);
    1272       Delete(s, 1, P + 1);
     1271        Inc(Result, ca.TextWidth(Copy(S, 1, P - 1)) + 10);
     1272      Delete(S, 1, P + 1);
    12731273    end;
    12741274  until False;
     
    12761276
    12771277procedure LoweredTextOut(ca: TCanvas; cl: TColor; T: TTexture;
    1278   x, y: Integer; s: string);
     1278  X, Y: Integer; S: string);
    12791279begin
    12801280  if cl = -2 then
    12811281    BiColorTextOut(ca, (T.ColorBevelShade and $FEFEFE) shr 1,
    1282       T.ColorBevelLight, x, y, s)
     1282      T.ColorBevelLight, X, Y, S)
    12831283  else if cl < 0 then
    1284     BiColorTextOut(ca, T.ColorTextShade, T.ColorTextLight, x, y, s)
     1284    BiColorTextOut(ca, T.ColorTextShade, T.ColorTextLight, X, Y, S)
    12851285  else
    1286     BiColorTextOut(ca, cl, T.ColorTextLight, x, y, s);
    1287 end;
    1288 
    1289 procedure RisedTextOut(ca: TCanvas; x, y: integer; s: string);
    1290 begin
    1291   BiColorTextOut(ca, $FFFFFF, $000000, x, y, s);
    1292 end;
    1293 
    1294 procedure Gradient(ca: TCanvas; x, y, dx, dy, Width, Height, Color: Integer;
    1295   Brightness: array of integer);
    1296 var
    1297   i, r, g, b: Integer;
    1298 begin
    1299   for i := 0 to Length(Brightness) - 1 do begin // gradient
    1300     r := Color and $FF + Brightness[i];
    1301     if r < 0 then
    1302       r := 0
    1303     else if r >= 256 then
    1304       r := 255;
    1305     g := Color shr 8 and $FF + Brightness[i];
    1306     if g < 0 then
    1307       g := 0
    1308     else if g >= 256 then
    1309       g := 255;
    1310     b := Color shr 16 and $FF + Brightness[i];
    1311     if b < 0 then
    1312       b := 0
    1313     else if b >= 256 then
    1314       b := 255;
    1315     ca.Pen.Color := r + g shl 8 + b shl 16;
    1316     ca.MoveTo(x + dx * i, y + dy * i);
    1317     ca.LineTo(x + dx * i + Width, y + dy * i + Height);
     1286    BiColorTextOut(ca, cl, T.ColorTextLight, X, Y, S);
     1287end;
     1288
     1289procedure RisedTextOut(ca: TCanvas; X, Y: Integer; S: string);
     1290begin
     1291  BiColorTextOut(ca, $FFFFFF, $000000, X, Y, S);
     1292end;
     1293
     1294procedure Gradient(ca: TCanvas; X, Y, dx, dy, Width, Height, Color: Integer;
     1295  Brightness: array of Integer);
     1296var
     1297  I, R, G, B: Integer;
     1298begin
     1299  for I := 0 to Length(Brightness) - 1 do begin // gradient
     1300    R := Color and $FF + Brightness[I];
     1301    if R < 0 then
     1302      R := 0
     1303    else if R >= 256 then
     1304      R := 255;
     1305    G := Color shr 8 and $FF + Brightness[I];
     1306    if G < 0 then
     1307      G := 0
     1308    else if G >= 256 then
     1309      G := 255;
     1310    B := Color shr 16 and $FF + Brightness[I];
     1311    if B < 0 then
     1312      B := 0
     1313    else if B >= 256 then
     1314      B := 255;
     1315    ca.Pen.Color := R + G shl 8 + B shl 16;
     1316    ca.MoveTo(X + dx * I, Y + dy * I);
     1317    ca.LineTo(X + dx * I + Width, Y + dy * I + Height);
    13181318  end;
    13191319  ca.Pen.Color := $000000;
    1320   ca.MoveTo(x + 1, y + 16 * dy + Height);
    1321   ca.LineTo(x + 16 * dx + Width, y + 16 * dy + Height);
    1322   ca.LineTo(x + 16 * dx + Width, y);
    1323 end;
    1324 
    1325 procedure LightGradient(ca: TCanvas; x, y, Width, Color: Integer);
     1320  ca.MoveTo(X + 1, Y + 16 * dy + Height);
     1321  ca.LineTo(X + 16 * dx + Width, Y + 16 * dy + Height);
     1322  ca.LineTo(X + 16 * dx + Width, Y);
     1323end;
     1324
     1325procedure LightGradient(ca: TCanvas; X, Y, Width, Color: Integer);
    13261326const
    1327   Brightness: array [0 .. 15] of integer =
     1327  Brightness: array [0 .. 15] of Integer =
    13281328    (16, 12, 8, 4, 0, -4, -8, -12, -16, -20, -24, -28, -32, -36, -40, -44);
    13291329begin
    1330   Gradient(ca, x, y, 0, 1, Width, 0, Color, Brightness);
    1331 end;
    1332 
    1333 procedure DarkGradient(ca: TCanvas; x, y, Width, Kind: Integer);
     1330  Gradient(ca, X, Y, 0, 1, Width, 0, Color, Brightness);
     1331end;
     1332
     1333procedure DarkGradient(ca: TCanvas; X, Y, Width, Kind: Integer);
    13341334const
    1335   Brightness: array [0 .. 15] of integer =
     1335  Brightness: array [0 .. 15] of Integer =
    13361336    (16, 12, 8, 4, 0, -4, -8, -12 - 24, -16 + 16, -20, -24, -28, -32, -36, -40, -44);
    13371337begin
    1338   Gradient(ca, x, y, 0, 1, Width, 0, HGrSystem.Data.Canvas.Pixels
     1338  Gradient(ca, X, Y, 0, 1, Width, 0, HGrSystem.Data.Canvas.Pixels
    13391339    [187, 137 + Kind], Brightness);
    13401340end;
    13411341
    1342 procedure VLightGradient(ca: TCanvas; x, y, Height, Color: Integer);
     1342procedure VLightGradient(ca: TCanvas; X, Y, Height, Color: Integer);
    13431343const
    1344   Brightness: array [0 .. 15] of integer =
     1344  Brightness: array [0 .. 15] of Integer =
    13451345    (16, 12, 8, 4, 0, -4, -8, -12, -16, -20, -24, -28, -32, -36, -40, -44);
    13461346begin
    1347   Gradient(ca, x, y, 1, 0, 0, Height, Color, Brightness);
    1348 end;
    1349 
    1350 procedure VDarkGradient(ca: TCanvas; x, y, Height, Kind: Integer);
     1347  Gradient(ca, X, Y, 1, 0, 0, Height, Color, Brightness);
     1348end;
     1349
     1350procedure VDarkGradient(ca: TCanvas; X, Y, Height, Kind: Integer);
    13511351const
    1352   Brightness: array [0 .. 15] of integer =
     1352  Brightness: array [0 .. 15] of Integer =
    13531353    (16, 12, 8, 4, 0, -4, -8, -12 - 24, -16 + 16, -20, -24, -28, -32, -36, -40, -44);
    13541354begin
    1355   Gradient(ca, x, y, 1, 0, 0, Height,
     1355  Gradient(ca, X, Y, 1, 0, 0, Height,
    13561356    HGrSystem.Data.Canvas.Pixels[187, 137 + Kind], Brightness);
    13571357end;
     
    13641364end;
    13651365
    1366 procedure NumberBar(dst: TBitmap; x, y: integer; Cap: string;
     1366procedure NumberBar(dst: TBitmap; X, Y: Integer; Cap: string;
    13671367  val: Integer; T: TTexture);
    13681368var
    1369   s: string;
     1369  S: string;
    13701370begin
    13711371  if val > 0 then
    13721372  begin
    1373     DLine(dst.Canvas, x - 2, x + 170, y + 16, T.ColorBevelShade,
     1373    DLine(dst.Canvas, X - 2, X + 170, Y + 16, T.ColorBevelShade,
    13741374      T.ColorBevelLight);
    1375     LoweredTextOut(dst.Canvas, -1, T, x - 2, y, Cap);
    1376     s := IntToStr(val);
    1377     RisedTextOut(dst.Canvas, x + 170 - BiColorTextWidth(dst.Canvas,
    1378       s), y, s);
    1379   end;
    1380 end;
    1381 
    1382 procedure CountBar(dst: TBitmap; x, y, w: Integer; Kind: Integer;
     1375    LoweredTextOut(dst.Canvas, -1, T, X - 2, Y, Cap);
     1376    S := IntToStr(val);
     1377    RisedTextOut(dst.Canvas, X + 170 - BiColorTextWidth(dst.Canvas,
     1378      S), Y, S);
     1379  end;
     1380end;
     1381
     1382procedure CountBar(dst: TBitmap; X, Y, W: Integer; Kind: Integer;
    13831383  Cap: string; val: Integer; T: TTexture);
    13841384var
    1385   i, sd, ld, cl, xIcon, yIcon: Integer;
    1386   s: string;
     1385  I, sd, ld, cl, xIcon, yIcon: Integer;
     1386  S: string;
    13871387begin
    13881388  // val:=random(40); //!!!
     
    13961396    // DLine(dst.Canvas,x-2,x+170+32,y+16,T.ColorBevelShade,T.ColorBevelLight);
    13971397
    1398     xIcon := x - 5;
    1399     yIcon := y + 15;
    1400     DLine(dst.Canvas, x - 2, xIcon + w + 2, yIcon + 16, T.ColorBevelShade,
     1398    xIcon := X - 5;
     1399    yIcon := Y + 15;
     1400    DLine(dst.Canvas, X - 2, xIcon + W + 2, yIcon + 16, T.ColorBevelShade,
    14011401      T.ColorBevelLight);
    14021402
    1403     s := IntToStr(val);
     1403    S := IntToStr(val);
    14041404    if val < 0 then
    14051405      cl := $0000FF
    14061406    else
    14071407      cl := -1;
    1408     LoweredTextOut(dst.Canvas, cl, T, x - 2, y, Cap);
     1408    LoweredTextOut(dst.Canvas, cl, T, X - 2, Y, Cap);
    14091409    LoweredTextOut(dst.Canvas, cl, T,
    1410       xIcon + w + 2 - BiColorTextWidth(dst.Canvas, s), yIcon, s);
     1410      xIcon + W + 2 - BiColorTextWidth(dst.Canvas, S), yIcon, S);
    14111411
    14121412    if (Kind = 12) and (val >= 100) then
     
    14161416      if sd = 0 then
    14171417        sd := 1;
    1418       if sd < w - 44 then
     1418      if sd < W - 44 then
    14191419        ld := sd
    14201420      else
    1421         ld := w - 44;
    1422       for i := 0 to val mod 10 - 1 do
     1421        ld := W - 44;
     1422      for I := 0 to val mod 10 - 1 do
    14231423      begin
    1424         BitBltCanvas(dst.Canvas, xIcon + 4 + i * (14 * ld div sd), yIcon + 2 + 1, 14,
     1424        BitBltCanvas(dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 2 + 1, 14,
    14251425          14, HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15,
    14261426          70 + Kind div 8 * 15, SRCAND);
    1427         Sprite(dst, HGrSystem, xIcon + 3 + i * (14 * ld div sd), yIcon + 2,
     1427        Sprite(dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2,
    14281428          14, 14, 67 + Kind mod 8 * 15, 70 + Kind div 8 * 15);
    14291429      end;
    1430       for i := 0 to val div 10 - 1 do
     1430      for I := 0 to val div 10 - 1 do
    14311431      begin
    14321432        BitBltCanvas(dst.Canvas, xIcon + 4 + (val mod 10) *
    1433           (14 * ld div sd) + i * (14 * ld div sd), yIcon + 3, 14, 14,
     1433          (14 * ld div sd) + I * (14 * ld div sd), yIcon + 3, 14, 14,
    14341434          HGrSystem.Mask.Canvas, 67 + 7 mod 8 * 15,
    14351435          70 + 7 div 8 * 15, SRCAND);
    14361436        Sprite(dst, HGrSystem, xIcon + 3 + (val mod 10) *
    1437           (14 * ld div sd) + i * (14 * ld div sd), yIcon + 2, 14,
     1437          (14 * ld div sd) + I * (14 * ld div sd), yIcon + 2, 14,
    14381438          14, 67 + 7 mod 8 * 15,
    14391439          70 + 7 div 8 * 15);
     
    14491449      if sd = 0 then
    14501450        sd := 1;
    1451       if sd < w - 44 then
     1451      if sd < W - 44 then
    14521452        ld := sd
    14531453      else
    1454         ld := w - 44;
    1455       for i := 0 to val div 10 - 1 do
     1454        ld := W - 44;
     1455      for I := 0 to val div 10 - 1 do
    14561456      begin
    1457         BitBltCanvas(dst.Canvas, xIcon + 4 + i * (14 * ld div sd), yIcon + 3, 14, 14,
     1457        BitBltCanvas(dst.Canvas, xIcon + 4 + I * (14 * ld div sd), yIcon + 3, 14, 14,
    14581458          HGrSystem.Mask.Canvas, 67 + Kind mod 8 * 15,
    14591459          70 + Kind div 8 * 15, SRCAND);
    1460         Sprite(dst, HGrSystem, xIcon + 3 + i * (14 * ld div sd), yIcon + 2,
     1460        Sprite(dst, HGrSystem, xIcon + 3 + I * (14 * ld div sd), yIcon + 2,
    14611461          14, 14, 67 + Kind mod 8 * 15, 70 + Kind div 8 * 15);
    14621462      end;
    1463       for i := 0 to val mod 10 - 1 do
     1463      for I := 0 to val mod 10 - 1 do
    14641464      begin
    14651465        BitBltCanvas(dst.Canvas, xIcon + 4 + (val div 10) *
    1466           (14 * ld div sd) + i * (10 * ld div sd), yIcon + 7, 10, 10,
     1466          (14 * ld div sd) + I * (10 * ld div sd), yIcon + 7, 10, 10,
    14671467          HGrSystem.Mask.Canvas, 66 + Kind mod 11 * 11,
    14681468          115 + Kind div 11 * 11, SRCAND);
    14691469        Sprite(dst, HGrSystem, xIcon + 3 + (val div 10) *
    1470           (14 * ld div sd) + i * (10 * ld div sd), yIcon + 6, 10,
     1470          (14 * ld div sd) + I * (10 * ld div sd), yIcon + 6, 10,
    14711471          10, 66 + Kind mod 11 * 11,
    14721472          115 + Kind div 11 * 11);
     
    14761476end;
    14771477
    1478 procedure PaintProgressBar(ca: TCanvas; Kind, x, y, pos, Growth, max: Integer;
     1478procedure PaintProgressBar(ca: TCanvas; Kind, X, Y, Pos, Growth, Max: Integer;
    14791479  T: TTexture);
    14801480var
    1481   i: Integer;
    1482 begin
    1483   if pos > max then
    1484     pos := max;
     1481  I: Integer;
     1482begin
     1483  if Pos > Max then
     1484    Pos := Max;
    14851485  if Growth < 0 then
    14861486  begin
    1487     pos := pos + Growth;
    1488     if pos < 0 then
     1487    Pos := Pos + Growth;
     1488    if Pos < 0 then
    14891489    begin
    1490       Growth := Growth - pos;
    1491       pos := 0;
     1490      Growth := Growth - Pos;
     1491      Pos := 0;
    14921492    end;
    14931493  end
    1494   else if pos + Growth > max then
    1495     Growth := max - pos;
    1496   Frame(ca, x - 1, y - 1, x + max, y + 7, $000000, $000000);
    1497   RFrame(ca, x - 2, y - 2, x + max + 1, y + 8, T.ColorBevelShade,
     1494  else if Pos + Growth > Max then
     1495    Growth := Max - Pos;
     1496  Frame(ca, X - 1, Y - 1, X + Max, Y + 7, $000000, $000000);
     1497  RFrame(ca, X - 2, Y - 2, X + Max + 1, Y + 8, T.ColorBevelShade,
    14981498    T.ColorBevelLight);
    14991499  with ca do
    15001500  begin
    1501     for i := 0 to pos div 8 - 1 do
    1502       BitBltCanvas(ca, x + i * 8, y, 8, 7,
     1501    for I := 0 to Pos div 8 - 1 do
     1502      BitBltCanvas(ca, X + I * 8, Y, 8, 7,
    15031503        HGrSystem.Data.Canvas, 104, 9 + 8 * Kind);
    1504     BitBltCanvas(ca, x + 8 * (pos div 8), y, pos - 8 * (pos div 8), 7,
     1504    BitBltCanvas(ca, X + 8 * (Pos div 8), Y, Pos - 8 * (Pos div 8), 7,
    15051505      HGrSystem.Data.Canvas, 104, 9 + 8 * Kind);
    15061506    if Growth > 0 then
    15071507    begin
    1508       for i := 0 to Growth div 8 - 1 do
    1509         BitBltCanvas(ca, x + pos + i * 8, y, 8, 7,
     1508      for I := 0 to Growth div 8 - 1 do
     1509        BitBltCanvas(ca, X + Pos + I * 8, Y, 8, 7,
    15101510          HGrSystem.Data.Canvas, 112, 9 + 8 * Kind);
    1511       BitBltCanvas(ca, x + pos + 8 * (Growth div 8), y,
     1511      BitBltCanvas(ca, X + Pos + 8 * (Growth div 8), Y,
    15121512        Growth - 8 * (Growth div 8), 7, HGrSystem.Data.Canvas,
    15131513        112, 9 + 8 * Kind);
     
    15151515    else if Growth < 0 then
    15161516    begin
    1517       for i := 0 to -Growth div 8 - 1 do
    1518         BitBltCanvas(ca, x + pos + i * 8, y, 8, 7,
     1517      for I := 0 to -Growth div 8 - 1 do
     1518        BitBltCanvas(ca, X + Pos + I * 8, Y, 8, 7,
    15191519          HGrSystem.Data.Canvas, 104, 1);
    1520       BitBltCanvas(ca, x + pos + 8 * (-Growth div 8), y, -Growth -
     1520      BitBltCanvas(ca, X + Pos + 8 * (-Growth div 8), Y, -Growth -
    15211521        8 * (-Growth div 8), 7,
    15221522        HGrSystem.Data.Canvas, 104, 1);
    15231523    end;
    15241524    Brush.Color := $000000;
    1525     FillRect(Rect(x + pos + abs(Growth), y, x + max, y + 7));
     1525    FillRect(Rect(X + Pos + abs(Growth), Y, X + Max, Y + 7));
    15261526    Brush.Style := bsClear;
    15271527  end;
     
    15301530// pos and growth are relative to max, set size independent
    15311531procedure PaintRelativeProgressBar(ca: TCanvas;
    1532   Kind, x, y, size, pos, Growth, max: Integer; IndicateComplete: Boolean;
     1532  Kind, X, Y, size, Pos, Growth, Max: Integer; IndicateComplete: Boolean;
    15331533  T: TTexture);
    15341534begin
    15351535  if Growth > 0 then
    1536     PaintProgressBar(ca, Kind, x, y, pos * size div max,
    1537       (Growth * size + max div 2) div max, size, T)
     1536    PaintProgressBar(ca, Kind, X, Y, Pos * size div Max,
     1537      (Growth * size + Max div 2) div Max, size, T)
    15381538  else
    1539     PaintProgressBar(ca, Kind, x, y, pos * size div max,
    1540       (Growth * size - max div 2) div max, size, T);
    1541   if IndicateComplete and (pos + Growth >= max) then
    1542     Sprite(ca, HGrSystem, x + size - 10, y - 7, 23, 16, 1, 129);
     1539    PaintProgressBar(ca, Kind, X, Y, Pos * size div Max,
     1540      (Growth * size - Max div 2) div Max, size, T);
     1541  if IndicateComplete and (Pos + Growth >= Max) then
     1542    Sprite(ca, HGrSystem, X + size - 10, Y - 7, 23, 16, 1, 129);
    15431543end;
    15441544
     
    16101610procedure DarkenImage(Bitmap: TBitmap; Change: Integer);
    16111611var
    1612   x, y: integer;
     1612  X, Y: Integer;
    16131613  PicturePixel: TPixelPointer;
    16141614begin
    16151615  Bitmap.BeginUpdate;
    16161616  PicturePixel := PixelPointer(Bitmap);
    1617   for y := 0 to ScaleToNative(Bitmap.Height) - 1 do begin
    1618     for x := 0 to ScaleToNative(Bitmap.Width) - 1 do begin
     1617  for Y := 0 to ScaleToNative(Bitmap.Height) - 1 do begin
     1618    for X := 0 to ScaleToNative(Bitmap.Width) - 1 do begin
    16191619      PicturePixel.Pixel^.B := Max(PicturePixel.Pixel^.B - Change, 0);
    16201620      PicturePixel.Pixel^.G := Max(PicturePixel.Pixel^.G - Change, 0);
     
    16621662  Section: TFontType;
    16631663  FontScript: TextFile;
    1664   Size: integer;
     1664  Size: Integer;
    16651665  S: string;
    1666   I: integer;
    1667   P: integer;
     1666  I: Integer;
     1667  P: Integer;
    16681668begin
    16691669  Section := ftNormal;
     
    16721672    Reset(FontScript);
    16731673    while not Eof(FontScript) do begin
    1674       ReadLn(FontScript, s);
    1675       if s <> '' then
    1676         if s[1] = '#' then begin
    1677           s := TrimRight(s);
    1678           if s = '#SMALL' then Section := ftSmall
    1679           else if s = '#TINY' then Section := ftTiny
    1680           else if s = '#CAPTION' then Section := ftCaption
    1681           else if s = '#BUTTON' then Section := ftButton
     1674      ReadLn(FontScript, S);
     1675      if S <> '' then
     1676        if S[1] = '#' then begin
     1677          S := TrimRight(S);
     1678          if S = '#SMALL' then Section := ftSmall
     1679          else if S = '#TINY' then Section := ftTiny
     1680          else if S = '#CAPTION' then Section := ftCaption
     1681          else if S = '#BUTTON' then Section := ftButton
    16821682          else Section := ftNormal;
    16831683        end else begin
    1684           p := Pos(',', s);
    1685           if p > 0 then begin
    1686             UniFont[section].Name := Trim(Copy(s, 1, p - 1));
     1684          P := Pos(',', S);
     1685          if P > 0 then begin
     1686            UniFont[section].Name := Trim(Copy(S, 1, P - 1));
    16871687            Size := 0;
    1688             for i := p + 1 to Length(s) do
    1689               case s[i] of
     1688            for I := P + 1 to Length(S) do
     1689              case S[I] of
    16901690                '0' .. '9':
    1691                   Size := Size * 10 + Byte(s[i]) - 48;
     1691                  Size := Size * 10 + Byte(S[I]) - 48;
    16921692                'B', 'b':
    16931693                  UniFont[section].Style := UniFont[section].Style + [fsBold];
  • trunk/Packages/CevoComponents/Sound.pas

    r424 r447  
    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
  • trunk/Packages/CevoComponents/StringTables.pas

    r300 r447  
    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;
  • trunk/Packages/CevoComponents/UGraphicSet.pas

    r424 r447  
    272272end.
    273273
     274
  • trunk/Packages/CevoComponents/UTexture.pas

    r380 r447  
    9797end.
    9898
     99
  • trunk/Packages/Common/Common.pas

    r396 r447  
    3737  RegisterPackage('Common', @Register);
    3838end.
     39
  • trunk/Packages/Common/StopWatch.pas

    r424 r447  
    3535implementation
    3636
    37 constructor TStopWatch.Create(const startOnCreate : boolean = false) ;
     37constructor TStopWatch.Create(const startOnCreate : Boolean = False) ;
    3838begin
    3939  inherited Create;
     
    7272begin
    7373  dt := ElapsedMiliseconds / MSecsPerSec / SecsPerDay;
    74   result := Format('%d days, %s', [Trunc(dt), FormatDateTime('hh:nn:ss.z', Frac(dt))]) ;
     74  Result := Format('%d days, %s', [Trunc(dt), FormatDateTime('hh:nn:ss.z', Frac(dt))]) ;
    7575end;
    7676
     
    9393
    9494end.
     95
  • trunk/Packages/Common/UAboutDialog.pas

    r424 r447  
    5151end.
    5252
     53
  • trunk/Packages/Common/UCommon.pas

    r424 r447  
    4242  clLightRed = TColor($8080FF);
    4343
    44 function AddLeadingZeroes(const aNumber, Length : integer) : string;
     44function AddLeadingZeroes(const aNumber, Length : Integer) : string;
    4545function BinToInt(BinStr: string): Int64;
    4646function BinToHexString(Source: AnsiString): string;
     
    9696function BinToInt(BinStr : string) : Int64;
    9797var
    98   i : byte;
     98  I : Byte;
    9999  RetVar : Int64;
    100100begin
    101101  BinStr := UpperCase(BinStr);
    102   if BinStr[length(BinStr)] = 'B' then Delete(BinStr,length(BinStr),1);
     102  if BinStr[Length(BinStr)] = 'B' then Delete(BinStr,Length(BinStr),1);
    103103  RetVar := 0;
    104   for i := 1 to length(BinStr) do begin
    105     if not (BinStr[i] in ['0','1']) then begin
     104  for I := 1 to Length(BinStr) do begin
     105    if not (BinStr[I] in ['0','1']) then begin
    106106      RetVar := 0;
    107107      Break;
    108108    end;
    109     RetVar := (RetVar shl 1) + (byte(BinStr[i]) and 1) ;
     109    RetVar := (RetVar shl 1) + (Byte(BinStr[I]) and 1) ;
    110110  end;
    111111
     
    435435end;
    436436
    437 function AddLeadingZeroes(const aNumber, Length : integer) : string;
     437function AddLeadingZeroes(const aNumber, Length : Integer) : string;
    438438begin
    439439  Result := SysUtils.Format('%.*d', [Length, aNumber]) ;
     
    614614  begin
    615615    for J := ReadFrom to Len do
    616       if (S[j] = C) then
     616      if (S[J] = C) then
    617617      begin
    618618        Result := J;
     
    631631    Inc(I);
    632632    APos := ReadUntil(I, '<');
    633     Result := Result + Copy(S, I, APos - i);
     633    Result := Result + Copy(S, I, APos - I);
    634634    I := ReadUntil(APos + 1, '>');
    635635  end;
  • trunk/Packages/Common/UFindFile.pas

    r424 r447  
    66Tired of using FindFirst, Next and Close?
    77Come see how to encapsulate all those functions
    8 in a single "find-files-recursively" component.
     8in A Single "find-files-recursively" component.
    99It's easy to use, free and with code.
    1010
     
    3434  TFindFile = class(TComponent)
    3535  private
    36     s : TStringList;
    37     fSubFolder : boolean;
     36    S : TStringList;
     37    fSubFolder : Boolean;
    3838    fAttr: TFileAttrib;
    3939    fPath : string;
     
    4747  published
    4848    property FileAttr: TFileAttrib read fAttr write fAttr;
    49     property InSubFolders : boolean read fSubFolder write fSubFolder;
     49    property InSubFolders : Boolean read fSubFolder write fSubFolder;
    5050    property Path : string read fPath write SetPath;
    5151    property FileMask : string read fFileMask write fFileMask ;
     
    7979  FileMask := FilterAll;
    8080  FileAttr := [ffaAnyFile];
    81   s := TStringList.Create;
     81  S := TStringList.Create;
    8282end;
    8383
    8484destructor TFindFile.Destroy;
    8585begin
    86   s.Free;
     86  S.Free;
    8787  inherited Destroy;
    8888end;
     
    101101function TFindFile.SearchForFiles: TStringList;
    102102begin
    103   s.Clear;
     103  S.Clear;
    104104  try
    105105    FileSearch(Path);
    106106  finally
    107     Result := s;
     107    Result := S;
    108108  end;
    109109end;
     
    111111procedure TFindFile.FileSearch(const InPath : string);
    112112var Rec  : TSearchRec;
    113     Attr : integer;
     113    Attr : Integer;
    114114begin
    115115  Attr := 0;
     
    125125  try
    126126    repeat
    127       s.Add(inPath + Rec.Name);
     127      S.Add(inPath + Rec.Name);
    128128    until SysUtils.FindNext(Rec) <> 0;
    129129  finally
  • trunk/Packages/Common/UFormAbout.pas

    r423 r447  
    8383end.
    8484
     85
  • trunk/Packages/Common/UGeometric.pas

    r424 r447  
    5252function PointToLineDistance(const P, V, W: TPoint): Integer;
    5353var
    54   l2, t: Double;
     54  l2, T: Double;
    5555  tt: TPoint;
    5656begin
     
    165165end.
    166166
     167
  • trunk/Packages/Common/UJobProgressView.pas

    r424 r447  
    221221      for I := 0 to ListViewJobs.Items.Count - 1 do
    222222      begin
    223         ItemRect := ListViewJobs.Items[i].DisplayRect(drBounds);
     223        ItemRect := ListViewJobs.Items[I].DisplayRect(drBounds);
    224224        Maxh := Max(Maxh, ItemRect.Top + (ItemRect.Bottom - ItemRect.Top));
    225225      end;
  • trunk/Packages/Common/UMetaCanvas.pas

    r424 r447  
    124124    procedure SetWidth(AValue: Integer); override;
    125125    function GetWidth: Integer; override;
    126     procedure DoLine (x1,y1,x2,y2:integer); override;
     126    procedure DoLine (x1,y1,x2,y2:Integer); override;
    127127    procedure DoTextOut(X, Y: Integer; Text: string); override;
    128128    procedure DoRectangle(const Bounds: TRect); override;
     
    451451end;
    452452
    453 procedure TMetaCanvas.DoLine(x1, y1, x2, y2: integer);
     453procedure TMetaCanvas.DoLine(x1, y1, x2, y2: Integer);
    454454var
    455455  NewObj: TCanvasLine;
     
    665665end.
    666666
     667
  • trunk/Packages/Common/UPrefixMultiplier.pas

    r423 r447  
    3030  BasePrefixMultipliers: TPrefixMultiplierDef =
    3131  (
    32     (ShortText: 'y'; FullText: 'yocto'; Value: 1e-24),
    33           (ShortText: 'z'; FullText: 'zepto'; Value: 1e-21),
    34     (ShortText: 'a'; FullText: 'atto'; Value: 1e-18),
    35     (ShortText: 'f'; FullText: 'femto'; Value: 1e-15),
    36     (ShortText: 'p'; FullText: 'piko'; Value: 1e-12),
    37     (ShortText: 'n'; FullText: 'nano'; Value: 1e-9),
    38     (ShortText: 'u'; FullText: 'mikro'; Value: 1e-6),
    39     (ShortText: 'm'; FullText: 'mili'; Value: 1e-3),
     32    (ShortText: 'y'; FullText: 'yocto'; Value: 1E-24),
     33          (ShortText: 'z'; FullText: 'zepto'; Value: 1E-21),
     34    (ShortText: 'a'; FullText: 'atto'; Value: 1E-18),
     35    (ShortText: 'f'; FullText: 'femto'; Value: 1E-15),
     36    (ShortText: 'p'; FullText: 'piko'; Value: 1E-12),
     37    (ShortText: 'n'; FullText: 'nano'; Value: 1E-9),
     38    (ShortText: 'u'; FullText: 'mikro'; Value: 1E-6),
     39    (ShortText: 'm'; FullText: 'mili'; Value: 1E-3),
    4040    (ShortText: ''; FullText: ''; Value: 1e0),
    4141    (ShortText: 'k'; FullText: 'kilo'; Value: 1e3),
     
    5151  TimePrefixMultipliers: TPrefixMultiplierDef =
    5252  (
    53     (ShortText: 'ys'; FullText: 'yocto'; Value: 1e-24),
    54           (ShortText: 'zs'; FullText: 'zepto'; Value: 1e-21),
    55     (ShortText: 'as'; FullText: 'atto'; Value: 1e-18),
    56     (ShortText: 'fs'; FullText: 'femto'; Value: 1e-15),
    57     (ShortText: 'ps'; FullText: 'piko'; Value: 1e-12),
    58     (ShortText: 'ns'; FullText: 'nano'; Value: 1e-9),
    59     (ShortText: 'us'; FullText: 'mikro'; Value: 1e-6),
    60     (ShortText: 'ms'; FullText: 'mili'; Value: 1e-3),
     53    (ShortText: 'ys'; FullText: 'yocto'; Value: 1E-24),
     54          (ShortText: 'zs'; FullText: 'zepto'; Value: 1E-21),
     55    (ShortText: 'as'; FullText: 'atto'; Value: 1E-18),
     56    (ShortText: 'fs'; FullText: 'femto'; Value: 1E-15),
     57    (ShortText: 'ps'; FullText: 'piko'; Value: 1E-12),
     58    (ShortText: 'ns'; FullText: 'nano'; Value: 1E-9),
     59    (ShortText: 'us'; FullText: 'mikro'; Value: 1E-6),
     60    (ShortText: 'ms'; FullText: 'mili'; Value: 1E-3),
    6161    (ShortText: 's'; FullText: 'sekunda'; Value: 1),
    6262    (ShortText: 'min'; FullText: 'minuta'; Value: 60),
  • trunk/Packages/Common/UResetableThread.pas

    r423 r447  
    296296end.
    297297
     298
  • trunk/Packages/Common/UScaleDPI.pas

    r424 r447  
    259259    begin
    260260      ImgList.Add(Temp[I], nil);
    261       Temp[i].Free;
     261      Temp[I].Free;
    262262    end;
    263263  finally
  • trunk/Packages/Common/UStringTable.pas

    r424 r447  
    3939function TStringTable.GetColCount: Integer;
    4040begin
    41   Result := Size.x;
     41  Result := Size.X;
    4242end;
    4343
  • trunk/Packages/Common/UTheme.pas

    r424 r447  
    188188
    189189end.
     190
  • trunk/Packages/Common/UTranslator.pas

    r424 r447  
    420420
    421421  if Lang = '' then begin
    422     for i := 1 to Paramcount - 1 do
    423       if (ParamStr(i) = '--LANG') or (ParamStr(i) = '-l') or
    424         (ParamStr(i) = '--lang') then
    425         Lang := ParamStr(i + 1);
     422    for I := 1 to Paramcount - 1 do
     423      if (ParamStr(I) = '--LANG') or (ParamStr(I) = '-l') or
     424        (ParamStr(I) = '--lang') then
     425        Lang := ParamStr(I + 1);
    426426  end;
    427427  if Lang = '' then begin
     
    473473      DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    474474    if FileExistsUTF8(Result) then
    475       exit;
     475      Exit;
    476476
    477477    Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator + LangID +
    478478      DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    479479    if FileExistsUTF8(Result) then
    480       exit;
     480      Exit;
    481481
    482482    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
    483483      + LangID + DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    484484    if FileExistsUTF8(Result) then
    485       exit;
     485      Exit;
    486486
    487487    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
     
    489489      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    490490    if FileExistsUTF8(Result) then
    491       exit;
     491      Exit;
    492492
    493493    {$IFDEF UNIX}
     
    496496      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    497497    if FileExistsUTF8(Result) then
    498       exit;
     498      Exit;
    499499    {$ENDIF}
    500500    // Let us search for reducted files
    501     LangShortID := copy(LangID, 1, 2);
     501    LangShortID := Copy(LangID, 1, 2);
    502502    // At first, check all was checked
    503503    Result := ExtractFilePath(ParamStrUTF8(0)) + LangShortID +
    504504      DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    505505    if FileExistsUTF8(Result) then
    506       exit;
     506      Exit;
    507507
    508508    Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator +
     
    510510      ExtractFileName(ParamStrUTF8(0)), LCExt);
    511511    if FileExistsUTF8(Result) then
    512       exit;
     512      Exit;
    513513
    514514    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
     
    516516      ExtractFileName(ParamStrUTF8(0)), LCExt);
    517517    if FileExistsUTF8(Result) then
    518       exit;
     518      Exit;
    519519
    520520    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator
     
    522522      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    523523    if FileExistsUTF8(Result) then
    524       exit;
     524      Exit;
    525525
    526526    // Full language in file name - this will be default for the project
     
    529529      Result := ExtractFilePath(ParamStrUTF8(0)) + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt;
    530530      if FileExistsUTF8(Result) then
    531         exit;
     531        Exit;
    532532      // Common location (like in Lazarus)
    533533      Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator +
    534534        ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt;
    535535      if FileExistsUTF8(Result) then
    536         exit;
     536        Exit;
    537537
    538538      Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' +
    539539        DirectorySeparator + ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangID])) + LCExt;
    540540      if FileExistsUTF8(Result) then
    541         exit;
     541        Exit;
    542542    except
    543543      Result := ''; // Or do something else (useless)
     
    548548      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), LCExt);
    549549    if FileExistsUTF8(Result) then
    550       exit;
     550      Exit;
    551551    {$ENDIF}
    552552    Result := ExtractFilePath(ParamStrUTF8(0)) + ChangeFileExt(
    553553      ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt;
    554554    if FileExistsUTF8(Result) then
    555       exit;
     555      Exit;
    556556
    557557    Result := ExtractFilePath(ParamStrUTF8(0)) + 'locale' + DirectorySeparator +
    558558      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt;
    559559    if FileExistsUTF8(Result) then
    560       exit;
     560      Exit;
    561561
    562562    Result := ExtractFilePath(ParamStrUTF8(0)) + 'languages' + DirectorySeparator +
    563563      ChangeFileExt(ExtractFileName(ParamStrUTF8(0)), Format(FormatLang, [LangShortID])) + LCExt;
    564564    if FileExistsUTF8(Result) then
    565       exit;
     565      Exit;
    566566  end;
    567567
Note: See TracChangeset for help on using the changeset viewer.