/* ==========================================================================
* 작 성 자 : 이순규
* 작 성 일 : 2007.08.10
* 내    용 : 창고 윈도우
* 주의사항 : 
*===========================================================================*/
#pragma once
#include "TabWindow.h"
#include "MoneyWindow.h"
#include "ItemManager.h"

class cPushButton;
class cItemIcon;
class cUIImage;
/// 창고 윈도우
class cWareHouseWindow : public cTabWindow
{
public:
	cWareHouseWindow();
	virtual ~cWareHouseWindow();

	/// 창고2 윈도우
	void SetOpen2Pressed( bool pressed );

	/// 금액
	void SetMoney( unsigned long money );

	void ChangeSelect( unsigned int slotIndex );

protected:
	bool OnCreate( cUINodeProperty* property );
	void OnCommand( cUINode* node, unsigned int id );
	void OnRender(cUIFontItemKeeper* pKeeper );
	void OnPushButtonPressed( cUINode* caller, unsigned int id );
	void OnTabButtonPressed(cUINode* caller, unsigned int id );
	void OnIconClicked( cUINode* caller, unsigned int id );
	void UpdateRect();
	void OnShow();
	void OnHide();

	void UpdateSelect( cItemIcon* icon );
	
protected:
	static const int TAB_COUNT = 2;

	/// 선택된 아이콘 표시 
	cItemIcon*  mSelectIcon;
	cUIImage*	mpSelectImage;
	bool		mShowSelect;

	cPushButton* mOpen2Button;

	/// 금액 에디트
	cNumberEditBox*	mpMoney;
};


/// 창고2 윈도우
class cWareHouse2Window : public cUIWindow
{
public:
	cWareHouse2Window( cWareHouseWindow* wareHouseWindow );
	virtual ~cWareHouse2Window();

	void ChangeSelect( unsigned int slotIndex );

protected:
	bool OnCreate( cUINodeProperty* property );
	void OnProcess( unsigned long deltaTime, unsigned long accumTime );
	void OnRender(cUIFontItemKeeper* pKeeper );
	void OnCommand( cUINode* node, unsigned int id );
	void OnIconDragged( cUINode* caller, unsigned int id, const cUIPos& pos, bool shift );
	void OnIconClicked( cUINode* caller, unsigned int id );
	void UpdateRect();
	void OnHide();
	
	void UpdateSelect( cItemIcon* icon );

protected:
	/// 창고 윈도우
	cWareHouseWindow* mWareHouseWindow;

	/// 선택된 아이콘 표시 
	cItemIcon*  mSelectIcon;
	cUIImage*	mpSelectImage;
	bool		mShowSelect;

	cItemIcon* mIcon[WAREHOUSE_SLOT_COUNT];
};
