//	Zinc Application Framework - Z_FILDLG.CPP
//	COPYRIGHT (C) 1990-1999.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#include <z_app.hpp>
#include <z_fildlg.hpp>
#include <z_string.hpp>
#define ZAF_FILE_DIALOG_INFO
#include "lang_def.cpp"
#include "gbl_def.cpp"

// ----- ZafFileDialog ------------------------------------------------------

ZafFileDialog::ZafFileDialog(const ZafFileDialog &copy) :
	ZafDialogWindow(copy)
{
	// Get the messages.
	messages = ZafLanguageManager::Allocate(className, defaultMessages);

	// Initialize the file dialog information.
	directory[0] = file[0] = filter[0] = 0;
	SetDirectory(copy.directory);
	SetFile(copy.file);
	SetFilter(copy.filter);
	SetModal(true);
}

ZafFileDialog::~ZafFileDialog(void)
{
	// Free the error strings.
	ZafLanguageManager::Free(messages);

#if defined(ZAF_INDEPENDENT)
	delete fileSystem;
#endif
}

bool ZafFileDialog::IsA(ZafClassID compareID) const
{
	return ((compareID == classID) ? true : ZafDialogWindow::IsA(compareID));
}

bool ZafFileDialog::IsA(ZafClassName compareName) const
{
	return (!strcmp(compareName, className) ? true : ZafDialogWindow::IsA(compareName));
}

void ZafFileDialog::SetDirectory(const ZafIChar *setDirectory)
{
	strncpy(directory, setDirectory, ZAF_MAXPATHLEN);
}

void ZafFileDialog::SetFile(const ZafIChar *setFile)
{
	strncpy(file, setFile, ZAF_MAXPATHLEN);
}

void ZafFileDialog::SetFilter(const ZafIChar *setFilter)
{
	strncpy(filter, setFilter, ZAF_MAXPATHLEN);
}

bool ZafFileDialog::SetModal(bool )
{
	// modal is true for this class.
	modal = true;
	return (modal);
}

