OSDN Git Service

PATCH: [ 1516626 ] Enable double-click in column customization dialog
authorKimmo Varis <kimmov@gmail.com>
Tue, 4 Jul 2006 15:05:28 +0000 (15:05 +0000)
committerKimmo Varis <kimmov@gmail.com>
Tue, 4 Jul 2006 15:05:28 +0000 (15:05 +0000)
Src/Changes.txt
Src/DirColsDlg.cpp
Src/DirColsDlg.h

index 0cf9fb1..ad62d97 100644 (file)
@@ -2,6 +2,10 @@ Src\Changes.txt
 Add new items to top.
 (This summarizes all changes to all files under Src, including Src\Languages.)
 
+2006-07-04 Kimmo
+ PATCH: [ 1516626 ] Enable double-click in column customization dialog
+  Src: DirColsDlg.cpp DirColsDlg.h
+
 2006-07-04 Takashi
  BUG: [ 1303166 ] crash or freeze on closing all window
   Src: MainFrm.cpp
index 0ffdaa8..04121e2 100644 (file)
@@ -12,6 +12,7 @@
 #include "stdafx.h"
 #include "merge.h"
 #include "DirColsDlg.h"
+#include ".\dircolsdlg.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -52,6 +53,8 @@ BEGIN_MESSAGE_MAP(CDirColsDlg, CDialog)
        //}}AFX_MSG_MAP
        ON_LBN_SELCHANGE(IDC_LIST_SHOW, OnLbnSelchangeListShow)
        ON_LBN_SELCHANGE(IDC_LIST_HIDE, OnLbnSelchangeListHide)
+       ON_LBN_DBLCLK(IDC_LIST_SHOW, OnLbnDblclkListShow)
+       ON_LBN_DBLCLK(IDC_LIST_HIDE, OnLbnDblclkListHide)
 END_MESSAGE_MAP()
 
 /////////////////////////////////////////////////////////////////////////////
@@ -320,6 +323,9 @@ void CDirColsDlg::OnLbnSelchangeListHide()
        }
 }
 
+/**
+ * @brief Handle keyboard events.
+ */
 BOOL CDirColsDlg::PreTranslateMessage(MSG* pMsg)
 {
        if (pMsg->message == WM_KEYDOWN && pMsg->wParam != VK_CONTROL)
@@ -362,3 +368,19 @@ BOOL CDirColsDlg::PreTranslateMessage(MSG* pMsg)
 
        return CDialog::PreTranslateMessage(pMsg);
 }
+
+/**
+ * @brief Called when mouse is double-clicked over shown columns list.
+ */
+void CDirColsDlg::OnLbnDblclkListShow()
+{
+       OnRemove();
+}
+
+/**
+ * @brief Called when mouse is double-clicked over hidden columns list.
+ */
+void CDirColsDlg::OnLbnDblclkListHide()
+{
+       OnAdd();
+}
index ab4a33c..bc490e4 100644 (file)
@@ -25,11 +25,13 @@ class CDirColsDlg : public CDialog
 {
 // Public types
 public:
-       struct column {
-               CString name;
-               CString desc;
-               int log_col;
-               int phy_col;
+       /** @brief One column's information. */
+       struct column
+       {
+               CString name; /**< Column name */
+               CString desc; /**< Description for column */
+               int log_col; /**< Logical (shown) order number */
+               int phy_col; /**< Physical (in memory) order number */
                column() : log_col(-1), phy_col(-1) { } /**< default constructor for use in CArray */
                column(LPCTSTR sz, LPCTSTR dsc, int log, int phy) : name(sz), desc(dsc), log_col(log), phy_col(phy) { } 
        };
@@ -89,6 +91,9 @@ private:
        afx_msg void OnLbnSelchangeListHide();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
+public:
+       afx_msg void OnLbnDblclkListShow();
+       afx_msg void OnLbnDblclkListHide();
 };
 
 //{{AFX_INSERT_LOCATION}}