4 * @brief Declaration file for CDirColsDlg
6 * @date Created: 2003-08-19
8 // ID line follows -- this is updated by SVN
12 #if !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)
13 #define AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_
17 #include "UnicodeString.h"
19 /////////////////////////////////////////////////////////////////////////////
23 * @brief A Dialog for choosing visible folder compare columns.
24 * This class implements a dialog for choosing visible columns in folder
25 * compare. Columns can be also re-ordered. There is one listview component
26 * which lists all available columns. Every column name has a checkbox with
27 * it. If the checkbox is checked, the column is visible.
29 * @note: Due to how columns handling code is implemented, hidden columns
30 * must be always be last in the list with order number -1.
31 * @todo: Allow hidden columns between visible columns.
33 class CDirColsDlg : public CDialog
37 /** @brief One column's information. */
40 String name; /**< Column name */
41 String desc; /**< Description for column */
42 int log_col; /**< Logical (shown) order number */
43 int phy_col; /**< Physical (in memory) order number */
44 column(const String & colName, const String & dsc, int log, int phy)
45 : name(colName), desc(dsc), log_col(log), phy_col(phy)
48 typedef std::vector<column> ColumnArray;
52 CDirColsDlg(CWnd* pParent = NULL); // standard constructor
53 void AddColumn(const String & name, const String & desc, int log, int phy=-1)
54 { column c(name, desc, log, phy); m_cols.push_back(c); }
55 void AddDefColumn(const String & name, int log, int phy=-1)
56 { column c(name, _T(""), log, phy); m_defCols.push_back(c); }
57 const ColumnArray & GetColumns() const { return m_cols; }
60 //{{AFX_DATA(CDirColsDlg)
61 enum { IDD = IDD_DIRCOLS };
62 CListCtrl m_listColumns;
68 // ClassWizard generated virtual function overrides
69 //{{AFX_VIRTUAL(CDirColsDlg)
71 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
74 // Implementation methods
78 void SelectItem(int index);
80 void SortArrayToLogicalOrder();
81 void MoveItem(int index, int newIndex);
82 void MoveSelectedItems(bool bUp);
85 // Implementation data
87 ColumnArray m_cols; /**< Column list. */
88 ColumnArray m_defCols; /**< Default columns. */
89 static bool CompareColumnsByLogicalOrder( const column & el1, const column & el2 );
91 // Generated message map functions
92 //{{AFX_MSG(CDirColsDlg)
93 virtual BOOL OnInitDialog();
95 afx_msg void OnDown();
97 afx_msg void OnDefaults();
101 afx_msg void OnLvnItemchangedColdlgList(NMHDR *pNMHDR, LRESULT *pResult);
104 //{{AFX_INSERT_LOCATION}}
105 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
107 #endif // !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)