WinMerge 2.7.7.3
Resolve conflict files (cvs, svn...) (#1875129)
+ Save line filter when edit box loses focus (#1875853)
BugFix: Fix Quick Compare regression in 2.7.7.2 (#1872165)
Bugfix: Clipped text in file saving error message (#1874854)
ON_BN_CLICKED(IDC_LFILTER_REMOVEBTN, OnBnClickedLfilterRemovebtn)
ON_BN_CLICKED(IDC_LFILTER_EDITSAVE, OnBnClickedLfilterEditsave)
ON_NOTIFY(LVN_ITEMACTIVATE, IDC_LFILTER_LIST, OnLvnItemActivateLfilterList)
+ ON_EN_KILLFOCUS(IDC_LFILTER_EDITBOX, OnEnKillfocusLfilterEditbox)
END_MESSAGE_MAP()
*/
void CPropLineFilter::OnBnClickedLfilterEditsave()
{
- ASSERT(m_bEditing);
-
- int sel =- 1;
- sel = m_filtersList.GetNextItem(sel, LVNI_SELECTED);
- if (sel != -1)
- {
- CString text;
- m_editRegexp.GetWindowText(text);
- m_filtersList.SetItemText(sel, 0, text);
- }
- m_bEditing = FALSE;
- m_editRegexp.SetReadOnly(TRUE);
- m_saveRegexp.EnableWindow(FALSE);
+ SaveItem();
}
/**
m_editRegexp.SetWindowText(text);
*pResult = 0;
}
+
+/**
+ * @brief Save the current filter in edit box.
+ */
+void CPropLineFilter::SaveItem()
+{
+ if (m_bEditing)
+ {
+ int sel =- 1;
+ sel = m_filtersList.GetNextItem(sel, LVNI_SELECTED);
+ if (sel != -1)
+ {
+ CString text;
+ m_editRegexp.GetWindowText(text);
+ m_filtersList.SetItemText(sel, 0, text);
+ }
+ m_bEditing = FALSE;
+ m_editRegexp.SetReadOnly(TRUE);
+ m_saveRegexp.EnableWindow(FALSE);
+ }
+}
+
+/**
+ * @brief Called when filter edit box loses its focus.
+ */
+void CPropLineFilter::OnEnKillfocusLfilterEditbox()
+{
+ SaveItem();
+}
-// PropLineFilter.h : header file
-//
-
-#include "afxcmn.h"
-#include "afxwin.h"
-#if !defined(AFX_PROPFILTER_H__73E79E13_34DD_4C86_A3EC_A1044B721CCA__INCLUDED_)
-#define AFX_PROPFILTER_H__73E79E13_34DD_4C86_A3EC_A1044B721CCA__INCLUDED_
-
/**
* @file PropLineFilter.h
*
// ID line follows -- this is updated by SVN
// $Id$
+#include "afxcmn.h"
+#include "afxwin.h"
+#if !defined(AFX_PROPFILTER_H__73E79E13_34DD_4C86_A3EC_A1044B721CCA__INCLUDED_)
+#define AFX_PROPFILTER_H__73E79E13_34DD_4C86_A3EC_A1044B721CCA__INCLUDED_
+
class LineFiltersList;
/// Class for Line filter propertypage
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnBnClickedLfilterEditsave();
afx_msg void OnLvnItemActivateLfilterList(NMHDR *pNMHDR, LRESULT *pResult);
+ afx_msg void OnEnKillfocusLfilterEditbox();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void InitList();
int AddRow(LPCTSTR filter = NULL, BOOL enabled = FALSE);
void EditSelectedFilter();
+ void SaveItem();
private:
CListCtrl m_filtersList; /**< List control having filter strings */