// COPYRIGHT (C) 1990-1999.  All Rights Reserved. - MDIWIN.CPP
// Zinc Software Incorporated.  Pleasant Grove, Utah  USA
// May be freely copied, used and distributed.

#include <zaf.hpp>

int ZafApplication::Main(void)
{
	LinkMain();

	// Create the MDI parent.
	ZafMDIWindow *mdiParent = new ZafMDIWindow(0, 0, 70, 9, ZAF_MDI_PARENT);

	// Add fields to the MDI parent.
	mdiParent->AddGenericObjects(new ZafStringData("ZafMDIWindow (parent)"));
	ZafPullDownMenu *menu = new ZafPullDownMenu();
	ZafPullDownItem *item = new ZafPullDownItem(ZAF_ITEXT("File"));
	item->SetHotKey('F', 0);
	item->Add(new ZafPopUpItem(ZAF_ITEXT(""), ZAF_EXIT_OPTION));
	menu->Add(item);
	mdiParent->Add(menu);
  	mdiParent->Add(new ZafScrollBar(ZAF_CORNER_SCROLL));
	mdiParent->Add(new ZafScrollBar(ZAF_VERTICAL_SCROLL));
	mdiParent->Add(new ZafScrollBar(ZAF_HORIZONTAL_SCROLL));

	// Create an MDI child and add it to the MDI parent.
	ZafMDIWindow *mdiChild = new ZafMDIWindow(2, 1, 40, 5, ZAF_MDI_CHILD);
	mdiChild->AddGenericObjects(new ZafStringData("ZafMDIWindow (child)"));
	mdiParent->Add(mdiChild);

	// Create an MDI child and add it to the MDI parent.
	mdiChild = new ZafMDIWindow(3, 2, 40, 5, ZAF_MDI_CHILD);
	mdiChild->AddGenericObjects(new ZafStringData("ZafMDIWindow (child)"));
	mdiParent->Add(mdiChild);

	// Create an MDI child and add it to the MDI parent.
	mdiChild = new ZafMDIWindow(4, 3, 40, 5, ZAF_MDI_CHILD);
	mdiChild->AddGenericObjects(new ZafStringData("ZafMDIWindow (child)"));
	mdiParent->Add(mdiChild);

	// Show the MDI window on the screen.
	zafWindowManager->Center(mdiParent);
	zafWindowManager->Add(mdiParent);

	// Process events.
	Control();

	return (0);
}

