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

Legend:

Unmodified
Added
Removed
  • 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);
Note: See TracChangeset for help on using the changeset viewer.