Ignore:
Timestamp:
Jul 15, 2023, 12:51:15 AM (16 months ago)
Author:
chronos
Message:
  • Modified: Removed U prefix from unit names.
  • Fixed: Memory leaks.
File:
1 moved

Legend:

Unmodified
Added
Removed
  • branches/CpuSingleSize/Forms/FormMain.pas

    r237 r238  
    1 unit UFormMain;
     1unit FormMain;
    22
    33interface
     
    55uses
    66  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ComCtrls,
    7   ExtCtrls, Menus, UCpu, UMachine, UAssembler;
     7  ExtCtrls, Menus, Cpu, Machine, Assembler, FormMessages, FormAssembler;
    88
    99type
     
    3636    PanelBottom: TPanel;
    3737    Splitter1: TSplitter;
    38     procedure ButtonConsoleClick(Sender: TObject);
    39     procedure ButtonCpuClick(Sender: TObject);
    40     procedure ButtonLoadClick(Sender: TObject);
    41     procedure ButtonScreenClick(Sender: TObject);
    42     procedure ButtonStartClick(Sender: TObject);
    43     procedure ButtonStopClick(Sender: TObject);
     38    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    4439    procedure FormCreate(Sender: TObject);
    4540    procedure FormDestroy(Sender: TObject);
     
    4742  private
    4843  public
     44    FormMessages: TFormMessages;
     45    FormAssembler: TFormAssembler;
    4946    procedure DockForm(Form: TForm; DockSite: TWinControl);
    5047    procedure DockInit;
    5148  end;
    52 
    53 var
    54   FormMain: TFormMain;
    5549
    5650
     
    5953{$R *.lfm}
    6054
    61 uses
    62   UFormScreen, UFormCpu, UFormConsole, UFormAssembler, UFormMessages;
    63 
    6455{ TFormMain }
    6556
    6657procedure TFormMain.FormCreate(Sender: TObject);
    6758begin
     59  FormMessages := TFormMessages.Create(nil);
     60  FormAssembler := TFormAssembler.Create(nil);
     61  FormMessages.OnSelect := FormAssembler.Select;
    6862end;
    6963
    70 procedure TFormMain.ButtonConsoleClick(Sender: TObject);
     64procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
    7165begin
    72 end;
    73 
    74 procedure TFormMain.ButtonCpuClick(Sender: TObject);
    75 begin
    76 
    77 end;
    78 
    79 procedure TFormMain.ButtonLoadClick(Sender: TObject);
    80 begin
    81 
    82 end;
    83 
    84 procedure TFormMain.ButtonScreenClick(Sender: TObject);
    85 begin
    86 
    87 end;
    88 
    89 procedure TFormMain.ButtonStartClick(Sender: TObject);
    90 begin
    91 end;
    92 
    93 procedure TFormMain.ButtonStopClick(Sender: TObject);
    94 begin
     66  Application.Terminate;
    9567end;
    9668
    9769procedure TFormMain.FormDestroy(Sender: TObject);
    9870begin
     71  FreeAndNil(FormAssembler);
     72  FreeAndNil(FormMessages);
    9973end;
    10074
Note: See TracChangeset for help on using the changeset viewer.