{ *************************************************************************** }
{                                                                             }
{ EControl Syntax Editor (MDI Application)                                    }
{                                                                             }
{ Copyright (c) 2004 - 2006 EControl Ltd., Zaharov Michael                    }
{     www.econtrol.ru                                                         }
{     support@econtrol.ru                                                     }
{                                                                             }
{ *************************************************************************** }
unit ChildFrm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TMDIChild = class(TForm)
    procedure FormActivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    constructor Create(AOwner: TComponent; Frame: TCustomFrame);
  end;

var
  MDIChild: TMDIChild;

implementation

{$R *.dfm}

uses main, editFrm;

{ TMDIChild }

constructor TMDIChild.Create(AOwner: TComponent; Frame: TCustomFrame);
begin
  inherited Create(AOwner);
  Frame.Parent := Self;
end;

procedure TMDIChild.FormActivate(Sender: TObject);
begin
  SyntEditMain.CurrentFrame := TEditorFrame(Controls[0]);
end;

procedure TMDIChild.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
end;

end.
