/*=============================================================================
 *
 *  Filename:			CMDlg.h
 *  Version:            1.0
 *  Date:				20/01/97
 *  Author:             V.L.
 *
 *  Description:		dialog that show incoherence
 *
 *===========================================================================*/
 
#ifndef __CMDLG_H__
#define __CMDLG_H__
 
#ifdef ACTIVE_EDITOR
 
#include "CPARes.h"
#include "CoheMngr.hpp"
 
/******************************************************************************
*
*	define for order in list and modes
*
******************************************************************************/
#define C_cAlpha		0
#define C_cIncoherence	1
#define C_cDLL			2
 
#define C_CM_Mode_cIncoherence	0
#define C_CM_Mode_cFather		1
#define C_CM_Mode_cChild		2
 
#define C_CM_cNumberOfModes		3
 
#define C_szAllDLLName		"_All Editors_"
 
/******************************************************************************
*
*	structure for the different modes data
*
******************************************************************************/
typedef struct tdstModeData_
{
	CTreeCtrl	*p_oTree;
	CComboBox	*p_oCombo;
	char		cOrder;
	char		szOrderName[ 25 ];
} tdstModeData;
 
 
 
/******************************************************************************
*
*	CCoherenceManagerDlg dialog class definition
*
******************************************************************************/
class CCoherenceManagerDlg : public CDialog
{
	private:
		char							m_cMode;
 
		tdstModeData					m_a_stModeData[ C_CM_cNumberOfModes ];
	
		BOOL							m_bBitmapInit;
		CBitmap							m_a_oBitmap[5];
		CImageList						m_oBitmapList;
 
		CFatherMap						*m_p_oIncoherenceMap;
		CFatherMap						*m_p_oFatherMap;
		CChildMap						*m_p_oChildMap;
		CChildMap						*m_p_oDeletedChildMap;
 
		CPA_List<CPA_BaseObject>		m_oReachObjList;
		CPA_BaseObject					*m_p_oSelectedObject;
 
		RECT							m_stWindowPos;
 
	/* Construction*/
	public:
		enum { IDD = CPA_IDD_DIALOG_COHERENCEMANAGER };
 
		CCoherenceManagerDlg(CWnd* pParent = NULL);   /* standard constructor*/
		~CCoherenceManagerDlg();
 
		void m_fn_vSetIncoherenceMap	( CFatherMap *_p_oIncoherenceMap ) { m_p_oIncoherenceMap = _p_oIncoherenceMap; }
		void m_fn_vSetFatherMap			( CFatherMap *_p_oFatherMap ) { m_p_oFatherMap = _p_oFatherMap; }
		void m_fn_vSetChildMap			( CChildMap *_p_oChildMap ) { m_p_oChildMap = _p_oChildMap; }
		void m_fn_vSetDeletedChildMap	( CChildMap *_p_oDeletedChildMap ) { m_p_oDeletedChildMap = _p_oDeletedChildMap; }
 
	protected:
		virtual void DoDataExchange(CDataExchange* pDX);    
	
 
	/* Implementation*/
	protected:
		void m_fn_vFatherList( CFatherMap *_p_oMap, char cMode, char *szDLLName );
		void m_fn_vChildList( CChildMap *_p_oMap, char cMode, char *szDLLName );
		void m_fn_vCallDLL(CPA_BaseObject *_p_oObject);
 
		void m_fn_vSortAlpha( char cMode );
		void m_fn_vSortIncoherence( char cMode );
		void m_fn_vSortDLL( char cMode );
 
		virtual BOOL OnInitDialog();
		BOOL PreTranslateMessage(MSG* pMsg);
		BOOL OnCommand(WPARAM wParam, LPARAM lParam);
 
		afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
		afx_msg void OnRadioAlpha();
		afx_msg void OnRadioIncoherence();
		afx_msg void OnRadioDLL();
		afx_msg void OnComboDLLFatherSelChange();
		afx_msg void OnComboDLLIncoherenceSelChange();
		afx_msg void OnComboDLLChildSelChange();
		afx_msg void OnSize(UINT nType, int cx, int cy);
		afx_msg void OnSizing( UINT nSide, LPRECT lpRect );
		afx_msg void OnDestroy();
		DECLARE_MESSAGE_MAP()
};
 
#endif /*ACTIVE_EDITOR*/
 
#endif /*__CMDLG_H__*/
