#pragma once

#include "uiframe.h"

// ----------------------------------------------------------------------------------
class CUiLuaScrollFrame
{
public:
	static	void			OpenLib(lua_State* L);
	static	int				SetMetaTable(lua_State* L);
};

// ----------------------------------------------------------------------------------
class CUiScrollFrame : public CUiFrame
{
public:
	CUiScrollFrame(const char* name, CUiLayout* pParent, CUi* pUi);
	virtual ~CUiScrollFrame();
	
	virtual void			Render(float alpha);
	virtual	void			SetLuaMetaTable(lua_State* L)			{ CUiLuaScrollFrame::SetMetaTable(L); }
	virtual	void			SetVerticalScroll(float value);
	virtual	void			SetHorizontalScroll(float value);
	virtual	void			SetScrollRange(float x, float y, bool forceUpdate=false);
	virtual	CUiPoint		GetScrollRange()						{ return m_scrollRange; }
	virtual	void			UpdateScrollChildRect();	
	virtual	void			GetRectangle(CUiRectangle* rect);
	virtual CUiFrame*		GetFrameAtPoint(CUiPoint pt, CUiFrame* pExclude);

protected:
	CUiPoint				m_scrollRange;
};