Changeset 149


Ignore:
Timestamp:
Jun 5, 2024, 9:58:43 AM (5 months ago)
Author:
chronos
Message:
  • Modified: Use TFormEx class from Common package.
Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/Core.pas

    r148 r149  
    7070
    7171uses
    72   LazFileUtils, FormMain,
     72  LazFileUtils, FormMain, FormEx,
    7373  // Targets
    7474  TargetInterpretter, TargetFPC, TargetJava, TargetDelphi, TargetJavascript,
     
    115115    ApplicationInfo.RegistryKey + '\' + RecentFilesRegKey);
    116116  LoadFromRegistry(Core.ApplicationInfo.GetRegistryContext);
     117
     118  TFormEx.ScaleDPI := ScaleDPI1;
     119  TFormEx.Translator := Translator;
     120  TFormEx.ThemeManager := ThemeManager;
     121  TFormEx.PersistentForm := PersistentForm1;
    117122
    118123  FormMain := TFormMain.Create(nil);
  • trunk/Forms/FormCPU.lfm

    r145 r149  
    88  ClientWidth = 621
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1211  object Label4: TLabel
    1312    Left = 12
  • trunk/Forms/FormCPU.pas

    r145 r149  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   ExtCtrls;
     7  ExtCtrls, FormEx;
    88
    99type
     
    1111  { TFormCPU }
    1212
    13   TFormCPU = class(TForm)
     13  TFormCPU = class(TFormEx)
    1414    Label3: TLabel;
    1515    Label4: TLabel;
     
    2020    LabelStepCounter: TLabel;
    2121    LabelStepSpeed: TLabel;
    22     procedure FormCreate(Sender: TObject);
    2322  public
    2423    LastStepCounter: Integer;
     
    4241{ TFormCPU }
    4342
    44 procedure TFormCPU.FormCreate(Sender: TObject);
    45 begin
    46   Core.Core.Translator.TranslateComponentRecursive(Self);
    47   Core.Core.ThemeManager.UseTheme(Self);
    48 end;
    49 
    5043procedure TFormCPU.Reload;
    5144begin
  • trunk/Forms/FormCompileMultiple.lfm

    r147 r149  
    88  ClientWidth = 973
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    11   OnCreate = FormCreate
    12   OnDestroy = FormDestroy
    1310  OnShow = FormShow
    1411  LCLVersion = '2.2.6.0'
     
    3128    Anchors = [akTop, akLeft, akRight, akBottom]
    3229    Checkboxes = True
    33     Columns = <   
     30    Columns = <
    3431      item
    3532        Caption = 'Name'
    3633        Width = 200
    37       end   
     34      end
    3835      item
    3936        Caption = 'Result'
  • trunk/Forms/FormCompileMultiple.pas

    r147 r149  
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
    7   Target;
     7  Target, FormEx;
    88
    99type
     
    1111  { TFormCompileMultiple }
    1212
    13   TFormCompileMultiple = class(TForm)
     13  TFormCompileMultiple = class(TFormEx)
    1414    ButtonCompile: TButton;
    1515    ButtonCancel: TButton;
    1616    ListViewTargets: TListView;
    1717    procedure ButtonCompileClick(Sender: TObject);
    18     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    19     procedure FormCreate(Sender: TObject);
    20     procedure FormDestroy(Sender: TObject);
    2118    procedure FormShow(Sender: TObject);
    2219  private
     
    3229{$R *.lfm}
    3330
    34 uses
    35   Core;
    36 
    37 procedure TFormCompileMultiple.FormCreate(Sender: TObject);
    38 begin
    39   Core.Core.Translator.TranslateComponentRecursive(Self);
    40   Core.Core.ThemeManager.UseTheme(Self);
    41 end;
    42 
    43 procedure TFormCompileMultiple.FormClose(Sender: TObject;
    44   var CloseAction: TCloseAction);
    45 begin
    46   Core.Core.PersistentForm1.Save(Self);
    47 end;
    48 
    4931procedure TFormCompileMultiple.ButtonCompileClick(Sender: TObject);
    5032var
     
    5638end;
    5739
    58 procedure TFormCompileMultiple.FormDestroy(Sender: TObject);
    59 begin
    60 end;
    61 
    6240procedure TFormCompileMultiple.FormShow(Sender: TObject);
    6341begin
    64   Core.Core.PersistentForm1.Load(Self);
    6542  ReloadList;
    6643end;
  • trunk/Forms/FormInput.lfm

    r147 r149  
    88  ClientWidth = 480
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1211  object MemoInput: TMemo
    1312    Left = 6
     
    1918    Font.Height = -18
    2019    Font.Name = 'Courier New'
    21     OnKeyPress = MemoInputKeyPress
    2220    ParentFont = False
    2321    ScrollBars = ssAutoBoth
    2422    TabOrder = 0
     23    OnKeyPress = MemoInputKeyPress
    2524  end
    2625  object Label1: TLabel
  • trunk/Forms/FormInput.pas

    r147 r149  
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     7  FormEx;
    78
    89type
     
    1011  { TFormInput }
    1112
    12   TFormInput = class(TForm)
     13  TFormInput = class(TFormEx)
    1314    Label1: TLabel;
    1415    MemoInput: TMemo;
    15     procedure FormCreate(Sender: TObject);
    1616    procedure MemoInputKeyPress(Sender: TObject; var Key: char);
    1717  end;
     
    3232end;
    3333
    34 procedure TFormInput.FormCreate(Sender: TObject);
    35 begin
    36   Core.Core.Translator.TranslateComponentRecursive(Self);
    37   Core.Core.ThemeManager.UseTheme(Self);
    38 end;
    39 
    4034end.
    4135
  • trunk/Forms/FormLog.lfm

    r145 r149  
    88  ClientWidth = 960
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    1110  LCLVersion = '2.0.0.4'
    1211  object Memo1: TMemo
  • trunk/Forms/FormLog.pas

    r145 r149  
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     7  FormEx;
    78
    89type
     
    1011  { TFormLog }
    1112
    12   TFormLog = class(TForm)
     13  TFormLog = class(TFormEx)
    1314    Memo1: TMemo;
    14     procedure FormCreate(Sender: TObject);
    1515  end;
    1616
     
    2020{$R *.lfm}
    2121
    22 uses
    23   Core;
    24 
    25 { TFormLog }
    26 
    27 procedure TFormLog.FormCreate(Sender: TObject);
    28 begin
    29   Core.Core.Translator.TranslateComponentRecursive(Self);
    30   Core.Core.ThemeManager.UseTheme(Self);
    31 end;
    32 
    3322end.
    3423
  • trunk/Forms/FormMain.pas

    r148 r149  
    66  Classes, SysUtils, FileUtil, Forms, Controls, FormCPU, FormInput,
    77  Graphics, Dialogs, Menus, ActnList, ComCtrls, ExtCtrls, Target, Registry,
    8   LazFileUtils, FormOptions, FormMessages, FormTargets,
    9   FormOutput, FormMemory, FormSourceCode, FormTargetCode, FormLog,
    10   FormCompileMultiple;
     8  LazFileUtils, FormOptions, FormMessages, FormTargets, FormCompileMultiple,
     9  FormOutput, FormMemory, FormSourceCode, FormTargetCode, FormLog, FormEx;
    1110
    1211type
     
    1413  { TFormMain }
    1514
    16   TFormMain = class(TForm)
     15  TFormMain = class(TFormEx)
    1716    AProgramCompileMultiple: TAction;
    1817    AViewLog: TAction;
     
    212211    UpdateTargetList;
    213212    DockInit;
    214     Core.Core.PersistentForm1.Load(Self, True);
    215     Core.Core.ThemeManager.UseTheme(Self);
    216213    FormSourceCode.UpdateTheme;
    217214  end;
     
    374371procedure TFormMain.FormCreate(Sender: TObject);
    375372begin
    376   Core.Core.Translator.TranslateComponentRecursive(Self);
    377   Core.Core.ThemeManager.UseTheme(Self);
    378 
    379373  FormSourceCode := TFormSourceCode.Create(nil);
    380374  FormCPU := TFormCPU.Create(nil);
     
    461455procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    462456begin
    463   Core.Core.PersistentForm1.Save(Self);
    464457  Application.Terminate;
    465458end;
  • trunk/Forms/FormMemory.lfm

    r145 r149  
    88  ClientWidth = 1039
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1211  object Label6: TLabel
    1312    Left = 6
  • trunk/Forms/FormMemory.pas

    r147 r149  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   ComCtrls, Math;
     7  ComCtrls, Math, FormEx;
    88
    99const
     
    1414  { TFormMemory }
    1515
    16   TFormMemory = class(TForm)
     16  TFormMemory = class(TFormEx)
    1717    Label6: TLabel;
    1818    ListViewMemory: TListView;
    19     procedure FormCreate(Sender: TObject);
    2019    procedure ListViewMemoryData(Sender: TObject; Item: TListItem);
    2120  public
     
    7271end;
    7372
    74 procedure TFormMemory.FormCreate(Sender: TObject);
    75 begin
    76   Core.Core.Translator.TranslateComponentRecursive(Self);
    77   Core.Core.ThemeManager.UseTheme(Self);
    78 end;
    79 
    8073end.
    8174
  • trunk/Forms/FormMessages.lfm

    r145 r149  
    88  ClientWidth = 738
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1211  object ListView1: TListView
    1312    Left = 0
  • trunk/Forms/FormMessages.pas

    r145 r149  
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, FormEx,
    77  ComCtrls;
    88
     
    1111  { TFormMessages }
    1212
    13   TFormMessages = class(TForm)
     13  TFormMessages = class(TFormEx)
    1414    ListView1: TListView;
    15     procedure FormCreate(Sender: TObject);
    1615    procedure ListView1Data(Sender: TObject; Item: TListItem);
    1716  public
     
    3938end;
    4039
    41 procedure TFormMessages.FormCreate(Sender: TObject);
    42 begin
    43   Core.Core.Translator.TranslateComponentRecursive(Self);
    44   Core.Core.ThemeManager.UseTheme(Self);
    45 end;
    46 
    4740procedure TFormMessages.Reload;
    4841begin
  • trunk/Forms/FormOptions.lfm

    r145 r149  
    88  ClientWidth = 728
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    1110  OnCreate = FormCreate
    12   OnShow = FormShow
    1311  LCLVersion = '2.2.6.0'
    1412  object ButtonOk: TButton
  • trunk/Forms/FormOptions.pas

    r145 r149  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Spin, ComCtrls, ExtCtrls, Target, Theme;
     7  Spin, ComCtrls, ExtCtrls, Target, Theme, FormEx;
    88
    99type
     
    1111  { TFormOptions }
    1212
    13   TFormOptions = class(TForm)
     13  TFormOptions = class(TFormEx)
    1414    ButtonOk: TButton;
    1515    ButtonCancel: TButton;
     
    4444    procedure CheckBoxOptimizeCopyMultiplyChange(Sender: TObject);
    4545    procedure CheckBoxOptimizeRelativeIndexesChange(Sender: TObject);
    46     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4746    procedure FormCreate(Sender: TObject);
    48     procedure FormShow(Sender: TObject);
    4947  public
    5048    procedure UpdateInterface;
     
    6260
    6361{ TFormOptions }
    64 
    65 procedure TFormOptions.FormShow(Sender: TObject);
    66 begin
    67   Core.Core.PersistentForm1.Load(Self);
    68 end;
    6962
    7063procedure TFormOptions.UpdateInterface;
     
    154147end;
    155148
    156 procedure TFormOptions.FormClose(Sender: TObject; var CloseAction: TCloseAction
    157   );
    158 begin
    159   Core.Core.PersistentForm1.Save(Self);
    160 end;
    161 
    162149procedure TFormOptions.FormCreate(Sender: TObject);
    163150begin
    164151  with Core.Core do begin
    165     Translator.TranslateComponentRecursive(Self);
    166     ThemeManager.UseTheme(Self);
    167152    ThemeManager.Themes.LoadToStrings(ComboBoxTheme.Items);
    168153    Translator.LanguageListToStrings(ComboBoxLanguage.Items);
  • trunk/Forms/FormOutput.lfm

    r145 r149  
    88  ClientWidth = 640
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1211  object Label2: TLabel
    1312    Left = 4
  • trunk/Forms/FormOutput.pas

    r145 r149  
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
     7  FormEx;
    78
    89type
     
    1011  { TFormOutput }
    1112
    12   TFormOutput = class(TForm)
     13  TFormOutput = class(TFormEx)
    1314    Label2: TLabel;
    1415    MemoOutput: TMemo;
    15     procedure FormCreate(Sender: TObject);
    1616  public
    1717    procedure Reload;
     
    2727
    2828{ TFormOutput }
    29 
    30 procedure TFormOutput.FormCreate(Sender: TObject);
    31 begin
    32   Core.Core.Translator.TranslateComponentRecursive(Self);
    33   Core.Core.ThemeManager.UseTheme(Self);
    34 end;
    3529
    3630procedure TFormOutput.Reload;
  • trunk/Forms/FormSourceCode.lfm

    r145 r149  
    1010  OnCreate = FormCreate
    1111  OnDestroy = FormDestroy
    12   LCLVersion = '2.2.6.0'
     12  LCLVersion = '3.4.0.0'
    1313  inline SynEditSource: TSynEdit
    1414    Left = 0
     
    2525    PopupMenu = PopupMenuSource
    2626    TabOrder = 0
    27     OnKeyDown = MemoSourceKeyDown
    28     OnKeyPress = MemoSourceKeyPress
    2927    OnKeyUp = MemoSourceKeyUp
    3028    OnMouseDown = MemoSourceMouseDown
  • trunk/Forms/FormSourceCode.pas

    r147 r149  
    55uses
    66  Classes, SysUtils, FileUtil, SynEdit, SynHighlighterIni, Forms, Controls,
    7   Graphics, Dialogs, Menus, ActnList,
     7  Graphics, Dialogs, Menus, ActnList, FormEx,
    88  SynEditHighlighter, SynHighlighterAny, SynHighlighterJava, BFHighlighter;
    99
     
    1212  { TFormSourceCode }
    1313
    14   TFormSourceCode = class(TForm)
     14  TFormSourceCode = class(TFormEx)
    1515    AGenerateText: TAction;
    1616    ACutToClipboard: TAction;
     
    5151    procedure FormDestroy(Sender: TObject);
    5252    procedure MemoSourceChange(Sender: TObject);
    53     procedure MemoSourceKeyDown(Sender: TObject; var Key: Word;
    54       Shift: TShiftState);
    55     procedure MemoSourceKeyPress(Sender: TObject; var Key: char);
    5653    procedure MemoSourceKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState
    5754      );
     
    6360    FOnUpdateStatusBar: TNotifyEvent;
    6461  public
    65     procedure UpdateInterface;
    6662    procedure UpdateTheme;
    6763    property OnUpdateStatusBar: TNotifyEvent read FOnUpdateStatusBar
     
    145141procedure TFormSourceCode.FormCreate(Sender: TObject);
    146142begin
    147   Core.Core.Translator.TranslateComponentRecursive(Self);
    148   Core.Core.ThemeManager.UseTheme(Self);
    149 
    150143  BFHighlighter := TSynBrainFuckHl.Create(nil);
    151144  SynEditSource.Highlighter := BFHighlighter;
     
    156149  SynEditSource.Highlighter := nil;
    157150  FreeAndNil(BFHighlighter);
    158 end;
    159 
    160 procedure TFormSourceCode.UpdateInterface;
    161 begin
    162151end;
    163152
     
    189178end;
    190179
    191 procedure TFormSourceCode.MemoSourceKeyDown(Sender: TObject; var Key: Word;
    192   Shift: TShiftState);
    193 begin
    194 end;
    195 
    196 procedure TFormSourceCode.MemoSourceKeyPress(Sender: TObject; var Key: char);
    197 begin
    198 end;
    199 
    200180procedure TFormSourceCode.MemoSourceKeyUp(Sender: TObject; var Key: Word;
    201181  Shift: TShiftState);
  • trunk/Forms/FormTargetCode.lfm

    r145 r149  
    88  ClientWidth = 734
    99  DesignTimePPI = 144
    10   OnCreate = FormCreate
    11   LCLVersion = '2.2.6.0'
     10  LCLVersion = '3.4.0.0'
    1211  inline SynEditTarget: TSynEdit
    1312    Left = 0
  • trunk/Forms/FormTargetCode.pas

    r145 r149  
    55uses
    66  Classes, SysUtils, FileUtil, SynEdit, SynHighlighterAny, SynHighlighterPas,
    7   SynHighlighterCpp, SynHighlighterPHP, SynHighlighterJava,
     7  SynHighlighterCpp, SynHighlighterPHP, SynHighlighterJava, FormEx,
    88  SynHighlighterPython, SynHighlighterJScript, Forms, Controls, Graphics,
    99  Dialogs, Menus, ActnList, strutils;
     
    1313  { TFormTargetCode }
    1414
    15   TFormTargetCode = class(TForm)
     15  TFormTargetCode = class(TFormEx)
    1616    AShrinkCode: TAction;
    1717    AFormatCode: TAction;
     
    2323    procedure AFormatCodeExecute(Sender: TObject);
    2424    procedure AShrinkCodeExecute(Sender: TObject);
    25     procedure FormCreate(Sender: TObject);
    2625  public
    2726    procedure SetHighlighter(SourceExt: string);
     
    3231
    3332{$R *.lfm}
    34 
    35 uses
    36   Core;
    3733
    3834{ TFormTargetCode }
     
    8480end;
    8581
    86 procedure TFormTargetCode.FormCreate(Sender: TObject);
    87 begin
    88   Core.Core.Translator.TranslateComponentRecursive(Self);
    89   Core.Core.ThemeManager.UseTheme(Self);
    90 end;
    91 
    9282procedure TFormTargetCode.SetHighlighter(SourceExt: string);
    9383begin
  • trunk/Forms/FormTargetOptions.lfm

    r145 r149  
    88  ClientWidth = 586
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    11   OnCreate = FormCreate
    12   OnShow = FormShow
    1310  LCLVersion = '2.0.10.0'
    1411  object Edit1: TEdit
  • trunk/Forms/FormTargetOptions.pas

    r145 r149  
    55uses
    66  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls,
    7   Target;
     7  Target, FormEx;
    88
    99type
     
    1111  { TFormTargetOptions }
    1212
    13   TFormTargetOptions = class(TForm)
     13  TFormTargetOptions = class(TFormEx)
    1414    ButtonOk: TButton;
    1515    ButtonCancel: TButton;
     
    2323    procedure ButtonCompilerClick(Sender: TObject);
    2424    procedure ButtonExecuteClick(Sender: TObject);
    25     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    26     procedure FormCreate(Sender: TObject);
    27     procedure FormShow(Sender: TObject);
    2825  public
    2926    procedure LoadControls(Target: TTarget);
     
    3532
    3633{$R *.lfm}
    37 
    38 uses
    39   Core;
    4034
    4135{ TFormTargetOptions }
     
    5145  OpenDialog1.FileName := Edit2.Text;
    5246  if OpenDialog1.Execute then Edit2.Text := OpenDialog1.FileName;
    53 end;
    54 
    55 procedure TFormTargetOptions.FormClose(Sender: TObject;
    56   var CloseAction: TCloseAction);
    57 begin
    58   Core.Core.PersistentForm1.Save(Self);
    59 end;
    60 
    61 procedure TFormTargetOptions.FormCreate(Sender: TObject);
    62 begin
    63   Core.Core.Translator.TranslateComponentRecursive(Self);
    64   Core.Core.ThemeManager.UseTheme(Self);
    65 end;
    66 
    67 procedure TFormTargetOptions.FormShow(Sender: TObject);
    68 begin
    69   Core.Core.PersistentForm1.Load(Self);
    7047end;
    7148
  • trunk/Forms/FormTargets.lfm

    r145 r149  
    88  ClientWidth = 689
    99  DesignTimePPI = 144
    10   OnClose = FormClose
    11   OnCreate = FormCreate
    1210  OnShow = FormShow
    13   LCLVersion = '2.2.6.0'
     11  LCLVersion = '3.4.0.0'
    1412  object ListView1: TListView
    1513    Left = 10
  • trunk/Forms/FormTargets.pas

    r145 r149  
    44
    55uses
    6   Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls;
     6  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
     7  FormEx;
    78
    89type
     
    1011  { TFormTargets }
    1112
    12   TFormTargets = class(TForm)
     13  TFormTargets = class(TFormEx)
    1314    ListView1: TListView;
    14     procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    15     procedure FormCreate(Sender: TObject);
    1615    procedure FormShow(Sender: TObject);
    1716    procedure ListView1Data(Sender: TObject; Item: TListItem);
     
    3433procedure TFormTargets.FormShow(Sender: TObject);
    3534begin
    36   Core.Core.PersistentForm1.Load(Self);
    3735  ReloadList;
    38 end;
    39 
    40 procedure TFormTargets.FormCreate(Sender: TObject);
    41 begin
    42   Core.Core.Translator.TranslateComponentRecursive(Self);
    43   Core.Core.ThemeManager.UseTheme(Self);
    44 end;
    45 
    46 procedure TFormTargets.FormClose(Sender: TObject; var CloseAction: TCloseAction
    47   );
    48 begin
    49   Core.Core.PersistentForm1.Save(Self);
    5036end;
    5137
Note: See TracChangeset for help on using the changeset viewer.