Ignore:
Timestamp:
Jan 17, 2025, 9:05:54 PM (4 days ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
  • Modified: Remove U prefix from unit names.
  • Modified: Use Gneeric.Collections instead of fgl.
  • Modified: Do not use global form variables.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Forms/FormImportFormats.pas

    r218 r219  
    1 unit UFormImportFormats;
    2 
    3 {$mode delphi}
     1unit FormImportFormats;
    42
    53interface
     
    75uses
    86  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
    9   ActnList, Menus, UAcronym;
     7  ActnList, Menus, Acronym, FormEx;
    108
    119type
     
    1311  { TFormImportFormats }
    1412
    15   TFormImportFormats = class(TForm)
     13  TFormImportFormats = class(TFormEx)
    1614    AAdd: TAction;
    1715    ActionList1: TActionList;
     
    3028    procedure AModifyExecute(Sender: TObject);
    3129    procedure ARemoveExecute(Sender: TObject);
    32     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    3330    procedure FormCreate(Sender: TObject);
    3431    procedure FormShow(Sender: TObject);
     
    3835    procedure ListView1SelectItem(Sender: TObject; Item: TListItem;
    3936      Selected: Boolean);
    40   private
    41     { private declarations }
    4237  public
    4338    ImportFormats: TImportFormats;
     
    4641  end;
    4742
    48 var
    49   FormImportFormats: TFormImportFormats;
    5043
    5144implementation
     
    5447
    5548uses
    56   UCore, UFormImportFormat;
     49  Core, FormImportFormat;
    5750
    5851resourcestring
     
    10497procedure TFormImportFormats.FormShow(Sender: TObject);
    10598begin
    106   Core.PersistentForm1.Load(Self);
    10799  UpdateList;
    108   Core.ScaleDPI1.ScaleControl(ToolBar1, Core.ScaleDPI1.DesignDPI);
     100  Core.Core.ScaleDPI1.ScaleControl(ToolBar1, Core.Core.ScaleDPI1.DesignDPI);
    109101end;
    110102
     
    112104var
    113105  NewImportFormat: TImportFormat;
     106  FormImportFormat: TFormImportFormat;
    114107begin
    115108  NewImportFormat := TImportFormat.Create;
     
    123116        ImportFormats.Add(NewImportFormat);
    124117        NewImportFormat := nil;
    125         Core.AcronymDb.Modified := True;
     118        Core.Core.AcronymDb.Modified := True;
    126119        UpdateList;
    127120      end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name]));
     
    136129var
    137130  NewImportFormat: TImportFormat;
     131  FormImportFormat: TFormImportFormat;
    138132begin
    139133  if Assigned(ListView1.Selected) then begin
     
    148142          if not Assigned(ImportFormats.SearchByName(NewImportFormat.Name)) then begin;
    149143            TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat);
    150             Core.AcronymDb.Modified := True;
     144            Core.Core.AcronymDb.Modified := True;
    151145            UpdateList;
    152146          end else ShowMessage(Format(SImportFormatAlreadyExists, [NewImportFormat.Name]));
    153147        end else begin
    154148          TImportFormat(ListView1.Selected.Data).Assign(NewImportFormat);
    155           Core.AcronymDb.Modified := True;
     149          Core.Core.AcronymDb.Modified := True;
    156150          UpdateList;
    157151        end;
     
    179173end;
    180174
    181 procedure TFormImportFormats.FormClose(Sender: TObject;
    182   var CloseAction: TCloseAction);
    183 begin
    184   Core.PersistentForm1.Save(Self);
    185 end;
    186 
    187175procedure TFormImportFormats.FormCreate(Sender: TObject);
    188176var
    189177  I: Integer;
    190178begin
    191   Core.Translator.TranslateComponentRecursive(Self);
    192   Core.ThemeManager.UseTheme(Self);
    193179  for I := 0 to ToolBar1.ButtonCount - 1 do
    194180    ToolBar1.Buttons[I].Hint := ToolBar1.Buttons[I].Caption;
Note: See TracChangeset for help on using the changeset viewer.