#if !defined(AFX_COLUMNSETUPDLG_H__98392DA5_0CC8_40F5_9C44_876742ACFDA1__INCLUDED_)
#define AFX_COLUMNSETUPDLG_H__98392DA5_0CC8_40F5_9C44_876742ACFDA1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ColumnSetupDlg.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CColumnSetupDlg dialog
#include "ReportDict.h"
#include <AplGuiEx.h>

#define APL_DLG_MODE_CREATE 0
#define APL_DLG_MODE_SELECT 1
#define APL_DLG_MODE_CREATE_GROUP 2
#define APL_DLG_MODE_CREATE_LR_GROUP 3
#define APL_DLG_MODE_CREATE_ONE_GROUP 4

class CColumnSetupDlg : public CaplResizableDialog
{
// Construction
protected:
	CString m_sTitleColName;
public:
	void CopyLevel(int ind);
	void CopyColumn(int ind=-1);
	void LevelProp(int ind=-1);
	void ColumnProp();
	void AddColumn();
	void SelectString(CListCtrl *ctrl, int row);
	void RefreshColumns();
	void ShowData(CSectionLevel* level);

	int m_dlg_mode;
	bool m_bDelTitleCol;
	CSectionLevelArray* m_levels;
	CSectionLevelArray* pLArray;
	CReportSection* m_section;
	CGroupCol* m_GroupCol;
	CColumn* m_select;
	CaplReportMgr* m_ReportMgr;

	CColumnSetupDlg(CWnd* pParent = NULL);   // standard constructor

// Dialog Data
	//{{AFX_DATA(CColumnSetupDlg)
	enum { IDD = IDD_COLUMN_SETUP_DLG };
	CaplStaticImage	m_ImageCtrl;
	CaplButton	m_prop_col_btn;
	CaplButton	m_del_col_btn;
	CaplButton	m_add_col_btn;
	CaplButton	m_ok_btn;
	CaplButton	m_cancel_btn;
	CaplButton	m_up;
	CaplButton	m_down;
	CListCtrl	m_level_ctrl;
	CListCtrl	m_column_ctrl;
	//}}AFX_DATA


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

// Implementation
	virtual void OnOK();
	virtual void OnCancel();
protected:
	bool PasteLevel();
	bool CopyLevelToMem(int ind);

	// Generated message map functions
	//{{AFX_MSG(CColumnSetupDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnRclickColumnTable(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclickLevelTable(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemchangedLevelTable(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnMoveUp();
	afx_msg void OnMoveDown();
	afx_msg void OnDblclkColumnTable(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemchangingLevelTable(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKeydownColumnTable(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnGroups();
	afx_msg void OnAddCol();
	afx_msg void OnDelCol();
	afx_msg void OnPropCol();
	afx_msg void OnDblclkLevelTable(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

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

#endif // !defined(AFX_COLUMNSETUPDLG_H__98392DA5_0CC8_40F5_9C44_876742ACFDA1__INCLUDED_)
