// ClassInfoDlg_TreeIcons.h : header file
//
#if !defined(_CLASSINFODLG_TREEICONS_H_)
#define _CLASSINFODLG_TREEICONS_H_


#include "PropertyEditorDlg.h"
#include "resource.h"
#include "ClassInfoDlg_TreeIcons_Chooser.h"
#include "cmString.h"

/////////////////////////////////////////////////////////////////////////////
// CClassInfoDlg_TreeIcons dialog

class CXmlClassInfo;
class CXmlTreeIcons;

class CClassInfoDlg_TreeIcons : public CPropertyEditorDlg
{
// Construction
public:
	CClassInfoDlg_TreeIcons(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CClassInfoDlg_TreeIcons)
	enum { IDD = IDD_CLASSINFO_TREEICONS };
	CButton	btnApplyToChildren_;
	CButton	chkExpanded_;
	CTreeCtrl	trvGroups_;
	//}}AFX_DATA

public:
	void StoreData();
	void SetData(CXmlBaseElement* element);

	void OnDataUpdate();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CClassInfoDlg_TreeIcons)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CClassInfoDlg_TreeIcons)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	virtual BOOL OnInitDialog();
	afx_msg void OnSelchangedTrvGroups(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnChkExpanded();
	afx_msg void OnBntApplyToChildren();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP();

	void UpdateWindowSize();

	void DisplayIcons(CXmlTreeIcons* treeIcons);
	void StoreIcons(CXmlTreeIcons* treeIcons);
	void UpdateChooser(	CClassInfoDlg_TreeIcons_Chooser& chooser, 
						const cmString& iconFileName);
	cmString GetIconFileName(CClassInfoDlg_TreeIcons_Chooser& chooser);

	CClassInfoDlg_TreeIcons_Chooser chooserExpandedSelected_;
	CClassInfoDlg_TreeIcons_Chooser chooserExpandedNotSelected_;
	CClassInfoDlg_TreeIcons_Chooser chooserCollapsedSelected_;
	CClassInfoDlg_TreeIcons_Chooser chooserCollapsedNotSelected_;

	CXmlClassInfo* classInfo_;

	CImageList imageList_;

	HTREEITEM singleInstanceNode_;
	HTREEITEM mapNode_;
	HTREEITEM arrayNode_;

	CXmlTreeIcons* lastIconGroup_;
};

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

#endif // !defined(_CLASSINFODLG_TREEICONS_H_)
