From e9a509284a33dcacc061035d8e451204cd2b0608 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sun, 7 Feb 2016 10:30:07 +0900 Subject: [PATCH] Reduce Merge.h dependency --- Src/AboutDlg.cpp | 16 +++++++--------- Src/CCPromptDlg.cpp | 26 +++++--------------------- Src/Common/PreferencesDlg.cpp | 5 ++--- Src/Common/PreferencesDlg.h | 3 ++- Src/CompareStatisticsDlg.cpp | 10 ++++------ Src/CompareStatisticsDlg.h | 4 +++- Src/ConfirmFolderCopyDlg.cpp | 13 +++++-------- Src/ConfirmFolderCopyDlg.h | 3 ++- Src/DirCmpReportDlg.cpp | 14 ++++++-------- Src/DirCmpReportDlg.h | 3 ++- Src/DirColsDlg.cpp | 12 +++++------- Src/DirColsDlg.h | 3 ++- Src/DirCompProgressBar.cpp | 10 ++++------ Src/DirCompProgressBar.h | 3 ++- Src/EncodingErrorBar.cpp | 5 +---- Src/EncodingErrorBar.h | 4 +++- Src/FileFiltersDlg.cpp | 5 ++--- Src/FileFiltersDlg.h | 3 ++- Src/LineFiltersDlg.cpp | 8 +++----- Src/LineFiltersDlg.h | 4 +++- Src/LoadSaveCodepageDlg.cpp | 13 +++++-------- Src/LoadSaveCodepageDlg.h | 3 ++- Src/Merge.vcxproj | 3 +++ Src/Merge.vcxproj.filters | 7 +++++++ Src/OptionsPanel.cpp | 2 +- Src/OptionsPanel.h | 3 ++- Src/PatchDlg.cpp | 12 +++++------- Src/PatchDlg.h | 3 ++- Src/PluginsListDlg.cpp | 12 +++++------- Src/PluginsListDlg.h | 3 ++- Src/ProjectFilePathsDlg.cpp | 14 +------------- Src/ProjectFilePathsDlg.h | 4 ++-- Src/PropArchive.cpp | 4 +--- Src/PropBackups.cpp | 14 -------------- Src/PropBackups.h | 1 - Src/PropCodepage.cpp | 5 +---- Src/PropColors.cpp | 12 +----------- Src/PropColors.h | 1 - Src/PropCompare.cpp | 14 -------------- Src/PropCompare.h | 1 - Src/PropCompareBinary.cpp | 13 ------------- Src/PropCompareBinary.h | 1 - Src/PropCompareFolder.cpp | 5 +---- Src/PropCompareImage.cpp | 13 ------------- Src/PropCompareImage.h | 1 - Src/PropEditor.cpp | 5 +---- Src/PropGeneral.cpp | 4 +--- Src/PropRegistry.cpp | 13 ------------- Src/PropRegistry.h | 1 - Src/PropShell.cpp | 5 +---- Src/PropSyntaxColors.cpp | 10 ---------- Src/PropSyntaxColors.h | 1 - Src/PropTextColors.cpp | 5 +---- Src/PropVss.cpp | 5 +---- Src/SaveClosingDlg.cpp | 13 +++++-------- Src/SaveClosingDlg.h | 3 ++- Src/SelectUnpackerDlg.cpp | 15 ++++++--------- Src/SelectUnpackerDlg.h | 3 ++- Src/SharedFilterDlg.cpp | 21 +++------------------ Src/SharedFilterDlg.h | 5 +++-- Src/TestFilterDlg.cpp | 13 +++++-------- Src/TestFilterDlg.h | 4 +++- Src/TrDialogs.cpp | 39 +++++++++++++++++++++++++++++++++++++++ Src/TrDialogs.h | 37 +++++++++++++++++++++++++++++++++++++ Src/VssPromptDlg.cpp | 16 +++++++--------- Src/WMGotoDlg.cpp | 23 +++++------------------ 66 files changed, 228 insertions(+), 331 deletions(-) create mode 100644 Src/TrDialogs.cpp create mode 100644 Src/TrDialogs.h diff --git a/Src/AboutDlg.cpp b/Src/AboutDlg.cpp index bf10f0f8d..f3fae093a 100644 --- a/Src/AboutDlg.cpp +++ b/Src/AboutDlg.cpp @@ -23,8 +23,7 @@ #include "stdafx.h" #include "AboutDlg.h" -#include "Merge.h" -#include "DDXHelper.h" +#include "TrDialogs.h" #include "Picture.h" #include "resource.h" // IDD_ABOUTBOX @@ -34,7 +33,7 @@ * Shows About-dialog bitmap and draws version number and other * texts into it. */ -class CAboutDlg::Impl : public CDialog +class CAboutDlg::Impl : public CTrDialog { public: CAboutDlg::Impl(CAboutDlg *p, CWnd* pParent = NULL); @@ -68,7 +67,7 @@ private: CFont m_font; }; -BEGIN_MESSAGE_MAP(CAboutDlg::Impl, CDialog) +BEGIN_MESSAGE_MAP(CAboutDlg::Impl, CTrDialog) //{{AFX_MSG_MAP(CAboutDlg::Impl) //}}AFX_MSG_MAP ON_BN_CLICKED(IDC_OPEN_CONTRIBUTORS, OnBnClickedOpenContributors) @@ -78,14 +77,14 @@ BEGIN_MESSAGE_MAP(CAboutDlg::Impl, CDialog) END_MESSAGE_MAP() CAboutDlg::Impl::Impl(CAboutDlg *p, CWnd* pParent /*=NULL*/) - : CDialog(CAboutDlg::Impl::IDD) + : CTrDialog(CAboutDlg::Impl::IDD) , m_p(p) { } void CAboutDlg::Impl::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAboutDlg::Impl) DDX_Text(pDX, IDC_COMPANY, m_p->m_info.copyright); DDX_Text(pDX, IDC_VERSION, m_p->m_info.version); @@ -98,8 +97,7 @@ void CAboutDlg::Impl::DoDataExchange(CDataExchange* pDX) */ BOOL CAboutDlg::Impl::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); m_image.Load(IDR_SPLASH); @@ -132,7 +130,7 @@ HBRUSH CAboutDlg::Impl::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) pDC->SetBkMode(TRANSPARENT); return (HBRUSH)GetStockObject(NULL_BRUSH); } - return CDialog::OnCtlColor(pDC, pWnd, nCtlColor); + return CTrDialog::OnCtlColor(pDC, pWnd, nCtlColor); } void CAboutDlg::Impl::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct) diff --git a/Src/CCPromptDlg.cpp b/Src/CCPromptDlg.cpp index d7f74fa1e..ce827a24f 100644 --- a/Src/CCPromptDlg.cpp +++ b/Src/CCPromptDlg.cpp @@ -22,8 +22,7 @@ #include "stdafx.h" #include "CCPromptDlg.h" -#include "Merge.h" -#include "DDXHelper.h" +#include "TrDialogs.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -32,7 +31,7 @@ /** * @brief A dialog for ClearCase checkout/checkin. */ -class CCCPromptDlg::Impl : public CDialog +class CCCPromptDlg::Impl : public CTrDialog { // Construction public: @@ -53,8 +52,6 @@ public: // Implementation protected: - virtual BOOL OnInitDialog(); - // Generated message map functions //{{AFX_MSG(CCCPromptDlg::Impl) afx_msg void OnSaveas(); @@ -66,14 +63,14 @@ private: }; CCCPromptDlg::Impl::Impl(CCCPromptDlg *p, CWnd* pParent /*=NULL*/) - : CDialog(CCCPromptDlg::Impl::IDD, pParent) + : CTrDialog(CCCPromptDlg::Impl::IDD, pParent) , m_p(p) { } void CCCPromptDlg::Impl::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CCCPromptDlg::Impl) DDX_Text(pDX, IDC_COMMENTS, m_p->m_comments); DDX_Check(pDX, IDC_MULTI_CHECKOUT, m_p->m_bMultiCheckouts); @@ -81,25 +78,12 @@ void CCCPromptDlg::Impl::DoDataExchange(CDataExchange* pDX) //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CCCPromptDlg::Impl, CDialog) +BEGIN_MESSAGE_MAP(CCCPromptDlg::Impl, CTrDialog) //{{AFX_MSG_MAP(CCCPromptDlg::Impl) ON_BN_CLICKED(IDC_SAVE_AS, OnSaveas) //}}AFX_MSG_MAP END_MESSAGE_MAP() -/** - * @brief Handler for WM_INITDIALOG; conventional location to initialize - * controls. At this point dialog and control windows exist. - */ -BOOL CCCPromptDlg::Impl::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - void CCCPromptDlg::Impl::OnSaveas() { EndDialog(IDC_SAVE_AS); diff --git a/Src/Common/PreferencesDlg.cpp b/Src/Common/PreferencesDlg.cpp index 818dc4113..dd01358cc 100644 --- a/Src/Common/PreferencesDlg.cpp +++ b/Src/Common/PreferencesDlg.cpp @@ -35,7 +35,7 @@ const TCHAR PATHDELIM = '>'; CPreferencesDlg::CPreferencesDlg(COptionsMgr *regOptions, SyntaxColors *colors, UINT nMenuID, CWnd* pParent) // standard constructor -: CDialog(IDD_PREFERENCES, pParent) +: CTrDialog(IDD_PREFERENCES, pParent) , m_pOptionsMgr(regOptions) , m_pageGeneral(regOptions) , m_pageCompare(regOptions) @@ -85,8 +85,7 @@ END_MESSAGE_MAP() BOOL CPreferencesDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); m_tcPages.SetIndent(0); diff --git a/Src/Common/PreferencesDlg.h b/Src/Common/PreferencesDlg.h index b44e64ccf..5adede364 100644 --- a/Src/Common/PreferencesDlg.h +++ b/Src/Common/PreferencesDlg.h @@ -9,6 +9,7 @@ */ #pragma once +#include "TrDialogs.h" #include "PropGeneral.h" #include "PropCompare.h" #include "PropEditor.h" @@ -33,7 +34,7 @@ class SyntaxColors; ///////////////////////////////////////////////////////////////////////////// // CPreferencesDlg dialog -class CPreferencesDlg : public CDialog +class CPreferencesDlg : public CTrDialog { // Construction public: diff --git a/Src/CompareStatisticsDlg.cpp b/Src/CompareStatisticsDlg.cpp index c4f91df56..4aba24123 100644 --- a/Src/CompareStatisticsDlg.cpp +++ b/Src/CompareStatisticsDlg.cpp @@ -23,7 +23,6 @@ #include "stdafx.h" #include "CompareStatisticsDlg.h" #include "CompareStats.h" -#include "Merge.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -32,17 +31,17 @@ ///////////////////////////////////////////////////////////////////////////// // SaveClosingDlg dialog -IMPLEMENT_DYNAMIC(CompareStatisticsDlg, CDialog) +IMPLEMENT_DYNAMIC(CompareStatisticsDlg, CTrDialog) CompareStatisticsDlg::CompareStatisticsDlg(const CompareStats* pStats, CWnd* pParent /*=NULL*/) : m_pCompareStats(pStats), - CDialog(pStats->GetCompareDirs() < 3 ? IDD_COMPARE_STATISTICS : IDD_COMPARE_STATISTICS3, pParent) + CTrDialog(pStats->GetCompareDirs() < 3 ? IDD_COMPARE_STATISTICS : IDD_COMPARE_STATISTICS3, pParent) { //{{AFX_DATA_INIT(CompareStatisticsDlg) //}}AFX_DATA_INIT } -BEGIN_MESSAGE_MAP(CompareStatisticsDlg, CDialog) +BEGIN_MESSAGE_MAP(CompareStatisticsDlg, CTrDialog) //{{AFX_MSG_MAP(SaveClosingDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -56,8 +55,7 @@ END_MESSAGE_MAP() */ BOOL CompareStatisticsDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); int totalFiles = 0; int totalFolders = 0; const int iconCX = []() { diff --git a/Src/CompareStatisticsDlg.h b/Src/CompareStatisticsDlg.h index 2908d67ad..8eeba227c 100644 --- a/Src/CompareStatisticsDlg.h +++ b/Src/CompareStatisticsDlg.h @@ -21,6 +21,8 @@ */ #pragma once +#include "TrDialogs.h" + class CompareStats; /** @@ -28,7 +30,7 @@ class CompareStats; * This dialog shows statistics about current folder compare. It shows amounts * if items in different compare status categories. */ -class CompareStatisticsDlg : public CDialog +class CompareStatisticsDlg : public CTrDialog { DECLARE_DYNAMIC(CompareStatisticsDlg) diff --git a/Src/ConfirmFolderCopyDlg.cpp b/Src/ConfirmFolderCopyDlg.cpp index 0500cfcab..18fb0d1c7 100644 --- a/Src/ConfirmFolderCopyDlg.cpp +++ b/Src/ConfirmFolderCopyDlg.cpp @@ -22,8 +22,6 @@ #include "stdafx.h" #include "ConfirmFolderCopyDlg.h" -#include "Merge.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -32,9 +30,9 @@ // ConfirmFolderCopyDlg dialog -IMPLEMENT_DYNAMIC(ConfirmFolderCopyDlg, CDialog) +IMPLEMENT_DYNAMIC(ConfirmFolderCopyDlg, CTrDialog) ConfirmFolderCopyDlg::ConfirmFolderCopyDlg(CWnd* pParent /*=NULL*/) - : CDialog(ConfirmFolderCopyDlg::IDD, pParent) + : CTrDialog(ConfirmFolderCopyDlg::IDD, pParent) { } @@ -44,7 +42,7 @@ ConfirmFolderCopyDlg::~ConfirmFolderCopyDlg() void ConfirmFolderCopyDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(ConfirmFolderCopyDlg) DDX_Text(pDX, IDC_FLDCONFIRM_FROM_TEXT, m_fromText); DDX_Text(pDX, IDC_FLDCONFIRM_TO_TEXT, m_toText); @@ -55,7 +53,7 @@ void ConfirmFolderCopyDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(ConfirmFolderCopyDlg, CDialog) +BEGIN_MESSAGE_MAP(ConfirmFolderCopyDlg, CTrDialog) ON_BN_CLICKED(IDNO, OnBnClickedNo) ON_BN_CLICKED(IDYES, OnBnClickedYes) END_MESSAGE_MAP() @@ -69,8 +67,7 @@ END_MESSAGE_MAP() */ BOOL ConfirmFolderCopyDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); // Load warning icon // TODO: we can have per-action icons? diff --git a/Src/ConfirmFolderCopyDlg.h b/Src/ConfirmFolderCopyDlg.h index c82d61cad..7bcac6087 100644 --- a/Src/ConfirmFolderCopyDlg.h +++ b/Src/ConfirmFolderCopyDlg.h @@ -21,13 +21,14 @@ */ #pragma once +#include "TrDialogs.h" #include "CMoveConstraint.h" #include "UnicodeString.h" /** * @brief Dialog for item copy confirmation. */ -class ConfirmFolderCopyDlg : public CDialog +class ConfirmFolderCopyDlg : public CTrDialog { DECLARE_DYNAMIC(ConfirmFolderCopyDlg) diff --git a/Src/DirCmpReportDlg.cpp b/Src/DirCmpReportDlg.cpp index 37adae45d..973a20dbe 100644 --- a/Src/DirCmpReportDlg.cpp +++ b/Src/DirCmpReportDlg.cpp @@ -12,15 +12,14 @@ #include "paths.h" #include "FileOrFolderSelect.h" #include "Merge.h" -#include "DDXHelper.h" -IMPLEMENT_DYNAMIC(DirCmpReportDlg, CDialog) +IMPLEMENT_DYNAMIC(DirCmpReportDlg, CTrDialog) /** * @brief Constructor. */ DirCmpReportDlg::DirCmpReportDlg(CWnd* pParent /*=NULL*/) - : CDialog(DirCmpReportDlg::IDD, pParent) + : CTrDialog(DirCmpReportDlg::IDD, pParent) , m_bCopyToClipboard(false) , m_bIncludeFileCmpReport(false) , m_nReportType(REPORT_TYPE_COMMALIST) @@ -35,7 +34,7 @@ DirCmpReportDlg::DirCmpReportDlg(CWnd* pParent /*=NULL*/) */ void DirCmpReportDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_REPORT_FILE, m_ctlReportFile); DDX_Control(pDX, IDC_REPORT_STYLECOMBO, m_ctlStyle); DDX_Text(pDX, IDC_REPORT_FILE, m_sReportFile); @@ -43,7 +42,7 @@ void DirCmpReportDlg::DoDataExchange(CDataExchange* pDX) DDX_Check(pDX, IDC_REPORT_INCLUDEFILECMPREPORT, m_bIncludeFileCmpReport); } -BEGIN_MESSAGE_MAP(DirCmpReportDlg, CDialog) +BEGIN_MESSAGE_MAP(DirCmpReportDlg, CTrDialog) ON_BN_CLICKED(IDC_REPORT_BROWSEFILE, OnBtnClickReportBrowse) ON_BN_DOUBLECLICKED(IDC_REPORT_COPYCLIPBOARD, OnBtnDblclickCopyClipboard) ON_CBN_SELCHANGE(IDC_REPORT_STYLECOMBO, OnCbnSelchangeReportStylecombo) @@ -89,8 +88,7 @@ static ReportTypeInfo f_types[] = { */ BOOL DirCmpReportDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); m_ctlReportFile.LoadState(_T("ReportFiles")); m_nReportType = static_cast(theApp.GetProfileInt(_T("ReportFiles"), _T("ReportType"), 0)); @@ -187,5 +185,5 @@ void DirCmpReportDlg::OnOK() theApp.WriteProfileInt(_T("ReportFiles"), _T("CopoyToClipboard"), m_bCopyToClipboard); theApp.WriteProfileInt(_T("ReportFiles"), _T("IncludeFileCmpReport"), m_bIncludeFileCmpReport); - CDialog::OnOK(); + CTrDialog::OnOK(); } diff --git a/Src/DirCmpReportDlg.h b/Src/DirCmpReportDlg.h index 008d0c5e2..b4dc176f8 100644 --- a/Src/DirCmpReportDlg.h +++ b/Src/DirCmpReportDlg.h @@ -7,6 +7,7 @@ #pragma once #include "DirReportTypes.h" +#include "TrDialogs.h" #include "SuperComboBox.h" /** @@ -15,7 +16,7 @@ * for user. Also filename and path for report file can be chosen * with this dialog. */ -class DirCmpReportDlg : public CDialog +class DirCmpReportDlg : public CTrDialog { DECLARE_DYNAMIC(DirCmpReportDlg) diff --git a/Src/DirColsDlg.cpp b/Src/DirColsDlg.cpp index ddc7d6390..44a1f5bca 100644 --- a/Src/DirColsDlg.cpp +++ b/Src/DirColsDlg.cpp @@ -10,7 +10,6 @@ #include "stdafx.h" #include "DirColsDlg.h" #include -#include "Merge.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -24,7 +23,7 @@ * @param [in] pParent Dialog's parent component (window). */ CDirColsDlg::CDirColsDlg(CWnd* pParent /*=NULL*/) - : CDialog(CDirColsDlg::IDD, pParent) + : CTrDialog(CDirColsDlg::IDD, pParent) , m_bReset(false) { } @@ -34,13 +33,13 @@ CDirColsDlg::CDirColsDlg(CWnd* pParent /*=NULL*/) */ void CDirColsDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDirColsDlg) DDX_Control(pDX, IDC_COLDLG_LIST, m_listColumns); //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CDirColsDlg, CDialog) +BEGIN_MESSAGE_MAP(CDirColsDlg, CTrDialog) //{{AFX_MSG_MAP(CDirColsDlg) ON_BN_CLICKED(IDC_UP, OnUp) ON_BN_CLICKED(IDC_DOWN, OnDown) @@ -68,8 +67,7 @@ void CDirColsDlg::InitList() */ BOOL CDirColsDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); InitList(); LoadLists(); @@ -246,7 +244,7 @@ void CDirColsDlg::OnOK() col1.phy_col = -1; } - CDialog::OnOK(); + CTrDialog::OnOK(); } /** diff --git a/Src/DirColsDlg.h b/Src/DirColsDlg.h index d84b7a179..357d56a37 100644 --- a/Src/DirColsDlg.h +++ b/Src/DirColsDlg.h @@ -8,6 +8,7 @@ #pragma once #include +#include "TrDialogs.h" #include "UnicodeString.h" ///////////////////////////////////////////////////////////////////////////// @@ -24,7 +25,7 @@ * must be always be last in the list with order number -1. * @todo: Allow hidden columns between visible columns. */ -class CDirColsDlg : public CDialog +class CDirColsDlg : public CTrDialog { // Public types public: diff --git a/Src/DirCompProgressBar.cpp b/Src/DirCompProgressBar.cpp index 47aa269f1..bc5135afa 100644 --- a/Src/DirCompProgressBar.cpp +++ b/Src/DirCompProgressBar.cpp @@ -6,7 +6,6 @@ #include "stdafx.h" #include "DirCompProgressBar.h" -#include "Merge.h" #include "CompareStats.h" #include "DiffContext.h" #include "paths.h" @@ -54,7 +53,7 @@ DirCompProgressBar::~DirCompProgressBar() #ifdef __ITaskbarList3_INTERFACE_DEFINED__ if (m_pTaskbarList) { - m_pTaskbarList->SetProgressState(theApp.GetMainWnd()->m_hWnd, TBPF_NOPROGRESS); + m_pTaskbarList->SetProgressState(AfxGetMainWnd()->m_hWnd, TBPF_NOPROGRESS); m_pTaskbarList->Release(); } #endif @@ -77,16 +76,15 @@ END_MESSAGE_MAP() */ BOOL DirCompProgressBar::Create(CWnd* pParentWnd) { - if (! CDialogBar::Create(pParentWnd, DirCompProgressBar::IDD, + if (! CTrDialogBar::Create(pParentWnd, DirCompProgressBar::IDD, CBRS_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY, DirCompProgressBar::IDD)) return FALSE; #ifdef __ITaskbarList3_INTERFACE_DEFINED__ CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_ALL, IID_ITaskbarList3, (void**)&m_pTaskbarList); if (m_pTaskbarList) - m_pTaskbarList->SetProgressState(theApp.GetMainWnd()->m_hWnd, TBPF_INDETERMINATE); + m_pTaskbarList->SetProgressState(AfxGetMainWnd()->m_hWnd, TBPF_INDETERMINATE); #endif - theApp.TranslateDialog(m_hWnd); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE @@ -118,7 +116,7 @@ void DirCompProgressBar::SetProgressState(int comparedItems, int totalItems) #ifdef __ITaskbarList3_INTERFACE_DEFINED__ if (m_pTaskbarList) - m_pTaskbarList->SetProgressValue(theApp.GetMainWnd()->m_hWnd, comparedItems, totalItems); + m_pTaskbarList->SetProgressValue(AfxGetMainWnd()->m_hWnd, comparedItems, totalItems); #endif } diff --git a/Src/DirCompProgressBar.h b/Src/DirCompProgressBar.h index d420815b3..b0dc44005 100644 --- a/Src/DirCompProgressBar.h +++ b/Src/DirCompProgressBar.h @@ -5,6 +5,7 @@ */ #pragma once +#include "TrDialogs.h" #include "CompareStats.h" class ITaskBarList3; @@ -30,7 +31,7 @@ class ITaskBarList3; * compared items count. Maybe we should use different timer and bigger * interval for total count updates? */ -class DirCompProgressBar : public CDialogBar +class DirCompProgressBar : public CTrDialogBar { // Construction public: diff --git a/Src/EncodingErrorBar.cpp b/Src/EncodingErrorBar.cpp index 92e69aaa8..93d9bb7d4 100644 --- a/Src/EncodingErrorBar.cpp +++ b/Src/EncodingErrorBar.cpp @@ -3,7 +3,6 @@ #include "stdafx.h" #include "EncodingErrorBar.h" -#include "Merge.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -40,12 +39,10 @@ END_MESSAGE_MAP() BOOL CEncodingErrorBar::Create(CWnd *pParentWnd) { - if (! CDialogBar::Create(pParentWnd, CEncodingErrorBar::IDD, + if (! CTrDialogBar::Create(pParentWnd, CEncodingErrorBar::IDD, CBRS_BOTTOM | CBRS_TOOLTIPS | CBRS_FLYBY, CEncodingErrorBar::IDD)) return FALSE; - theApp.TranslateDialog(m_hWnd); - return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } diff --git a/Src/EncodingErrorBar.h b/Src/EncodingErrorBar.h index 6a98f93f7..a448b8d0e 100644 --- a/Src/EncodingErrorBar.h +++ b/Src/EncodingErrorBar.h @@ -3,10 +3,12 @@ #pragma once +#include "TrDialogs.h" + ///////////////////////////////////////////////////////////////////////////// // CEncodingErrorBar dialog -class CEncodingErrorBar : public CDialogBar +class CEncodingErrorBar : public CTrDialogBar { // Construction public: diff --git a/Src/FileFiltersDlg.cpp b/Src/FileFiltersDlg.cpp index 8c7bf9d2f..bf82dcd29 100644 --- a/Src/FileFiltersDlg.cpp +++ b/Src/FileFiltersDlg.cpp @@ -53,7 +53,7 @@ IMPLEMENT_DYNCREATE(FileFiltersDlg, CPropertyPage) /** * @brief Constructor. */ -FileFiltersDlg::FileFiltersDlg() : CPropertyPage(FileFiltersDlg::IDD) +FileFiltersDlg::FileFiltersDlg() : CTrPropertyPage(FileFiltersDlg::IDD) , m_Filters(nullptr) { m_strCaption = theApp.LoadDialogCaption(m_lpszTemplateName).c_str(); @@ -165,8 +165,7 @@ void FileFiltersDlg::SelectFilterByIndex(int index) */ BOOL FileFiltersDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrPropertyPage::OnInitDialog(); InitList(); diff --git a/Src/FileFiltersDlg.h b/Src/FileFiltersDlg.h index e1fbd6936..6d1daa602 100644 --- a/Src/FileFiltersDlg.h +++ b/Src/FileFiltersDlg.h @@ -21,6 +21,7 @@ */ #pragma once +#include "TrDialogs.h" #include struct FileFilterInfo; @@ -29,7 +30,7 @@ struct FileFilterInfo; * @brief Class for dialog allowing user to select * and edit used file filters */ -class FileFiltersDlg : public CPropertyPage +class FileFiltersDlg : public CTrPropertyPage { DECLARE_DYNCREATE(FileFiltersDlg) diff --git a/Src/LineFiltersDlg.cpp b/Src/LineFiltersDlg.cpp index 7d5ea3e17..3156fc84d 100644 --- a/Src/LineFiltersDlg.cpp +++ b/Src/LineFiltersDlg.cpp @@ -8,7 +8,6 @@ #include "LineFiltersList.h" #include "Merge.h" #include "LineFiltersDlg.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -20,13 +19,13 @@ static TCHAR FilterHelpLocation[] = _T("::/htmlhelp/Filters.html"); ///////////////////////////////////////////////////////////////////////////// // CPropLineFilter property page -IMPLEMENT_DYNAMIC(LineFiltersDlg, CPropertyPage) +IMPLEMENT_DYNAMIC(LineFiltersDlg, CTrPropertyPage) /** * @brief Constructor. */ LineFiltersDlg::LineFiltersDlg() -: CPropertyPage(LineFiltersDlg::IDD) +: CTrPropertyPage(LineFiltersDlg::IDD) , m_pList(NULL) { //{{AFX_DATA_INIT(LineFiltersDlg) @@ -70,8 +69,7 @@ END_MESSAGE_MAP() */ BOOL LineFiltersDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + CTrPropertyPage::OnInitDialog(); InitList(); diff --git a/Src/LineFiltersDlg.h b/Src/LineFiltersDlg.h index 5c4587121..40f7eeb1f 100644 --- a/Src/LineFiltersDlg.h +++ b/Src/LineFiltersDlg.h @@ -6,6 +6,8 @@ */ #pragma once +#include "TrDialogs.h" + class LineFiltersList; /** @@ -13,7 +15,7 @@ class LineFiltersList; * This dialog allows user to add, edit and remove line filters. Currently * active filters are selected by enabling their checkbox. */ -class LineFiltersDlg : public CPropertyPage +class LineFiltersDlg : public CTrPropertyPage { DECLARE_DYNAMIC(LineFiltersDlg) diff --git a/Src/LoadSaveCodepageDlg.cpp b/Src/LoadSaveCodepageDlg.cpp index 0375061f2..79aabf41b 100644 --- a/Src/LoadSaveCodepageDlg.cpp +++ b/Src/LoadSaveCodepageDlg.cpp @@ -6,11 +6,9 @@ #include "stdafx.h" #include "LoadSaveCodepageDlg.h" -#include "Merge.h" #include "resource.h" #include "unicoder.h" #include "ExConverter.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -21,7 +19,7 @@ CLoadSaveCodepageDlg::CLoadSaveCodepageDlg(int nFiles, CWnd* pParent /*=NULL*/) -: CDialog(CLoadSaveCodepageDlg::IDD, pParent) +: CTrDialog(CLoadSaveCodepageDlg::IDD, pParent) , m_bAffectsLeft(true) , m_bAffectsMiddle(true) , m_bAffectsRight(true) @@ -47,7 +45,7 @@ void CLoadSaveCodepageDlg::SetLeftRightAffectStrings(const String & sAffectsLeft void CLoadSaveCodepageDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CLoadSaveCodepageDlg) DDX_Check(pDX, IDC_AFFECTS_LEFT_BTN, m_bAffectsLeft); DDX_Check(pDX, IDC_AFFECTS_MIDDLE_BTN, m_bAffectsMiddle); @@ -62,7 +60,7 @@ void CLoadSaveCodepageDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CLoadSaveCodepageDlg, CDialog) +BEGIN_MESSAGE_MAP(CLoadSaveCodepageDlg, CTrDialog) //{{AFX_MSG_MAP(CLoadSaveCodepageDlg) ON_BN_CLICKED(IDC_AFFECTS_LEFT_BTN, OnAffectsLeftBtnClicked) ON_BN_CLICKED(IDC_AFFECTS_MIDDLE_BTN, OnAffectsMiddleBtnClicked) @@ -80,8 +78,7 @@ END_MESSAGE_MAP() */ BOOL CLoadSaveCodepageDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); IExconverter *pexconv = Exconverter::getInstance(); if (pexconv != NULL) @@ -214,7 +211,7 @@ void CLoadSaveCodepageDlg::UpdateSaveGroup() */ void CLoadSaveCodepageDlg::OnOK () { - CDialog::OnOK(); + CTrDialog::OnOK(); if (m_bLoadSaveSameCodepage) { m_nSaveCodepage = m_nLoadCodepage; diff --git a/Src/LoadSaveCodepageDlg.h b/Src/LoadSaveCodepageDlg.h index 2214eb34d..b887f966e 100644 --- a/Src/LoadSaveCodepageDlg.h +++ b/Src/LoadSaveCodepageDlg.h @@ -5,12 +5,13 @@ */ #pragma once +#include "TrDialogs.h" #include "UnicodeString.h" ///////////////////////////////////////////////////////////////////////////// // CLoadSaveCodepageDlg dialog -class CLoadSaveCodepageDlg : public CDialog +class CLoadSaveCodepageDlg : public CTrDialog { public: // Construction diff --git a/Src/Merge.vcxproj b/Src/Merge.vcxproj index 5e0002815..967d6af6a 100644 --- a/Src/Merge.vcxproj +++ b/Src/Merge.vcxproj @@ -682,6 +682,7 @@ NotUsing + NotUsing @@ -941,6 +942,7 @@ + @@ -962,6 +964,7 @@ + diff --git a/Src/Merge.vcxproj.filters b/Src/Merge.vcxproj.filters index e0dc74d70..8e17dc79f 100644 --- a/Src/Merge.vcxproj.filters +++ b/Src/Merge.vcxproj.filters @@ -745,6 +745,9 @@ MFCGui\Dialogs + + MFCGui\Source Files + @@ -1383,6 +1386,9 @@ Header Files + + MFCGui\Header Files + @@ -1499,6 +1505,7 @@ EditLib + diff --git a/Src/OptionsPanel.cpp b/Src/OptionsPanel.cpp index 8d37bd573..1d42b53ff 100644 --- a/Src/OptionsPanel.cpp +++ b/Src/OptionsPanel.cpp @@ -12,7 +12,7 @@ * @brief Constructor. */ OptionsPanel::OptionsPanel(COptionsMgr *optionsMgr, UINT nIDTemplate) - : CPropertyPage(nIDTemplate) + : CTrPropertyPage(nIDTemplate) , m_pOptionsMgr(optionsMgr) { } diff --git a/Src/OptionsPanel.h b/Src/OptionsPanel.h index 4cd96b5a6..323ae6519 100644 --- a/Src/OptionsPanel.h +++ b/Src/OptionsPanel.h @@ -7,13 +7,14 @@ #pragma once #include "IOptionsPanel.h" +#include "TrDialogs.h" class COptionsMgr; /** * @brief A base class for WinMerge options dialogs. */ -class OptionsPanel : public CPropertyPage, public IOptionsPanel +class OptionsPanel : public CTrPropertyPage, public IOptionsPanel { public: OptionsPanel(COptionsMgr *optionsMgr, UINT nIDTemplate); diff --git a/Src/PatchDlg.cpp b/Src/PatchDlg.cpp index 119221934..b2311818c 100644 --- a/Src/PatchDlg.cpp +++ b/Src/PatchDlg.cpp @@ -31,7 +31,6 @@ #include "PatchHTML.h" #include "FileOrFolderSelect.h" #include "Environment.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -46,7 +45,7 @@ using std::swap; * @brief Constructor, initializes members. */ CPatchDlg::CPatchDlg(CWnd* pParent /*=NULL*/) - : CDialog(CPatchDlg::IDD, pParent) + : CTrDialog(CPatchDlg::IDD, pParent) , m_caseSensitive(FALSE) , m_ignoreBlanks(0) , m_ignoreEOLDifference(FALSE) @@ -64,7 +63,7 @@ CPatchDlg::CPatchDlg(CWnd* pParent /*=NULL*/) */ void CPatchDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPatchDlg) DDX_Control(pDX, IDC_DIFF_STYLE, m_comboStyle); DDX_Control(pDX, IDC_DIFF_CONTEXT, m_comboContext); @@ -85,7 +84,7 @@ void CPatchDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CPatchDlg, CDialog) +BEGIN_MESSAGE_MAP(CPatchDlg, CTrDialog) //{{AFX_MSG_MAP(CPatchDlg) ON_BN_CLICKED(IDC_DIFF_BROWSE_FILE1, OnDiffBrowseFile1) ON_BN_CLICKED(IDC_DIFF_BROWSE_FILE2, OnDiffBrowseFile2) @@ -197,7 +196,7 @@ void CPatchDlg::OnOK() m_ctlFile2.SaveState(_T("Files\\DiffFile2")); } - CDialog::OnOK(); + CTrDialog::OnOK(); } /** @@ -209,8 +208,7 @@ void CPatchDlg::OnOK() */ BOOL CPatchDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); // Load combobox history m_ctlFile1.LoadState(_T("Files\\DiffFile1")); diff --git a/Src/PatchDlg.h b/Src/PatchDlg.h index b8a9a083a..3c4143054 100644 --- a/Src/PatchDlg.h +++ b/Src/PatchDlg.h @@ -22,6 +22,7 @@ #pragma once #include "resource.h" +#include "TrDialogs.h" #include "SuperComboBox.h" #include "UnicodeString.h" @@ -35,7 +36,7 @@ struct PATCHFILES; * This dialog allows user to select files from which to create a patch, * patch file's filename and several options related to patch. */ -class CPatchDlg : public CDialog +class CPatchDlg : public CTrDialog { // Construction public: diff --git a/Src/PluginsListDlg.cpp b/Src/PluginsListDlg.cpp index c9059e327..c258ae947 100644 --- a/Src/PluginsListDlg.cpp +++ b/Src/PluginsListDlg.cpp @@ -7,14 +7,13 @@ #include "stdafx.h" #include "PluginsListDlg.h" #include "UnicodeString.h" -#include "Merge.h" #include "Plugins.h" #include "OptionsDef.h" #include "OptionsMgr.h" -IMPLEMENT_DYNAMIC(PluginsListDlg, CDialog) +IMPLEMENT_DYNAMIC(PluginsListDlg, CTrDialog) -BEGIN_MESSAGE_MAP(PluginsListDlg, CDialog) +BEGIN_MESSAGE_MAP(PluginsListDlg, CTrDialog) ON_BN_CLICKED(IDOK, OnBnClickedOk) ON_BN_CLICKED(IDC_PLUGIN_SETTINGS, OnBnClickedPluginSettings) ON_NOTIFY(NM_DBLCLK, IDC_PLUGINSLIST_LIST, OnNMDblclkList) @@ -24,7 +23,7 @@ END_MESSAGE_MAP() * @brief Constructor. */ PluginsListDlg::PluginsListDlg(CWnd* pParent /*=NULL*/) - : CDialog(PluginsListDlg::IDD, pParent) + : CTrDialog(PluginsListDlg::IDD, pParent) { } @@ -37,7 +36,7 @@ PluginsListDlg::~PluginsListDlg() void PluginsListDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_PLUGINSLIST_LIST, m_list); } @@ -46,8 +45,7 @@ void PluginsListDlg::DoDataExchange(CDataExchange* pDX) */ BOOL PluginsListDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); InitList(); AddPlugins(); diff --git a/Src/PluginsListDlg.h b/Src/PluginsListDlg.h index 8c6684adb..35a14651e 100644 --- a/Src/PluginsListDlg.h +++ b/Src/PluginsListDlg.h @@ -5,6 +5,7 @@ */ #pragma once +#include "TrDialogs.h" #include "UnicodeString.h" /** @@ -13,7 +14,7 @@ * to the plugin (file)name it shows plugin type and description. The * dialog also has a control to enable/disable plugins. */ -class PluginsListDlg : public CDialog +class PluginsListDlg : public CTrDialog { DECLARE_DYNAMIC(PluginsListDlg) diff --git a/Src/ProjectFilePathsDlg.cpp b/Src/ProjectFilePathsDlg.cpp index d40fd8947..6099d6193 100644 --- a/Src/ProjectFilePathsDlg.cpp +++ b/Src/ProjectFilePathsDlg.cpp @@ -15,7 +15,6 @@ #include "ProjectFile.h" #include "FileOrFolderSelect.h" #include "FileFilterHelper.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -26,7 +25,7 @@ IMPLEMENT_DYNCREATE(ProjectFilePathsDlg, CPropertyPage) /** * @brief Standard constructor. */ -ProjectFilePathsDlg::ProjectFilePathsDlg() : CPropertyPage(ProjectFilePathsDlg::IDD) +ProjectFilePathsDlg::ProjectFilePathsDlg() : CTrPropertyPage(ProjectFilePathsDlg::IDD) , m_bLeftPathReadOnly(false) , m_bRightPathReadOnly(false) , m_bIncludeSubfolders(false) @@ -62,17 +61,6 @@ BEGIN_MESSAGE_MAP(ProjectFilePathsDlg, CDialog) END_MESSAGE_MAP() /** - * @brief Initialize dialog. - */ -BOOL ProjectFilePathsDlg::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); - return FALSE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -/** * @brief Called when Browse-button for left path is selected. */ void ProjectFilePathsDlg::OnBnClickedProjLfileBrowse() diff --git a/Src/ProjectFilePathsDlg.h b/Src/ProjectFilePathsDlg.h index 7b068762d..a09b22b2d 100644 --- a/Src/ProjectFilePathsDlg.h +++ b/Src/ProjectFilePathsDlg.h @@ -5,12 +5,13 @@ */ #pragma once +#include "TrDialogs.h" #include "UnicodeString.h" /** * @brief Dialog allowing user to load, edit and save project files. */ -class ProjectFilePathsDlg : public CPropertyPage +class ProjectFilePathsDlg : public CTrPropertyPage { DECLARE_DYNCREATE(ProjectFilePathsDlg) @@ -34,7 +35,6 @@ protected: // Generated message map functions //{{AFX_MSG(ProjectFilePathsDlg) - afx_msg BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Src/PropArchive.cpp b/Src/PropArchive.cpp index a24c554bd..567959ac3 100644 --- a/Src/PropArchive.cpp +++ b/Src/PropArchive.cpp @@ -7,11 +7,9 @@ #include "stdafx.h" #include "PropArchive.h" #include "Constants.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -65,7 +63,7 @@ void PropArchive::WriteOptions() */ BOOL PropArchive::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); + OptionsPanel::OnInitDialog(); UpdateData(FALSE); UpdateControls(); diff --git a/Src/PropBackups.cpp b/Src/PropBackups.cpp index 5e6d52f20..689fb8dec 100644 --- a/Src/PropBackups.cpp +++ b/Src/PropBackups.cpp @@ -6,13 +6,11 @@ #include "stdafx.h" #include "PropBackups.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" #include "FileOrFolderSelect.h" #include "paths.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -80,18 +78,6 @@ void PropBackups::WriteOptions() } /** - * @brief Called before propertysheet is drawn. - */ -BOOL PropBackups::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -/** * @brief Called when user selects Browse-button. */ void PropBackups::OnBnClickedBackupBrowse() diff --git a/Src/PropBackups.h b/Src/PropBackups.h index 81c06a3c4..d9ccb6569 100644 --- a/Src/PropBackups.h +++ b/Src/PropBackups.h @@ -42,7 +42,6 @@ public: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); afx_msg void OnBnClickedBackupBrowse(); DECLARE_MESSAGE_MAP() diff --git a/Src/PropCodepage.cpp b/Src/PropCodepage.cpp index e7b340711..4f677c3f9 100644 --- a/Src/PropCodepage.cpp +++ b/Src/PropCodepage.cpp @@ -29,12 +29,10 @@ #include "PropCodepage.h" #include "common/unicoder.h" #include "common/ExConverter.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" #include "charsets.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -102,8 +100,7 @@ void PropCodepage::WriteOptions() BOOL PropCodepage::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); CEdit * pEdit = (CEdit *) GetDlgItem(IDC_CUSTOM_CP_NUMBER); diff --git a/Src/PropColors.cpp b/Src/PropColors.cpp index 1bd4e53c1..4e1f66da1 100644 --- a/Src/PropColors.cpp +++ b/Src/PropColors.cpp @@ -6,7 +6,6 @@ #include "stdafx.h" #include "PropColors.h" -#include "Merge.h" #include "OptionsCustomColors.h" #include "OptionsDef.h" #include "OptionsMgr.h" @@ -106,15 +105,6 @@ BEGIN_MESSAGE_MAP(PropMergeColors, CDialog) END_MESSAGE_MAP() /** - * @brief Called before propertysheet is drawn. - */ -BOOL PropMergeColors::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - return CPropertyPage::OnInitDialog(); -} - -/** * @brief Reads options values from storage to UI. * (Property sheet calls this before displaying all property pages) */ @@ -346,7 +336,7 @@ template void PropMergeColors::OnUseTextColor() { CColorButton *cButton = dynamic_cast(GetDlgItem(colorbutton_id)); - if (((CButton *)GetDlgItem(checkbox_id))->GetCheck() != 0) + if (IsDlgButtonChecked(checkbox_id) != 0) { cButton->ShowWindow(SW_SHOW); cButton->SetColor(0); diff --git a/Src/PropColors.h b/Src/PropColors.h index 7af111c59..951afbf71 100644 --- a/Src/PropColors.h +++ b/Src/PropColors.h @@ -62,7 +62,6 @@ private: //{{AFX_VIRTUAL(PropMergeColors) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); //}}AFX_VIRTUAL // Implementation diff --git a/Src/PropCompare.cpp b/Src/PropCompare.cpp index 91dc8aff4..f15531399 100644 --- a/Src/PropCompare.cpp +++ b/Src/PropCompare.cpp @@ -6,11 +6,9 @@ #include "stdafx.h" #include "PropCompare.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -86,18 +84,6 @@ void PropCompare::WriteOptions() } /** - * @brief Called before propertysheet is drawn. - */ -BOOL PropCompare::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -/** * @brief Sets options to defaults */ void PropCompare::OnDefaults() diff --git a/Src/PropCompare.h b/Src/PropCompare.h index 71e686a18..3844cf89f 100644 --- a/Src/PropCompare.h +++ b/Src/PropCompare.h @@ -51,7 +51,6 @@ public: protected: // Generated message map functions //{{AFX_MSG(PropCompare) - afx_msg BOOL OnInitDialog(); afx_msg void OnDefaults(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Src/PropCompareBinary.cpp b/Src/PropCompareBinary.cpp index 92f1ef7a0..c5a30909a 100644 --- a/Src/PropCompareBinary.cpp +++ b/Src/PropCompareBinary.cpp @@ -6,7 +6,6 @@ #include "stdafx.h" #include "PropCompareBinary.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" @@ -90,18 +89,6 @@ void PropCompareBinary::WriteOptions() } /** - * @brief Called before propertysheet is drawn. - */ -BOOL PropCompareBinary::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -/** * @brief Show Frhed view settings dialog */ void PropCompareBinary::OnViewSettings() diff --git a/Src/PropCompareBinary.h b/Src/PropCompareBinary.h index 951b445f7..24a4b2f92 100644 --- a/Src/PropCompareBinary.h +++ b/Src/PropCompareBinary.h @@ -41,7 +41,6 @@ public: protected: // Generated message map functions //{{AFX_MSG(PropCompareBinary) - afx_msg BOOL OnInitDialog(); afx_msg void OnViewSettings(); afx_msg void OnBinaryMode(); afx_msg void OnCharacterSet(); diff --git a/Src/PropCompareFolder.cpp b/Src/PropCompareFolder.cpp index 3eb811486..f16d612e4 100644 --- a/Src/PropCompareFolder.cpp +++ b/Src/PropCompareFolder.cpp @@ -6,11 +6,9 @@ #include "stdafx.h" #include "PropCompareFolder.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -96,8 +94,7 @@ void PropCompareFolder::WriteOptions() */ BOOL PropCompareFolder::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); CComboBox * combo = (CComboBox*) GetDlgItem(IDC_COMPAREMETHODCOMBO); String item = _("Full Contents"); diff --git a/Src/PropCompareImage.cpp b/Src/PropCompareImage.cpp index 193e6bb40..859bb09b8 100644 --- a/Src/PropCompareImage.cpp +++ b/Src/PropCompareImage.cpp @@ -6,7 +6,6 @@ #include "stdafx.h" #include "PropCompareImage.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" @@ -60,18 +59,6 @@ void PropCompareImage::WriteOptions() } /** - * @brief Called before propertysheet is drawn. - */ -BOOL PropCompareImage::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - -/** * @brief Sets options to defaults */ void PropCompareImage::OnDefaults() diff --git a/Src/PropCompareImage.h b/Src/PropCompareImage.h index 81115941d..712a7dff2 100644 --- a/Src/PropCompareImage.h +++ b/Src/PropCompareImage.h @@ -41,7 +41,6 @@ public: protected: // Generated message map functions //{{AFX_MSG(PropCompareImage) - afx_msg BOOL OnInitDialog(); afx_msg void OnDefaults(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Src/PropEditor.cpp b/Src/PropEditor.cpp index deb38d15b..dbab96f50 100644 --- a/Src/PropEditor.cpp +++ b/Src/PropEditor.cpp @@ -6,11 +6,9 @@ #include "stdafx.h" #include "PropEditor.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -107,8 +105,7 @@ void PropEditor::WriteOptions() */ BOOL PropEditor::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); CEdit * pEdit = (CEdit *) GetDlgItem(IDC_TAB_EDIT); diff --git a/Src/PropGeneral.cpp b/Src/PropGeneral.cpp index 7bb692670..77afa1cd9 100644 --- a/Src/PropGeneral.cpp +++ b/Src/PropGeneral.cpp @@ -32,7 +32,6 @@ #include "OptionsMgr.h" #include "OptionsPanel.h" #include "LanguageSelect.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -61,8 +60,7 @@ PropGeneral::~PropGeneral() BOOL PropGeneral::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); CComboBox *pWnd = (CComboBox*)GetDlgItem(IDC_AUTO_COMPLETE_SOURCE); ASSERT(NULL != pWnd); diff --git a/Src/PropRegistry.cpp b/Src/PropRegistry.cpp index c654169cb..433d2ae49 100644 --- a/Src/PropRegistry.cpp +++ b/Src/PropRegistry.cpp @@ -25,11 +25,9 @@ #include "RegKey.h" #include "coretools.h" #include "FileOrFolderSelect.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -100,17 +98,6 @@ void PropRegistry::WriteOptions() GetOptionsMgr()->SaveOption(OPT_CUSTOM_TEMP_PATH, tempFolder); } -BOOL PropRegistry::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); - - UpdateData(FALSE); - - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} - /// Open file browse dialog to locate editor void PropRegistry::OnBrowseEditor() { diff --git a/Src/PropRegistry.h b/Src/PropRegistry.h index dd88bff83..b6f13ce38 100644 --- a/Src/PropRegistry.h +++ b/Src/PropRegistry.h @@ -64,7 +64,6 @@ public: protected: // Generated message map functions //{{AFX_MSG(PropRegistry) - virtual BOOL OnInitDialog(); afx_msg void OnBrowseEditor(); afx_msg void OnBrowseFilterPath(); afx_msg void OnBrowseTmpFolder(); diff --git a/Src/PropShell.cpp b/Src/PropShell.cpp index b216d7625..7816d6ce2 100644 --- a/Src/PropShell.cpp +++ b/Src/PropShell.cpp @@ -7,12 +7,10 @@ #include "stdafx.h" #include "PropShell.h" -#include "Merge.h" #include "RegKey.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #include "Constants.h" #include "Environment.h" #include "paths.h" @@ -82,8 +80,7 @@ PropShell::PropShell(COptionsMgr *optionsMgr) BOOL PropShell::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); #ifndef BCM_SETSHIELD #define BCM_SETSHIELD (0x1600/*BCM_FIRST*/ + 0x000C) diff --git a/Src/PropSyntaxColors.cpp b/Src/PropSyntaxColors.cpp index cf31b44b8..90d9b1127 100644 --- a/Src/PropSyntaxColors.cpp +++ b/Src/PropSyntaxColors.cpp @@ -9,7 +9,6 @@ #include "SyntaxColors.h" #include "OptionsSyntaxColors.h" #include "OptionsCustomColors.h" -#include "Merge.h" #include "OptionsPanel.h" #ifdef _DEBUG @@ -112,15 +111,6 @@ BEGIN_MESSAGE_MAP(PropSyntaxColors, CPropertyPage) END_MESSAGE_MAP() /** - * @brief Called before propertysheet is drawn. - */ -BOOL PropSyntaxColors::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - return CPropertyPage::OnInitDialog(); -} - -/** * @brief Reads options values from storage to UI. * (Property sheet calls this before displaying all property pages) */ diff --git a/Src/PropSyntaxColors.h b/Src/PropSyntaxColors.h index 118c21eff..1d6261e44 100644 --- a/Src/PropSyntaxColors.h +++ b/Src/PropSyntaxColors.h @@ -33,7 +33,6 @@ private: protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support - virtual BOOL OnInitDialog(); afx_msg void OnBnClickedEcolorKeywords(); afx_msg void OnBnClickedEcolorFunctions(); afx_msg void OnBnClickedEcolorComments(); diff --git a/Src/PropTextColors.cpp b/Src/PropTextColors.cpp index 1ef155567..a1d25990e 100644 --- a/Src/PropTextColors.cpp +++ b/Src/PropTextColors.cpp @@ -6,13 +6,11 @@ #include "stdafx.h" #include "PropTextColors.h" -#include "Merge.h" #include "SyntaxColors.h" #include "OptionsCustomColors.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -63,8 +61,7 @@ END_MESSAGE_MAP() */ BOOL PropTextColors::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); if (m_bCustomColors) EnableColorButtons(TRUE); diff --git a/Src/PropVss.cpp b/Src/PropVss.cpp index 7c3cafd7a..a006d50cd 100644 --- a/Src/PropVss.cpp +++ b/Src/PropVss.cpp @@ -27,12 +27,10 @@ #include "stdafx.h" #include "PropVss.h" #include "FileOrFolderSelect.h" -#include "Merge.h" #include "OptionsDef.h" #include "OptionsMgr.h" #include "OptionsPanel.h" #include "SourceControl.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -105,8 +103,7 @@ void PropVss::OnBrowseButton() */ BOOL PropVss::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CPropertyPage::OnInitDialog(); + OptionsPanel::OnInitDialog(); LoadVssOptionStrings(); diff --git a/Src/SaveClosingDlg.cpp b/Src/SaveClosingDlg.cpp index 64edeadc2..9d301dff8 100644 --- a/Src/SaveClosingDlg.cpp +++ b/Src/SaveClosingDlg.cpp @@ -22,8 +22,6 @@ #include "stdafx.h" #include "SaveClosingDlg.h" -#include "Merge.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -32,14 +30,14 @@ ///////////////////////////////////////////////////////////////////////////// // SaveClosingDlg dialog -IMPLEMENT_DYNAMIC(SaveClosingDlg, CDialog) +IMPLEMENT_DYNAMIC(SaveClosingDlg, CTrDialog) /** * @brief Constructor. * @param [in] pParent Dialog's parent window. */ SaveClosingDlg::SaveClosingDlg(CWnd* pParent /*=NULL*/) - : CDialog(SaveClosingDlg::IDD, pParent) + : CTrDialog(SaveClosingDlg::IDD, pParent) , m_leftSave(SAVECLOSING_SAVE) , m_middleSave(SAVECLOSING_SAVE) , m_rightSave(SAVECLOSING_SAVE) @@ -52,7 +50,7 @@ SaveClosingDlg::SaveClosingDlg(CWnd* pParent /*=NULL*/) void SaveClosingDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SaveClosingDlg) DDX_Text(pDX, IDC_SAVECLOSING_LEFTFILE, m_sLeftFile); DDX_Text(pDX, IDC_SAVECLOSING_MIDDLEFILE, m_sMiddleFile); @@ -64,7 +62,7 @@ void SaveClosingDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(SaveClosingDlg, CDialog) +BEGIN_MESSAGE_MAP(SaveClosingDlg, CTrDialog) //{{AFX_MSG_MAP(SaveClosingDlg) ON_BN_CLICKED(IDC_SAVECLOSING_DISCARDALL, OnDiscardAll) //}}AFX_MSG_MAP @@ -80,8 +78,7 @@ END_MESSAGE_MAP() */ BOOL SaveClosingDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); GetDlgItem(IDC_SAVECLOSING_SAVELEFT)->SetFocus(); if (!m_bAskForLeft) diff --git a/Src/SaveClosingDlg.h b/Src/SaveClosingDlg.h index 92c8ee23d..122f1e100 100644 --- a/Src/SaveClosingDlg.h +++ b/Src/SaveClosingDlg.h @@ -21,6 +21,7 @@ */ #pragma once +#include "TrDialogs.h" #include "CMoveConstraint.h" #include "UnicodeString.h" @@ -35,7 +36,7 @@ * controls inside it are disabled. Asked file(s) are selected using * DoAskFor() function. */ -class SaveClosingDlg : public CDialog +class SaveClosingDlg : public CTrDialog { DECLARE_DYNAMIC(SaveClosingDlg) diff --git a/Src/SelectUnpackerDlg.cpp b/Src/SelectUnpackerDlg.cpp index 1894ddbb2..14f1c558e 100644 --- a/Src/SelectUnpackerDlg.cpp +++ b/Src/SelectUnpackerDlg.cpp @@ -26,10 +26,8 @@ #include "stdafx.h" #include "SelectUnpackerDlg.h" -#include "Merge.h" #include "Plugins.h" #include "FileTransform.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -107,14 +105,14 @@ void CSelectUnpackerDlg::Initialize() CSelectUnpackerDlg::CSelectUnpackerDlg(const String& filename, CWnd* pParent /*=NULL*/) - : CDialog(CSelectUnpackerDlg::IDD, pParent) + : CTrDialog(CSelectUnpackerDlg::IDD, pParent) { m_filteredFilenames = filename; Initialize(); } CSelectUnpackerDlg::CSelectUnpackerDlg(const String& filename1, const String& filename2, CWnd* pParent /*=NULL*/) - : CDialog(CSelectUnpackerDlg::IDD, pParent) + : CTrDialog(CSelectUnpackerDlg::IDD, pParent) { m_filteredFilenames = filename1; m_filteredFilenames += _T("|"); @@ -177,7 +175,7 @@ const PackingInfo CSelectUnpackerDlg::GetInfoHandler() void CSelectUnpackerDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSelectUnpackerDlg) DDX_Control(pDX, IDOK, m_btnOK); DDX_Control(pDX, IDC_UNPACKER_NAME, m_cboUnpackerName); @@ -188,7 +186,7 @@ void CSelectUnpackerDlg::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CSelectUnpackerDlg, CDialog) +BEGIN_MESSAGE_MAP(CSelectUnpackerDlg, CTrDialog) //{{AFX_MSG_MAP(CSelectUnpackerDlg) ON_BN_CLICKED(IDC_UNPACKER_ALLOW_ALL, OnUnpackerAllowAll) ON_CBN_SELCHANGE(IDC_UNPACKER_NAME, OnSelchangeUnpackerName) @@ -203,13 +201,12 @@ void CSelectUnpackerDlg::OnOK() { AfxGetApp()->WriteProfileInt(_T("Plugins"), _T("UnpackDontCheckExtension"), m_bNoExtensionCheck); - CDialog::OnOK(); + CTrDialog::OnOK(); } BOOL CSelectUnpackerDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); m_bNoExtensionCheck = !!AfxGetApp()->GetProfileInt(_T("Plugins"), _T("UnpackDontCheckExtension"), false); diff --git a/Src/SelectUnpackerDlg.h b/Src/SelectUnpackerDlg.h index 6938743d7..8feb7f847 100644 --- a/Src/SelectUnpackerDlg.h +++ b/Src/SelectUnpackerDlg.h @@ -27,6 +27,7 @@ #include #include +#include "TrDialogs.h" #include "UnicodeString.h" ///////////////////////////////////////////////////////////////////////////// @@ -35,7 +36,7 @@ class PackingInfo; class PluginInfo; -class CSelectUnpackerDlg : public CDialog +class CSelectUnpackerDlg : public CTrDialog { private: // Construction diff --git a/Src/SharedFilterDlg.cpp b/Src/SharedFilterDlg.cpp index 7fc04ac71..3eae8157b 100644 --- a/Src/SharedFilterDlg.cpp +++ b/Src/SharedFilterDlg.cpp @@ -6,7 +6,6 @@ #include "stdafx.h" #include "SharedFilterDlg.h" -#include "Merge.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -20,35 +19,21 @@ * @brief A constructor. */ CSharedFilterDlg::CSharedFilterDlg(FilterType type, CWnd* pParent /*=NULL*/) - : CDialog(CSharedFilterDlg::IDD, pParent), m_selectedType(type) + : CTrDialog(CSharedFilterDlg::IDD, pParent), m_selectedType(type) { } void CSharedFilterDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CSharedFilterDlg) DDX_Radio(pDX, IDC_SHARED, *(reinterpret_cast(&m_selectedType))); //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CSharedFilterDlg, CDialog) +BEGIN_MESSAGE_MAP(CSharedFilterDlg, CTrDialog) //{{AFX_MSG_MAP(CSharedFilterDlg) //}}AFX_MSG_MAP END_MESSAGE_MAP() - -///////////////////////////////////////////////////////////////////////////// -// CSharedFilterDlg message handlers - -/** - * @brief Dialog initialization. - */ -BOOL CSharedFilterDlg::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE -} diff --git a/Src/SharedFilterDlg.h b/Src/SharedFilterDlg.h index d968a0a65..5fb0af055 100644 --- a/Src/SharedFilterDlg.h +++ b/Src/SharedFilterDlg.h @@ -6,6 +6,8 @@ */ #pragma once +#include "TrDialogs.h" + ///////////////////////////////////////////////////////////////////////////// // CSharedFilterDlg dialog @@ -15,7 +17,7 @@ * (placed into WinMerge executable's subfolder) or private filter * (placed into profile folder). */ -class CSharedFilterDlg : public CDialog +class CSharedFilterDlg : public CTrDialog { // Construction public: @@ -41,7 +43,6 @@ protected: // Generated message map functions //{{AFX_MSG(CSharedFilterDlg) - virtual BOOL OnInitDialog(); //}}AFX_MSG DECLARE_MESSAGE_MAP() diff --git a/Src/TestFilterDlg.cpp b/Src/TestFilterDlg.cpp index 55358566b..6a7e2bad4 100644 --- a/Src/TestFilterDlg.cpp +++ b/Src/TestFilterDlg.cpp @@ -6,11 +6,9 @@ #include "stdafx.h" #include "TestFilterDlg.h" -#include "Merge.h" #include "resource.h" #include "UnicodeString.h" #include "FileFilterMgr.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -23,7 +21,7 @@ * @param [in] pFilterMgr File filter manager. */ CTestFilterDlg::CTestFilterDlg(CWnd* pParent, FileFilter * pFileFilter, FileFilterMgr *pFilterMgr) -: CDialog(CTestFilterDlg::IDD, pParent) +: CTrDialog(CTestFilterDlg::IDD, pParent) , m_pFileFilter(pFileFilter) , m_pFileFilterMgr(pFilterMgr) { @@ -31,14 +29,14 @@ CTestFilterDlg::CTestFilterDlg(CWnd* pParent, FileFilter * pFileFilter, FileFilt void CTestFilterDlg::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTestFilterDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } -BEGIN_MESSAGE_MAP(CTestFilterDlg, CDialog) +BEGIN_MESSAGE_MAP(CTestFilterDlg, CTrDialog) //{{AFX_MSG_MAP(CTestFilterDlg) ON_BN_CLICKED(IDC_TEST_BTN, OnTestBtn) //}}AFX_MSG_MAP @@ -53,8 +51,7 @@ END_MESSAGE_MAP() */ BOOL CTestFilterDlg::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); GetDlgItem(IDC_TEST_TEXT)->SetFocus(); @@ -86,7 +83,7 @@ void CTestFilterDlg::OnOK() ASSERT (pWnd); if (IDCANCEL == pWnd->GetDlgCtrlID()) { - CDialog::OnCancel(); + CTrDialog::OnCancel(); } else { diff --git a/Src/TestFilterDlg.h b/Src/TestFilterDlg.h index 31ffffe1d..4879e9485 100644 --- a/Src/TestFilterDlg.h +++ b/Src/TestFilterDlg.h @@ -6,6 +6,8 @@ */ #pragma once +#include "TrDialogs.h" + struct FileFilter; class FileFilterMgr; @@ -13,7 +15,7 @@ class FileFilterMgr; * @brief Dialog allowing user to test out file filter strings. * The user can type a text and test if selected file filter matches to it. */ -class CTestFilterDlg : public CDialog +class CTestFilterDlg : public CTrDialog { // Construction public: diff --git a/Src/TrDialogs.cpp b/Src/TrDialogs.cpp new file mode 100644 index 000000000..d64c34362 --- /dev/null +++ b/Src/TrDialogs.cpp @@ -0,0 +1,39 @@ +#include +#include "Merge.h" +#include "TrDialogs.h" + +IMPLEMENT_DYNAMIC(CTrDialog, CDialog) +IMPLEMENT_DYNAMIC(CTrPropertyPage, CPropertyPage) +IMPLEMENT_DYNAMIC(CTrDialogBar, CDialogBar) + +BOOL CTrDialog::OnInitDialog() +{ + theApp.TranslateDialog(m_hWnd); + CDialog::OnInitDialog(); + return TRUE; +} + +BOOL CTrPropertyPage::OnInitDialog() +{ + theApp.TranslateDialog(m_hWnd); + CPropertyPage::OnInitDialog(); + return TRUE; +} + +BOOL CTrDialogBar::Create(CWnd* pParentWnd, LPCTSTR lpszTemplateName, + UINT nStyle, UINT nID) +{ + BOOL bSucceeded = CDialogBar::Create(pParentWnd, lpszTemplateName, nStyle, nID); + if (bSucceeded) + theApp.TranslateDialog(m_hWnd); + return bSucceeded; +} + +BOOL CTrDialogBar::Create(CWnd* pParentWnd, UINT nIDTemplate, + UINT nStyle, UINT nID) +{ + BOOL bSucceeded = CDialogBar::Create(pParentWnd, nIDTemplate, nStyle, nID); + if (bSucceeded) + theApp.TranslateDialog(m_hWnd); + return bSucceeded; +} diff --git a/Src/TrDialogs.h b/Src/TrDialogs.h new file mode 100644 index 000000000..62e3a04d2 --- /dev/null +++ b/Src/TrDialogs.h @@ -0,0 +1,37 @@ +#pragma once + +#include "DDXHelper.h" + +class CTrDialog : public CDialog +{ + DECLARE_DYNAMIC(CTrDialog) +public: + CTrDialog() : CDialog() {} + CTrDialog(UINT nIDTemplate, CWnd *pParent = NULL) : CDialog(nIDTemplate, pParent) {} + CTrDialog(LPCTSTR lpszTemplateName, CWnd *pParentWnd = NULL) : CDialog(lpszTemplateName, pParentWnd) {} + + virtual BOOL OnInitDialog(); +}; + +class CTrPropertyPage : public CPropertyPage +{ + DECLARE_DYNAMIC(CTrPropertyPage) +public: + CTrPropertyPage() : CPropertyPage() {} + explicit CTrPropertyPage(UINT nIDTemplate, UINT nIDCaption = 0, DWORD dwSize = sizeof(PROPSHEETPAGE)) + : CPropertyPage(nIDTemplate, nIDCaption, dwSize) {} + explicit CTrPropertyPage(LPCTSTR lpszTemplateName, UINT nIDCaption = 0, DWORD dwSize = sizeof(PROPSHEETPAGE)) + : CPropertyPage(lpszTemplateName, nIDCaption, dwSize) {} + + virtual BOOL OnInitDialog(); +}; + +class CTrDialogBar : public CDialogBar +{ + DECLARE_DYNAMIC(CTrDialogBar) +public: + virtual BOOL Create(CWnd* pParentWnd, LPCTSTR lpszTemplateName, + UINT nStyle, UINT nID); + virtual BOOL Create(CWnd* pParentWnd, UINT nIDTemplate, + UINT nStyle, UINT nID); +}; diff --git a/Src/VssPromptDlg.cpp b/Src/VssPromptDlg.cpp index 1f4e919a0..e2be08b78 100644 --- a/Src/VssPromptDlg.cpp +++ b/Src/VssPromptDlg.cpp @@ -27,9 +27,8 @@ #include "stdafx.h" #include "VssPromptDlg.h" #include "SuperComboBox.h" -#include "Merge.h" +#include "TrDialogs.h" #include "RegKey.h" -#include "DDXHelper.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -38,7 +37,7 @@ /** * @brief Class for VSS dialog */ -class CVssPromptDlg::Impl : public CDialog +class CVssPromptDlg::Impl : public CTrDialog { // Construction public: @@ -85,7 +84,7 @@ private: * @param [in] pParent Pointer to parent component. */ CVssPromptDlg::Impl::Impl(CVssPromptDlg *p, CWnd* pParent /*=NULL*/) - : CDialog(CVssPromptDlg::Impl::IDD, pParent) + : CTrDialog(CVssPromptDlg::Impl::IDD, pParent) , m_p(p) { @@ -94,7 +93,7 @@ CVssPromptDlg::Impl::Impl(CVssPromptDlg *p, CWnd* pParent /*=NULL*/) void CVssPromptDlg::Impl::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CVssPromptDlg::Impl) DDX_Control(pDX, IDC_PROJECT_COMBO, m_ctlProject); DDX_CBString(pDX, IDC_PROJECT_COMBO, m_p->m_strProject); @@ -110,7 +109,7 @@ void CVssPromptDlg::Impl::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(CVssPromptDlg::Impl, CDialog) +BEGIN_MESSAGE_MAP(CVssPromptDlg::Impl, CTrDialog) //{{AFX_MSG_MAP(CVssPromptDlg::Impl) ON_BN_CLICKED(IDC_SAVE_AS, OnSaveas) //}}AFX_MSG_MAP @@ -125,8 +124,7 @@ END_MESSAGE_MAP() */ BOOL CVssPromptDlg::Impl::OnInitDialog() { - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); + CTrDialog::OnInitDialog(); m_ctlProject.LoadState(_T("Vss")); @@ -181,7 +179,7 @@ void CVssPromptDlg::Impl::OnOK() } m_ctlProject.SaveState(_T("Vss")); - CDialog::OnOK(); + CTrDialog::OnOK(); } /** diff --git a/Src/WMGotoDlg.cpp b/Src/WMGotoDlg.cpp index 33e753632..98bd2240d 100644 --- a/Src/WMGotoDlg.cpp +++ b/Src/WMGotoDlg.cpp @@ -22,8 +22,7 @@ #include "stdafx.h" #include "WMGotoDlg.h" -#include "Merge.h" -#include "DDXHelper.h" +#include "TrDialogs.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -36,7 +35,7 @@ * choice for target panel. When dialog is opened, its values are initialized * for active file's line number. */ -class WMGotoDlg::Impl : public CDialog +class WMGotoDlg::Impl : public CTrDialog { // Construction public: @@ -59,7 +58,6 @@ protected: // Generated message map functions //{{AFX_MSG(WMGotoDlg) - virtual BOOL OnInitDialog(); // NOTE: the ClassWizard will add member functions here //}}AFX_MSG DECLARE_MESSAGE_MAP() @@ -75,24 +73,13 @@ private: * @brief Constructor. */ WMGotoDlg::Impl::Impl(WMGotoDlg *p, CWnd* pParent /*=NULL*/) - : CDialog(WMGotoDlg::Impl::IDD, pParent), m_p(p) + : CTrDialog(WMGotoDlg::Impl::IDD, pParent), m_p(p) { } -/** - * @brief Initialize dialog. - */ -BOOL WMGotoDlg::Impl::OnInitDialog() -{ - theApp.TranslateDialog(m_hWnd); - CDialog::OnInitDialog(); - return TRUE; -} - - void WMGotoDlg::Impl::DoDataExchange(CDataExchange* pDX) { - CDialog::DoDataExchange(pDX); + CTrDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(WMGotoDlg) DDX_Text(pDX, IDC_WMGOTO_PARAM, m_p->m_strParam); DDX_Radio(pDX, IDC_WMGOTO_FILELEFT, m_p->m_nFile); @@ -101,7 +88,7 @@ void WMGotoDlg::Impl::DoDataExchange(CDataExchange* pDX) } -BEGIN_MESSAGE_MAP(WMGotoDlg::Impl, CDialog) +BEGIN_MESSAGE_MAP(WMGotoDlg::Impl, CTrDialog) //{{AFX_MSG_MAP(WMGotoDlg::Impl) // NOTE: the ClassWizard will add message map macros here //}}AFX_MSG_MAP -- 2.11.0