Revision: 3697
http://svn.sourceforge.net/winmerge/?rev=3697&view=rev
Author: elsapo
Date: 2006-10-09 18:12:17 -0700 (Mon, 09 Oct 2006)
Log Message:
-----------
Merge in changes from my local UI version (no line transformations)
Modified Paths:
--------------
branches/Perry/Src/Common/MessageBoxDialog.h
branches/Perry/Src/Common/dllproxy.c
branches/Perry/Src/Common/unicoder.cpp
branches/Perry/Src/DiffFileData.cpp
branches/Perry/Src/DiffThread.cpp
branches/Perry/Src/DiffThread.h
branches/Perry/Src/DirCompProgressDlg.cpp
branches/Perry/Src/DirCompProgressDlg.h
branches/Perry/Src/DirDoc.cpp
branches/Perry/Src/DirDoc.h
branches/Perry/Src/DirView.cpp
branches/Perry/Src/DirView.h
branches/Perry/Src/DirViewColItems.cpp
branches/Perry/Src/LocationView.cpp
branches/Perry/Src/MainFrm.cpp
branches/Perry/Src/Merge.cpp
branches/Perry/Src/Merge.dsp
branches/Perry/Src/Merge.rc
branches/Perry/Src/MergeDoc.cpp
branches/Perry/Src/MergeEditView.cpp
branches/Perry/Src/MergeEditView.h
branches/Perry/Src/OptionsDef.h
branches/Perry/Src/OptionsInit.cpp
branches/Perry/Src/PropCompare.cpp
branches/Perry/Src/PropCompare.h
branches/Perry/Src/PropGeneral.cpp
branches/Perry/Src/PropGeneral.h
branches/Perry/Src/PropRegistry.cpp
branches/Perry/Src/diffutils/src/IO.C
branches/Perry/Src/editlib/ccrystaleditview.cpp
branches/Perry/Src/editlib/ccrystaleditview.h
branches/Perry/Src/editlib/ccrystaltextview.cpp
branches/Perry/Src/editlib/ccrystaltextview.h
branches/Perry/Src/editlib/ccrystaltextview2.cpp
branches/Perry/Src/editlib/ceditreplacedlg.cpp
branches/Perry/Src/editlib/ceditreplacedlg.h
branches/Perry/Src/editlib/cfindtextdlg.cpp
branches/Perry/Src/editlib/cfindtextdlg.h
branches/Perry/Src/editlib/cplusplus.cpp
branches/Perry/Src/editlib/editreg.h
branches/Perry/Src/editlib/gotodlg.cpp
branches/Perry/Src/editlib/gotodlg.h
branches/Perry/Src/resource.h
branches/Perry/Src/stringdiffs.cpp
branches/Perry/Testing/selftests/testdiff.pl
Added Paths:
-----------
branches/Perry/Src/DisplayProperties.cpp
branches/Perry/Src/DisplayProperties.h
branches/Perry/Src/PropertyDlg.cpp
branches/Perry/Src/PropertyDlg.h
branches/Perry/Src/res/dirstat_binarydiff.bmp
branches/Perry/Src/res/dirstat_binarysame.bmp
branches/Perry/Src/res/dirstat_equal.bmp
branches/Perry/Src/res/dirstat_error.bmp
branches/Perry/Src/res/dirstat_fileskip.bmp
branches/Perry/Src/res/dirstat_folder.bmp
branches/Perry/Src/res/dirstat_folderskip.bmp
branches/Perry/Src/res/dirstat_lfile.bmp
branches/Perry/Src/res/dirstat_lfolder.bmp
branches/Perry/Src/res/dirstat_notequal.bmp
branches/Perry/Src/res/dirstat_rfile.bmp
branches/Perry/Src/res/dirstat_rfolder.bmp
branches/Perry/branch.txt
Modified: branches/Perry/Src/Common/MessageBoxDialog.h
===================================================================
--- branches/Perry/Src/Common/MessageBoxDialog.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/Common/MessageBoxDialog.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -159,7 +159,7 @@
// Methods for handling common window functions.
// Method for displaying the dialog.
- virtual INT_PTR DoModal ( );
+ virtual int DoModal ( );
// Method for closing the dialog.
void EndDialog ( int nResult );
Modified: branches/Perry/Src/Common/dllproxy.c
===================================================================
--- branches/Perry/Src/Common/dllproxy.c 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/Common/dllproxy.c 2006-10-10 01:12:17 UTC (rev 3697)
@@ -93,6 +93,7 @@
return TlsGetValue(ThreadTopOfStack);
}
+#pragma warning (disable:4731) // warning C4731: 'Unresolved' : frame pointer register 'ebp' modified by inline assembly code
static INT NTAPI Unresolved()
{
// declare a variable to produce a stack frame
@@ -126,6 +127,7 @@
#endif
return Unresolved;
}
+#pragma warning (default:4731) // warning C4731: 'Unresolved' : frame pointer register 'ebp' modified by inline assembly code
#else
#ifdef _MSC_VER
Modified: branches/Perry/Src/Common/unicoder.cpp
===================================================================
--- branches/Perry/Src/Common/unicoder.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/Common/unicoder.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -502,6 +502,15 @@
int n = MultiByteToWideChar(codepage, flags, lpd, len, wbuff, wlen-1);
if (n)
{
+ /*
+ NB: MultiByteToWideChar is documented as only zero-terminating
+ if input was zero-terminated, but it appears that it can
+ zero-terminate even if input wasn't.
+ So we check if it zero-terminated and adjust count accordingly.
+ */
+ if (wbuff[n-1] == 0)
+ --n;
+
str.ReleaseBuffer(n);
return str;
}
Modified: branches/Perry/Src/DiffFileData.cpp
===================================================================
--- branches/Perry/Src/DiffFileData.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DiffFileData.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -643,7 +643,8 @@
if (!eof[i] && bfend[i]<countof(buff[i])-1)
{
// Assume our blocks are in range of unsigned int
- unsigned int space = countof(buff[i]) - bfend[i];
+ _int64 space64 = countof(buff[i]) - bfend[i];
+ unsigned int space = static_cast<unsigned int>(space64);
size_t rtn = fread(&buff[i][bfend[i]], 1, space, fp[i]);
if (ferror(fp[i]))
return DIFFCODE::CMPERR;
Modified: branches/Perry/Src/DiffThread.cpp
===================================================================
--- branches/Perry/Src/DiffThread.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DiffThread.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -33,12 +33,7 @@
#include "CompareStats.h"
#include "IAbortable.h"
-// Set this to true in order to single step
-// through entire compare process all in a single thread
-// Either edit this line, or breakpoint & change it in CompareDirectories() below
-static bool bSinglethreaded=false;
-
/**
* @brief Data sent to diff thread
*/
@@ -112,7 +107,7 @@
/**
* @brief Start directory compare thread
*/
-UINT CDiffThread::CompareDirectories(CString dir1, CString dir2, BOOL bRecursive)
+UINT CDiffThread::CompareDirectories(CString dir1, CString dir2, BOOL bRecursive, bool bSingleThreaded)
{
ASSERT(m_pDiffParm->nThreadState != THREAD_COMPARING);
@@ -128,7 +123,7 @@
m_pDiffParm->nThreadState = THREAD_COMPARING;
- if (bSinglethreaded)
+ if (bSingleThreaded)
{
DiffThread(m_pDiffParm);
}
Modified: branches/Perry/Src/DiffThread.h
===================================================================
--- branches/Perry/Src/DiffThread.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DiffThread.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -52,7 +52,7 @@
CDiffThread();
~CDiffThread();
CDiffContext * SetContext(CDiffContext * pCtx);
- UINT CompareDirectories(CString dir1, CString dir2, BOOL bRecursive);
+ UINT CompareDirectories(CString dir1, CString dir2, BOOL bRecursive, bool bSingleThreaded);
void SetHwnd(HWND hWnd);
void SetMessageIDs(UINT updateMsg, UINT statusMsg);
void SetCompareSelected(bool bSelected = false);
Modified: branches/Perry/Src/DirCompProgressDlg.cpp
===================================================================
--- branches/Perry/Src/DirCompProgressDlg.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirCompProgressDlg.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -41,6 +41,19 @@
*/
void DirCompProgressDlg::ClearStat()
{
+ SetDlgItemInt(IDC_COUNT_LFILE, 0);
+ SetDlgItemInt(IDC_COUNT_RFILE, 0);
+ SetDlgItemInt(IDC_COUNT_NOTEQUAL, 0);
+ SetDlgItemInt(IDC_COUNT_EQUAL, 0);
+ SetDlgItemInt(IDC_COUNT_BINARYSAME, 0);
+ SetDlgItemInt(IDC_COUNT_BINARYDIFF, 0);
+ SetDlgItemInt(IDC_COUNT_LFOLDER, 0);
+ SetDlgItemInt(IDC_COUNT_RFOLDER, 0);
+ SetDlgItemInt(IDC_COUNT_FILESKIP, 0);
+ SetDlgItemInt(IDC_COUNT_FOLDERSKIP, 0);
+ SetDlgItemInt(IDC_COUNT_FOLDER, 0);
+ SetDlgItemInt(IDC_COUNT_ERROR, 0);
+
CProgressCtrl *pProg = (CProgressCtrl*) GetDlgItem(IDC_PROGRESSCOMPARE);
pProg->SetPos(0);
@@ -100,6 +113,69 @@
}
/**
+ * @brief Return control ID for result code.
+ */
+UINT DirCompProgressDlg::GetIDFromResult(CompareStats::RESULT res)
+{
+ UINT resID = 0;
+
+ switch ((int)res)
+ {
+ case CompareStats::RESULT_LUNIQUE:
+ resID = IDC_COUNT_LFILE;
+ break;
+ case CompareStats::RESULT_RUNIQUE:
+ resID = IDC_COUNT_RFILE;
+ break;
+ case CompareStats::RESULT_DIFF:
+ resID = IDC_COUNT_NOTEQUAL;
+ break;
+ case CompareStats::RESULT_SAME:
+ resID = IDC_COUNT_EQUAL;
+ break;
+ case CompareStats::RESULT_BINSAME:
+ resID = IDC_COUNT_BINARYSAME;
+ break;
+ case CompareStats::RESULT_BINDIFF:
+ resID = IDC_COUNT_BINARYDIFF;
+ break;
+ case CompareStats::RESULT_LDIRUNIQUE:
+ resID = IDC_COUNT_LFOLDER;
+ break;
+ case CompareStats::RESULT_RDIRUNIQUE:
+ resID = IDC_COUNT_RFOLDER;
+ break;
+ case CompareStats::RESULT_SKIP:
+ resID = IDC_COUNT_FILESKIP;
+ break;
+ case CompareStats::RESULT_DIRSKIP:
+ resID = IDC_COUNT_FOLDERSKIP;
+ break;
+ case CompareStats::RESULT_DIR:
+ resID = IDC_COUNT_FOLDER;
+ break;
+ case CompareStats::RESULT_ERROR:
+ resID = IDC_COUNT_ERROR;
+ break;
+ }
+ return resID;
+}
+
+/**
+ * @brief Update all status counts at current values.
+ */
+void DirCompProgressDlg::UpdateElements()
+{
+ for (int i = 0; i < CompareStats::RESULT_COUNT; i++)
+ {
+ CompareStats::RESULT resnum = static_cast<CompareStats::RESULT>(i);
+ UINT resID = GetIDFromResult(resnum);
+ int count = m_pCompareStats->GetCount(resnum);
+ SetDlgItemInt(resID, count);
+ }
+}
+
+/**
* @brief Handle WM_KEYDOWN messages before normal processing
* to allow any key close stateDlg.
*/
@@ -169,6 +245,7 @@
_itot(comparedItems, num, 10);
pCompared->SetWindowText(num);
pProg->SetPos(comparedItems);
+ UpdateElements();
m_prevState = CompareStats::STATE_COMPARE;
}
// Comparing items
@@ -180,6 +257,7 @@
_itot(comparedItems, num, 10);
pCompared->SetWindowText(num);
pProg->SetPos(comparedItems);
+ UpdateElements();
}
// Compare is ready
// Update total items too since we might get only this one state
@@ -196,6 +274,7 @@
pTotal->SetWindowText(num);
pProg->SetRange32(0, totalItems);
pProg->SetPos(comparedItems);
+ UpdateElements();
EndUpdating();
m_prevState = CompareStats::STATE_COMPARE;
m_bCompareReady = TRUE;
Modified: branches/Perry/Src/DirCompProgressDlg.h
===================================================================
--- branches/Perry/Src/DirCompProgressDlg.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirCompProgressDlg.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -46,6 +46,8 @@
void EndUpdating();
void CloseDialog();
void SetDirDoc(CDirDoc *pDirDoc);
+ void UpdateElements();
+ UINT GetIDFromResult(CompareStats::RESULT res);
// Dialog Data
//{{AFX_DATA(DirCompProgressDlg)
Modified: branches/Perry/Src/DirDoc.cpp
===================================================================
--- branches/Perry/Src/DirDoc.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirDoc.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -324,13 +324,15 @@
m_pDirView->DeleteAllDisplayItems();
m_diffWrapper.StartDirectoryDiff();
+
+ bool bSingleThreaded = GetOptionsMgr()->GetBool(OPT_CMP_SINGLETHREADED);
m_diffThread.SetContext(m_pCtxt);
m_diffThread.SetHwnd(m_pDirView->GetSafeHwnd());
m_diffThread.SetMessageIDs(MSG_UI_UPDATE, MSG_STAT_UPDATE);
m_diffThread.SetCompareSelected(!!m_bMarkedRescan);
m_diffThread.CompareDirectories(m_pCtxt->GetNormalizedLeft(),
- m_pCtxt->GetNormalizedRight(), m_bRecursive);
+ m_pCtxt->GetNormalizedRight(), m_bRecursive, bSingleThreaded);
m_bMarkedRescan = FALSE;
}
Modified: branches/Perry/Src/DirDoc.h
===================================================================
--- branches/Perry/Src/DirDoc.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirDoc.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -151,6 +151,8 @@
void SetItemViewFlag(POSITION key, UINT flag, UINT mask);
void SetItemViewFlag(UINT flag, UINT mask);
const CompareStats * GetCompareStats() const { return m_pCompareStats; };
+ CString GetLeftDesc() const { return m_strLeftDesc; }
+ CString GetRightDesc() const { return m_strRightDesc; }
protected:
CDiffWrapper m_diffWrapper;
Modified: branches/Perry/Src/DirView.cpp
===================================================================
--- branches/Perry/Src/DirView.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirView.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -46,6 +46,7 @@
#include "DirCmpReport.h"
#include "DirCompProgressDlg.h"
#include "CompareStatisticsDlg.h"
+#include "DisplayProperties.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -193,6 +194,8 @@
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)
ON_UPDATE_COMMAND_UI(ID_EDIT_UNDO, OnUpdateEditUndo)
+ ON_COMMAND(ID_DIR_ITEM_PROPERTIES, OnItemProperties)
+ ON_UPDATE_COMMAND_UI(ID_DIR_ITEM_PROPERTIES, OnUpdateItemProperties)
//}}AFX_MSG_MAP
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnClick)
ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, OnItemChanged)
@@ -2025,9 +2028,12 @@
ASSERT(pDoc);
// Close and destroy the dialog after compare
- m_pCmpProgressDlg->CloseDialog();
- delete m_pCmpProgressDlg;
- m_pCmpProgressDlg = NULL;
+ if (GetOptionsMgr()->GetBool(OPT_AUTOCLOSE_DIRCOMP_STATS))
+ {
+ m_pCmpProgressDlg->CloseDialog();
+ delete m_pCmpProgressDlg;
+ m_pCmpProgressDlg = NULL;
+ }
pDoc->CompareReady();
Redisplay();
@@ -3052,3 +3058,79 @@
pCmdUI->Enable(FALSE);
}
}
+
+static void AddProps(PropertyList & props, PROPSIDE side, const DiffFileInfo & finfo)
+{
+ props.AddProperty(_T("Attr"), side, finfo.flags.toString());
+ props.AddProperty(_T("Encoding"), side, finfo.encoding.GetName());
+ props.AddProperty(_T("Zeros, number"), side, finfo.m_textStats.nzeros);
+ props.AddProperty(_T("Zeros, first offset"), side, finfo.m_textStats.first_zero);
+ props.AddProperty(_T("Zeros, last offset"), side, finfo.m_textStats.last_zero);
+ props.AddProperty(_T("ncrs"), side, finfo.m_textStats.ncrs);
+ props.AddProperty(_T("nlfs"), side, finfo.m_textStats.nlfs);
+ props.AddProperty(_T("ncrlfs"), side, finfo.m_textStats.ncrlfs);
+ props.AddProperty(_T("nlosses"), side, finfo.m_textStats.nlosses);
+}
+
+/**
+ * @brief For now, just display msgbox with comparison results, so use can see error
+ *
+ * @todo Should do dialog with complete paths and perhaps more info
+ * Maybe a treeview or listview of all known column properties as well
+ */
+void CDirView::DoDisplayItemProperties()
+{
+ int sel = GetSingleSelectedItem();
+ if (sel == -1)
+ return;
+ const DIFFITEM& di = GetDiffItem(sel);
+ if (di.empty)
+ return;
+ PropertyList props;
+ CString filename = (di.isSideRight() ? di.sRightFilename : di.sLeftFilename);
+ props.AddProperty(_T("Filename"), PNONE, filename);
+ props.AddProperty(_T("Subdir"), PRIGHT, di.sRightSubdir);
+ props.AddProperty(_T("Subdir"), PLEFT, di.sLeftSubdir);
+ props.AddProperty(_T("Error"), PNONE, di.errorDesc);
+ props.AddProperty(_T("Diffs(sig)"), PNONE, di.nsdiffs);
+ props.AddProperty(_T("Diffs(insig)"), PNONE, di.nidiffs);
+ AddProps(props, PLEFT, di.left);
+ AddProps(props, PRIGHT, di.right);
+
+ DisplayProperties(this, props);
+}
+
+/**
+ * @brief Display item properties
+ */
+void CDirView::OnItemProperties()
+{
+ DoDisplayItemProperties();
+}
+
+/**
+ * @brief Update "Item Properties" menu item
+ */
+void CDirView::OnUpdateItemProperties(CCmdUI* pCmdUI)
+{
+ DoUpdateItemProperties(pCmdUI);
+}
+
+/**
+ * @brief Update "Item Properties" menu item
+ *
+ * Currently we only display properties for single non-empty items
+ */
+void CDirView::DoUpdateItemProperties(CCmdUI* pCmdUI)
+{
+ BOOL bEnable = FALSE;
+ int sel = GetSingleSelectedItem();
+ if (sel != -1)
+ {
+ const DIFFITEM& di = GetDiffItem(sel);
+ if (!di.empty)
+ bEnable = TRUE;
+ }
+ pCmdUI->Enable(bEnable);
+
+}
Modified: branches/Perry/Src/DirView.h
===================================================================
--- branches/Perry/Src/DirView.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirView.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -173,6 +173,7 @@
void DoUpdateFileEncodingDialog(CCmdUI* pCmdUI);
BOOL DoItemRename(LPCTSTR szNewItemName);
BOOL RenameOnSameDir(LPCTSTR szOldFileName, LPCTSTR szNewFileName);
+ void DoDisplayItemProperties();
// End DirActions.cpp
void ReflectGetdispinfo(NMLVDISPINFO *);
@@ -367,6 +368,8 @@
afx_msg void OnEditPaste();
afx_msg void OnEditUndo();
afx_msg void OnUpdateEditUndo(CCmdUI* pCmdUI);
+ afx_msg void OnItemProperties();
+ afx_msg void OnUpdateItemProperties(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
BOOL OnHeaderBeginDrag(LPNMHEADER hdr, LRESULT* pResult);
@@ -396,6 +399,7 @@
void DoUpdateCtxtDirCopyRightTo(CCmdUI* pCmdUI);
void DoUpdateCtxtDirMoveLeftTo(CCmdUI* pCmdUI);
void DoUpdateCtxtDirMoveRightTo(CCmdUI* pCmdUI);
+ void DoUpdateItemProperties(CCmdUI* pCmdUI);
POSITION GetItemKeyFromData(DWORD dw) const;
DIFFITEM GetDiffItem(int sel) const;
DIFFITEM & GetDiffItemRef(int sel);
Modified: branches/Perry/Src/DirViewColItems.cpp
===================================================================
--- branches/Perry/Src/DirViewColItems.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/DirViewColItems.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -241,11 +241,11 @@
}
else if (di.isSideLeft())
{
- AfxFormatString1(s, IDS_ONLY_IN_FMT, di.getLeftFilepath(pCtxt->GetNormalizedLeft()));
+ AfxFormatString1(s, IDS_LEFT_ONLY_IN_FMT, di.getLeftFilepath(pCtxt->GetNormalizedLeft()));
}
else if (di.isSideRight())
{
- AfxFormatString1(s, IDS_ONLY_IN_FMT, di.getRightFilepath(pCtxt->GetNormalizedRight()));
+ AfxFormatString1(s, IDS_RIGHT_ONLY_IN_FMT, di.getRightFilepath(pCtxt->GetNormalizedRight()));
}
else if (di.isResultSame())
{
Added: branches/Perry/Src/DisplayProperties.cpp
===================================================================
--- branches/Perry/Src/DisplayProperties.cpp (rev 0)
+++ branches/Perry/Src/DisplayProperties.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -0,0 +1,11 @@
+#include "StdAfx.h"
+#include "resource.h"
+#include "DisplayProperties.h"
+#include "PropertyDlg.h"
+
+void DisplayProperties(CWnd * parent, const PropertyList & props)
+{
+ PropertyDlg dlg(parent, props);
+ dlg.DoModal();
+}
+
Added: branches/Perry/Src/DisplayProperties.h
===================================================================
--- branches/Perry/Src/DisplayProperties.h (rev 0)
+++ branches/Perry/Src/DisplayProperties.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -0,0 +1,26 @@
+#ifndef PropertyDialog_h_included
+#define PropertyDialog_h_included
+
+typedef enum { PLEFT, PRIGHT, PNONE } PROPSIDE;
+struct Property
+{
+ CString name;
+ PROPSIDE side;
+ CString value;
+ Property() { }
+ Property(LPCTSTR tname, PROPSIDE tside, LPCTSTR tvalue) : name(tname), side(tside), value(tvalue) { }
+};
+
+class PropertyList : public CList<Property>
+{
+public:
+ PropertyList() { }
+ void AddProperty(LPCTSTR name, PROPSIDE side, LPCTSTR value) { Property prop(name, side, value); AddTail(prop); }
+ void AddProperty(LPCTSTR name, PROPSIDE side, int value) { CString sval; sval.Format(_T("%d"), value); Property prop(name, side, sval); AddTail(prop); }
+ void AddProperty(LPCTSTR name, PROPSIDE side, unsigned int value) { CString sval; sval.Format(_T("%d"), value); Property prop(name, side, sval); AddTail(prop); }
+ void AddProperty(LPCTSTR name, PROPSIDE side, __int64 value) { CString sval; sval.Format(_T("%d"), value); Property prop(name, side, sval); AddTail(prop); }
+};
+
+void DisplayProperties(CWnd * parent, const PropertyList & props);
+
+#endif // PropertyDialog_h_included
Modified: branches/Perry/Src/LocationView.cpp
===================================================================
--- branches/Perry/Src/LocationView.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/LocationView.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -191,8 +191,8 @@
// Draw bar outlines
CPen* oldObj = (CPen*)pDC->SelectStockObject(BLACK_PEN);
- pDC->Rectangle(m_nLeftBarLeft, Y_OFFSET - 1, m_nLeftBarRight, LineInPix * nbLines + Y_OFFSET);
- pDC->Rectangle(m_nRightBarLeft, Y_OFFSET - 1, m_nRightBarRight, LineInPix * nbLines + Y_OFFSET);
+ pDC->Rectangle(m_nLeftBarLeft, Y_OFFSET - 1, m_nLeftBarRight, (int)(LineInPix * nbLines) + Y_OFFSET);
+ pDC->Rectangle(m_nRightBarLeft, Y_OFFSET - 1, m_nRightBarRight, (int)(LineInPix * nbLines) + Y_OFFSET);
pDC->SelectObject(oldObj);
while (true)
Modified: branches/Perry/Src/MainFrm.cpp
===================================================================
--- branches/Perry/Src/MainFrm.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/MainFrm.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -402,7 +402,7 @@
// Finds debug menu by looking for a submenu which
// starts with item ID_DEBUG_LOADCONFIG
- for (int i=0; i< menu->GetMenuItemCount(); ++i)
+ for (UINT i=0; i< menu->GetMenuItemCount(); ++i)
{
if (menu->GetSubMenu(i)->GetMenuItemID(0) == ID_DEBUG_LOADCONFIG)
{
@@ -1232,7 +1232,7 @@
// Add backup extension if pathlength allows it
BOOL success = TRUE;
CString s = pszPath;
- if (s.GetLength() >= (MAX_PATH - _tcslen(BACKUP_FILE_EXT)))
+ if (s.GetLength() >= (MAX_PATH - (int)_tcslen(BACKUP_FILE_EXT)))
success = FALSE;
else
s += BACKUP_FILE_EXT;
Modified: branches/Perry/Src/Merge.cpp
===================================================================
--- branches/Perry/Src/Merge.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/Merge.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -203,19 +203,20 @@
// WinMerge registry settings are stored under HKEY_CURRENT_USER/Software/Thingamahoochie
// This is the name of the company of the original author (Dean Grimm)
- SetRegistryKey(_T("Thingamahoochie"));
+ SetRegistryKey(_T("WinMergeX"));
BOOL bSingleInstance = GetProfileInt(_T("Settings"), _T("SingleInstance"), FALSE) ||
(TRUE == cmdInfo.m_bSingleInstance);
HANDLE hMutex = NULL;
+ CString mutexGuid = _T("{E10D9583-1261-47c8-B973-9E4F88074D72}");
if (bSingleInstance)
{
- hMutex = CreateMutex(NULL, FALSE, _T("WinMerge{05963771-8B2E-11d8-B3B9-000000000000}"));
+ hMutex = CreateMutex(NULL, FALSE, mutexGuid);
WaitForSingleObject(hMutex, INFINITE);
}
- CInstanceChecker instanceChecker(_T("{05963771-8B2E-11d8-B3B9-000000000000}"));
+ CInstanceChecker instanceChecker(mutexGuid);
if (bSingleInstance)
{
if (instanceChecker.PreviousInstanceRunning())
Modified: branches/Perry/Src/Merge.dsp
===================================================================
--- branches/Perry/Src/Merge.dsp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/Merge.dsp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -380,6 +380,10 @@
# End Source File
# Begin Source File
+SOURCE=.\DisplayProperties.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\dlgutil.cpp
# End Source File
# Begin Source File
@@ -683,6 +687,10 @@
# End Source File
# Begin Source File
+SOURCE=.\PropertyDlg.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Common\PropertyPageHost.cpp
# End Source File
# Begin Source File
@@ -1097,6 +1105,10 @@
# End Source File
# Begin Source File
+SOURCE=.\DisplayProperties.h
+# End Source File
+# Begin Source File
+
SOURCE=.\dlgutil.h
# End Source File
# Begin Source File
@@ -1345,6 +1357,10 @@
# End Source File
# Begin Source File
+SOURCE=.\PropertyDlg.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Common\PropertyPageHost.h
# End Source File
# Begin Source File
Modified: branches/Perry/Src/Merge.rc
===================================================================
--- branches/Perry/Src/Merge.rc 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/Merge.rc 2006-10-10 01:12:17 UTC (rev 3697)
@@ -531,7 +531,9 @@
MENUITEM "&Differences... (%1 of %2)", ID_DIR_ZIP_BOTH_DIFFS_ONLY
END
MENUITEM SEPARATOR
- MENUITEM "&Refresh", ID_DIR_RESCAN
+ MENUITEM "Properties", ID_DIR_ITEM_PROPERTIES
+ MENUITEM SEPARATOR
+ MENUITEM "&Refresh", ID_DIR_RESCAN
END
POPUP "_HDR_POPUP_"
BEGIN
@@ -632,11 +634,11 @@
IDD_ABOUTBOX DIALOGEX 0, 0, 223, 124
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION |
WS_SYSMENU
-CAPTION "About WinMerge"
+CAPTION "About WinMergeX"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,24,14,21,20
- LTEXT "WinMerge",IDC_STATIC,63,13,63,8,SS_NOPREFIX
+ LTEXT "WinMergeX",IDC_STATIC,63,13,63,8,SS_NOPREFIX
LTEXT "Version 1.0",IDC_VERSION,63,23,153,8,SS_NOPREFIX
LTEXT "(Private Build)",IDC_PRIVATEBUILD,63,33,153,8
LTEXT "All rights reserved.",IDC_STATIC,7,60,170,8
@@ -753,6 +755,8 @@
IDC_STATIC,7,153,168,31
PUSHBUTTON "Reset",IDC_RESET_ALL_MESSAGE_BOXES,178,159,50,14,NOT
WS_TABSTOP
+ CONTROL "AutoClose Dir Stats",IDC_AUTOCLOSE_DIRCOMP_STATS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,139,36,89,10
END
IDD_LANGUAGE_SELECT DIALOGEX 0, 0, 214, 142
@@ -1072,9 +1076,9 @@
ES_READONLY
END
-IDD_DIRCOMP_PROGRESS DIALOGEX 0, 0, 256, 60
+IDD_DIRCOMP_PROGRESS DIALOGEX 0, 0, 330, 110
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE |
- WS_CAPTION
+ WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_TOOLWINDOW
CAPTION " Folder Compare Progress"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
@@ -1087,6 +1091,61 @@
LTEXT "Comparing items...",IDC_STATIC,7,7,150,8
LTEXT "Items compared:",IDC_STATIC,7,29,85,8
LTEXT "Items total:",IDC_STATIC,7,19,85,8
+ LTEXT "",IDC_STATIC,3,64,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,3,84,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,56,64,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,56,84,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,109,64,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,109,84,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,162,64,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,162,84,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,215,64,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,215,84,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,268,64,51,17,SS_SUNKEN | NOT WS_GROUP
+ LTEXT "",IDC_STATIC,268,84,51,17,SS_SUNKEN | NOT WS_GROUP
+ CONTROL 7410,IDC_STATIC,"Static",SS_BITMAP,7,68,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7411,IDC_STATIC,"Static",SS_BITMAP,7,87,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7412,IDC_STATIC,"Static",SS_BITMAP,60,68,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7413,IDC_STATIC,"Static",SS_BITMAP,60,87,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7414,IDC_STATIC,"Static",SS_BITMAP,113,68,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7415,IDC_STATIC,"Static",SS_BITMAP,113,87,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7416,IDC_STATIC,"Static",SS_BITMAP,165,68,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7417,IDC_STATIC,"Static",SS_BITMAP,165,87,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7418,IDC_STATIC,"Static",SS_BITMAP,218,68,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7419,IDC_STATIC,"Static",SS_BITMAP,218,87,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7420,IDC_STATIC,"Static",SS_BITMAP,271,68,12,11,
+ WS_EX_STATICEDGE
+ CONTROL 7421,IDC_STATIC,"Static",SS_BITMAP,271,87,12,11,
+ WS_EX_STATICEDGE
+ RTEXT "",IDC_COUNT_FOLDER,24,70,26,8,SS_REALSIZEIMAGE | 0x2000
+ RTEXT "",IDC_COUNT_ERROR,24,89,26,8,SS_REALSIZEIMAGE | 0x2000
+ RTEXT "",IDC_COUNT_LFOLDER,76,70,26,8,SS_REALSIZEIMAGE |
+ 0x2000
+ RTEXT "",IDC_COUNT_RFOLDER,76,89,26,8,SS_REALSIZEIMAGE |
+ 0x2000
+ RTEXT "",IDC_COUNT_EQUAL,129,70,26,8,SS_REALSIZEIMAGE | 0x2000
+ RTEXT "",IDC_COUNT_NOTEQUAL,129,89,26,8,SS_REALSIZEIMAGE |
+ 0x2000
+ RTEXT "",IDC_COUNT_BINARYSAME,182,70,26,8,SS_REALSIZEIMAGE |
+ 0x2000
+ RTEXT "",IDC_COUNT_BINARYDIFF,182,89,26,8,SS_REALSIZEIMAGE |
+ 0x2000
+ RTEXT "",IDC_COUNT_LFILE,235,70,26,8,SS_REALSIZEIMAGE | 0x2000
+ RTEXT "",IDC_COUNT_RFILE,235,89,26,8,SS_REALSIZEIMAGE | 0x2000
+ RTEXT "",IDC_COUNT_FOLDERSKIP,288,70,26,8,SS_REALSIZEIMAGE |
+ 0x2000
+ RTEXT "",IDC_COUNT_FILESKIP,288,89,26,8,SS_REALSIZEIMAGE |
+ 0x2000
END
IDD_WMGOTO DIALOGEX 0, 0, 210, 70
@@ -1141,6 +1200,8 @@
CONTROL "Filter Comments",IDC_FILTERCOMMENTS_CHECK,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,15,147,205,10
PUSHBUTTON "Defaults",IDC_COMPARE_DEFAULTS,7,179,50,14
+ CONTROL "SingleThreaded",IDC_SINGLETHREADED,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,128,177,82,9
END
IDD_PROPPAGE_EDITOR DIALOGEX 0, 0, 235, 186
@@ -1569,6 +1630,18 @@
PUSHBUTTON "Save...",IDC_PROJ_SAVE,265,103,50,14
END
+IDD_PROPERTYDIALOG DIALOGEX 0, 0, 274, 126
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU |
+ WS_THICKFRAME
+CAPTION "Properties"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_LIST,"SysListView32",LVS_REPORT | LVS_ALIGNLEFT |
+ WS_BORDER | WS_TABSTOP,7,7,260,59
+ EDITTEXT IDC_EDIT,7,70,260,49,ES_MULTILINE | ES_AUTOHSCROLL |
+ WS_VSCROLL
+END
+
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
@@ -1576,8 +1649,8 @@
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,0,0,0
- PRODUCTVERSION 0,0,0,0
+ FILEVERSION 1,0,0,16281
+ PRODUCTVERSION 1,0,0,16281
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x9L
@@ -1593,13 +1666,13 @@
BLOCK "040904e4"
BEGIN
VALUE "Comments", "English translation by developers"
- VALUE "FileDescription", "WinMerge Application\0"
+ VALUE "FileDescription", "WinMergeX Application\0"
VALUE "FileVersion", "000.000.000.000\0"
- VALUE "InternalName", "WinMerge\0"
+ VALUE "InternalName", "WinMergeX\0"
VALUE "LegalCopyright", "\xA9 1996-2006 Dean P. Grimm / Thingamahoochie Software\0"
- VALUE "OriginalFilename", "WinMerge.EXE\0"
+ VALUE "OriginalFilename", "WinMergeX.EXE\0"
VALUE "PrivateBuild", ""
- VALUE "ProductName", "WinMerge\0"
+ VALUE "ProductName", "WinMergeX\0"
VALUE "ProductVersion", "000.000.000.000\0"
END
END
@@ -1691,8 +1764,19 @@
IDB_EDIT_GOTO_NEXT_BOOKMARK BITMAP "res\\next_bookmark.bmp"
IDB_EDIT_GOTO_PREV_BOOKMARK BITMAP "res\\prev_bookmark.bmp"
IDB_EDIT_CLEAR_ALL_BOOKMARKS BITMAP "res\\clear_bookmarks.bmp"
+IDB_FOLDER BITMAP "res\\dirstat_folder.bmp"
+IDB_ERROR BITMAP "res\\dirstat_error.bmp"
+IDB_LFOLDER BITMAP "res\\dirstat_lfolder.bmp"
+IDB_RFOLDER BITMAP "res\\dirstat_rfolder.bmp"
+IDB_EQUAL BITMAP "res\\dirstat_equal.bmp"
+IDB_NOTEQUAL BITMAP "res\\dirstat_notequal.bmp"
+IDB_BINARYSAME BITMAP "res\\dirstat_binarysame.bmp"
+IDB_BINARYDIFF BITMAP "res\\dirstat_binarydiff.bmp"
+IDB_LFILE BITMAP "res\\dirstat_lfile.bmp"
+IDB_RFILE BITMAP "res\\dirstat_rfile.bmp"
+IDB_FOLDERSKIP BITMAP "res\\dirstat_folderskip.bmp"
+IDB_FILESKIP BITMAP "res\\dirstat_fileskip.bmp"
-
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
@@ -1708,7 +1792,7 @@
STRINGTABLE
BEGIN
- AFX_IDS_APP_TITLE "WinMerge"
+ AFX_IDS_APP_TITLE "WinMergeX"
AFX_IDS_IDLEMESSAGE "Ready"
END
@@ -1849,7 +1933,7 @@
// WINMERGE INFORMATION
STRINGTABLE
BEGIN
- IDR_MAINFRAME "WinMerge"
+ IDR_MAINFRAME "WinMergeX"
IDR_MERGEDOCTYPE "\nWinMerge\nWinMerge\n\n\nWinMerge.Document\nWinMerge Document"
END
@@ -2279,7 +2363,8 @@
IDS_ABORTED_ITEM "Item aborted"
IDS_FILE_SKIPPED "File skipped"
IDS_DIR_SKIPPED "Folder skipped"
- IDS_ONLY_IN_FMT "Only in %1"
+ IDS_LEFT_ONLY_IN_FMT "Left Only: %1"
+ IDS_RIGHT_ONLY_IN_FMT "Right Only: %1"
IDS_BIN_FILES_SAME "Binary files are identical"
IDS_IDENTICAL "Identical"
IDS_BIN_FILES_DIFF "Binary files are different"
@@ -2921,6 +3006,17 @@
IDS_AUTOCOMPLETE_MRU "From MRU list"
END
+// Find/Replace customization
+STRINGTABLE
+BEGIN
+ IDS_FIND_IN_LEFT_FILE "Find In Left File"
+ IDS_FIND_IN_RIGHT_FILE "Find In Right File"
+ IDS_REPLACE_IN_LEFT_FILE "Replace In Left File"
+ IDS_REPLACE_IN_RIGHT_FILE "Replace In Right File"
+ IDS_GOTO_IN_LEFT_FILE "Goto (Left)"
+ IDS_GOTO_IN_RIGHT_FILE "Goto (Right)"
+END
+
// END STRINGS SYNCHRO
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
Modified: branches/Perry/Src/MergeDoc.cpp
===================================================================
--- branches/Perry/Src/MergeDoc.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/MergeDoc.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -2369,8 +2369,8 @@
dfi.Update(szPath);
- int timeDiff = dfi.mtime - fileInfo->mtime;
- timeDiff = abs(timeDiff);
+ __int64 timeDiff = dfi.mtime - fileInfo->mtime;
+ timeDiff = abs((int)timeDiff);
if (timeDiff > tolerance ||
dfi.size != fileInfo->size)
{
@@ -2982,19 +2982,23 @@
*/
void CMergeDoc::UpdateHeaderPath(int pane)
{
- CChildFrame *pf = GetParentFrame();
- ASSERT(pf);
CString sText;
BOOL bChanges = FALSE;
- if (m_nBufferType[pane] == BUFFER_UNNAMED ||
- m_nBufferType[pane] == BUFFER_NORMAL_NAMED)
+ sText = m_strDesc[pane];
+ if (sText.IsEmpty())
{
- sText = m_strDesc[pane];
+ if (pane == MERGE_VIEW_LEFT)
+ sText = m_pDirDoc->GetLeftDesc();
+ else
+ sText = m_pDirDoc->GetRightDesc();
}
- else
+
+ if (!(m_nBufferType[pane] == BUFFER_UNNAMED ||
+ m_nBufferType[pane] == BUFFER_NORMAL_NAMED))
{
- sText = m_filePaths.GetPath(pane);
+ sText += _T(": ");
+ sText += m_filePaths.GetPath(pane);
if (m_pDirDoc)
{
if (pane == 0)
@@ -3008,6 +3012,8 @@
if (bChanges)
sText.Insert(0, _T("* "));
+ CChildFrame *pf = GetParentFrame();
+ ASSERT(pf);
pf->GetHeaderInterface()->SetText(pane, sText);
SetTitle(NULL);
Modified: branches/Perry/Src/MergeEditView.cpp
===================================================================
--- branches/Perry/Src/MergeEditView.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/MergeEditView.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -45,6 +45,9 @@
#include "SyntaxColors.h"
#include "SplitterWndEx.h" // For printing (OnPrint, SlavePrint)
#include "MergeLineFlags.h"
+#include "cfindtextdlg.h"
+#include "ceditreplacedlg.h"
+#include "gotodlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@@ -1470,8 +1473,8 @@
// If diff first line outside current view - context OR
// if diff last line outside current view - context OR
// if diff is bigger than screen
- if ((ptStart.y < m_nTopLine + CONTEXT_LINES_ABOVE) ||
- (ptEnd.y >= m_nTopLine + GetScreenLines() - CONTEXT_LINES_BELOW) ||
+ if ((ptStart.y < m_nTopLine + (int)CONTEXT_LINES_ABOVE) ||
+ (ptEnd.y >= m_nTopLine + GetScreenLines() - (int)CONTEXT_LINES_BELOW) ||
(ptEnd.y - ptStart.y) >= GetScreenLines())
{
int line = ptStart.y - CONTEXT_LINES_ABOVE;
@@ -2986,3 +2989,47 @@
m_pLocationView->UpdateVisiblePos(nTopLine, nBottomLine);
}
}
+
+static bool IsLeftPane(int pane)
+{
+ return (pane == MERGE_VIEW_LEFT);
+}
+
+/**
+ * Customize title of Crystal Editor's find dialog
+ */
+void // virtual
+CMergeEditView::OnFindTextDlgInit(CFindTextDlg & dlg)
+{
+ CGhostTextView::OnFindTextDlgInit(dlg);
+ int id = (IsLeftPane(m_nThisPane) ? IDS_FIND_IN_LEFT_FILE : IDS_FIND_IN_RIGHT_FILE);
+ CString title = LoadResString(id);
+ if (!title.IsEmpty())
+ dlg.SetWindowText(title);
+}
+
+/**
+ * Customize title of Crystal Editor's replace dialog
+ */
+void // virtual
+CMergeEditView::OnReplaceTextDlgInit(CEditReplaceDlg & dlg)
+{
+ CGhostTextView::OnReplaceTextDlgInit(dlg);
+ int id = (IsLeftPane(m_nThisPane) ? IDS_REPLACE_IN_LEFT_FILE : IDS_REPLACE_IN_RIGHT_FILE);
+ CString title = LoadResString(id);
+ if (!title.IsEmpty())
+ dlg.SetWindowText(title);
+}
+
+/**
+ * Customize title of Crystal Editor's replace dialog
+ */
+void // virtual
+CMergeEditView::OnGotoDlgInit(CGotoDlg & dlg)
+{
+ CGhostTextView::OnGotoDlgInit(dlg);
+ int id = (IsLeftPane(m_nThisPane) ? IDS_GOTO_IN_LEFT_FILE : IDS_GOTO_IN_RIGHT_FILE);
+ CString title = LoadResString(id);
+ if (!title.IsEmpty())
+ dlg.SetWindowText(title);
+}
Modified: branches/Perry/Src/MergeEditView.h
===================================================================
--- branches/Perry/Src/MergeEditView.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/MergeEditView.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -198,6 +198,10 @@
virtual void OnUpdateCaret();
BOOL MergeModeKeyDown(MSG* pMsg);
int FindPrediffer(const CString & prediffer) const;
+ // Customize Crystal Text Editor
+ virtual void OnFindTextDlgInit(CFindTextDlg & dlg);
+ virtual void OnReplaceTextDlgInit(CEditReplaceDlg & dlg);
+ virtual void OnGotoDlgInit(CGotoDlg & dlg);
// Generated message map functions
Modified: branches/Perry/Src/OptionsDef.h
===================================================================
--- branches/Perry/Src/OptionsDef.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/OptionsDef.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -46,6 +46,7 @@
const TCHAR OPT_SINGLE_INSTANCE[] = _T("Settings/SingleInstance");
const TCHAR OPT_MERGE_MODE[] = _T("Settings/MergingMode");
const TCHAR OPT_CLOSE_WITH_ESC[] = _T("Settings/CloseWithEsc");
+const TCHAR OPT_AUTOCLOSE_DIRCOMP_STATS[] = _T("Settings/AutoCloseDirCompStats");
const TCHAR OPT_LOGGING[] = _T("Settings/Logging");
const TCHAR OPT_VERIFY_OPEN_PATHS[] = _T("Settings/VerifyOpenPaths");
const TCHAR OPT_AUTO_COMPLETE_SOURCE[] = _T("Settings/AutoCompleteSource");
@@ -109,6 +110,7 @@
const TCHAR OPT_CMP_MOVED_BLOCKS[] = _T("Settings/MovedBlocks");
const TCHAR OPT_CMP_STOP_AFTER_FIRST[] = _T("Settings/StopAfterFirst");
const TCHAR OPT_CMP_QUICK_LIMIT[] = _T("Settings/QuickMethodLimit");
+const TCHAR OPT_CMP_SINGLETHREADED[] = _T("Settings/CompareSingleThreaded");
// Multidoc enable/disable per document type
const TCHAR OPT_MULTIDOC_DIRDOCS[] = _T("Settings/MultiDirDocs");
Modified: branches/Perry/Src/OptionsInit.cpp
===================================================================
--- branches/Perry/Src/OptionsInit.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/OptionsInit.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -22,7 +22,7 @@
*/
void CMainFrame::OptionsInit()
{
- m_options.SetRegRootKey(_T("Thingamahoochie\\WinMerge\\"));
+ m_options.SetRegRootKey(_T("WinMergeX\\WinMergeX\\"));
// Initialise options (name, default value)
m_options.InitOption(OPT_SHOW_UNIQUE_LEFT, true);
@@ -64,6 +64,7 @@
m_options.InitOption(OPT_BREAK_TYPE, 0);
m_options.InitOption(OPT_CLOSE_WITH_ESC, true);
+ m_options.InitOption(OPT_AUTOCLOSE_DIRCOMP_STATS, false);
m_options.InitOption(OPT_LOGGING, 0);
m_options.InitOption(OPT_IGNORE_SMALL_FILETIME, false);
@@ -76,6 +77,7 @@
m_options.InitOption(OPT_CMP_MOVED_BLOCKS, false);
m_options.InitOption(OPT_CMP_STOP_AFTER_FIRST, false);
m_options.InitOption(OPT_CMP_QUICK_LIMIT, 4 * 1024 * 1024); // 4 Megs
+ m_options.InitOption(OPT_CMP_SINGLETHREADED, false);
m_options.InitOption(OPT_CLR_DIFF, (int)RGB(239,203,5));
m_options.InitOption(OPT_CLR_SELECTED_DIFF, (int)RGB(239,119,116));
Modified: branches/Perry/Src/PropCompare.cpp
===================================================================
--- branches/Perry/Src/PropCompare.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/PropCompare.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -50,6 +50,7 @@
DDX_Radio(pDX, IDC_WHITESPACE, m_nIgnoreWhite);
DDX_Check(pDX, IDC_MOVED_BLOCKS, m_bMovedBlocks);
DDX_Check(pDX, IDC_COMPARE_STOPFIRST, m_bStopAfterFirst);
+ DDX_Check(pDX, IDC_SINGLETHREADED, m_bSingleThreaded);
//}}AFX_DATA_MAP
}
@@ -76,6 +77,7 @@
m_bMovedBlocks = m_pOptionsMgr->GetBool(OPT_CMP_MOVED_BLOCKS);
m_compareMethod = m_pOptionsMgr->GetInt(OPT_CMP_METHOD);
m_bStopAfterFirst = m_pOptionsMgr->GetBool(OPT_CMP_STOP_AFTER_FIRST);
+ m_bSingleThreaded = m_pOptionsMgr->GetBool(OPT_CMP_SINGLETHREADED);
}
/**
@@ -93,6 +95,7 @@
m_pOptionsMgr->SaveOption(OPT_CMP_METHOD, (int)m_compareMethod);
m_pOptionsMgr->SaveOption(OPT_CMP_MOVED_BLOCKS, m_bMovedBlocks == TRUE);
m_pOptionsMgr->SaveOption(OPT_CMP_STOP_AFTER_FIRST, m_bStopAfterFirst == TRUE);
+ m_pOptionsMgr->SaveOption(OPT_CMP_SINGLETHREADED, m_bSingleThreaded == TRUE);
}
/////////////////////////////////////////////////////////////////////////////
Modified: branches/Perry/Src/PropCompare.h
===================================================================
--- branches/Perry/Src/PropCompare.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/PropCompare.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -53,7 +53,8 @@
int m_nIgnoreWhite;
BOOL m_bMovedBlocks;
BOOL m_bStopAfterFirst;
- BOOL m_bFilterCommentsLines;
+ BOOL m_bFilterCommentsLines;
+ BOOL m_bSingleThreaded;
//}}AFX_DATA
Modified: branches/Perry/Src/PropGeneral.cpp
===================================================================
--- branches/Perry/Src/PropGeneral.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/PropGeneral.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -53,6 +53,7 @@
, m_bSingleInstance(FALSE)
, m_bVerifyPaths(FALSE)
, m_bCloseWindowWithEsc(TRUE)
+, m_bAutoCloseDirCompStats(FALSE)
, m_bMultipleFileCmp(FALSE)
, m_bMultipleDirCmp(FALSE)
, m_nAutoCompleteSource(0)
@@ -93,6 +94,7 @@
DDX_Check(pDX, IDC_SINGLE_INSTANCE, m_bSingleInstance);
DDX_Check(pDX, IDC_VERIFY_OPEN_PATHS, m_bVerifyPaths);
DDX_Check(pDX, IDC_ESC_CLOSES_WINDOW, m_bCloseWindowWithEsc);
+ DDX_Check(pDX, IDC_AUTOCLOSE_DIRCOMP_STATS, m_bAutoCloseDirCompStats);
DDX_Check(pDX, IDC_MULTIDOC_FILECMP, m_bMultipleFileCmp);
DDX_Check(pDX, IDC_MULTIDOC_DIRCMP, m_bMultipleDirCmp);
DDX_CBIndex(pDX, IDC_AUTO_COMPLETE_SOURCE, m_nAutoCompleteSource);
@@ -117,6 +119,7 @@
m_bSingleInstance = m_pOptionsMgr->GetBool(OPT_SINGLE_INSTANCE);
m_bVerifyPaths = m_pOptionsMgr->GetBool(OPT_VERIFY_OPEN_PATHS);
m_bCloseWindowWithEsc = m_pOptionsMgr->GetBool(OPT_CLOSE_WITH_ESC);
+ m_bAutoCloseDirCompStats = m_pOptionsMgr->GetBool(OPT_AUTOCLOSE_DIRCOMP_STATS);
m_bMultipleFileCmp = m_pOptionsMgr->GetBool(OPT_MULTIDOC_MERGEDOCS);
m_bMultipleDirCmp = m_pOptionsMgr->GetBool(OPT_MULTIDOC_DIRDOCS);
m_nAutoCompleteSource = m_pOptionsMgr->GetInt(OPT_AUTO_COMPLETE_SOURCE);
@@ -133,6 +136,7 @@
m_pOptionsMgr->SaveOption(OPT_SINGLE_INSTANCE, m_bSingleInstance == TRUE);
m_pOptionsMgr->SaveOption(OPT_VERIFY_OPEN_PATHS, m_bVerifyPaths == TRUE);
m_pOptionsMgr->SaveOption(OPT_CLOSE_WITH_ESC, m_bCloseWindowWithEsc == TRUE);
+ m_pOptionsMgr->SaveOption(OPT_AUTOCLOSE_DIRCOMP_STATS, m_bAutoCloseDirCompStats == TRUE);
m_pOptionsMgr->SaveOption(OPT_MULTIDOC_MERGEDOCS, m_bMultipleFileCmp == TRUE);
m_pOptionsMgr->SaveOption(OPT_MULTIDOC_DIRDOCS, m_bMultipleDirCmp == TRUE);
m_pOptionsMgr->SaveOption(OPT_AUTO_COMPLETE_SOURCE, m_nAutoCompleteSource);
Modified: branches/Perry/Src/PropGeneral.h
===================================================================
--- branches/Perry/Src/PropGeneral.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/PropGeneral.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -39,6 +39,7 @@
BOOL m_bSingleInstance;
BOOL m_bVerifyPaths;
BOOL m_bCloseWindowWithEsc;
+ BOOL m_bAutoCloseDirCompStats;
BOOL m_bMultipleFileCmp;
BOOL m_bMultipleDirCmp;
int m_nAutoCompleteSource;
Modified: branches/Perry/Src/PropRegistry.cpp
===================================================================
--- branches/Perry/Src/PropRegistry.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/PropRegistry.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -44,7 +44,7 @@
#define CONTEXT_F_SUBFOLDERS 0x04
// registry dir to WinMerge
-static LPCTSTR f_RegDir = _T("Software\\Thingamahoochie\\WinMerge");
+static LPCTSTR f_RegDir = _T("Software\\WinMergeX\\WinMergeX");
// registry values
static LPCTSTR f_RegValueEnabled = _T("ContextMenuEnabled");
Added: branches/Perry/Src/PropertyDlg.cpp
===================================================================
--- branches/Perry/Src/PropertyDlg.cpp (rev 0)
+++ branches/Perry/Src/PropertyDlg.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -0,0 +1,96 @@
+// PropertyDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "Merge.h"
+#include "PropertyDlg.h"
+#include "DisplayProperties.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+// PropertyDlg dialog
+
+IMPLEMENT_DYNAMIC(PropertyDlg, CDialog)
+
+PropertyDlg::PropertyDlg(CWnd* pParent, const PropertyList & props)
+ : CDialog(PropertyDlg::IDD, pParent)
+ , m_props(props)
+{
+ //{{AFX_DATA_INIT(PropertyDlg)
+ //}}AFX_DATA_INIT
+}
+
+PropertyDlg::~PropertyDlg()
+{
+}
+
+void PropertyDlg::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+ //{{AFX_DATA_MAP(FileFiltersDlg)
+ DDX_Control(pDX, IDC_LIST, m_list);
+ DDX_Control(pDX, IDC_EDIT, m_value_box);
+ //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(PropertyDlg, CDialog)
+ //{{AFX_MSG_MAP(CJunkDlg)
+ ON_NOTIFY(LVN_ITEMCHANGED, IDC_LIST, OnItemchangedList)
+ //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+
+// PropertyDlg message handlers
+
+/**
+ * @brief Called before dialog is shown.
+ */
+BOOL PropertyDlg::OnInitDialog()
+{
+ CDialog::OnInitDialog();
+
+ // setup handler for resizing this dialog
+ m_constraint.InitializeCurrentSize(this);
+ // configure how individual controls adjust when dialog resizes
+ m_constraint.ConstrainItem(IDC_LIST, 0, 1, 0, 0.5); // grows right & 50% down
+ m_constraint.ConstrainItem(IDC_EDIT, 0, 1, 0.5, 0.5); // grows right, slides 50% down grows 50% down
+ m_constraint.SubclassWnd(); // install subclassing
+ m_constraint.LoadPosition(_T("ResizeableDialogs"), _T("ItemPropertyDlg"), false); // persist size via registry
+
+ DisplayProperties();
+
+ return TRUE; // return TRUE unless you set the focus to a control
+ // EXCEPTION: OCX Property Pages should return FALSE
+}
+
+void PropertyDlg::DisplayProperties()
+{
+ m_list.InsertColumn(0, _T("Name"), LVCFMT_LEFT, 100, 0);
+ m_list.InsertColumn(1, _T("Side"), LVCFMT_LEFT, 30, 1);
+ m_list.InsertColumn(2, _T("Value"), LVCFMT_LEFT, 100, 2);
+
+ for (POSITION pos = m_props.GetHeadPosition(); pos; m_props.GetNext(pos))
+ {
+ Property prop = m_props.GetAt(pos);
+ int index = m_list.InsertItem(m_list.GetItemCount(), prop.name);
+ CString side = (prop.side == PNONE ? _T("") : (prop.side == PLEFT ? _T("L") : _T("R")));
+ m_list.SetItemText(index, 1, side);
+ m_list.SetItemText(index, 2, prop.value);
+ }
+}
+
+void PropertyDlg::OnItemchangedList(NMHDR* pNMHDR, LRESULT* pResult)
+{
+ NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
+ if (pNMListView->iItem < 0) return;
+ CString value = m_list.GetItemText(pNMListView->iItem, 2);
+ m_value_box.SetWindowText(value);
+
+ *pResult = 0;
+}
+
Added: branches/Perry/Src/PropertyDlg.h
===================================================================
--- branches/Perry/Src/PropertyDlg.h (rev 0)
+++ branches/Perry/Src/PropertyDlg.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -0,0 +1,45 @@
+#ifndef PropertyDlg_h_included
+#define PropertyDlg_h_included
+
+#ifndef CMoveConstraint_h
+#include "CMoveConstraint.h"
+#endif
+
+class PropertyList;
+
+// PropertyDlg dialog
+
+class PropertyDlg : public CDialog
+{
+ DECLARE_DYNAMIC(PropertyDlg)
+
+public:
+ PropertyDlg(CWnd* pParent, const PropertyList & props); // standard constructor
+ virtual ~PropertyDlg();
+
+private:
+ void DisplayProperties();
+
+// Dialog Data
+ //{{AFX_DATA(FileFiltersDlg)
+ enum { IDD = IDD_PROPERTYDIALOG };
+ CListCtrl m_list;
+ CEdit m_value_box;
+ //}}AFX_DATA
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+ // Generated message map functions
+ //{{AFX_MSG(FileFiltersDlg)
+ virtual BOOL OnInitDialog();
+ afx_msg void OnItemchangedList(NMHDR* pNMHDR, LRESULT* pResult);
+ //}}AFX_MSG
+ DECLARE_MESSAGE_MAP()
+
+private:
+ prdlg::CMoveConstraint m_constraint;
+ const PropertyList & m_props;
+};
+
+#endif // PropertyDlg_h_included
Modified: branches/Perry/Src/diffutils/src/IO.C
===================================================================
--- branches/Perry/Src/diffutils/src/IO.C 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/diffutils/src/IO.C 2006-10-10 01:12:17 UTC (rev 3697)
@@ -268,10 +268,12 @@
further down (after hashing_done label)
*/
+ /* Note that all this logic must be essentially repeated in line_cmp */
+
/* Hash this line until we find a newline. */
if (ignore_case_flag)
{
- if (ignore_all_space_flag)
+ if (ignore_all_space_flag) {
while ((c = *p++) != '\n' && (c != '\r' || *p == '\n'))
{
if (ignore_eol_diff && (c=='\r' || c=='\n'))
@@ -279,7 +281,9 @@
if (! ISWSPACE (c))
h = HASH (h, isupper (c) ? tolower (c) : c);
}
- else if (ignore_space_change_flag)
+ if (c == '\r' && !ignore_eol_diff)
+ h = HASH(h, c);
+ } else if (ignore_space_change_flag) {
/* Note that \r must be hashed (if !ignore_eol_diff) */
while ((c = *p++) != '\n' && (c != '\r' || *p == '\n'))
{
@@ -314,6 +318,7 @@
{
/* runs of whitespace not ending line hashed as one space */
h = HASH (h, ' ');
+ /* c is not whitespace, so continue to hash it */
}
}
/* c is now the first non-space. */
@@ -322,17 +327,22 @@
if (c == '\r' && *p != '\n')
goto hashing_done;
}
- else
+ if (c == '\r' && !ignore_eol_diff)
+ h = HASH(h, c);
+ } else {
while ((c = *p++) != '\n' && (c != '\r' || *p == '\n'))
{
if (ignore_eol_diff && (c=='\r' || c=='\n'))
continue;
h = HASH (h, isupper (c) ? tolower (c) : c);
}
+ if (c == '\r' && !ignore_eol_diff)
+ h = HASH(h, c);
+ }
}
else
{
- if (ignore_all_space_flag)
+ if (ignore_all_space_flag) {
while ((c = *p++) != '\n' && (c != '\r' || *p == '\n'))
{
if (ignore_eol_diff && (c=='\r' || c=='\n'))
@@ -340,7 +350,9 @@
if (! ISWSPACE (c))
h = HASH (h, c);
}
- else if (ignore_space_change_flag)
+ if (c == '\r' && !ignore_eol_diff)
+ h = HASH(h, c);
+ } else if (ignore_space_change_flag) {
/* Note that \r must be hashed (if !ignore_eol_diff) */
while ((c = *p++) != '\n' && (c != '\r' || *p == '\n'))
{
@@ -375,6 +387,7 @@
{
/* runs of whitespace not ending line hashed as one space */
h = HASH (h, ' ');
+ /* c is not whitespace, so continue to hash it */
}
}
/* c is now the first non-space. */
@@ -383,13 +396,18 @@
if (c == '\r' && *p != '\n')
goto hashing_done;
}
- else
+ if (c == '\r' && !ignore_eol_diff)
+ h = HASH(h, c);
+ } else {
while ((c = *p++) != '\n' && (c != '\r' || *p == '\n'))
{
if (ignore_eol_diff && (c=='\r' || c=='\n'))
continue;
h = HASH (h, c);
}
+ if (c == '\r' && !ignore_eol_diff)
+ h = HASH(h, c);
+ }
}
hashing_done:;
@@ -404,7 +422,7 @@
((char HUGE *)p)[-2] = 0;
length -= 2;
}
- else if (p[-1] == '\n' || p[-1] == '\r')
+ else if (length>0 && p[-1] == '\n' || p[-1] == '\r')
{
if (p[-1] == '\n')
++current->count_lfs;
Modified: branches/Perry/Src/editlib/ccrystaleditview.cpp
===================================================================
--- branches/Perry/Src/editlib/ccrystaleditview.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/editlib/ccrystaleditview.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -1081,7 +1081,7 @@
//UpdateSiblingScrollPos(FALSE);
return;
}
- if (point.x < rcClientRect.left + GetMarginWidth () + DRAG_BORDER_X)
+ if (point.x < rcClientRect.left + GetSignedMarginWidth () + DRAG_BORDER_X)
{
HideDropIndicator ();
ScrollLeft ();
@@ -1256,6 +1256,15 @@
}
}
+// Forward callback from CEditReplaceDlg's OnInit to CCrystalEditView's virtual handler
+void CCrystalEditView:: // static
+OnReplaceTextDlgInit(CEditReplaceDlg & dlg, LPVOID param)
+{
+ CCrystalEditView * pView = reinterpret_cast<CCrystalEditView *>(param);
+ pView->OnReplaceTextDlgInit(dlg);
+}
+
+
void CCrystalEditView::
OnEditReplace ()
{
@@ -1315,6 +1324,9 @@
// Execute Replace dialog
// m_bShowInactiveSelection = TRUE; // FP: removed because I like it
+
+ CCrystalEditView * pMe = this;
+ dlg.SetInitHandler(OnReplaceTextDlgInit, reinterpret_cast<LPVOID>(pMe));
dlg.DoModal ();
// m_bShowInactiveSelection = FALSE; // FP: removed because I like it
Modified: branches/Perry/Src/editlib/ccrystaleditview.h
===================================================================
--- branches/Perry/Src/editlib/ccrystaleditview.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/editlib/ccrystaleditview.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -133,7 +133,15 @@
// Implementation
protected :
+ // Virtual hooks for child classes to customize behavior
+protected:
+ virtual void OnReplaceTextDlgInit(CEditReplaceDlg & dlg) { }
+ // Infrastructure for virtual hooks
+private:
+ static void OnReplaceTextDlgInit(CEditReplaceDlg & dlg, LPVOID param);
+
+
// Generated message map functions
protected :
bool m_bMergeUndo;
Modified: branches/Perry/Src/editlib/ccrystaltextview.cpp
===================================================================
--- branches/Perry/Src/editlib/ccrystaltextview.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/editlib/ccrystaltextview.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -3349,7 +3349,7 @@
CPoint pt;
::GetCursorPos (&pt);
ScreenToClient (&pt);
- if (pt.x < GetMarginWidth ())
+ if (pt.x < GetSignedMarginWidth ())
{
::SetCursor (::LoadCursor (GetResourceHandle (), MAKEINTRESOURCE (IDR_MARGIN_CURSOR)));
}
@@ -3421,7 +3421,7 @@
int nPos = 0;
// Char index for margin area is 0
- if (point.x > GetMarginWidth())
+ if (point.x > GetSignedMarginWidth())
nPos = nOffsetChar + (point.x - GetMarginWidth()) / GetCharWidth();
if (nPos < 0)
nPos = 0;
@@ -4757,6 +4757,14 @@
return FALSE;
}
+// Forward callback from CFindTextDlg's OnInit to CCrystalTextView's virtual handler
+void CCrystalTextView:: // static
+OnFindTextDlgInit(CFindTextDlg & dlg, LPVOID param)
+{
+ CCrystalTextView * pView = reinterpret_cast<CCrystalTextView *>(param);
+ pView->OnFindTextDlgInit(dlg);
+}
+
void CCrystalTextView::
OnEditFind ()
{
@@ -4814,6 +4822,8 @@
dlg.m_ptCurrentPos = m_ptCursorPos; // Search from cursor position
// m_bShowInactiveSelection = TRUE; // FP: removed because I like it
+ CCrystalTextView * pMe = this;
+ dlg.SetInitHandler(OnFindTextDlgInit, reinterpret_cast<LPVOID>(pMe));
dlg.DoModal ();
// m_bShowInactiveSelection = FALSE; // FP: removed because I like it
@@ -4963,7 +4973,7 @@
*/
void CCrystalTextView::ToggleBookmark(UINT nLine)
{
- ASSERT(nLine < GetSubLineCount());
+ ASSERT(nLine < (UINT)GetSubLineCount());
if (m_pTextBuffer != NULL)
{
DWORD dwFlags = GetLineFlags (nLine);
@@ -5428,10 +5438,20 @@
pCmdUI->Enable (ptCursorPos.x < nLength && (bracetype (*pszText) || ptCursorPos.x > 0 && bracetype (pszText[-1])) || ptCursorPos.x > 0 && bracetype (pszText[-1]));
}
+// Forward callback from CFindTextDlg's OnInit to CCrystalTextView's virtual handler
+void CCrystalTextView:: // static
+OnGotoDlgInit(CGotoDlg & dlg, LPVOID param)
+{
+ CCrystalTextView * pView = reinterpret_cast<CCrystalTextView *>(param);
+ pView->OnGotoDlgInit(dlg);
+}
+
void CCrystalTextView::
OnEditGoTo ()
{
CGotoDlg dlg (this);
+ CCrystalTextView * pMe = this;
+ dlg.SetInitHandler(OnGotoDlgInit, reinterpret_cast<LPVOID>(pMe));
dlg.DoModal ();
}
Modified: branches/Perry/Src/editlib/ccrystaltextview.h
===================================================================
--- branches/Perry/Src/editlib/ccrystaltextview.h 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/editlib/ccrystaltextview.h 2006-10-10 01:12:17 UTC (rev 3697)
@@ -48,8 +48,10 @@
class CUpdateContext;
struct ViewableWhitespaceChars;
class SyntaxColors;
+class CFindTextDlg;
+class CEditReplaceDlg;
+class CGotoDlg;
-
////////////////////////////////////////////////////////////////////////////
// CCrystalTextView class declaration
@@ -213,6 +215,8 @@
void UpdateCaret ();
void SetAnchor (const CPoint & ptNewAnchor);
UINT GetMarginWidth ();
+ int GetSignedMarginWidth() { return (int)GetMarginWidth(); }
+
bool IsValidTextPos (const CPoint &point);
bool IsValidTextPosX (const CPoint &point);
bool IsValidTextPosY (const CPoint &point);
@@ -836,6 +840,16 @@
protected :
+ // Virtual hooks for child classes to customize behavior
+protected:
+ virtual void OnFindTextDlgInit(CFindTextDlg & dlg) { }
+ virtual void OnGotoDlgInit(CGotoDlg & dlg) { }
+
+ // Infrastructure for virtual hooks
+private:
+ static void OnFindTextDlgInit(CFindTextDlg & dlg, LPVOID param);
+ static void OnGotoDlgInit(CGotoDlg & dlg, LPVOID param);
+
// Generated message map functions
protected :
#ifdef _DEBUG
Modified: branches/Perry/Src/editlib/ccrystaltextview2.cpp
===================================================================
--- branches/Perry/Src/editlib/ccrystaltextview2.cpp 2006-10-10 00:32:26 UTC (rev 3696)
+++ branches/Perry/Src/editlib/ccrystaltextview2.cpp 2006-10-10 01:12:17 UTC (rev 3697)
@@ -585,7 +585,7 @@
BOOL bShift = GetKeyState (VK_SHIFT) & 0x8000;
BOOL bControl = GetKeyState (VK_CONTROL) & 0x8000;
- if (point.x < GetMarginWidth ())
+ if (point.x < GetSignedMarginWidth ())
{
AdjustTextPoint (point);
if (bControl)
@@ -701,7 +701,7 @@
if (m_bDragSelection)
{
- BOOL bOnMargin = point.x < GetMarginWidth ();
+ BOOL bOnMargin = point.x < GetSignedMarginWidth ();
AdjustTextPoint (point);
CPoint ptNewCursorPos = ClientToText (point);
@@ -1073,7 +1073,7 @@
{
CView::OnLButtonDblClk (nFlags, point);
- if (point.x < GetMarginWi...
[truncated message content] |