4 * @brief Declaration file for CDirColsDlg
6 * @date Created: 2003-08-19
11 #include "UnicodeString.h"
13 /////////////////////////////////////////////////////////////////////////////
17 * @brief A Dialog for choosing visible folder compare columns.
18 * This class implements a dialog for choosing visible columns in folder
19 * compare. Columns can be also re-ordered. There is one listview component
20 * which lists all available columns. Every column name has a checkbox with
21 * it. If the checkbox is checked, the column is visible.
23 * @note: Due to how columns handling code is implemented, hidden columns
24 * must be always be last in the list with order number -1.
25 * @todo: Allow hidden columns between visible columns.
27 class CDirColsDlg : public CDialog
31 /** @brief One column's information. */
34 String name; /**< Column name */
35 String desc; /**< Description for column */
36 int log_col; /**< Logical (shown) order number */
37 int phy_col; /**< Physical (in memory) order number */
38 column(const String & colName, const String & dsc, int log, int phy)
39 : name(colName), desc(dsc), log_col(log), phy_col(phy)
42 typedef std::vector<column> ColumnArray;
46 CDirColsDlg(CWnd* pParent = NULL); // standard constructor
47 void AddColumn(const String & name, const String & desc, int log, int phy=-1)
48 { column c(name, desc, log, phy); m_cols.push_back(c); }
49 void AddDefColumn(const String & name, int log, int phy=-1)
50 { column c(name, _T(""), log, phy); m_defCols.push_back(c); }
51 const ColumnArray & GetColumns() const { return m_cols; }
54 //{{AFX_DATA(CDirColsDlg)
55 enum { IDD = IDD_DIRCOLS };
56 CListCtrl m_listColumns;
62 // ClassWizard generated virtual function overrides
63 //{{AFX_VIRTUAL(CDirColsDlg)
65 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
68 // Implementation methods
72 void SelectItem(int index);
74 void SortArrayToLogicalOrder();
75 void MoveItem(int index, int newIndex);
76 void MoveSelectedItems(bool bUp);
79 // Implementation data
81 ColumnArray m_cols; /**< Column list. */
82 ColumnArray m_defCols; /**< Default columns. */
83 static bool CompareColumnsByLogicalOrder( const column & el1, const column & el2 );
85 // Generated message map functions
86 //{{AFX_MSG(CDirColsDlg)
87 virtual BOOL OnInitDialog();
89 afx_msg void OnDown();
91 afx_msg void OnDefaults();
95 afx_msg void OnLvnItemchangedColdlgList(NMHDR *pNMHDR, LRESULT *pResult);
98 //{{AFX_INSERT_LOCATION}}
99 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.