CPropGeneral gen;
CPropSyntax syn;
CPropFilter filter(&fileFilters, selectedFilter);
- CPropColors colors(theApp.GetDiffColor(), theApp.GetSelDiffColor(), theApp.GetDiffDeletedColor(), theApp.GetSelDiffDeletedColor(), theApp.GetDiffTextColor(), theApp.GetSelDiffTextColor());
+ CPropColors colors(theApp.GetDiffColor(), theApp.GetSelDiffColor(), theApp.GetDiffDeletedColor(), theApp.GetSelDiffDeletedColor(),
+ theApp.GetDiffTextColor(), theApp.GetSelDiffTextColor(), theApp.GetTrivialColor(), theApp.GetTrivialDeletedColor());
CPropRegistry regpage;
sht.AddPage(&gen);
sht.AddPage(&syn);
theApp.SetSelDiffDeletedColor(colors.m_clrSelDiffDeleted);
theApp.SetDiffTextColor(colors.m_clrDiffText);
theApp.SetSelDiffTextColor(colors.m_clrSelDiffText);
+ theApp.SetTrivialColor(colors.m_clrTrivial);
+ theApp.SetTrivialDeletedColor(colors.m_clrTrivialDeleted);
theApp.WriteProfileInt(_T("Settings"), _T("VersionSystem"), m_nVerSys);
theApp.WriteProfileInt(_T("Settings"), _T("ScrollToFirst"), m_bScrollToFirst);
, m_clrSelDiffDeleted(RGB(240, 192, 192))
, m_clrDiffText(RGB(0,0,0))
, m_clrSelDiffText(RGB(0,0,0))
+, m_clrTrivial(RGB(251,242,191))
+, m_clrTrivialDeleted(RGB(233,233,233))
, m_bNeedIdleTimer(FALSE)
, m_pDiffTemplate(0)
, m_pDirTemplate(0)
m_clrSelDiffDeleted = GetProfileInt(_T("Settings"), _T("SelectedDifferenceDeletedColor"), m_clrSelDiffDeleted);
m_clrDiffText = GetProfileInt(_T("Settings"), _T("DifferenceTextColor"), m_clrDiffText);
m_clrSelDiffText = GetProfileInt(_T("Settings"), _T("SelectedDifferenceTextColor"), m_clrSelDiffText);
+ m_clrTrivial = GetProfileInt(_T("Settings"), _T("TrivialDifferenceColor"), m_clrTrivial);
+ m_clrTrivialDeleted = GetProfileInt(_T("Settings"), _T("TrivialDifferenceDeletedColor"), m_clrTrivialDeleted);
// CG: The following block was added by the Splash Screen component.
{
WriteProfileInt(_T("Settings"), _T("SelectedDifferenceDeletedColor"), m_clrSelDiffDeleted);
WriteProfileInt(_T("Settings"), _T("DifferenceTextColor"), m_clrDiffText);
WriteProfileInt(_T("Settings"), _T("SelectedDifferenceTextColor"), m_clrSelDiffText);
+ WriteProfileInt(_T("Settings"), _T("TrivialDifferenceColor"), m_clrTrivial);
+ WriteProfileInt(_T("Settings"), _T("TrivialDifferenceDeletedColor"), m_clrTrivialDeleted);
delete m_fileFilterMgr;
COLORREF m_clrSelDiffDeleted; // The selected difference deleted color
COLORREF m_clrDiffText; // The difference text color
COLORREF m_clrSelDiffText; // The selected difference text color
+ COLORREF m_clrTrivial; // The ignored lines color
+ COLORREF m_clrTrivialDeleted; // The ignored and deleted lines color
BOOL m_bNeedIdleTimer;
CMultiDocTemplate* m_pDiffTemplate;
CMultiDocTemplate* m_pDirTemplate;
COLORREF GetSelDiffDeletedColor() const { return m_clrSelDiffDeleted; }
COLORREF GetDiffTextColor() const { return m_clrDiffText; }
COLORREF GetSelDiffTextColor() const { return m_clrSelDiffText; }
+ COLORREF GetTrivialColor() const { return m_clrTrivial; }
+ COLORREF GetTrivialDeletedColor() const { return m_clrTrivialDeleted; }
void SetDiffColor(COLORREF clrValue) { m_clrDiff = clrValue; }
void SetSelDiffColor(COLORREF clrValue) { m_clrSelDiff = clrValue; }
void SetDiffDeletedColor(COLORREF clrValue) { m_clrDiffDeleted = clrValue; }
void SetSelDiffDeletedColor(COLORREF clrValue) { m_clrSelDiffDeleted = clrValue; }
void SetDiffTextColor(COLORREF clrValue) { m_clrDiffText = clrValue; }
void SetSelDiffTextColor(COLORREF clrValue) { m_clrSelDiffText = clrValue; }
+ void SetTrivialColor(COLORREF clrValue) { m_clrTrivial = clrValue; }
+ void SetTrivialDeletedColor(COLORREF clrValue) { m_clrTrivialDeleted = clrValue; }
void SetNeedIdleTimer();
CString GetFileFilterPath() const { return m_sFileFilterPath; }
void SetFileFilterPath(LPCTSTR szFileFilterPath);
BS_OWNERDRAW | WS_TABSTOP,184,49,17,14,WS_EX_TRANSPARENT |
WS_EX_CLIENTEDGE
LTEXT "Text",IDC_STATIC,184,15,15,8
+ CONTROL "Dif",IDC_TRIVIAL_DIFF_COLOR,"Button",BS_OWNERDRAW |
+ WS_TABSTOP,98,69,17,14,WS_EX_TRANSPARENT |
+ WS_EX_CLIENTEDGE
+ LTEXT "Ignored Difference:",IDC_STATIC,17,69,62,8
+ CONTROL "Dif",IDC_TRIVIAL_DIFF_DELETED_COLOR,"Button",
+ BS_OWNERDRAW | WS_TABSTOP,141,69,17,14,WS_EX_TRANSPARENT |
+ WS_EX_CLIENTEDGE
END
IDD_OUTPUT DIALOG DISCARDABLE 0, 0, 278, 157
{
int idx = curDiff.blank0+b;
m_ltBuf.InsertLine(NULL, 0, idx);
+ // ghost lines opposite to trivial lines are ghost and trivial
m_ltBuf.SetLineFlag(idx, LF_GHOST, TRUE, FALSE, FALSE);
+ if (curDiff.op == OP_TRIVIAL)
+ m_ltBuf.SetLineFlag(idx, LF_TRIVIAL, TRUE, FALSE, FALSE);
curDiff.dend0++;
LeftExtras++;
}
{
int idx = curDiff.blank1+b;
m_rtBuf.InsertLine(NULL, 0, idx);
+ // ghost lines opposite to trivial lines are ghost and trivial
m_rtBuf.SetLineFlag(idx, LF_GHOST, TRUE, FALSE, FALSE);
+ if (curDiff.op == OP_TRIVIAL)
+ m_rtBuf.SetLineFlag(idx, LF_TRIVIAL, TRUE, FALSE, FALSE);
curDiff.dend1++;
++RightExtras;
}
}
return;
}
- else if (dwLineFlags & LF_GHOST)
+ else if (dwLineFlags & LF_TRIVIAL)
{
- if (lineInCurrentDiff)
- crBkgnd = theApp.GetSelDiffDeletedColor();
+ // trivial diff can not be selected
+ if (dwLineFlags & LF_GHOST)
+ // ghost lines in trivial diff has their own color
+ crBkgnd = theApp.GetTrivialDeletedColor();
else
- crBkgnd = theApp.GetDiffDeletedColor();
+ crBkgnd = theApp.GetTrivialColor();
return;
}
- else if (dwLineFlags & LF_TRIVIAL)
+ else if (dwLineFlags & LF_GHOST)
{
- // TODO: Use trivial color when trivial color implemented
if (lineInCurrentDiff)
crBkgnd = theApp.GetSelDiffDeletedColor();
else
crBkgnd = theApp.GetDiffDeletedColor();
return;
}
+
}
else
{
// CPropColors dialog
-CPropColors::CPropColors( COLORREF clrDiff, COLORREF clrSelDiff, COLORREF clrDiffDeleted, COLORREF clrSelDiffDeleted, COLORREF clrDiffText, COLORREF clrSelDiffText)
+CPropColors::CPropColors( COLORREF clrDiff, COLORREF clrSelDiff, COLORREF clrDiffDeleted, COLORREF clrSelDiffDeleted, COLORREF clrDiffText, COLORREF clrSelDiffText, COLORREF clrTrivial, COLORREF clrTrivialDeleted)
: CPropertyPage(CPropColors::IDD),
- m_clrDiff(clrDiff), m_clrSelDiff(clrSelDiff), m_clrDiffDeleted(clrDiffDeleted), m_clrSelDiffDeleted(clrSelDiffDeleted), m_clrDiffText(clrDiffText), m_clrSelDiffText(clrSelDiffText),
- m_cDiff(clrDiff), m_cSelDiff(clrSelDiff), m_cDiffDeleted(clrDiffDeleted), m_cSelDiffDeleted(clrSelDiffDeleted), m_cDiffText(clrDiffText), m_cSelDiffText(clrSelDiffText)
+ m_clrDiff(clrDiff), m_clrSelDiff(clrSelDiff), m_clrDiffDeleted(clrDiffDeleted), m_clrSelDiffDeleted(clrSelDiffDeleted),
+ m_clrDiffText(clrDiffText), m_clrSelDiffText(clrSelDiffText), m_clrTrivial(clrTrivial), m_clrTrivialDeleted(clrTrivialDeleted),
+ m_cDiff(clrDiff), m_cSelDiff(clrSelDiff), m_cDiffDeleted(clrDiffDeleted), m_cSelDiffDeleted(clrSelDiffDeleted),
+ m_cDiffText(clrDiffText), m_cSelDiffText(clrSelDiffText), m_cTrivial(clrTrivial), m_cTrivialDeleted(clrTrivialDeleted)
{
//{{AFX_DATA_INIT(CPropColors)
// NOTE: the ClassWizard will add member initialization here
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPropColors)
+ DDX_Control(pDX, IDC_TRIVIAL_DIFF_DELETED_COLOR, m_cTrivialDeleted);
+ DDX_Control(pDX, IDC_TRIVIAL_DIFF_COLOR, m_cTrivial);
DDX_Control(pDX, IDC_SEL_DIFFERENCE_TEXT_COLOR, m_cSelDiffText);
DDX_Control(pDX, IDC_DIFFERENCE_TEXT_COLOR, m_cDiffText);
DDX_Control(pDX, IDC_SEL_DIFFERENCE_DELETED_COLOR, m_cSelDiffDeleted);
ON_BN_CLICKED(IDC_SEL_DIFFERENCE_COLOR, OnSelDifferenceColor)
ON_BN_CLICKED(IDC_DIFFERENCE_TEXT_COLOR, OnDifferenceTextColor)
ON_BN_CLICKED(IDC_SEL_DIFFERENCE_TEXT_COLOR, OnSelDifferenceTextColor)
+ ON_BN_CLICKED(IDC_TRIVIAL_DIFF_COLOR, OnTrivialDiffColor)
+ ON_BN_CLICKED(IDC_TRIVIAL_DIFF_DELETED_COLOR, OnTrivialDiffDeletedColor)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
SaveCustomColors();
}
+void CPropColors::OnTrivialDiffColor()
+{
+ CColorDialog dialog(m_clrTrivial);
+ LoadCustomColors();
+ dialog.m_cc.lpCustColors = m_cCustColors;
+
+ if (dialog.DoModal() == IDOK)
+ {
+ m_clrTrivial = dialog.GetColor();
+ m_cTrivial.SetColor(m_clrTrivial);
+ }
+ SaveCustomColors();
+}
+
+void CPropColors::OnTrivialDiffDeletedColor()
+{
+ CColorDialog dialog(m_clrTrivialDeleted);
+ LoadCustomColors();
+ dialog.m_cc.lpCustColors = m_cCustColors;
+
+ if (dialog.DoModal() == IDOK)
+ {
+ m_clrTrivialDeleted = dialog.GetColor();
+ m_cTrivialDeleted.SetColor(m_clrTrivialDeleted);
+ }
+ SaveCustomColors();
+}
+
void CPropColors::LoadCustomColors()
{
for (int i = 0; i < CustomColorsAmount; i++)
// Construction
public:
- CPropColors(COLORREF clrDiff, COLORREF clrSelDiff, COLORREF clrDiffDeleted, COLORREF clrSelDiffDeleted, COLORREF clrDiffText, COLORREF clrSelDiffText); // standard constructor
+ CPropColors(COLORREF clrDiff, COLORREF clrSelDiff, COLORREF clrDiffDeleted, COLORREF clrSelDiffDeleted, COLORREF clrDiffText, COLORREF clrSelDiffText, COLORREF clrTrivial, COLORREF clrTrivialDeleted); // standard constructor
// Dialog Data
//{{AFX_DATA(CPropColors)
enum { IDD = IDD_PROPPAGE_COLORS };
+ CColorButton m_cTrivialDeleted;
+ CColorButton m_cTrivial;
CColorButton m_cSelDiffText;
CColorButton m_cDiffText;
CColorButton m_cSelDiffDeleted;
COLORREF m_clrSelDiffDeleted;
COLORREF m_clrDiffText;
COLORREF m_clrSelDiffText;
+ COLORREF m_clrTrivial;
+ COLORREF m_clrTrivialDeleted;
// Overrides
// ClassWizard generated virtual function overrides
afx_msg void OnSelDifferenceColor();
afx_msg void OnDifferenceTextColor();
afx_msg void OnSelDifferenceTextColor();
+ afx_msg void OnTrivialDiffColor();
+ afx_msg void OnTrivialDiffDeletedColor();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
+2003-10-08 Laoran
+ PATCH: [ 818198 ] Colors for "ignore blank lines"
+ WinMerge: MainFrm.cpp Merge.cpp Merge.h Merge.rc MergeDoc.cpp MergeEditView.cpp PropColors.cpp
+ PropColors.h resource.h
+
2003-10-08 Kimmo
PATCH: [ 819188 ] Show column number in statusbar
WinMerge: ChildFrm.h ChildFrm.cpp Merge.rc MergeEditStatus.h MergeEditView.cpp
#define IDC_DIFF_BROWSE_FILE2 1075
#define IDC_DIFF_BROWSE_RESULT 1076
#define IDC_DIFF_APPENDFILE 1077
+#define IDC_TRIVIAL_DIFF_COLOR 1078
+#define IDC_TRIVIAL_DIFF_DELETED_COLOR 1079
#define IDS_NUM_REPLACED 8501
#define IDS_EDIT_TEXT_NOT_FOUND 8502
#define IDS_LINE_STATUS_INFO_EOL 8503
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 118
#define _APS_NEXT_COMMAND_VALUE 32848
-#define _APS_NEXT_CONTROL_VALUE 1078
+#define _APS_NEXT_CONTROL_VALUE 1080
#define _APS_NEXT_SYMED_VALUE 108
#endif
#endif