Ignore:
Timestamp:
Jun 21, 2024, 12:44:53 PM (5 months ago)
Author:
chronos
Message:
  • Modified: Remove U prefix from unit names.
  • Modified: Use TFormEx for all forms for code simplification.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormItem.pas

    r316 r317  
    1 unit UFormItem;
     1unit FormItem;
    22
    33interface
    44
    55uses
    6   Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, UItemList,
    7   ExtCtrls, ColorBox, Spin, Generics.Collections;
     6  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ItemList,
     7  ExtCtrls, ColorBox, Spin, Generics.Collections, FormEx;
    88
    99type
     
    1111  { TFormItem }
    1212
    13   TFormItem = class(TForm)
     13  TFormItem = class(TFormEx)
    1414    ButtonOk: TButton;
    1515    ButtonCancel: TButton;
    1616    procedure ButtonOkClick(Sender: TObject);
    17     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1817    procedure FormCreate(Sender: TObject);
    1918    procedure FormDestroy(Sender: TObject);
    20     procedure FormShow(Sender: TObject);
    2119  private
    2220    FItem: TItem;
     
    3331  end;
    3432
    35 var
    36   FormItem: TFormItem;
    37 
    3833
    3934implementation
     
    4237
    4338uses
    44   UCore;
     39  Core;
    4540
    4641{ TFormItem }
     
    5146end;
    5247
    53 procedure TFormItem.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    54 begin
    55   Core.PersistentForm.Save(Self);
    56 end;
    57 
    5848procedure TFormItem.FormCreate(Sender: TObject);
    5949begin
    60   Core.CoolTranslator1.TranslateComponentRecursive(Self);
    61   Core.ThemeManager1.UseTheme(Self);
    6250  DataControls := TObjectList<TControl>.Create;
    6351  DataLabels := TObjectList<TLabel>.Create;
     
    6654procedure TFormItem.FormDestroy(Sender: TObject);
    6755begin
    68   DataLabels.Free;
    69   DataControls.Free;
    70 end;
    71 
    72 procedure TFormItem.FormShow(Sender: TObject);
    73 begin
    74   Core.PersistentForm.Load(Self);
     56  FreeAndNil(DataLabels);
     57  FreeAndNil(DataControls);
    7558end;
    7659
     
    221204    NewControl.Top := Y;
    222205    NewControl.Parent := Self;
    223     Core.CoolTranslator1.TranslateComponent(NewControl);
    224     Core.ThemeManager1.ApplyTheme(NewControl);
     206    Core.Core.Translator1.TranslateComponent(NewControl);
     207    Core.Core.ThemeManager1.ApplyTheme(NewControl);
    225208    NewControl.Visible := True;
    226209    DataControls.Add(NewControl);
Note: See TracChangeset for help on using the changeset viewer.