//
// Tools_GUIMenu_Widget_Checkbox.h
//
// Created by Richard Rice - 01/12/2006
// 
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//


#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif


#ifndef _TOOLS_GUIMENU_WIDGET_CHECKBOX_H_
#define _TOOLS_GUIMENU_WIDGET_CHECKBOX_H_
#ifdef ASURA_USE_GUI_MENU_SYSTEM

#include "GUIMenu/Tools_GUIMenu_Widget_Base.h"


class Asura_GUIMenu_Widget_CheckBox;

class Tools_GUIMenu_Widget_CheckBox : public Tools_GUIMenu_Widget_Base
{
	typedef Tools_GUIMenu_Widget_Base PARENT;

public :
	Tools_GUIMenu_Widget_CheckBox(Asura_GUIMenu_Widget_CheckBox* pxAsuraCheckBox,Tools_GUIMenu_Root* pxToolsParent);

	virtual void AddChildConditionOverlayControls(Tools_GUIMenu_Root* pxItem,Asura_Overlay* pxOverlay,Asura_Vector_2& xOffset);
	virtual void AddToPreviewOverlay() const;

protected:

	virtual void AddOverlayControls(Asura_Overlay* pxOverlay,Asura_Vector_2& xOffset);
	virtual u_int GetFlagsToEdit() const;
	virtual const char* GetLocalDataFlagName(u_int uFlagValue) const;

private :
	static bool IsChecked_ConditionAlways(void* pItem);
	static bool IsChecked_ConditionOn(void* pItem);
	static bool IsChecked_ConditionOff(void* pItem);

	static void SetChecked_ConditionAlways(bool bSet,void* pItem);
	static void SetChecked_ConditionOn(bool bSet,void* pItem);
	static void SetChecked_ConditionOff(bool bSet,void* pItem);

#define OVERLAY_BOOL_CALLBACK(__FnName)\
	static bool __FnName(int iThis){return ((Tools_GUIMenu_Widget_CheckBox*)iThis)->__FnName();}\
	bool __FnName();

	OVERLAY_BOOL_CALLBACK(CanEditCheckboxFlags)

#undef OVERLAY_BOOL_CALLBACK


	Asura_GUIMenu_Widget_CheckBox* m_pxAsuraCheckBox;
};




#endif //ASURA_USE_GUI_MENU_SYSTEM
#endif //_TOOLS_GUIMENU_WIDGET_CHECKBOX_H_
