4 * @brief Declaration file for CDirColsDlg
6 * @date Created: 2003-08-19
11 #include "TrDialogs.h"
12 #include "UnicodeString.h"
14 /////////////////////////////////////////////////////////////////////////////
18 * @brief A Dialog for choosing visible folder compare columns.
19 * This class implements a dialog for choosing visible columns in folder
20 * compare. Columns can be also re-ordered. There is one listview component
21 * which lists all available columns. Every column name has a checkbox with
22 * it. If the checkbox is checked, the column is visible.
24 * @note: Due to how columns handling code is implemented, hidden columns
25 * must be always be last in the list with order number -1.
26 * @todo: Allow hidden columns between visible columns.
28 class CDirColsDlg : public CTrDialog
32 /** @brief One column's information. */
35 String name; /**< Column name */
36 String desc; /**< Description for column */
37 int log_col; /**< Logical (shown) order number */
38 int phy_col; /**< Physical (in memory) order number */
39 column(const String & colName, const String & dsc, int log, int phy)
40 : name(colName), desc(dsc), log_col(log), phy_col(phy)
43 typedef std::vector<column> ColumnArray;
47 explicit CDirColsDlg(CWnd* pParent = NULL); // standard constructor
48 void AddColumn(const String & name, const String & desc, int log, int phy=-1)
49 { column c(name, desc, log, phy); m_cols.push_back(c); }
50 void AddDefColumn(const String & name, int log, int phy=-1)
51 { column c(name, _T(""), log, phy); m_defCols.push_back(c); }
52 const ColumnArray & GetColumns() const { return m_cols; }
55 //{{AFX_DATA(CDirColsDlg)
56 enum { IDD = IDD_DIRCOLS };
57 CListCtrl m_listColumns;
63 // ClassWizard generated virtual function overrides
64 //{{AFX_VIRTUAL(CDirColsDlg)
66 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
69 // Implementation methods
73 void SelectItem(int index);
75 void SortArrayToLogicalOrder();
76 void MoveItem(int index, int newIndex);
77 void MoveSelectedItems(bool bUp);
80 // Implementation data
82 ColumnArray m_cols; /**< Column list. */
83 ColumnArray m_defCols; /**< Default columns. */
84 static bool CompareColumnsByLogicalOrder( const column & el1, const column & el2 );
86 // Generated message map functions
87 //{{AFX_MSG(CDirColsDlg)
88 virtual BOOL OnInitDialog();
90 afx_msg void OnDown();
92 afx_msg void OnDefaults();
96 afx_msg void OnLvnItemchangedColdlgList(NMHDR *pNMHDR, LRESULT *pResult);