ON_UPDATE_COMMAND_UI(IDC_DIFF_CASESENSITIVE, OnUpdateDiffCaseSensitive)
ON_COMMAND(IDC_DIFF_IGNOREEOL, OnDiffIgnoreEOL)
ON_UPDATE_COMMAND_UI(IDC_DIFF_IGNOREEOL, OnUpdateDiffIgnoreEOL)
- ON_CBN_SELENDOK(IDC_COMPAREMETHODCOMBO, OnSelectCompareMethod)
+ ON_COMMAND_RANGE(ID_COMPMETHOD_FULL_CONTENTS, ID_COMPMETHOD_SIZE, OnCompareMethod)
+ ON_UPDATE_COMMAND_UI_RANGE(ID_COMPMETHOD_FULL_CONTENTS, ID_COMPMETHOD_SIZE, OnUpdateCompareMethod)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
}
}
-BOOL CMainFrame::CreateComboBoxOnToolbar()
-{
- const int methods[] =
- {IDS_COMPMETHOD_FULL_CONTENTS, IDS_COMPMETHOD_QUICK_CONTENTS, IDS_COMPMETHOD_MODDATE, IDS_COMPMETHOD_DATESIZE, IDS_COMPMETHOD_SIZE};
- CRect rcComboBox;
- int index = m_wndToolBar.CommandToIndex(IDC_COMPAREMETHODCOMBO);
- m_wndToolBar.SetButtonInfo(index, IDC_COMPAREMETHODCOMBO, TBBS_SEPARATOR, 128);
- m_wndToolBar.GetItemRect(index, &rcComboBox);
- rcComboBox.left += 6;
- if (rcComboBox.Height() > 24)
- rcComboBox.top += rcComboBox.Height() / 4;
- rcComboBox.bottom = rcComboBox.top + 128;
- if (!m_ctlCompareMethod.Create(
- CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE,
- rcComboBox, &m_wndToolBar, IDC_COMPAREMETHODCOMBO ) )
- {
- return FALSE;
- }
- m_ctlCompareMethod.SetFont(CFont::FromHandle((HFONT)GetStockObject(DEFAULT_GUI_FONT)));
- for (int i = 0; i < sizeof(methods)/sizeof(methods[0]); ++i)
- m_ctlCompareMethod.AddString(theApp.LoadString(methods[i]).c_str());
- m_ctlCompareMethod.SetCurSel(GetOptionsMgr()->GetInt(OPT_CMP_METHOD));
- return TRUE;
-}
-
BOOL CMainFrame::CreateToolbar()
{
if (!m_wndToolBar.CreateEx(this) ||
nStyle |= TBSTYLE_DROPDOWN;
m_wndToolBar.SetButtonInfo(index, nID, nStyle, iImage);
- // Create "Folder Compare Method" ComboBox on toolbar
- if (!CreateComboBoxOnToolbar())
- return FALSE;
-
if (GetOptionsMgr()->GetBool(OPT_SHOW_TOOLBAR) == false)
{
CMDIFrameWnd::ShowControlBar(&m_wndToolBar, false, 0);
void CMainFrame::OnUpdateDiffWhitespace(CCmdUI* pCmdUI)
{
- pCmdUI->SetRadio(pCmdUI->m_nID - IDC_DIFF_WHITESPACE_COMPARE == GetOptionsMgr()->GetInt(OPT_CMP_IGNORE_WHITESPACE));
+ pCmdUI->SetRadio((pCmdUI->m_nID - IDC_DIFF_WHITESPACE_COMPARE) == GetOptionsMgr()->GetInt(OPT_CMP_IGNORE_WHITESPACE));
pCmdUI->Enable();
}
pCmdUI->Enable();
}
-void CMainFrame::OnSelectCompareMethod()
+void CMainFrame::OnCompareMethod(UINT nID)
{
- GetOptionsMgr()->SaveOption(OPT_CMP_METHOD, m_ctlCompareMethod.GetCurSel());
+ GetOptionsMgr()->SaveOption(OPT_CMP_METHOD, nID - ID_COMPMETHOD_FULL_CONTENTS);
+}
+
+void CMainFrame::OnUpdateCompareMethod(CCmdUI* pCmdUI)
+{
+ pCmdUI->SetRadio((pCmdUI->m_nID - ID_COMPMETHOD_FULL_CONTENTS) == GetOptionsMgr()->GetInt(OPT_CMP_METHOD));
+ pCmdUI->Enable();
}
/**
afx_msg void OnUpdateDiffCaseSensitive(CCmdUI* pCmdUI);
afx_msg void OnDiffIgnoreEOL();
afx_msg void OnUpdateDiffIgnoreEOL(CCmdUI* pCmdUI);
- afx_msg void OnSelectCompareMethod();
+ afx_msg void OnCompareMethod(UINT nID);
+ afx_msg void OnUpdateCompareMethod(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
MENUITEM "Sa&ve Project...", ID_FILE_SAVEPROJECT
MENUITEM SEPARATOR
MENUITEM "Recent Projects", ID_FILE_MRU_FILE1
+ POPUP "Recent Files Or Folders"
+ BEGIN
+ MENUITEM "< Empty >", ID_NO_MRU
+ END
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
MENUITEM "I&gnore changes", IDC_DIFF_WHITESPACE_IGNORE
MENUITEM "Ig&nore all", IDC_DIFF_WHITESPACE_IGNOREALL
END
- MENUITEM "Case sensi&tive", IDC_DIFF_CASESENSITIVE
- MENUITEM "Igno&re carriage return differences (Windows/Unix/Mac)", IDC_DIFF_IGNOREEOL
+ MENUITEM "Case sensi&tive", IDC_DIFF_CASESENSITIVE
+ MENUITEM "Igno&re carriage return differences (Windows/Unix/Mac)", IDC_DIFF_IGNOREEOL
+ POPUP "&Compare method:"
+ BEGIN
+ MENUITEM "Full Contents", ID_COMPMETHOD_FULL_CONTENTS
+ MENUITEM "Quick Contents", ID_COMPMETHOD_QUICK_CONTENTS
+ MENUITEM "Modified Date", ID_COMPMETHOD_MODDATE
+ MENUITEM "Modified Date and Size", ID_COMPMETHOD_DATESIZE
+ MENUITEM "Size", ID_COMPMETHOD_SIZE
+ END
END
END
// COMPARE OPTIONS
STRINGTABLE
BEGIN
- IDS_COMPMETHOD_FULL_CONTENTS "Full Contents"
- IDS_COMPMETHOD_QUICK_CONTENTS "Quick Contents"
- IDS_COMPMETHOD_MODDATE "Modified Date"
- IDS_COMPMETHOD_DATESIZE "Modified Date and Size"
- IDS_COMPMETHOD_SIZE "Size"
+ ID_COMPMETHOD_FULL_CONTENTS "Full Contents"
+ ID_COMPMETHOD_QUICK_CONTENTS "Quick Contents"
+ ID_COMPMETHOD_MODDATE "Modified Date"
+ ID_COMPMETHOD_DATESIZE "Modified Date and Size"
+ ID_COMPMETHOD_SIZE "Size"
END
// FILTER OPTIONS
BUTTON ID_AUTO_MERGE
SEPARATOR
BUTTON ID_REFRESH
- BUTTON IDC_COMPAREMETHODCOMBO
END
CPropertyPage::OnInitDialog();
CComboBox * combo = (CComboBox*) GetDlgItem(IDC_COMPAREMETHODCOMBO);
- String item = theApp.LoadString(IDS_COMPMETHOD_FULL_CONTENTS);
+ String item = theApp.LoadString(ID_COMPMETHOD_FULL_CONTENTS);
combo->AddString(item.c_str());
- item = theApp.LoadString(IDS_COMPMETHOD_QUICK_CONTENTS);
+ item = theApp.LoadString(ID_COMPMETHOD_QUICK_CONTENTS);
combo->AddString(item.c_str());
- item = theApp.LoadString(IDS_COMPMETHOD_MODDATE);
+ item = theApp.LoadString(ID_COMPMETHOD_MODDATE);
combo->AddString(item.c_str());
- item = theApp.LoadString(IDS_COMPMETHOD_DATESIZE);
+ item = theApp.LoadString(ID_COMPMETHOD_DATESIZE);
combo->AddString(item.c_str());
- item = theApp.LoadString(IDS_COMPMETHOD_SIZE);
+ item = theApp.LoadString(ID_COMPMETHOD_SIZE);
combo->AddString(item.c_str());
combo->SetCurSel(m_compareMethod);
#define IDS_PROJECTFILES 16419
#define IDS_PROJECTFILES_EXT 16420
#define IDS_INIFILES 16421
-#define IDS_COMPMETHOD_FULL_CONTENTS 16432
-#define IDS_COMPMETHOD_QUICK_CONTENTS 16433
-#define IDS_COMPMETHOD_MODDATE 16434
-#define IDS_COMPMETHOD_DATESIZE 16435
-#define IDS_COMPMETHOD_SIZE 16436
+#define ID_COMPMETHOD_FULL_CONTENTS 16432
+#define ID_COMPMETHOD_QUICK_CONTENTS 16433
+#define ID_COMPMETHOD_MODDATE 16434
+#define ID_COMPMETHOD_DATESIZE 16435
+#define ID_COMPMETHOD_SIZE 16436
#define IDS_FILTERFILE_NAMETITLE 16448
#define IDS_FILTERFILE_PATHTITLE 16449
#define IDS_FILTER_TITLE 16450