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

#include <zaf.hpp>

// ----- MovieWindow --------------------------------------------------------

class MovieWindow : public ZafWindow
{
public:
	MovieWindow(void);

protected:
	ZafStringData *movieData;
	ZafStringData *directorData;
	ZafStringData *producerData;
	ZafIntegerData *copyrightData;
	ZafStringData *starsData;
};

MovieWindow::MovieWindow(void) :
	ZafWindow(0, 0, 50, 7)
{
	// Center the window and add generic objects.
	zafWindowManager->Center(this);
	AddGenericObjects(new ZafStringData("Data Window"));

	// Create the data fields.
	movieData = new ZafStringData("Angel and the Badman");
	directorData = new ZafStringData("James Edward Grant");
	producerData = new ZafStringData("John Wayne");
	copyrightData = new ZafIntegerData(1946);
	starsData = new ZafStringData("John Wayne, Gail Russell");

	// Add the data fields.
	Add(new ZafPrompt(2, 1, 10, ZAF_ITEXT("Movie:")));
	Add(new ZafString(12, 1, 35, movieData));

	Add(new ZafPrompt(2, 2, 10, ZAF_ITEXT("Director:")));
	Add(new ZafString(12, 2, 35, directorData));

	Add(new ZafPrompt(2, 3, 10, ZAF_ITEXT("Producer:")));
	Add(new ZafString(12, 3, 35, producerData));

	Add(new ZafPrompt(2, 4, 10, ZAF_ITEXT("Copyright:")));
	Add(new ZafInteger(12, 4, 35, copyrightData));

	Add(new ZafPrompt(2, 5, 10, ZAF_ITEXT("Stars:")));
	Add(new ZafString(12, 5, 35, starsData));
}

// ----- ZafApplication -----------------------------------------------------

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

	zafWindowManager->Add(new MovieWindow);

	Control();

	return (0);
}

