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

#include <z_popup.hpp>
#define ZAF_POPUP_INFO
#include "gbl_def.cpp"

// ----- ZafPopUpMenu -------------------------------------------------------

ZafPopUpMenu::ZafPopUpMenu(int left, int top) :
	ZafWindow(left, top, 0, 0)
{
	// Initialize the pop-up menu information.
	SetBordered(true);
	SetDestroyable(false);
	SetMoveable(false);
	SetNormalHotKeys(true);
	SetSizeable(false);
	SetTemporary(true);
}

ZafPopUpMenu::ZafPopUpMenu(const ZafPopUpMenu &copy) :
	ZafWindow(copy)
{
}

ZafPopUpMenu::~ZafPopUpMenu(void)
{
}

ZafWindowObject *ZafPopUpMenu::Duplicate(void)
{
	return(new ZafPopUpMenu(*this));
}

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

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

bool ZafPopUpMenu::SetAcceptDrop(bool )
{
	// acceptDrop is false for this class.
	acceptDrop = false;
	return (acceptDrop);
}

bool ZafPopUpMenu::SetBordered(bool )
{
	// bordered is true for this class.
	bordered = true;
	return (bordered);
}

bool ZafPopUpMenu::SetDisabled(bool )
{
	// disabled is false for this class.
	disabled = false;
	return (disabled);
}

bool ZafPopUpMenu::SetLocked(bool )
{
	// locked is false for this class.
	locked = false;
	return (locked);
}

bool ZafPopUpMenu::SetMaximized(bool )
{
	// maximized is false for this class.
	maximized = false;
	return (maximized);
}

bool ZafPopUpMenu::SetMinimized(bool )
{
	// minimized is false for this class.
	minimized = false;
	return (minimized);
}

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

bool ZafPopUpMenu::SetMoveable(bool )
{
	// moveable is false for this class.
	moveable = false;
	return (moveable);
}

bool ZafPopUpMenu::SetNoncurrent(bool )
{
	// noncurrent is false for this class.
	noncurrent = false;
	return (noncurrent);
}

bool ZafPopUpMenu::SetNormalHotKeys(bool )
{
	// normalHotKeys is true for this class.
	normalHotKeys = true;
	return (normalHotKeys);
}

ZafWindow *ZafPopUpMenu::SetOwner(ZafWindow *)
{
	// owner is null for this class.
	owner = ZAF_NULLP(ZafWindow);
	return (owner);
}

bool ZafPopUpMenu::SetParentPalette(bool )
{
	// parentPalette is false for this class.
	parentPalette = false;
	return (parentPalette);
}

ZafRegionType ZafPopUpMenu::SetRegionType(ZafRegionType )
{
	// regionType is ZAF_INSIDE_REGION for this class.
	regionType = ZAF_INSIDE_REGION;
	return (regionType);
}

bool ZafPopUpMenu::SetSizeable(bool )
{
	// sizeable is false for this class.
	sizeable = false;
	return (sizeable);
}

bool ZafPopUpMenu::SetTemporary(bool )
{
	// temporary is true for this class.
	temporary = true;
	return (temporary);
}

// ----- Persistent functions -----------------------------------------------
#if defined(USE_ZAF_PERSISTENCE)
ZafPopUpMenu::ZafPopUpMenu(const ZafIChar *name, ZafObjectPersistence &persist) :
	ZafWindow(name, persist.PushLevel(className, classID, ZAF_PERSIST_DIRECTORY))
{
	persist.PopLevel();
	if (persist.Error() != ZAF_ERROR_NONE)
		SetError(persist.Error());
}

ZafElement *ZafPopUpMenu::Read(const ZafIChar *name, ZafObjectPersistence &persist)
{
	return (new ZafPopUpMenu(name, persist));
}

void ZafPopUpMenu::Write(ZafObjectPersistence &persist)
{
	// Write the object.
	ZafWindow::Write(persist.PushLevel(className, classID, ZAF_PERSIST_DIRECTORY));
	persist.PopLevel();
	if (persist.Error() != ZAF_ERROR_NONE)
		SetError(persist.Error());
}
#endif
