/* Header for the definition of a base control list*/
/*/////////////////////////////////////////////////////////*/
#ifndef _CTL_BASE_CONTROL_LIST_
#define _CTL_BASE_CONTROL_LIST_
 
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000*/
 
#include <afxtempl.h>
#include "CTL\Controls\CTL_BCtl.hpp"
 
class CTL_Editor_Control;
 
/*#########################################################*/
/* Definition of the class for the list of base controls*/
class CPA_EXPORT CTL_Editor_BaseControlList : public CList<CTL_Editor_BaseControl *, CTL_Editor_BaseControl *>
{
public:
	CTL_Editor_BaseControlList(BOOL _bMustDestroyElements = TRUE);
	~CTL_Editor_BaseControlList();
 
private:
	BOOL m_pri_bMustDestroyElements;
 
public:
	CTL_Editor_BaseControl *m_pub_fn_pclAddControlAtHead(CTL_BaseWindowsControl *_pclBaseWindowsControl,
																	CWnd *_pclWnd,
																	CTL_Editor_Control *_pclParentControl,
																	CTL_tdeBaseControlDisplayType _eDisplayType,
																	unsigned char _ucPercentWidth,
																	unsigned short _uwFixedWidth,
																	unsigned short _uwHeight,
																	BOOL _bSamePlaceAsNext = FALSE,
																	BOOL _bGoToNextLineAfterMe = FALSE);
	CTL_Editor_BaseControl *m_pub_fn_pclAddControlAtTail(CTL_BaseWindowsControl *_pclBaseWindowsControl,
																	CWnd *_pclWnd,
																	CTL_Editor_Control *_pclParentControl,
																	CTL_tdeBaseControlDisplayType _eDisplayType,
																	unsigned char _ucPercentWidth,
																	unsigned short _uwFixedWidth,
																	unsigned short _uwHeight,
																	BOOL _bSamePlaceAsNext = FALSE,
																	BOOL _bGoToNextLineAfterMe = FALSE);
	CTL_Editor_BaseControl *m_pub_fn_pclAddControlAtPosition(unsigned char _ucTargettedPosition,
																	CTL_BaseWindowsControl *_pclBaseWindowsControl,
																	CWnd *_pclWnd,
																	CTL_Editor_Control *_pclParentControl,
																	CTL_tdeBaseControlDisplayType _eDisplayType,
																	unsigned char _ucPercentWidth,
																	unsigned short _uwFixedWidth,
																	unsigned short _uwHeight,
																	BOOL _bSamePlaceAsNext = FALSE,
																	BOOL _bGoToNextLineAfterMe = FALSE);
 
 
	void m_pub_fn_vComputeZoneOfAllBaseControls(long _lTotalWidth,
																							enum CTL_eControlSpacingType _eSpacingType);
 
private:
	void m_pri_fn_vEmptyList();
 
	short m_pri_fn_wComputeTotalSizeOfFixedSizeControlsAndTheirSize(enum CTL_eControlSpacingType _eSpacingType);
	short m_pri_fn_wComputeTotalSizeOfSpaces();
	short m_pri_fn_wComputeTotalOfPercentages();
 	void m_pri_fn_vComputeTruePercentagesAndSizes(long _lTotalWidth);
	
	BOOL m_pri_fn_bAllBaseControlsPercentagesInitialized();
};
 
#endif /*_CTL_BASE_CONTROL_LIST_*/
