unit FormHolder;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, Menus, StdCtrls, fcOutlookList, fcButton, fcImgBtn, fcShapeBtn,
  fcClearPanel, fcButtonGroup, fcOutlookBar, fcStatusBar, ImgList, ToolWin,
  ComCtrls,data, Placemnt;

type
  TfmHolder = class(TForm)
    pnlHolder: TPanel;
    MainMenu1: TMainMenu;
    N1: TMenuItem;
    N2: TMenuItem;
    N3: TMenuItem;
    N4: TMenuItem;
    N5: TMenuItem;
    fcOutlookBar1: TfcOutlookBar;
    fcOutlookBar1OutlookList1: TfcOutlookList;
    fcOutlookBar1fcShapeBtn1: TfcShapeBtn;
    fcStatusBar1: TfcStatusBar;
    ImageList1: TImageList;
    Panel1: TPanel;
    FormStorage1: TFormStorage;
    procedure FormCreate(Sender: TObject);
    procedure itemSelected(OutlookList: TfcCustomOutlookList;
      Item: TfcOutlookListItem);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure HoldFormClass(fmClass : TFormClass);
    function  IsShortCut(var Message: TWMKey): Boolean; override;

  end;

var
  fmHolder: TfmHolder;

implementation

uses phDataEd, WDataEd, DeviceSel, LoadConst, project, design, Ssned;

{$R *.DFM}


function TfmHolder.IsShortCut(var Message: TWMKey): Boolean;
var
 i : integer;
begin
  result := inherited isShortCut(message);
  if PnlHolder.ComponentCount>0 then
  begin
    for i := 0 to PnlHolder.ComponentCount-1 do
    if PnlHolder.Components[i] is TCustomForm then
    begin
      result := TCustomForm(pnlHolder.Components[i]).IsShortCut(message);
      if result then
         Break;
    end;
  end;
end;

procedure TfmHolder.HoldFormClass(fmClass: TFormClass);
begin
  Data.HoldFormClass(pnlHolder,panel1,false,true,fmClass);
end;

procedure TfmHolder.FormCreate(Sender: TObject);
begin
  HoldFormClass(TFmDesign);
end;

procedure TfmHolder.itemSelected(OutlookList: TfcCustomOutlookList;
  Item: TfcOutlookListItem);

const
  FormClasses : array[0..4] of TFormClass =
  (
    TFmDesign,
    TFmSsnEd,
    TFmLoadConstr,
    TFmPhDataEd,
    TFmWDataEd
  );

begin
  HoldFormClass(FormClasses[Item.Tag]);
end;

end.
