// COPYRIGHT (C) 1990-1999.  All Rights Reserved. - DLGWIN.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 dialog window.
	ZafDialogWindow *dialogWindow = new ZafDialogWindow(0, 0, 40, 5);

	// Add fields to the dialog window.
	dialogWindow->AddGenericObjects(new ZafStringData("ZafDialogWindow"));
	ZafPrompt *prompt = new ZafPrompt(0, 1, 40, ZAF_ITEXT("Zinc Application Framework"));
	prompt->SetHzJustify(ZAF_HZ_CENTER);
	prompt->SetFont(ZAF_FNT_SYSTEM);
	dialogWindow->Add(prompt);
	ZafButton *button = new ZafButton(15, 3, 10, 1, ZAF_ITEXT("OK"));
	button->SetAllowDefault(true);
	button->SetSendMessageWhenSelected(true);
	button->SetValue(S_DLG_OK);
	dialogWindow->Add(button);
	dialogWindow->SetDefaultButton(button);

	// Display the dialog and wait for it to be closed.
	zafWindowManager->Center(dialogWindow);
	dialogWindow->Control();

	// Clean up.
	delete dialogWindow;

	return (0);
}

