unit FormMain;

interface

uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Menus, ExtCtrls, FormEx;

type

  { TFormMain }

  TFormMain = class(TFormEx)
    MainMenu1: TMainMenu;
    MenuItem1: TMenuItem;
    MenuItem16: TMenuItem;
    MenuItem17: TMenuItem;
    MenuItem2: TMenuItem;
    MenuItem5: TMenuItem;
    MenuItemTools: TMenuItem;
    PanelCallStack: TPanel;
    Separator1: TMenuItem;
    MenuItemFile: TMenuItem;
    MenuItem10: TMenuItem;
    MenuItem11: TMenuItem;
    MenuItem12: TMenuItem;
    MenuItem13: TMenuItem;
    MenuItem14: TMenuItem;
    MenuItem15: TMenuItem;
    MenuItemEdit: TMenuItem;
    MenuItemDebug: TMenuItem;
    MenuItem3: TMenuItem;
    MenuItem4: TMenuItem;
    MenuItemView: TMenuItem;
    MenuItem6: TMenuItem;
    MenuItem7: TMenuItem;
    MenuItem8: TMenuItem;
    MenuItem9: TMenuItem;
    PanelBottom: TPanel;
    PanelLeft: TPanel;
    PanelRight: TPanel;
    PanelCenter: TPanel;
    Splitter1: TSplitter;
    Splitter2: TSplitter;
    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure FormShow(Sender: TObject);
  public
    procedure DockForm(Form: TForm; DockSite: TWinControl);
    procedure DockInit;
  end;

var
  FormMain: TFormMain;


implementation

{$R *.lfm}

uses
  Core;

{ TFormMain }

procedure TFormMain.DockForm(Form: TForm; DockSite: TWinControl);
begin
  Form.ManualDock(DockSite, nil, alClient);
  Form.Align := alClient;
  Form.Show;
end;

procedure TFormMain.DockInit;
begin
  Core.Core.AViewMessages.Execute;
  Core.Core.AViewCpu.Execute;
  Core.Core.AViewScreen.Execute;
  Core.Core.AViewDissssembler.Execute;
  Core.Core.AViewCallStack.Execute;
  DockForm(Core.Core.FormScreen, PanelCenter);
  DockForm(Core.Core.FormCpu, PanelRight);
  DockForm(Core.Core.FormDisassembler, PanelLeft);
  DockForm(Core.Core.FormMessages, PanelBottom);
  DockForm(Core.Core.FormCallStack, PanelCallStack);
end;

procedure TFormMain.FormCreate(Sender: TObject);
begin
end;

procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
  Application.Terminate;
end;

procedure TFormMain.FormDestroy(Sender: TObject);
begin
end;

procedure TFormMain.FormShow(Sender: TObject);
begin
  DockInit;
end;

end.

