OSDN Git Service

PATCH: [ 954991 ] Add directory compare column descriptions
[winmerge-jp/winmerge-jp.git] / Src / DirColsDlg.h
1 /** 
2  * @file  DirColsDlg.h
3  *
4  * @brief Declaration file for CDirColsDlg
5  *
6  * @date  Created: 2003-08-19
7  */
8 // RCS ID line follows -- this is updated by CVS
9 // $Id$
10
11
12 #if !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)
13 #define AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_
14 #pragma once
15
16
17 /////////////////////////////////////////////////////////////////////////////
18 // CDirColsDlg dialog
19
20 /**
21  * @brief Dialog to choose & order columns to be shown in dirview of differing files
22  */
23 class CDirColsDlg : public CDialog
24 {
25 // Public types
26 public:
27         struct column {
28                 CString name;
29                 CString desc;
30                 int log_col;
31                 int phy_col;
32                 column() : log_col(-1), phy_col(-1) { } /**< default constructor for use in CArray */
33                 column(LPCTSTR sz, LPCTSTR dsc, int log, int phy) : name(sz), desc(dsc), log_col(log), phy_col(phy) { } 
34         };
35         typedef CArray<column, column> ColumnArray;
36
37 // Construction
38 public:
39         CDirColsDlg(CWnd* pParent = NULL);   // standard constructor
40         void AddColumn(CString name, CString desc, int log, int phy=-1)
41                 { column c(name, desc, log, phy); m_cols.Add(c); }
42         void AddDefColumn(CString name, int log, int phy=-1)
43                 { column c(name, _T(""), log, phy); m_defCols.Add(c); }
44         const ColumnArray & GetColumns() const { return m_cols; }
45
46 // Dialog Data
47         //{{AFX_DATA(CDirColsDlg)
48         enum { IDD = IDD_DIRCOLS };
49         CListBox        m_list_show;
50         CListBox        m_list_hide;
51         BOOL            m_bReset;
52         //}}AFX_DATA
53
54
55 // Overrides
56         // ClassWizard generated virtual function overrides
57         //{{AFX_VIRTUAL(CDirColsDlg)
58         protected:
59         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
60         //}}AFX_VIRTUAL
61
62 // Implementation methods
63 protected:
64         void LoadLists();
65         void LoadDefLists();
66         void MoveItems(CListBox * list1, CListBox * list2, bool top);
67         void UpdateEnables();
68         void SortArrayToLogicalOrder();
69         static int cmpcols(const void * el1, const void * el2);
70
71 // Implementation data
72 private:
73         ColumnArray m_cols;
74         ColumnArray m_defCols;
75
76         // Generated message map functions
77         //{{AFX_MSG(CDirColsDlg)
78         virtual BOOL OnInitDialog();
79         afx_msg void OnUp();
80         afx_msg void OnDown();
81         afx_msg void OnAdd();
82         afx_msg void OnRemove();
83         virtual void OnOK();
84         afx_msg void OnDefaults();
85         afx_msg void OnLbnSelchangeListShow();
86         afx_msg void OnLbnSelchangeListHide();
87         //}}AFX_MSG
88         DECLARE_MESSAGE_MAP()
89 };
90
91 //{{AFX_INSERT_LOCATION}}
92 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
93
94 #endif // !defined(AFX_DIRCOLSDLG_H__2FCB576C_C609_4623_8C55_F3870F22CA0B__INCLUDED_)