From 5122139cba6eb872327c6d077cf5662c2a129ffd Mon Sep 17 00:00:00 2001 From: Perry Rapp Date: Sun, 20 Apr 2003 04:46:22 +0000 Subject: [PATCH] [ 724473 ] Move WaitStatusCursor strings into RC --- Src/DirDoc.cpp | 2 +- Src/DirView.cpp | 24 +++++++----------------- Src/MainFrm.cpp | 4 +--- Src/Merge.rc | 8 +++++++- Src/MergeDoc.cpp | 2 +- Src/MergeEditView.cpp | 8 ++++---- Src/StdAfx.cpp | 7 +++++++ Src/StdAfx.h | 3 +-- Src/readme.txt | 2 ++ Src/resource.h | 6 ++++++ 10 files changed, 37 insertions(+), 29 deletions(-) diff --git a/Src/DirDoc.cpp b/Src/DirDoc.cpp index 812d48587..a69e86661 100644 --- a/Src/DirDoc.cpp +++ b/Src/DirDoc.cpp @@ -205,7 +205,7 @@ diff_dirs2 (filevec, handle_file, depth) void CDirDoc::Rescan() { - WaitStatusCursor waitstatus(_T("Rescanning")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_RESCANNING)); ASSERT(m_pCtxt != NULL); diff --git a/Src/DirView.cpp b/Src/DirView.cpp index 44550db42..c5c0755ee 100644 --- a/Src/DirView.cpp +++ b/Src/DirView.cpp @@ -213,7 +213,7 @@ void CDirView::OnInitialUpdate() void CDirView::OnLButtonDblClk(UINT nFlags, CPoint point) { - WaitStatusCursor waitstatus(_T("Opening selection")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_OPENING_SELECTION)); OpenSelection(); CListViewEx::OnLButtonDblClk(nFlags, point); } @@ -486,7 +486,7 @@ void CDirView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) { if(nChar==VK_RETURN) { - WaitStatusCursor waitstatus(_T("Opening selection")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_OPENING_SELECTION)); OpenSelection(); } CListViewEx::OnChar(nChar, nRepCnt, nFlags); @@ -513,40 +513,30 @@ void CDirView::OpenSelection() break; case FILE_SAME: { - CString s; - VERIFY(s.LoadString(IDS_FILESSAME)); - AfxMessageBox(s, MB_ICONINFORMATION); + AfxMessageBox(IDS_FILESSAME, MB_ICONINFORMATION); } break; case FILE_LDIRUNIQUE: case FILE_RDIRUNIQUE: { - CString s; - VERIFY(s.LoadString(IDS_FILEISDIR)); - AfxMessageBox(s, MB_ICONINFORMATION); + AfxMessageBox(IDS_FILEISDIR, MB_ICONINFORMATION); } break; case FILE_LUNIQUE: case FILE_RUNIQUE: { - CString s; - VERIFY(s.LoadString(IDS_FILEUNIQUE)); - AfxMessageBox(s, MB_ICONINFORMATION); + AfxMessageBox(IDS_FILEUNIQUE, MB_ICONINFORMATION); } break; case FILE_BINDIFF: case FILE_BINSAME: { - CString s; - VERIFY(s.LoadString(IDS_FILEBINARY)); - AfxMessageBox(s, MB_ICONSTOP); + AfxMessageBox(IDS_FILEBINARY, MB_ICONSTOP); } break; default: { - CString s; - VERIFY(s.LoadString(IDS_FILEERROR)); - AfxMessageBox(s, MB_ICONSTOP); + AfxMessageBox(IDS_FILEERROR, MB_ICONSTOP); } break; } diff --git a/Src/MainFrm.cpp b/Src/MainFrm.cpp index 575626fa6..b14a0d231 100644 --- a/Src/MainFrm.cpp +++ b/Src/MainFrm.cpp @@ -1242,9 +1242,7 @@ void CMainFrame::OnUpdateViewUsedefaultfont(CCmdUI* pCmdUI) void CMainFrame::UpdateResources() { - CString s; - VERIFY(s.LoadString(AFX_IDS_IDLEMESSAGE)); - m_wndStatusBar.SetPaneText(0, s); + m_wndStatusBar.SetPaneText(0, LoadResString(AFX_IDS_IDLEMESSAGE)); DirDocList dirdocs; GetAllDirDocs(&dirdocs); diff --git a/Src/Merge.rc b/Src/Merge.rc index bdc9202a5..092eea1b0 100644 --- a/Src/Merge.rc +++ b/Src/Merge.rc @@ -1046,6 +1046,7 @@ BEGIN ID_DIR_OPEN_RIGHT_WITH "Open right file with..." ID_OPTIONS_SHOWBINARIES "Displays binary files" ID_VIEW_WHITESPACE "Shows whitespace characters" + ID_REFRESH "Refresh display\nRefresh (F5)" END STRINGTABLE DISCARDABLE @@ -1053,7 +1054,12 @@ BEGIN IDS_FILESAVE_FAILED "Saving %1 failed. Would you like to save the file under a different name?" IDS_ERROR_FILE_NOT_FOUND "File not found: %1" IDS_ERROR_INCOMPARABLE "Select two existing directories or files to compare" - ID_REFRESH "Refresh display\nRefresh (F5)" + IDS_STATUS_RESCANNING "Rescanning" + IDS_STATUS_OPENING_SELECTION "Opening selection" + IDS_STATUS_COPYL2R "Copying Left to Right" + IDS_STATUS_COPYR2L "Copying Right to Left" + IDS_STATUS_COPYALL2L "Copying All to Left" + IDS_STATUS_COPYALL2R "Copying All to Right" END #endif // English (U.S.) resources diff --git a/Src/MergeDoc.cpp b/Src/MergeDoc.cpp index 04671f855..c10fc3b58 100644 --- a/Src/MergeDoc.cpp +++ b/Src/MergeDoc.cpp @@ -1676,7 +1676,7 @@ void CMergeDoc::RescanIfNeeded() COleDateTimeSpan elapsed = COleDateTime::GetCurrentTime() - m_LastRescan; if (elapsed.GetTotalSeconds() > 1) { - WaitStatusCursor waitstatus(_T("Rescanning")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_RESCANNING)); FlushAndRescan(); } } diff --git a/Src/MergeEditView.cpp b/Src/MergeEditView.cpp index e3ba75ae3..ac0aaaa0b 100644 --- a/Src/MergeEditView.cpp +++ b/Src/MergeEditView.cpp @@ -589,7 +589,7 @@ void CMergeEditView::UpdateLineLengths() void CMergeEditView::OnL2r() { - WaitStatusCursor waitstatus(_T("Copying Left to Right")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_COPYL2R)); GetDocument()->ListCopy(true); } @@ -600,7 +600,7 @@ void CMergeEditView::OnUpdateL2r(CCmdUI* pCmdUI) void CMergeEditView::OnR2l() { - WaitStatusCursor waitstatus(_T("Copying Right to Left")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_COPYR2L)); GetDocument()->ListCopy(false); } @@ -611,7 +611,7 @@ void CMergeEditView::OnUpdateR2l(CCmdUI* pCmdUI) void CMergeEditView::OnAllLeft() { - WaitStatusCursor waitstatus(_T("Copying All to Left")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_COPYALL2L)); CMergeDoc* pDoc = GetDocument(); // Unfortunately difftools is not designed for this kind @@ -635,7 +635,7 @@ void CMergeEditView::OnUpdateAllLeft(CCmdUI* pCmdUI) void CMergeEditView::OnAllRight() { - WaitStatusCursor waitstatus(_T("Copying All to Right")); + WaitStatusCursor waitstatus(LoadResString(IDS_STATUS_COPYALL2R)); CMergeDoc* pDoc = GetDocument(); // Unfortunately difftools is not designed for this kind diff --git a/Src/StdAfx.cpp b/Src/StdAfx.cpp index b088a7d60..62e709270 100644 --- a/Src/StdAfx.cpp +++ b/Src/StdAfx.cpp @@ -49,3 +49,10 @@ xisalnum (int c) { return isalnum (normch(c)) || xisspecial (normch(c)); } + +CString LoadResString(int id) +{ + CString s; + VERIFY(s.LoadString(id)); + return s; +} diff --git a/Src/StdAfx.h b/Src/StdAfx.h index 0b5c1cf41..d6e6f60c3 100644 --- a/Src/StdAfx.h +++ b/Src/StdAfx.h @@ -35,8 +35,7 @@ int xisspecial (int c); int xisalpha (int c); int xisalnum (int c); - - +CString LoadResString(int id); //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. diff --git a/Src/readme.txt b/Src/readme.txt index 928dc407c..df848ee00 100644 --- a/Src/readme.txt +++ b/Src/readme.txt @@ -4,6 +4,8 @@ PATCH: [ 724309 ] Add WaitStatusCursors WinMerge: DirDoc.cpp DirView.cpp MainFrm.cpp Merge.dsp MergeDoc.cpp MergeEditView.cpp WaitStatusCursor.cpp WaitStatusCursor.h + PATCH: [ 724473 ] Move WaitStatusCursor strings into RC + WinMerge: DirDoc.cpp DirView.cpp MainFrm.cpp MergeDoc.cpp MergeEditView.cpp resource.h StdAfx.cpp StdAfx.h 2003-04-19 Perry [ 724280 ] Could use wait cursors at OpenSelection calls diff --git a/Src/resource.h b/Src/resource.h index 63df8872f..a932b824d 100644 --- a/Src/resource.h +++ b/Src/resource.h @@ -91,6 +91,12 @@ #define IDS_FILESAVE_FAILED 192 #define IDS_ERROR_FILE_NOT_FOUND 193 #define IDS_ERROR_INCOMPARABLE 194 +#define IDS_STATUS_RESCANNING 195 +#define IDS_STATUS_OPENING_SELECTION 196 +#define IDS_STATUS_COPYL2R 197 +#define IDS_STATUS_COPYR2L 198 +#define IDS_STATUS_COPYALL2L 199 +#define IDS_STATUS_COPYALL2R 200 #define IDB_EQUAL 213 #define IDB_NOTEQUAL 214 #define IDB_RFOLDER 215 -- 2.11.0