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

#if !defined(D_CLOSE_HPP)
#	define D_CLOSE_HPP
#	if !defined(Z_BUTTON_HPP)
#		include <z_button.hpp>
#	endif

// ----- ZafCloseButton ------------------------------------------------

class ZafCloseButton : public ZafButton
{
public:
	// --- General class members ---
	ZafCloseButton(ZafEventType value);
	ZafCloseButton(const ZafCloseButton &copy);
	virtual ~ZafCloseButton(void);

	// --- Window object members ---
	virtual ZafEventType Draw(const ZafEventStruct &event, ZafEventType ccode);
	virtual ZafEventType Event(const ZafEventStruct &event);
	virtual bool SetSupportObject(bool supportObject);

	// --- Class identification ---
	static ZafClassID classID;
	static ZafClassNameChar ZAF_FARDATA className[];
	virtual ZafClassID ClassID(void) const { return (classID); }
	virtual ZafClassName ClassName(void) const { return (className); }
	virtual bool IsA(ZafClassID compareID) const;
	virtual bool IsA(ZafClassName compareName) const;

#if defined(USE_ZAF_PERSISTENCE)
	virtual void Write(ZafObjectPersistence &persist); // Don't allow it to store.
#endif

protected:
	// --- Image support ---
	static char ZAF_FARDATA closeName[];
	static char ZAF_FARDATA closeDepressedName[];
	static char ZAF_FARDATA closeDisabledName[];
	static ZafBitmapData *closeBitmap;
	static ZafBitmapData *closeDepressedBitmap;
	static ZafBitmapData *closeDisabledBitmap;
	static void ImageAllocate(void);
	static void ImageFree(bool globalRequest = false);

	virtual ZafWindowObject *Duplicate(void) { return (new ZafCloseButton(*this)); }
};

#endif // D_CLOSE_HPP

