Changeset 431 for trunk


Ignore:
Timestamp:
Apr 28, 2022, 10:40:37 PM (3 years ago)
Author:
chronos
Message:
  • Modified: Changed WindowMode numerical constants to enumeration.
Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r423 r431  
    9696    CloseAction: TCityCloseAction;
    9797    procedure OffscreenPaint; override;
    98     procedure ShowNewContent(NewMode, Loc: integer; ShowEvent: cardinal);
     98    procedure ShowNewContent(NewMode: TWindowMode; Loc: integer; ShowEvent: cardinal);
    9999    procedure Reset;
    100100    procedure CheckAge;
     
    11091109end;
    11101110
    1111 procedure TCityDlg.ShowNewContent(NewMode, Loc: integer; ShowEvent: cardinal);
     1111procedure TCityDlg.ShowNewContent(NewMode: TWindowMode; Loc: integer; ShowEvent: cardinal);
    11121112begin
    11131113  if MyMap[Loc] and fOwned <> 0 then
     
    12041204        if iix >= 0 then
    12051205          if ssShift in Shift then
    1206             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, iix)
     1206            HelpDlg.ShowNewContent(WindowModePersistent(FWindowMode), hkImp, iix)
    12071207          else if (ClientMode < scContact) then
    12081208            with MessgExDlg do
     
    13351335          Loc1 := dLoc(cLoc, dx, dy);
    13361336          if (Loc1 >= 0) and (Loc1 < G.lx * G.ly) then
    1337             HelpOnTerrain(Loc1, FWindowMode or wmPersistent)
     1337            HelpOnTerrain(Loc1, WindowModePersistent(FWindowMode))
    13381338        end
    13391339        else if (ClientMode < scContact) and (cGov <> gAnarchy) and
  • trunk/LocalPlayer/CityType.pas

    r352 r431  
    2424    procedure DeleteBtnClick(Sender: TObject);
    2525  public
    26     procedure ShowNewContent(NewMode: integer);
     26    procedure ShowNewContent(NewMode: TWindowMode);
    2727  protected
    2828    procedure OffscreenPaint; override;
     
    226226end;
    227227
    228 procedure TCityTypeDlg.ShowNewContent(NewMode: integer);
     228procedure TCityTypeDlg.ShowNewContent(NewMode: TWindowMode);
    229229begin
    230230  inherited ShowNewContent(NewMode);
     
    246246  begin
    247247    if ssShift in Shift then
    248       HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp,
     248      HelpDlg.ShowNewContent(WindowModePersistent(FWindowMode), hkImp,
    249249        MyData.ImpOrder[ctype, i])
    250250    else
     
    263263  begin
    264264    if ssShift in Shift then
    265       HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, Pooliix[i])
     265      HelpDlg.ShowNewContent(WindowModePersistent(FWindowMode), hkImp, Pooliix[i])
    266266    else
    267267    begin
  • trunk/LocalPlayer/Diagram.pas

    r352 r431  
    2323  public
    2424    procedure OffscreenPaint; override;
    25     procedure ShowNewContent_Charts(NewMode: integer);
    26     procedure ShowNewContent_Ship(NewMode: integer; p: integer = -1);
     25    procedure ShowNewContent_Charts(NewMode: TWindowMode);
     26    procedure ShowNewContent_Ship(NewMode: TWindowMode; p: integer = -1);
    2727
    2828  private
     
    299299end;
    300300
    301 procedure TDiaDlg.ShowNewContent_Charts(NewMode: integer);
     301procedure TDiaDlg.ShowNewContent_Charts(NewMode: TWindowMode);
    302302begin
    303303  Kind := dkChart;
     
    309309end;
    310310
    311 procedure TDiaDlg.ShowNewContent_Ship(NewMode, p: integer);
     311procedure TDiaDlg.ShowNewContent_Ship(NewMode: TWindowMode; p: integer);
    312312begin
    313313  Kind := dkShip;
  • trunk/LocalPlayer/Draft.pas

    r352 r431  
    2828      Shift: TShiftState; x, y: integer);
    2929  public
    30     procedure ShowNewContent(NewMode: integer);
     30    procedure ShowNewContent(NewMode: TWindowMode);
    3131  protected
    3232    procedure OffscreenPaint; override;
     
    502502end;
    503503
    504 procedure TDraftDlg.ShowNewContent(NewMode: integer);
     504procedure TDraftDlg.ShowNewContent(NewMode: TWindowMode);
    505505begin
    506506  inherited ShowNewContent(NewMode);
     
    532532      i := (y - yFeature) div LinePitch;
    533533      if (x >= xFeature - 21) and (x < ClientWidth) and (ssShift in Shift) then
    534         HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkFeature, code[i])
     534        HelpDlg.ShowNewContent(WindowModePersistent(FWindowMode), hkFeature, code[i])
    535535      else if not(code[i] in AutoFeature) then
    536536      begin
  • trunk/LocalPlayer/Enhance.pas

    r350 r431  
    3939    NoMap: TIsoMap;
    4040  public
    41     procedure ShowNewContent(NewMode: integer; TerrType: integer = -1);
     41    procedure ShowNewContent(NewMode: TWindowMode; TerrType: integer = -1);
    4242  protected
    4343    Page: integer;
     
    117117end;
    118118
    119 procedure TEnhanceDlg.ShowNewContent(NewMode, TerrType: integer);
     119procedure TEnhanceDlg.ShowNewContent(NewMode: TWindowMode; TerrType: integer);
    120120begin
    121121  if (TerrType < fGrass) or (TerrType > fMountains) then
     
    384384  ShortCut := KeyToShortCut(Key, Shift);
    385385  if BHelp.Test(ShortCut) then
    386     HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,
     386    HelpDlg.ShowNewContent(WindowModePersistent(FWindowMode), hkText,
    387387      HelpDlg.TextIndex('MACRO'))
    388388end;
  • trunk/LocalPlayer/Help.pas

    r424 r431  
    108108    procedure Line(ca: TCanvas; i: Integer; lit: Boolean);
    109109    procedure Prepare(sbPos: Integer = 0);
    110     procedure ShowNewContentProcExecute(NewMode: Integer; HelpContext: string);
     110    procedure ShowNewContentProcExecute(NewMode: TWindowMode; HelpContext: string);
    111111    procedure WaterSign(x0, y0, iix: Integer);
    112112    procedure Search(SearchString: string);
     
    117117    Difficulty: Integer;
    118118    procedure ClearHistory;
    119     procedure ShowNewContent(NewMode, Category, Index: Integer);
     119    procedure ShowNewContent(NewMode: TWindowMode; Category, Index: Integer);
    120120    function TextIndex(Item: string): Integer;
    121121  end;
     
    316316end;
    317317
    318 procedure THelpDlg.ShowNewContentProcExecute(NewMode: Integer;
     318procedure THelpDlg.ShowNewContentProcExecute(NewMode: TWindowMode;
    319319  HelpContext: string);
    320320begin
     
    19311931end;
    19321932
    1933 procedure THelpDlg.ShowNewContent(NewMode, Category, Index: Integer);
     1933procedure THelpDlg.ShowNewContent(NewMode: TWindowMode; Category, Index: Integer);
    19341934begin
    19351935  if (Category <> Kind) or (Index <> no) or (Category = hkMisc) and
  • trunk/LocalPlayer/NatStat.pas

    r414 r431  
    3232  public
    3333    procedure CheckAge;
    34     procedure ShowNewContent(NewMode: integer; p: integer = -1);
     34    procedure ShowNewContent(NewMode: TWindowMode; p: integer = -1);
    3535    procedure EcoChange;
    3636  protected
     
    145145end;
    146146
    147 procedure TNatStatDlg.ShowNewContent(NewMode, p: integer);
     147procedure TNatStatDlg.ShowNewContent(NewMode: TWindowMode; p: integer);
    148148begin
    149149  if p < 0 then
  • trunk/LocalPlayer/Nego.pas

    r417 r431  
    7575    procedure Start; // next turn of negotiation
    7676    procedure OffscreenPaint; override;
    77     procedure ShowNewContent(NewMode: integer);
     77    procedure ShowNewContent(NewMode: TWindowMode);
    7878
    7979  private
     
    192192end;
    193193
    194 procedure TNegoDlg.ShowNewContent(NewMode: integer);
     194procedure TNegoDlg.ShowNewContent(NewMode: TWindowMode);
    195195begin
    196196  inherited ShowNewContent(NewMode);
     
    648648  if (X >= xNationPicture0) and (X < xNationPicture0 + 64) and
    649649    (Y >= yNationPicture) and (Y < yNationPicture + 48) then
    650     NatStatDlg.ShowNewContent(FWindowMode or wmPersistent, DipMem[me].pContact)
     650    NatStatDlg.ShowNewContent(WindowModePersistent(FWindowMode), DipMem[me].pContact)
    651651  else if (X >= xNationPicture1) and (X < xNationPicture1 + 64) and
    652652    (Y >= yNationPicture) and (Y < yNationPicture + 48) then
    653     NatStatDlg.ShowNewContent(FWindowMode or wmPersistent, me)
     653    NatStatDlg.ShowNewContent(WindowModePersistent(FWindowMode), me)
    654654end;
    655655
  • trunk/LocalPlayer/Rates.pas

    r426 r431  
    2323  public
    2424    procedure OffscreenPaint; override;
    25     procedure ShowNewContent(NewMode: integer);
     25    procedure ShowNewContent(NewMode: TWindowMode);
    2626  end;
    2727
     
    157157end;
    158158
    159 procedure TRatesDlg.ShowNewContent(NewMode: integer);
     159procedure TRatesDlg.ShowNewContent(NewMode: TWindowMode);
    160160begin
    161161  inherited ShowNewContent(NewMode);
  • trunk/LocalPlayer/Select.pas

    r363 r431  
    7474    // -2=empty, -1=ambiguous, other=only choice
    7575    procedure OffscreenPaint; override;
    76     procedure ShowNewContent(NewMode: integer; ListKind: TListKind);
    77     procedure ShowNewContent_CityProject(NewMode, cix: integer);
    78     procedure ShowNewContent_MilReport(NewMode, p: integer);
     76    procedure ShowNewContent(NewMode: TWindowMode; ListKind: TListKind);
     77    procedure ShowNewContent_CityProject(NewMode: TWindowMode; cix: integer);
     78    procedure ShowNewContent_MilReport(NewMode: TWindowMode; p: integer);
    7979    procedure EcoChange;
    8080    procedure TechChange;
     
    928928        kModels, kChooseModel:
    929929          if lix <> mixAll then
    930             UnitStatDlg.ShowNewContent_OwnModel(FWindowMode or
    931               wmPersistent, lix);
     930            UnitStatDlg.ShowNewContent_OwnModel(wmPersistent, lix);
    932931        kEModels:
    933           UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode or wmPersistent,
     932          UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent,
    934933            code[1, sb.Position + Sel]);
    935934        kAllEModels, kChooseEModel:
    936935          if lix <> mixAll then
    937             UnitStatDlg.ShowNewContent_EnemyModel(FWindowMode or
    938               wmPersistent, lix);
     936            UnitStatDlg.ShowNewContent_EnemyModel(wmPersistent, lix);
    939937        kAdvance, kFarAdvance, kScience, kChooseTech, kChooseETech, kStealTech:
    940938          if lix = adMilitary then
    941             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,
     939            HelpDlg.ShowNewContent(wmPersistent, hkText,
    942940              HelpDlg.TextIndex('MILRES'))
    943941          else if lix < adMilitary then
    944             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkAdv, lix);
     942            HelpDlg.ShowNewContent(wmPersistent, hkAdv, lix);
    945943        kProject:
    946944          if lix = cpImp + imTrGoods then
    947             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkText,
     945            HelpDlg.ShowNewContent(wmPersistent, hkText,
    948946              HelpDlg.TextIndex('TRADINGGOODS'))
    949947          else if lix and (cpImp + cpType) = 0 then
    950             UnitStatDlg.ShowNewContent_OwnModel(FWindowMode or wmPersistent,
     948            UnitStatDlg.ShowNewContent_OwnModel(wmPersistent,
    951949              lix and cpIndex)
    952950          else if (lix and cpType = 0) and (lix <> cpImp + imTrGoods) then
    953             HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp,
     951            HelpDlg.ShowNewContent(wmPersistent, hkImp,
    954952              lix and cpIndex);
    955953        kGov:
    956           HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkMisc,
     954          HelpDlg.ShowNewContent(wmPersistent, hkMisc,
    957955            miscGovList);
    958956        kShipPart, kEShipPart:
     
    16551653end;
    16561654
    1657 procedure TListDlg.ShowNewContent(NewMode: integer; ListKind: TListKind);
     1655procedure TListDlg.ShowNewContent(NewMode: TWindowMode; ListKind: TListKind);
    16581656var
    16591657  i: integer;
     
    17401738end; // ShowNewContent
    17411739
    1742 procedure TListDlg.ShowNewContent_CityProject(NewMode, cix: integer);
     1740procedure TListDlg.ShowNewContent_CityProject(NewMode: TWindowMode; cix: integer);
    17431741begin
    17441742  cixProject := cix;
     
    17461744end;
    17471745
    1748 procedure TListDlg.ShowNewContent_MilReport(NewMode, p: integer);
     1746procedure TListDlg.ShowNewContent_MilReport(NewMode: TWindowMode; p: integer);
    17491747begin
    17501748  pView := p;
  • trunk/LocalPlayer/Term.pas

    r428 r431  
    573573procedure ImpImage(ca: TCanvas; x, y, iix: integer; Government: integer = -1;
    574574  IsControl: boolean = false);
    575 procedure HelpOnTerrain(Loc, NewMode: integer);
     575procedure HelpOnTerrain(Loc: Integer; NewMode: TWindowMode);
    576576
    577577
     
    748748end;
    749749
    750 procedure HelpOnTerrain(Loc, NewMode: integer);
     750procedure HelpOnTerrain(Loc: Integer; NewMode: TWindowMode);
    751751begin
    752752  if MyMap[Loc] and fDeadLands <> 0 then
  • trunk/LocalPlayer/UnitStat.pas

    r380 r431  
    2828  public
    2929    procedure CheckAge;
    30     procedure ShowNewContent_OwnModel(NewMode, mix: integer);
    31     procedure ShowNewContent_OwnUnit(NewMode, uix: integer);
    32     procedure ShowNewContent_EnemyUnit(NewMode, euix: integer);
    33     procedure ShowNewContent_EnemyLoc(NewMode, Loc: integer);
    34     procedure ShowNewContent_EnemyModel(NewMode, emix: integer);
    35     procedure ShowNewContent_EnemyCity(NewMode, Loc: integer);
     30    procedure ShowNewContent_OwnModel(NewMode: TWindowMode; mix: integer);
     31    procedure ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: integer);
     32    procedure ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: integer);
     33    procedure ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: integer);
     34    procedure ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: integer);
     35    procedure ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: integer);
    3636
    3737  protected
     
    218218end;
    219219
    220 procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode, mix: integer);
     220procedure TUnitStatDlg.ShowNewContent_OwnModel(NewMode: TWindowMode; mix: integer);
    221221begin
    222222  Kind := dkOwnModel;
     
    225225end;
    226226
    227 procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode, uix: integer);
     227procedure TUnitStatDlg.ShowNewContent_OwnUnit(NewMode: TWindowMode; uix: integer);
    228228begin
    229229  Kind := dkOwnUnit;
     
    232232end;
    233233
    234 procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode, euix: integer);
     234procedure TUnitStatDlg.ShowNewContent_EnemyUnit(NewMode: TWindowMode; euix: integer);
    235235begin
    236236  Kind := dkEnemyUnit;
     
    240240end;
    241241
    242 procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode, Loc: integer);
     242procedure TUnitStatDlg.ShowNewContent_EnemyLoc(NewMode: TWindowMode; Loc: integer);
    243243begin
    244244  Kind := dkEnemyUnit;
     
    248248end;
    249249
    250 procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode, emix: integer);
     250procedure TUnitStatDlg.ShowNewContent_EnemyModel(NewMode: TWindowMode; emix: integer);
    251251begin
    252252  Kind := dkEnemyModel;
     
    255255end;
    256256
    257 procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode, Loc: integer);
     257procedure TUnitStatDlg.ShowNewContent_EnemyCity(NewMode: TWindowMode; Loc: integer);
    258258begin
    259259  if MyMap[Loc] and fUnit <> 0 then
  • trunk/LocalPlayer/Wonders.pas

    r426 r431  
    2828  public
    2929    procedure OffscreenPaint; override;
    30     procedure ShowNewContent(NewMode: Integer);
     30    procedure ShowNewContent(NewMode: TWindowMode);
    3131  end;
    3232
     
    8181end;
    8282
    83 procedure TWondersDlg.ShowNewContent(NewMode: Integer);
     83procedure TWondersDlg.ShowNewContent(NewMode: TWindowMode);
    8484begin
    8585  inherited ShowNewContent(NewMode);
     
    351351begin
    352352  if Selection >= 0 then
    353     HelpDlg.ShowNewContent(FWindowMode or wmPersistent, hkImp, Selection);
     353    HelpDlg.ShowNewContent(WindowModePersistent(FWindowMode), hkImp, Selection);
    354354end;
    355355
  • trunk/Packages/CevoComponents/BaseWin.pas

    r408 r431  
    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 }
     
    2526    procedure StayOnTop_Workaround;
    2627  protected
    27     FWindowMode: Integer;
     28    FWindowMode: TWindowMode;
    2829    ModalFrameIndent: Integer;
    2930    HelpContext: string;
    30     procedure ShowNewContent(NewMode: Integer; ForceClose: Boolean = False);
     31    procedure ShowNewContent(NewMode: TWindowMode; ForceClose: Boolean = False);
    3132    procedure MarkUsedOffscreen(xMax, yMax: Integer);
    3233    procedure OffscreenPaint; virtual;
     
    3738    Offscreen: TBitmap;
    3839    OffscreenUser: TForm;
    39     property WindowMode: integer read FWindowMode;
     40    property WindowMode: TWindowMode read FWindowMode;
    4041  end;
    4142
     
    6465
    6566const
    66   // window modes
    67   wmNone = 0;
    68   wmModal = $1;
    69   wmPersistent = $2;
    70   wmSubmodal = $3;
    71 
    7267  yUnused = 161;
    7368  NarrowFrame = 11;
     
    7671
    7772procedure CreateOffscreen(var Offscreen: TBitmap);
     73function WindowModePersistent(Mode: TWindowMode): TWindowMode;
    7874procedure Register;
    7975
     
    8379uses
    8480  ButtonBase, Area;
     81
     82function WindowModeMakePersistent(Mode: TWindowMode): TWindowMode;
     83begin
     84  if Mode = wmModal then Result := wmSubmodal
     85    else Result := wmPersistent;
     86end;
    8587
    8688procedure Register;
     
    142144  if Key = VK_F1 then begin
    143145    if Assigned(ShowNewContentProc) then
    144       ShowNewContentProc(FWindowMode or wmPersistent, HelpContext);
     146      ShowNewContentProc(WindowModePersistent(FWindowMode), HelpContext);
    145147  end else
    146148  if FWindowMode = wmPersistent then begin
     
    168170end;
    169171
    170 procedure TBufferedDrawDlg.ShowNewContent(NewMode: Integer;
     172procedure TBufferedDrawDlg.ShowNewContent(NewMode: TWindowMode;
    171173  ForceClose: Boolean);
    172174begin
  • trunk/Packages/CevoComponents/ButtonA.pas

    r315 r431  
    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;
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r355 r431  
    99  TButtonBase = class(TGraphicControl)
    1010  protected
    11     FDown, FPermanent: boolean;
     11    FDown: Boolean;
     12    FPermanent: Boolean;
    1213    FGraphic: TBitmap;
    1314    // FDownSound, FUpSound: string;
     
    5960begin
    6061  Active := true;
    61   MouseMove(Shift, x, y)
     62  MouseMove(Shift, x, y);
    6263end;
    6364
     
    9394        DownChangedProc(self);
    9495    end;
    95   end
     96  end;
    9697end;
    9798
  • trunk/Packages/CevoComponents/ButtonC.pas

    r290 r431  
    4646    begin
    4747      Brush.Color := $0000FF;
    48       FrameRect(Rect(0, 0, 12, 12))
     48      FrameRect(Rect(0, 0, 12, 12));
    4949    end;
    5050end;
Note: See TracChangeset for help on using the changeset viewer.