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
33 column() : log_col(-1), phy_col(-1) { } /**< default constructor for use in CArray */
34 column(LPCTSTR sz, LPCTSTR dsc, int log, int phy) : name(sz), desc(dsc), log_col(log), phy_col(phy) { }
36 typedef CArray<column, column> ColumnArray;
40 CDirColsDlg(CWnd* pParent = NULL); // standard constructor
41 void AddColumn(CString name, CString desc, int log, int phy=-1)
42 { column c(name, desc, log, phy); m_cols.Add(c); }
43 void AddDefColumn(CString name, int log, int phy=-1)
44 { column c(name, _T(""), log, phy); m_defCols.Add(c); }
45 const ColumnArray & GetColumns() const { return m_cols; }
48 //{{AFX_DATA(CDirColsDlg)
49 enum { IDD = IDD_DIRCOLS };
50 CHScrollListBox m_list_show;
51 CHScrollListBox m_list_hide;
57 // ClassWizard generated virtual function overrides
58 //{{AFX_VIRTUAL(CDirColsDlg)
60 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
61 virtual BOOL PreTranslateMessage(MSG* pMsg);
64 // Implementation methods
68 void MoveItems(CHScrollListBox * list1, CHScrollListBox * list2, bool top);
70 void SortArrayToLogicalOrder();
71 static int cmpcols(const void * el1, const void * el2);
73 // Implementation data
76 ColumnArray m_defCols;
77 BOOL m_bFromKeyboard; /**< Is up/down movement originating from keyboard? */
79 // Generated message map functions
80 //{{AFX_MSG(CDirColsDlg)
81 virtual BOOL OnInitDialog();
83 afx_msg void OnDown();
85 afx_msg void OnRemove();
87 afx_msg void OnDefaults();
88 afx_msg void OnLbnSelchangeListShow();
89 afx_msg void OnLbnSelchangeListHide();
94 //{{AFX_INSERT_LOCATION}}
95 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
97 #endif // !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)