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

#ifndef D_SCRLL_HPP
#define D_SCRLL_HPP

#	if !defined(Z_SCRLL2_HPP)
#		include <z_scrll2.hpp>
#	endif
#	if !defined(Z_BUTTON_HPP)
#		include <z_button.hpp>
#	endif

enum ZafScrollButtonType
{
	ZAF_VTOP_BUTTON,
	ZAF_VMIDDLE_BUTTON,
	ZAF_VBOTTOM_BUTTON,
	ZAF_HLEFT_BUTTON,
	ZAF_HMIDDLE_BUTTON,
	ZAF_HRIGHT_BUTTON
};

class ZafScrollButton : public ZafButton
{
	friend class ZAF_EXPORT ZafScrollBar;
public:
	~ZafScrollButton(void);
	ZafEventType Callback(const ZafEventStruct &event, ZafEventType ccode);
	virtual ZafEventType Draw(const ZafEventStruct &event, ZafEventType ccode);
	virtual ZafEventType DrawShadow(ZafRegionStruct &region, int depth, ZafEventType ccode);
	virtual ZafEventType Event(const ZafEventStruct &event);

	// --- Attributes ---
	// get
	ZafScrollButtonType ScrollButtonType(void) const;
	// set
	ZafScrollButtonType SetScrollButtonType(ZafScrollButtonType buttonType);

protected:
	// --- Image support ---
	static char ZAF_FARDATA scrollUpArrowName[];
	static char ZAF_FARDATA scrollDownArrowName[];
	static char ZAF_FARDATA scrollLeftArrowName[];
	static char ZAF_FARDATA scrollRightArrowName[];
	static ZafBitmapData *scrollUpArrowBitmap;
	static ZafBitmapData *scrollDownArrowBitmap;
	static ZafBitmapData *scrollLeftArrowBitmap;
	static ZafBitmapData *scrollRightArrowBitmap;
	static void ImageAllocate(void);
	static void ImageFree(bool globalRequest = false);

	virtual const ZafPaletteStruct *MapClassPalette(ZafPaletteType type, ZafPaletteState state);

private:
	ZafScrollButtonType scrollButtonType;
	static ZafPaletteMap ZAF_FARDATA defaultPaletteMap[];

	ZafScrollButton(ZafScrollButtonType buttonType);
};

// --- inline functions ---
inline ZafScrollButtonType ZafScrollButton::ScrollButtonType(void) const { return scrollButtonType; }

#endif // D_SCRLL_HPP
