#pragma once

#include <list>

class CBox;
class CzLayout
{
public:
     enum Position { West, North, South, East, Center };

	CzLayout(CWnd* pOwner);
	~CzLayout(void);

	void AddThings(CWnd* pThing, 
							int fromRow, int fromCol, int spanRow, int spanCol);
	void Resize();

private:
	void UpdateChildPos();
	void CheckPosValid(int fromRow, int fromCol, int spanRow, int spanCol);
	void UpdateMaxRowCol(int iRowCnt, int iColCnt);

private:
	CWnd* m_pOwner;
	std::list<CBox*> m_things;

	int m_iCurRowCnt, m_iCurColCnt;
	CRect m_OwnerRect;
};
