Changeset 554


Ignore:
Timestamp:
Apr 24, 2024, 11:19:11 AM (7 months ago)
Author:
chronos
Message:
  • Added: TButtonG class as a button class component referencing TGraphicSet item.
  • Modified: Code cleanup.
Location:
trunk
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/AI/StdAI/Barbarina.pas

    r549 r554  
    18291829          (RO.Treaty[Nation] > trPeace) then
    18301830        begin
    1831           DebugMessage(1, 'End alliance/friendly contact with P' + char(48 + Nation));
     1831          DebugMessage(1, 'End alliance/friendly contact with P' + Char(48 + Nation));
    18321832          NegoCause := CancelTreaty;
    18331833          Result := True;
  • trunk/Graphics/System.grs

    r314 r554  
    11<?xml version="1.0" encoding="utf-8"?>
    22<GraphicSet>
     3  <ImageFileName>System.png</ImageFileName>
    34  <Items>
    45    <Item>
  • trunk/Graphics/System2.grs

    r417 r554  
    11<?xml version="1.0" encoding="utf-8"?>
    22<GraphicSet>
     3  <ImageFileName>System2.png</ImageFileName>
    34  <Items>
    45    <Item>
  • trunk/Graphics/Templates.grs

    r318 r554  
    11<?xml version="1.0" encoding="utf-8"?>
    22<GraphicSet>
     3  <ImageFileName>Templates.png</ImageFileName>
    34  <Items>
    45    <Item>
     
    4344      <Width>17</Width>
    4445      <Height>17</Height>
    45     </Item>   
     46    </Item>
    4647    <Item>
    4748      <Name>Research</Name>
     
    5051      <Width>36</Width>
    5152      <Height>36</Height>
    52     </Item>   
     53    </Item>
    5354    <Item>
    5455      <Name>Change</Name>
     
    5758      <Width>14</Width>
    5859      <Height>14</Height>
    59     </Item>   
     60    </Item>
    6061    <Item>
    6162      <Name>Treasury</Name>
     
    6465      <Width>36</Width>
    6566      <Height>36</Height>
    66     </Item>   
     67    </Item>
    6768    <Item>
    6869      <Name>StarshipDeparted</Name>
     
    7172      <Width>140</Width>
    7273      <Height>120</Height>
    73     </Item>   
     74    </Item>
    7475    <Item>
    7576      <Name>WeightOff</Name>
     
    7879      <Width>18</Width>
    7980      <Height>20</Height>
    80     </Item>   
     81    </Item>
    8182    <Item>
    8283      <Name>WeightOn</Name>
     
    8586      <Width>18</Width>
    8687      <Height>20</Height>
    87     </Item>   
     88    </Item>
    8889  </Items>
    8990</GraphicSet>
  • trunk/LocalPlayer/Enhance.lfm

    • Property svn:mime-type deleted
  • trunk/LocalPlayer/MessgEx.pas

    r530 r554  
    3030    procedure Button2Click(Sender: TObject);
    3131    procedure Button3Click(Sender: TObject);
    32     procedure FormKeyPress(Sender: TObject; var Key: char);
     32    procedure FormKeyPress(Sender: TObject; var Key: Char);
    3333    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    3434    procedure RemoveBtnClick(Sender: TObject);
     
    474474end;
    475475
    476 procedure TMessgExDlg.FormKeyPress(Sender: TObject; var Key: char);
     476procedure TMessgExDlg.FormKeyPress(Sender: TObject; var Key: Char);
    477477begin
    478478  if Key = #13 then
  • trunk/Messg.pas

    r471 r554  
    2525    procedure Button1Click(Sender: TObject);
    2626    procedure Button2Click(Sender: TObject);
    27     procedure FormKeyPress(Sender: TObject; var Key: char);
     27    procedure FormKeyPress(Sender: TObject; var Key: Char);
    2828  public
    2929    Kind: TMessageKind;
     
    9393end;
    9494
    95 procedure TMessgDlg.FormKeyPress(Sender: TObject; var Key: char);
     95procedure TMessgDlg.FormKeyPress(Sender: TObject; var Key: Char);
    9696begin
    9797  if Key = #13 then
  • trunk/Packages/CevoComponents/ButtonA.pas

    r548 r554  
    99type
    1010  TButtonA = class(TButtonBase)
    11     constructor Create(aOwner: TComponent); override;
     11    constructor Create(AOwner: TComponent); override;
    1212  private
    1313    FCaption: string;
    14     procedure SetCaption(Text: string); override;
    1514    procedure SetFont(const Font: TFont);
    1615  protected
     16    procedure SetCaption(Text: string); override;
    1717    procedure Paint; override;
    1818  public
     
    3434end;
    3535
    36 constructor TButtonA.Create(aOwner: TComponent);
     36constructor TButtonA.Create(AOwner: TComponent);
    3737begin
    3838  inherited;
  • trunk/Packages/CevoComponents/ButtonB.pas

    r531 r554  
    99type
    1010  TButtonB = class(TButtonBase)
    11     constructor Create(aOwner: TComponent); override;
     11    constructor Create(AOwner: TComponent); override;
    1212  private
    1313    FMask: TBitmap;
     
    3737end;
    3838
    39 constructor TButtonB.Create(aOwner: TComponent);
     39constructor TButtonB.Create(AOwner: TComponent);
    4040begin
    4141  inherited;
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r531 r554  
    3232    procedure SetGraphic(AValue: TBitmap);
    3333  public
    34     constructor Create(aOwner: TComponent); override;
     34    constructor Create(AOwner: TComponent); override;
    3535    property Graphic: TBitmap read FGraphic write SetGraphic;
    3636    // property DownSound: string read FDownSound write FDownSound;
     
    5050// MMSystem;
    5151
    52 constructor TButtonBase.Create(aOwner: TComponent);
     52constructor TButtonBase.Create(AOwner: TComponent);
    5353begin
    5454  inherited;
  • trunk/Packages/CevoComponents/ButtonC.pas

    r531 r554  
    88type
    99  TButtonC = class(TButtonBase)
    10     constructor Create(aOwner: TComponent); override;
     10    constructor Create(AOwner: TComponent); override;
    1111  private
    1212    FIndex: Integer;
     
    3030end;
    3131
    32 constructor TButtonC.Create(aOwner: TComponent);
     32constructor TButtonC.Create(AOwner: TComponent);
    3333begin
    3434  inherited;
  • trunk/Packages/CevoComponents/ButtonN.pas

    r531 r554  
    99type
    1010  TButtonN = class(TGraphicControl)
    11     constructor Create(aOwner: TComponent); override;
     11    constructor Create(AOwner: TComponent); override;
    1212  private
    1313    FPossible, FLit: Boolean;
     
    4545end;
    4646
    47 constructor TButtonN.Create(aOwner: TComponent);
     47constructor TButtonN.Create(AOwner: TComponent);
    4848begin
    4949  inherited;
  • trunk/Packages/CevoComponents/CevoComponents.lpk

    r548 r554  
    3737    <Description Value="C-evo components"/>
    3838    <Version Major="1" Minor="2"/>
    39     <Files Count="16">
     39    <Files Count="17">
    4040      <Item1>
    4141        <Filename Value="Area.pas"/>
     
    104104      <Item15>
    105105        <Filename Value="GraphicSet.pas"/>
     106        <HasRegisterProc Value="True"/>
    106107        <UnitName Value="GraphicSet"/>
    107108      </Item15>
     
    110111        <UnitName Value="Texture"/>
    111112      </Item16>
     113      <Item17>
     114        <Filename Value="ButtonG.pas"/>
     115        <HasRegisterProc Value="True"/>
     116        <UnitName Value="ButtonG"/>
     117      </Item17>
    112118    </Files>
    113119    <CompatibilityMode Value="True"/>
  • trunk/Packages/CevoComponents/CevoComponents.pas

    r456 r554  
    1010uses
    1111  Area, ButtonA, ButtonB, ButtonC, ButtonN, EOTButton, ButtonBase, DrawDlg,
    12   Sound, BaseWin, AsyncProcess2, GraphicSet, Texture, LazarusPackageIntf;
     12  Sound, BaseWin, AsyncProcess2, GraphicSet, Texture, ButtonG,
     13  LazarusPackageIntf;
    1314
    1415implementation
     
    2425  RegisterUnit('DrawDlg', @DrawDlg.Register);
    2526  RegisterUnit('BaseWin', @BaseWin.Register);
     27  RegisterUnit('GraphicSet', @GraphicSet.Register);
     28  RegisterUnit('ButtonG', @ButtonG.Register);
    2629end;
    2730
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r531 r554  
    132132  MousePos2: TPoint;
    133133{$IFDEF UNIX}
    134   MousePosNew: TPoint;
    135134  NewFormPos: TPoint;
    136135{$ENDIF}
     
    149148      MoveMousePos := ClientToScreen(Point(X, Y));
    150149      MoveFormPos := Point(Left, Top);
    151       MousePosNew := Mouse.CursorPos;
    152150      // Activate move only if mouse position was not changed during inherited call
    153151      if (MousePos1.X = MousePos2.X) and (MousePos1.Y = MousePos2.Y) then begin
  • trunk/Packages/CevoComponents/EOTButton.pas

    r533 r554  
    2525    procedure Paint; override;
    2626  public
    27     constructor Create(aOwner: TComponent); override;
     27    constructor Create(AOwner: TComponent); override;
    2828    destructor Destroy; override;
    2929    procedure SetButtonIndexFast(X: Integer);
  • trunk/Packages/CevoComponents/GraphicSet.pas

    r471 r554  
    4343  { TGraphicSet }
    4444
    45   TGraphicSet = class
     45  TGraphicSet = class(TComponent)
     46  public
    4647    Name: string;
    4748    Data: TBitmap;
     
    5354    procedure LoadFromFile(FileName: string);
    5455    procedure SaveToFile(FileName: string);
    55     constructor Create;
     56    constructor Create(AOwner: TComponent); override;
    5657    destructor Destroy; override;
    5758  end;
     
    7172  GraphicSetFileExt = '.grs';
    7273
     74procedure Register;
     75
    7376
    7477implementation
     
    7780  SWrongFileFormat = 'Wrong file format.';
    7881  SGraphicItemNotFound = 'Graphic item %s not found in graphic set %s.';
     82
     83procedure Register;
     84begin
     85  RegisterComponents('C-evo', [TGraphicSet]);
     86end;
    7987
    8088{ TGraphicSetItem }
     
    227235end;
    228236
    229 constructor TGraphicSet.Create;
    230 begin
     237constructor TGraphicSet.Create(AOwner: TComponent);
     238begin
     239  inherited;
    231240  Data := TBitmap.Create;
    232241  Data.PixelFormat := TPixelFormat.pf24bit;
     
    259268function TGraphicSets.AddNew(Name: string): TGraphicSet;
    260269begin
    261   Result := TGraphicSet.Create;
     270  Result := TGraphicSet.Create(nil);
    262271  Result.Name := Name;
    263272  Add(Result);
  • trunk/Packages/Common/Common.pas

    r531 r554  
    185185var
    186186  SHFileOpStruct: TSHFileOpStruct;
    187   DirBuf: array [0..255] of char;
     187  DirBuf: array [0..255] of Char;
    188188begin
    189189  DirName := UTF8Decode(DirName);
  • trunk/Start.pas

    r533 r554  
    6060    ReplayBtn: TButtonB;
    6161    procedure ListKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    62     procedure ListKeyPress(Sender: TObject; var Key: char);
     62    procedure ListKeyPress(Sender: TObject; var Key: Char);
    6363    procedure StartBtnClick(Sender: TObject);
    6464    procedure FormPaint(Sender: TObject);
     
    10631063end;
    10641064
    1065 procedure TStartDlg.ListKeyPress(Sender: TObject; var Key: char);
     1065procedure TStartDlg.ListKeyPress(Sender: TObject; var Key: Char);
    10661066begin
    10671067  if Key = #13 then StartBtnClick(Sender);
Note: See TracChangeset for help on using the changeset viewer.