// ProjectItemView.h : header file
//
#if !defined(_PROJECTITEMVIEW_H_)
#define _PROJECTITEMVIEW_H_

#include "PropertyEditorDlg.h"
#include "ClassInfoDlg_TreeIcons.h"
#include "TitleStripBmp.h"

/////////////////////////////////////////////////////////////////////////////
// CProjectItemView form view

#ifndef __AFXEXT_H__
#include <afxext.h>
#endif

#include <vector>
#include "ClassInfoDlg_Cardinality.h"
#include "ClassInfoDlg_Global.h"
#include "ClassInfoDlg_Gui.h"
#include "MemberInfoDlg_Global.h"
#include "MemberInfoDlg_Validation.h"
#include "MemberInfoDlg_DataFormat.h"
#include "MemberInfoDlg_Gui.h"
#include "EnTabCtrl.h"

using namespace std;

class CProjectDoc;
class CXmlBaseElement;
class CPropertyEditorDlg;

class CProjectItemView : public CView
{
protected:
	CProjectItemView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CProjectItemView)

// Form Data
public:
	//{{AFX_DATA(CProjectItemView)
	
	//}}AFX_DATA

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CProjectItemView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	virtual void OnDraw(CDC* pDC);
	//}}AFX_VIRTUAL

	
// Implementation
protected:
	virtual ~CProjectItemView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
	//{{AFX_MSG(CProjectItemView)
	afx_msg void OnSelchangeTabProperties(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

protected:
	void DisplayClassInfo();
	void DisplayMemberInfo();
	CProjectDoc* GetDocument();
	void UpdateSelChild();
	void StoreEditors();
	void SetupEditors();
	void UpdateEditors();
	void DrawBackground(CDC* pDC);

	vector<CPropertyEditorDlg*> propertyEditors_;
	
	CClassInfoDlg_Cardinality classCardinalityDlg_;
	CClassInfoDlg_Global classGlobalDlg_;
	CClassInfoDlg_Gui classGuiDlg_;
	CClassInfoDlg_TreeIcons classTreeIconsDlg_;

	CMemberInfoDlg_Global memberGlobalDlg_;
	CMemberInfoDlg_Validation memberValidationDlg_;
	CMemberInfoDlg_DataFormat memberDataFormatDlg_;
	CMemberInfoDlg_Gui memberGuiDlg_;

	int lastClassSelTab_;
	int lastMemberSelTab_;
	CXmlBaseElement* selElement_;
	CPropertyEditorDlg* lastSelChild_;

	friend CPropertyEditorDlg;

	CTitleStripBmp titleStrip_;
	CEnTabCtrl tab_;
	CFont font_;
	bool initialized_;
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(_PROJECTITEMVIEW_H_)
