4 * @brief Declaration file for CDirColsDlg
6 * @date Created: 2003-08-19
8 // RCS ID line follows -- this is updated by CVS
12 #if !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)
13 #define AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_
16 #include "HScrollListBox.h"
18 /////////////////////////////////////////////////////////////////////////////
22 * @brief Dialog to choose & order columns to be shown in dirview of differing files
24 class CDirColsDlg : public CDialog
28 /** @brief One column's information. */
31 CString name; /**< Column name */
32 CString desc; /**< Description for column */
33 int log_col; /**< Logical (shown) order number */
34 int phy_col; /**< Physical (in memory) order number */
35 column() : log_col(-1), phy_col(-1) { } /**< default constructor for use in CArray */
36 column(LPCTSTR sz, LPCTSTR dsc, int log, int phy) : name(sz), desc(dsc), log_col(log), phy_col(phy) { }
38 typedef CArray<column, column> ColumnArray;
42 CDirColsDlg(CWnd* pParent = NULL); // standard constructor
43 void AddColumn(CString name, CString desc, int log, int phy=-1)
44 { column c(name, desc, log, phy); m_cols.Add(c); }
45 void AddDefColumn(CString name, int log, int phy=-1)
46 { column c(name, _T(""), log, phy); m_defCols.Add(c); }
47 const ColumnArray & GetColumns() const { return m_cols; }
50 //{{AFX_DATA(CDirColsDlg)
51 enum { IDD = IDD_DIRCOLS };
52 CHScrollListBox m_list_show;
53 CHScrollListBox m_list_hide;
59 // ClassWizard generated virtual function overrides
60 //{{AFX_VIRTUAL(CDirColsDlg)
62 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
63 virtual BOOL PreTranslateMessage(MSG* pMsg);
66 // Implementation methods
70 void MoveItems(CHScrollListBox * list1, CHScrollListBox * list2, bool top);
72 void SortArrayToLogicalOrder();
73 static int cmpcols(const void * el1, const void * el2);
75 // Implementation data
78 ColumnArray m_defCols;
79 BOOL m_bFromKeyboard; /**< Is up/down movement originating from keyboard? */
81 // Generated message map functions
82 //{{AFX_MSG(CDirColsDlg)
83 virtual BOOL OnInitDialog();
85 afx_msg void OnDown();
87 afx_msg void OnRemove();
89 afx_msg void OnDefaults();
90 afx_msg void OnLbnSelchangeListShow();
91 afx_msg void OnLbnSelchangeListHide();
95 afx_msg void OnLbnDblclkListShow();
96 afx_msg void OnLbnDblclkListHide();
99 //{{AFX_INSERT_LOCATION}}
100 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
102 #endif // !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)