Changeset 503 for trunk


Ignore:
Timestamp:
Dec 23, 2023, 8:59:07 PM (11 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Help.pas

    r502 r503  
    55
    66uses
    7   Protocol, ScreenTools, BaseWin, StringTables, Math, LCLIntf, LCLType,
    8   Messages, SysUtils, Classes, ButtonB, PVSB, Types, Generics.Collections, IsoEngine,
     7  Protocol, ScreenTools, BaseWin, StringTables, Math, LCLIntf, LCLType, Messages,
     8  SysUtils, Classes, ButtonB, PVSB, Types, Generics.Collections, IsoEngine,
    99  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.ExtCtrls, Dpi.Common,
    1010  System.UITypes{$ELSE}
     
    858858          x0[I] := x0[I] + 8;
    859859        end;
    860         Self.Line(OffScreen.Canvas, I, False)
     860        Self.Line(OffScreen.Canvas, I, False);
    861861      end;
    862862  end;
     
    11131113                Delete(S, 1, P)
    11141114              else
    1115                 Delete(S, 1, P - 1)
     1115                Delete(S, 1, P - 1);
    11161116            end;
    11171117          '!': // highlighted
     
    11461146        repeat
    11471147          repeat
    1148             Inc(P)
     1148            Inc(P);
    11491149          until (P > Length(S)) or (S[P] = ' ') or (S[P] = '\');
    11501150          if (BiColorTextWidth(OffScreen.Canvas, Copy(S, 1, P - 1)) <=
     
    12111211        MainText[Count - 1] := Format(HelpText.Lookup('REQUIRED'),
    12121212          [MainText[Count - 1]]);
    1213     end
     1213    end;
    12141214  end;
    12151215
     
    12531253    I: Integer;
    12541254    S: string;
    1255     sr: TSearchRec;
     1255    SearchRec: TSearchRec;
    12561256    List, Plus: TStringList;
    12571257  begin
    12581258    List := TStringList.Create;
    12591259    Plus := TStringList.Create;
    1260     if FindFirst(GetGraphicsDir + DirectorySeparator + '*.credits.txt', $27, sr) = 0 then
     1260    if FindFirst(GetGraphicsDir + DirectorySeparator + '*.credits.txt', $27, SearchRec) = 0 then
    12611261      repeat
    1262         Plus.LoadFromFile(GetGraphicsDir + DirectorySeparator + sr.Name);
     1262        Plus.LoadFromFile(GetGraphicsDir + DirectorySeparator + SearchRec.Name);
    12631263        List.AddStrings(Plus);
    1264       until FindNext(sr) <> 0;
    1265     FindClose(sr);
     1264      until FindNext(SearchRec) <> 0;
     1265    FindClose(SearchRec);
    12661266    FreeAndNil(Plus);
    12671267
     
    19591959  if (Sel + i0 >= MainText.Count) or (Sel >= 0) and
    19601960    (THelpLineInfo(MainText.Objects[Sel + i0]).Category = hkNoLink) and
    1961     (THelpLineInfo(MainText.Objects[Sel + i0]).Index = 0)then
     1961    (THelpLineInfo(MainText.Objects[Sel + i0]).Index = 0) then
    19621962    Sel := -1;
    19631963  if Sel <> Sel0 then
     
    21662166      SearchResult.AddLine(S, pkNormal, 0, hkImp, I, True);
    21672167      Include(mIMPHELP, I);
    2168     end
     2168    end;
    21692169  end;
    21702170  for I := 0 to nGov - 1 do
     
    21872187    begin
    21882188      if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and
    2189         not(I in mADVHELP) then
     2189        not (I in mADVHELP) then
    21902190      begin
    21912191        S := Phrases.Lookup('ADVANCES', I);
     
    22002200    begin
    22012201      if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and
    2202         not(I in mIMPHELP) then
     2202        not (I in mIMPHELP) then
    22032203      begin
    22042204        S := Phrases.Lookup('IMPROVEMENTS', I);
     
    22192219    begin
    22202220      if (I >= 0) and ((I <> PrevIndex) or (H <> PrevHandle)) and
    2221         not(I in mFEATUREHELP) then
     2221        not (I in mFEATUREHELP) then
    22222222      begin
    22232223        S := Phrases.Lookup('FEATURES', I);
     
    22712271    while BiColorTextWidth(OffScreen.Canvas, SearchResult[I]) >
    22722272      RightMargin - 32 do
    2273       SearchResult[I] := Copy(SearchResult[I], 1, Length(SearchResult[I]) - 1)
     2273      SearchResult[I] := Copy(SearchResult[I], 1, Length(SearchResult[I]) - 1);
    22742274  end;
    22752275end;
  • trunk/Packages/DpiControls/Dpi.StdCtrls.pas

    r502 r503  
    9393  { TButton }
    9494
    95   TButton = class(TControl)
     95  TButton = class(TWinControl)
    9696  private
    9797  protected
    98     function GetNativeControl: Controls.TControl; override;
     98    function GetNativeWinControl: Controls.TWinControl; override;
    9999  public
    100100    NativeButton: StdCtrls.TButton;
     
    155155  { TScrollBar }
    156156
    157   TScrollBar = class(TControl)
     157  TScrollBar = class(TWinControl)
    158158  private
    159159    function GetKind: TScrollBarKind;
     
    170170    procedure SetPosition(AValue: Integer);
    171171  protected
    172     function GetNativeControl: Controls.TControl; override;
     172    function GetNativeWinControl: Controls.TWinControl; override;
    173173    function GetNativeScrollBar: StdCtrls.TScrollBar; virtual;
    174174  public
     
    178178  published
    179179    property PageSize: Integer read GetPageSize write SetPageSize;
    180     property Min: Integer read GetMin write SetMin;
    181     property Max: Integer read GetMax write SetMax;
    182     property Position: Integer read GetPosition write SetPosition;
    183     property Kind: TScrollBarKind read GetKind write SetKind;
     180    property Min: Integer read GetMin write SetMin default 0;
     181    property Max: Integer read GetMax write SetMax default 100;
     182    property Position: Integer read GetPosition write SetPosition default 0;
     183    property Kind: TScrollBarKind read GetKind write SetKind default sbHorizontal;
    184184    property OnChange: TNotifyEvent read GetOnChange write SetOnChange;
    185185    property Visible;
     
    197197begin
    198198  RegisterComponents(DpiControlsComponentPaletteName, [TEdit, TButton,
    199     TScrollBar]);
     199    TScrollBar, TListBox, TCheckBox, TComboBox]);
    200200end;
    201201
     
    377377{ TButton }
    378378
    379 function TButton.GetNativeControl: Controls.TControl;
     379function TButton.GetNativeWinControl: Controls.TWinControl;
    380380begin
    381381  if not Assigned(NativeButton) then NativeButton := StdCtrls.TButton.Create(nil);
     
    451451end;
    452452
    453 function TScrollBar.GetNativeControl: Controls.TControl;
     453function TScrollBar.GetNativeWinControl: Controls.TWinControl;
    454454begin
    455455  Result := GetNativeScrollBar;
Note: See TracChangeset for help on using the changeset viewer.