// ClassInfoDlg_Gui_CatList.h : header file
//
#if !defined(_CLASSINFODLG_GUI_CATLIST_H_)
#define _CLASSINFODLG_GUI_CATLIST_H_

#include "resource.h"
#include "PropertyEditorDlg.h"
#include "BaseListCtrl.h"

class CXmlClassInfo;
class CXmlGuiCategoryInfoList;
class CXmlGuiCategoryInfo;
class CXmlGuiCategoryField;

/////////////////////////////////////////////////////////////////////////////
// CClassInfoDlg_Gui_CatList dialog

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

// Dialog Data
	//{{AFX_DATA(CClassInfoDlg_Gui_CatList)
	enum { IDD = IDD_CLASSINFO_GUI_CATLIST };
	CButton	chkSort_;
	CButton	cmdEditCategory_;
	CButton	cmdEditField_;
	CBaseListCtrl	lvwStruct_;
	CButton	cmdMoveUp_;
	CButton	cmdMoveDown_;
	CButton	cmdDeleteField_;
	CButton	cmdDeleteCategory_;
	CButton	cmdAddField_;
	CButton	cmdAddCategory_;
	//}}AFX_DATA

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

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

// Implementation
protected:

	// Generated message map functions
	//{{AFX_MSG(CClassInfoDlg_Gui_CatList)
	virtual BOOL OnInitDialog();
	afx_msg void OnCmdAddCat();
	afx_msg void OnCmdDeleteCat();
	afx_msg void OnCmdMoveDown();
	afx_msg void OnCmdMoveUp();
	afx_msg void OnCmdAddField();
	afx_msg void OnDblclkLvwStruct(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnCmdEditField();
	afx_msg void OnCmdDeleteField();
	afx_msg void OnCmdEditCategory();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP();

	void BuildList();
	int GetItemIndent(int index);
	int GetSelectedCategoryIndex();
	CXmlGuiCategoryInfo* GetSelectedCategory();
	int GetSelectedFieldIndex();
	CXmlGuiCategoryField* GetSelectedField();
	void UpdateWindowSize();

	CXmlGuiCategoryInfoList* categoryList_;
	CImageList imageList_;

	CXmlClassInfo* classInfo_;

	bool initialized_;
};

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

#endif // !defined(AFX_CLASSINFODLG_GUI_CATLIST_H__2D3DCD40_4309_4219_A42E_D1D39C3D2C18__INCLUDED_)
