unit mdimain;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  KsItems, KsSkinItems, KsHooks, KsForms, KsSkinForms, KsSkinEngine,
  KsControls, KsMenus, KsSkinMenus;
  
type
  TfrmMDIMain = class(TForm)
    SeSkinMenuBar1: TSeSkinMenuBar;
    SeSkinEngine1: TSeSkinEngine;
    SeSkinForm1: TSeSkinForm;
    CustomItem1: TSeSkinItem;
    CustomItem2: TSeSkinItem;
    CustomItem3: TSeSkinItem;
    CustomItem4: TSeSkinItem;
    CustomItem5: TSeSkinItem;
    CustomItem6: TSeSkinItem;
    CustomItem7: TSeSkinItem;
    CustomItem8: TSeSkinItem;
    CustomItem9: TSeSkinItem;
    OpenDialog1: TOpenDialog;
    procedure CustomItem3Click(Sender: TObject);
    procedure CustomItem4Click(Sender: TObject);
    procedure CustomItem2Click(Sender: TObject);
    procedure CustomItem6Click(Sender: TObject);
    procedure CustomItem7Click(Sender: TObject);
    procedure CustomItem8Click(Sender: TObject);
  private
    { Private declarations }
    Count: integer;
  public
    { Public declarations }
  end;

var
  frmMDIMain: TfrmMDIMain;

implementation

uses MDIChild;

{$R *.DFM}

procedure TfrmMDIMain.CustomItem3Click(Sender: TObject);
begin
  if ActiveMDIChild <> nil then
    ActiveMDIChild.Close;
end;

procedure TfrmMDIMain.CustomItem4Click(Sender: TObject);
begin
  Close;
end;

procedure TfrmMDIMain.CustomItem2Click(Sender: TObject);
var
  Child: TfrmMDIChild;
begin
  { New Child }
  Inc(Count);

  Child := TfrmMDIChild.Create(Self);
  Child.Caption := Child.Caption + ' ' + IntToStr(Count);
end;

procedure TfrmMDIMain.CustomItem6Click(Sender: TObject);
begin
  SeSkinForm1.Tile;
end;

procedure TfrmMDIMain.CustomItem7Click(Sender: TObject);
begin
  SeSkinForm1.Cascade;
end;

procedure TfrmMDIMain.CustomItem8Click(Sender: TObject);
begin
  { Load Skin }
  if OpenDialog1.Execute then
    SeSkinEngine1.SkinFile := OpenDialog1.FileName;
end;

end.
