bRecurse = dlg.m_bRecurse;
strExt = dlg.m_strParsedExt;
}
+ else
+ {
+ //save the MRU left and right files.
+ addToMru(pszLeft, _T("Files\\Left"));
+ addToMru(pszRight, _T("Files\\Right"));
+ }
// check to make sure they are same type
r->next = *reglist;
*reglist = r;
}
+
+// utility function to update CSuperComboBox format MRU
+void CMainFrame::addToMru(LPCSTR szItem, LPCSTR szRegSubKey, UINT nMaxItems)
+{
+ CString s,s2;
+ UINT cnt = AfxGetApp()->GetProfileInt(szRegSubKey, "Count", 0);
+ ++cnt; // add new string
+ if(cnt>nMaxItems)
+ {
+ cnt=nMaxItems;
+ }
+ // move items down a step
+ for (UINT i=cnt ; i!=0; --i)
+ {
+ s2.Format("Item_%d", i-1);
+ s = AfxGetApp()->GetProfileString(szRegSubKey, s2);
+ s2.Format("Item_%d", i);
+ AfxGetApp()->WriteProfileString(szRegSubKey, s2, s);
+ }
+ // add most recent item
+ AfxGetApp()->WriteProfileString(szRegSubKey, "Item_0", szItem);
+ // update count
+ AfxGetApp()->WriteProfileInt(szRegSubKey, "Count", cnt);
+}
DECLARE_MESSAGE_MAP()
private:
+ void addToMru(LPCSTR szItem, LPCSTR szRegSubKey, UINT nMaxItems = 20);
// builds the regular expression list if the
// user choose to ignore Ignore changes affecting only lines
// that match the specified regexp.