OSDN Git Service

MergeStatusBar.*: Colorize encoding and EOL differeces in status bar
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 14 Mar 2016 15:24:32 +0000 (00:24 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Mon, 14 Mar 2016 15:24:32 +0000 (00:24 +0900)
Src/Merge.rc
Src/MergeStatusBar.cpp
Src/MergeStatusBar.h
Translations/WinMerge/English.pot

index 1569604..a153a9c 100644 (file)
@@ -1739,8 +1739,10 @@ END
 // WinMerge Project Files\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_UNK_ERROR_READING_PROJECT "Unknown error attempting to open project file"\r
-    IDS_UNK_ERROR_SAVING_PROJECT "Unknown error attempting to save project file"\r
+    IDS_UNK_ERROR_READING_PROJECT \r
+                            "Unknown error attempting to open project file"\r
+    IDS_UNK_ERROR_SAVING_PROJECT \r
+                            "Unknown error attempting to save project file"\r
     IDS_PROJFILEDLG_CAPTION "Project File"\r
     IDS_PROJFILE_LOAD_SUCCESS "Project file successfully loaded."\r
     IDS_PROJFILE_SAVE_SUCCESS "Project file successfully saved."\r
@@ -1900,13 +1902,13 @@ BEGIN
 END\r
 \r
 // LINEFILTER STRINGS\r
-STRINGTABLE \r
+STRINGTABLE\r
 BEGIN\r
     IDS_FILTERLINE_REGEXP   "Regular expression"\r
 END\r
 \r
 // GENERAL FILTER STRINGS\r
-STRINGTABLE \r
+STRINGTABLE\r
 BEGIN\r
     IDS_FILTERCHANGED       "Filters were updated. Do you want to refresh all open folder compares?\n\nIf you do not want to refresh all compares now you can select No and refresh compares later."\r
 END\r
@@ -1927,15 +1929,16 @@ BEGIN
     IDS_EMPTY_MIDDLE_FILE   "Untitled middle"\r
     IDS_EMPTY_RIGHT_FILE    "Untitled right"\r
     IDS_CONFLICT_THEIRS_FILE "Theirs File"\r
-    IDS_CONFLICT_MINE_FILE   "Mine File"\r
+    IDS_CONFLICT_MINE_FILE  "Mine File"\r
 END\r
 \r
 // STATUS BAR : OTHER PANES (MOSTLY FOR EDITOR)\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_LINE_STATUS_INFO_EOL "Ln: %s  Col: %d/%d  Ch: %d/%d  EOL: %s  Cp: %d(%s)"\r
+    IDS_LINE_STATUS_INFO_EOL \r
+                            "Ln: %s  Col: %d/%d  Ch: %d/%d  EOL: %s"\r
     IDS_EMPTY_LINE_STATUS_INFO "Line: %s"\r
-    IDS_LINE_STATUS_INFO    "Ln: %s  Col: %d/%d  Ch: %d/%d  Cp: %d(%s)"\r
+    IDS_LINE_STATUS_INFO    "Ln: %s  Col: %d/%d  Ch: %d/%d"\r
     IDS_MERGEMODE_MERGING   "Merge"\r
     IDS_DIFF_NUMBER_STATUS_FMT "Difference %1 of %2"\r
     IDS_NO_DIFF_SEL_FMT     "%1 Differences Found"\r
@@ -1960,8 +1963,8 @@ BEGIN
     IDS_OPEN_MIDDLEINVALID  "Middle path is invalid!"\r
     IDS_OPEN_RIGHTINVALID   "Right path is invalid!"\r
     IDS_OPEN_BOTHINVALID    "Both paths are invalid!"\r
-    IDS_OPEN_LEFTMIDDLEINVALID  "Left and middle path is invalid!"\r
-    IDS_OPEN_LEFTRIGHTINVALID   "Left and right path is invalid!"\r
+    IDS_OPEN_LEFTMIDDLEINVALID "Left and middle path is invalid!"\r
+    IDS_OPEN_LEFTRIGHTINVALID "Left and right path is invalid!"\r
     IDS_OPEN_MIDDLERIGHTINVALID "Middle and right path is invalid!"\r
     IDS_OPEN_ALLINVALID     "All paths are invalid!"\r
     IDS_OPEN_UNPACKERDISABLED "Choose two files to enable unpacker selection."\r
@@ -1973,7 +1976,7 @@ STRINGTABLE
 BEGIN\r
     IDS_ERROR_FILE_NOT_FOUND "File not found: %1"\r
     IDS_ERROR_FILE_NOT_UNPACKED "File not unpacked: %1"\r
-    IDS_ERROR_FILEOPEN       "Cannot open file\n%1\n\n%2"\r
+    IDS_ERROR_FILEOPEN      "Cannot open file\n%1\n\n%2"\r
     IDS_ERROR_CONF_RESOLVE  "Failed to parse conflict file."\r
     IDS_NOT_CONFLICT_FILE   "The file\n%1\nis not a conflict file."\r
 END\r
@@ -1985,11 +1988,13 @@ BEGIN
     IDS_SAVE_FMT            "Save changes to %1?"\r
     IDS_SAVEREADONLY_FMT    "%1 is marked read-only. Would you like to override the read-only file ? (No to save as new filename.)"\r
     IDS_ERROR_BACKUP        "Error backing up file"\r
-    IDS_BACKUP_FAILED_PROMPT\r
+    IDS_BACKUP_FAILED_PROMPT \r
                             "Unable to backup original file:\n%1\n\nContinue anyway?"\r
     IDS_FILESAVE_FAILED     "Saving file failed.\n%1\n%2\nDo you want to:\n\t-use a different filename (Press Ok)\n\t-abort the current operation (Press Cancel)?"\r
-    IDS_FILEPACK_FAILED_LEFT "Plugin '%2' cannot pack your changes to the left file back into '%1'.\n\nThe original file will not be changed.\n\nDo you want to save the unpacked version to another file?"\r
-    IDS_FILEPACK_FAILED_RIGHT "Plugin '%2' cannot pack your changes to the right file back into '%1'.\n\nThe original file will not be changed.\n\nDo you want to save the unpacked version to another file?"\r
+    IDS_FILEPACK_FAILED_LEFT \r
+                            "Plugin '%2' cannot pack your changes to the left file back into '%1'.\n\nThe original file will not be changed.\n\nDo you want to save the unpacked version to another file?"\r
+    IDS_FILEPACK_FAILED_RIGHT \r
+                            "Plugin '%2' cannot pack your changes to the right file back into '%1'.\n\nThe original file will not be changed.\n\nDo you want to save the unpacked version to another file?"\r
     IDS_FILECHANGED_ONDISK  "Another application has updated file\n%1\nsince WinMerge loaded it.\n\nOverwrite changed file?"\r
     IDS_SAVEREADONLY_MULTI  "%1\nis marked read-only. Would you like to override the read-only item?"\r
     IDS_FILECHANGED_RESCAN  "Another application has updated file\n%1\nsince WinMerge scanned it last time.\n\nDo you want to reload the file?"\r
@@ -2012,11 +2017,12 @@ BEGIN
     IDS_VSS_CHECKOUT_STATUS "Checkout files from VSS..."\r
     IDS_VSSERROR            "Versioning System returned an error while attempting to check out the file.  Unable to continue..."\r
     IDS_VSS_RUN_ERROR       "Error executing versioning system command."\r
-    IDS_VSSFOLDER_AND_FILE_NOMATCH "The VSS Working Folder and the location of the current file do not match. Continue?"\r
+    IDS_VSSFOLDER_AND_FILE_NOMATCH \r
+                            "The VSS Working Folder and the location of the current file do not match. Continue?"\r
     IDS_VSS_NODATABASES     "No VSS database(s) found!"\r
     IDS_VSS_ERRORFROM       "Error from VSS:"\r
-    IDS_VSS_CHECKINERROR     "Versioning System returned an error while attempting to check in the file.\n Please, check config spec of used view.\n Undo checkout operation?"\r
-    IDS_VSS_UNCOERROR        "Versioning System returned an error while attempting to undo checkout the file.\n Please, check config spec of used view. "\r
+    IDS_VSS_CHECKINERROR    "Versioning System returned an error while attempting to check in the file.\n Please, check config spec of used view.\n Undo checkout operation?"\r
+    IDS_VSS_UNCOERROR       "Versioning System returned an error while attempting to undo checkout the file.\n Please, check config spec of used view. "\r
 END\r
 \r
 // VSS system\r
@@ -2033,17 +2039,17 @@ END
 // DIRECTORY DIFFING : FILE COPY/DELETE (WITHOUT/WITH NUMBER MARK)\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_COPY_RIGHT_TO_LEFT   "Right to Left (%1)"\r
+    IDS_COPY_RIGHT_TO_LEFT  "Right to Left (%1)"\r
     IDS_COPY_RIGHT_TO_MIDDLE "Right to Middle (%1)"\r
-    IDS_COPY_MIDDLE_TO_LEFT  "Middle to Left (%1)"\r
+    IDS_COPY_MIDDLE_TO_LEFT "Middle to Left (%1)"\r
     IDS_COPY_MIDDLE_TO_RIGHT "Middle to Right (%1)"\r
-    IDS_COPY_LEFT_TO_RIGHT   "Left to Right (%1)"\r
-    IDS_COPY_LEFT_TO_MIDDLE  "Left to Middle (%1)"\r
-    IDS_COPY_RIGHT_TO_LEFT2  "Right to Left (%1 of %2)"\r
+    IDS_COPY_LEFT_TO_RIGHT  "Left to Right (%1)"\r
+    IDS_COPY_LEFT_TO_MIDDLE "Left to Middle (%1)"\r
+    IDS_COPY_RIGHT_TO_LEFT2 "Right to Left (%1 of %2)"\r
     IDS_COPY_RIGHT_TO_MIDDLE2 "Right to Middle (%1 of %2)"\r
     IDS_COPY_MIDDLE_TO_LEFT2 "Middle to Left (%1 of %2)"\r
     IDS_COPY_MIDDLE_TO_RIGHT2 "Middle to Right (%1 of %2)"\r
-    IDS_COPY_LEFT_TO_RIGHT2  "Left to Right (%1 of %2)"\r
+    IDS_COPY_LEFT_TO_RIGHT2 "Left to Right (%1 of %2)"\r
     IDS_COPY_LEFT_TO_MIDDLE2 "Left to Middle (%1 of %2)"\r
     IDS_COPY_LEFT_TO        "Left to... (%1)"\r
     IDS_COPY_MIDDLE_TO      "Middle to... (%1)"\r
@@ -2096,13 +2102,14 @@ BEGIN
     IDS_CONFIRM_MULTIPLE_MOVE "Are you sure you want to move %d items:"\r
     IDS_CONFIRM_COPY_CAPTION "Confirm Copy"\r
     IDS_CONFIRM_MOVE_CAPTION "Confirm Move"\r
-    IDS_CONFIRM_CLOSE_WINDOW "You are about to close the window that is comparing folders. Are you sure you want to close the window?"\r
+    IDS_CONFIRM_CLOSE_WINDOW \r
+                            "You are about to close the window that is comparing folders. Are you sure you want to close the window?"\r
 END\r
 \r
 // DIRECTORY DIFFING : OPEN FILE\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_ERROR_EXECUTE_FILE   "Failed to execute external editor: %1"\r
+    IDS_ERROR_EXECUTE_FILE  "Failed to execute external editor: %1"\r
 END\r
 \r
 // DIRECTORY DIFFING : 7ZIP\r
@@ -2255,7 +2262,7 @@ BEGIN
     IDS_REPORT_TABLIST      "Tab-separated list"\r
     IDS_REPORT_SIMPLEHTML   "Simple HTML"\r
     IDS_REPORT_SIMPLEXML    "Simple XML"\r
-    IDS_REPORT_FILEOVERWRITE\r
+    IDS_REPORT_FILEOVERWRITE \r
                             "The report file already exists. Do you want to overwrite existing file?"\r
     IDS_REPORT_ERROR        "Error creating the report:\n%1"\r
     IDS_REPORT_SUCCESS      "The report has been created successfully."\r
@@ -2270,18 +2277,23 @@ BEGIN
     IDS_TEMP_FILEERROR      "Temporary files could not be created. Check your temporary path settings."\r
     IDS_SUGGEST_IGNOREEOL   "These files use different carriage return types.\n\nDo you want to treat all carriage return types as equivalent for this comparison?\n\nNote: If you always want to treat all carriage return types as equivalent, set the option 'Ignore carriage return differences..' in the Compare tab of the options dialog (available under Edit/Options)."\r
     IDS_INVALID_DIRECTORY   "The selected folder is invalid."\r
-    IDS_CANNOT_OPEN_BINARYFILE  "Cannot open a binary file to editor."\r
+    IDS_CANNOT_OPEN_BINARYFILE "Cannot open a binary file to editor."\r
     IDS_CREATE_PAIR_FOLDER  "The folder exists only in other side and cannot be opened.\n\nDo you want to create a matching folder:\n%1\nto the other side and open these folders?"\r
 END\r
 \r
 // Encoding issues\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_SUGGEST_IGNORECODEPAGE "Different codepages found in left (cp%d) and right (cp%d) files. \nDisplaying each file in its codepage will give a better display but merging/copying will be dangerous.\nWould you like to treat both files as being in the default windows codepage (recommended)?"\r
-    IDS_LOSSY_TRANSCODING_BOTH  "Information lost due to encoding errors: both files"\r
-    IDS_LOSSY_TRANSCODING_FIRST  "Information lost due to encoding errors: first file"\r
-    IDS_LOSSY_TRANSCODING_SECOND "Information lost due to encoding errors: second file"\r
-    IDS_LOSSY_TRANSCODING_THIRD  "Information lost due to encoding errors: third file"\r
+    IDS_SUGGEST_IGNORECODEPAGE \r
+                            "Different codepages found in left (cp%d) and right (cp%d) files. \nDisplaying each file in its codepage will give a better display but merging/copying will be dangerous.\nWould you like to treat both files as being in the default windows codepage (recommended)?"\r
+    IDS_LOSSY_TRANSCODING_BOTH \r
+                            "Information lost due to encoding errors: both files"\r
+    IDS_LOSSY_TRANSCODING_FIRST \r
+                            "Information lost due to encoding errors: first file"\r
+    IDS_LOSSY_TRANSCODING_SECOND \r
+                            "Information lost due to encoding errors: second file"\r
+    IDS_LOSSY_TRANSCODING_THIRD \r
+                            "Information lost due to encoding errors: third file"\r
 END\r
 \r
 // EDITOR : SHOW LINE DIFF\r
@@ -2337,7 +2349,8 @@ BEGIN
     IDS_FILEWRITE_ERROR     "Could not write to file %1."\r
     IDS_PATH_NOT_ABSOLUTE   "The specified output path is not an absolute path: %1"\r
     IDS_MUST_SPECIFY_OUTPUT "Specify an output file"\r
-    IDS_CANNOT_CREATE_BINARYPATCH "Cannot create a patch file from binary files."\r
+    IDS_CANNOT_CREATE_BINARYPATCH \r
+                            "Cannot create a patch file from binary files."\r
     IDS_CANNOT_CREATE_DIRPATCH "Cannot create a patch file from directories."\r
     IDS_SAVEFILES_FORPATCH  "Please save all files first.\n\nCreating a patch requires that there are no unsaved changes in files."\r
     IDS_FOLDER_NOTEXIST     "Folder does not exist."\r
@@ -2420,7 +2433,8 @@ STRINGTABLE
 BEGIN\r
     IDS_PRIVATEBUILD_FMT    "Private Build: %1"\r
     IDS_CHECKFORUPDATES_UPTODATE "Your software is up to date"\r
-    IDS_CHECKFORUPDATES_NEWVERSION "A new version of WinMerge is available.\n%1 is now available (you have %2). Would you like to download it now?"\r
+    IDS_CHECKFORUPDATES_NEWVERSION \r
+                            "A new version of WinMerge is available.\n%1 is now available (you have %2). Would you like to download it now?"\r
     IDS_CHECKFORUPDATES_FAILED "Failed to download latest version information"\r
 END\r
 \r
@@ -2437,71 +2451,71 @@ END
 // LOCATIONBAR CONTEXT MENU\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_LOCBAR_GOTOLINE_FMT  "G&oto Line %1"\r
+    IDS_LOCBAR_GOTOLINE_FMT "G&oto Line %1"\r
 END\r
 \r
 // AUTOCOMPLETE COMBOBOX OPTIONS\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_AUTOCOMPLETE_DISABLED   "Disabled"\r
-    IDS_AUTOCOMPLETE_FILE_SYS   "From file system"\r
-    IDS_AUTOCOMPLETE_MRU        "From MRU list"\r
+    IDS_AUTOCOMPLETE_DISABLED "Disabled"\r
+    IDS_AUTOCOMPLETE_FILE_SYS "From file system"\r
+    IDS_AUTOCOMPLETE_MRU    "From MRU list"\r
 END\r
 \r
 // COLOR SCHEMES\r
 STRINGTABLE\r
 BEGIN\r
-    IDS_COLORSCHEME_PLAIN           "No Highlighting"\r
-    IDS_COLORSCHEME_ASP             "ASP"\r
-    IDS_COLORSCHEME_BASIC           "Basic"\r
-    IDS_COLORSCHEME_BATCH           "Batch"\r
-    IDS_COLORSCHEME_C               "C/C++"\r
-    IDS_COLORSCHEME_CSHARP          "C#"\r
-    IDS_COLORSCHEME_CSS             "CSS"\r
-    IDS_COLORSCHEME_DCL             "DCL"\r
-    IDS_COLORSCHEME_FORTRAN         "Fortran"\r
-    IDS_COLORSCHEME_HTML            "HTML"\r
-    IDS_COLORSCHEME_INI             "INI"\r
-    IDS_COLORSCHEME_INNOSETUP       "InnoSetup"\r
-    IDS_COLORSCHEME_INSTALLSHIELD   "InstallShield"\r
-    IDS_COLORSCHEME_JAVA            "Java"\r
-    IDS_COLORSCHEME_LISP            "AutoLISP"\r
-    IDS_COLORSCHEME_NSIS            "NSIS"\r
-    IDS_COLORSCHEME_PASCAL          "Pascal"\r
-    IDS_COLORSCHEME_PERL            "Perl"\r
-    IDS_COLORSCHEME_PHP             "PHP"\r
-    IDS_COLORSCHEME_PO              "Portable Object"\r
-    IDS_COLORSCHEME_POWERSHELL      "PowerShell"\r
-    IDS_COLORSCHEME_PYTHON          "Python"\r
-    IDS_COLORSCHEME_REXX            "REXX"\r
-    IDS_COLORSCHEME_RSRC            "Resources"\r
-    IDS_COLORSCHEME_RUBY            "Ruby"\r
-    IDS_COLORSCHEME_SGML            "SGML"\r
-    IDS_COLORSCHEME_SH              "Shell"\r
-    IDS_COLORSCHEME_SIOD            "SIOD"\r
-    IDS_COLORSCHEME_SQL             "SQL"\r
-    IDS_COLORSCHEME_TCL             "TCL"\r
-    IDS_COLORSCHEME_TEX             "TEX"\r
-    IDS_COLORSCHEME_VERILOG         "Verilog"\r
-    IDS_COLORSCHEME_XML             "XML"\r
-END\r
-\r
-STRINGTABLE \r
-BEGIN\r
-    IDS_CLOSE_LEFT_TABS    "Close &Left Tabs"\r
-    IDS_CLOSE_RIGHT_TABS   "Close R&ight Tabs"\r
-    IDS_CLOSE_OTHER_TABS   "Close &Other Tabs"\r
+    IDS_COLORSCHEME_PLAIN   "No Highlighting"\r
+    IDS_COLORSCHEME_ASP     "ASP"\r
+    IDS_COLORSCHEME_BASIC   "Basic"\r
+    IDS_COLORSCHEME_BATCH   "Batch"\r
+    IDS_COLORSCHEME_C       "C/C++"\r
+    IDS_COLORSCHEME_CSHARP  "C#"\r
+    IDS_COLORSCHEME_CSS     "CSS"\r
+    IDS_COLORSCHEME_DCL     "DCL"\r
+    IDS_COLORSCHEME_FORTRAN "Fortran"\r
+    IDS_COLORSCHEME_HTML    "HTML"\r
+    IDS_COLORSCHEME_INI     "INI"\r
+    IDS_COLORSCHEME_INNOSETUP "InnoSetup"\r
+    IDS_COLORSCHEME_INSTALLSHIELD "InstallShield"\r
+    IDS_COLORSCHEME_JAVA    "Java"\r
+    IDS_COLORSCHEME_LISP    "AutoLISP"\r
+    IDS_COLORSCHEME_NSIS    "NSIS"\r
+    IDS_COLORSCHEME_PASCAL  "Pascal"\r
+    IDS_COLORSCHEME_PERL    "Perl"\r
+    IDS_COLORSCHEME_PHP     "PHP"\r
+    IDS_COLORSCHEME_PO      "Portable Object"\r
+    IDS_COLORSCHEME_POWERSHELL "PowerShell"\r
+    IDS_COLORSCHEME_PYTHON  "Python"\r
+    IDS_COLORSCHEME_REXX    "REXX"\r
+    IDS_COLORSCHEME_RSRC    "Resources"\r
+    IDS_COLORSCHEME_RUBY    "Ruby"\r
+    IDS_COLORSCHEME_SGML    "SGML"\r
+    IDS_COLORSCHEME_SH      "Shell"\r
+    IDS_COLORSCHEME_SIOD    "SIOD"\r
+    IDS_COLORSCHEME_SQL     "SQL"\r
+    IDS_COLORSCHEME_TCL     "TCL"\r
+    IDS_COLORSCHEME_TEX     "TEX"\r
+    IDS_COLORSCHEME_VERILOG "Verilog"\r
+    IDS_COLORSCHEME_XML     "XML"\r
+END\r
+\r
+STRINGTABLE\r
+BEGIN\r
+    IDS_CLOSE_LEFT_TABS     "Close &Left Tabs"\r
+    IDS_CLOSE_RIGHT_TABS    "Close R&ight Tabs"\r
+    IDS_CLOSE_OTHER_TABS    "Close &Other Tabs"\r
     IDS_TABBAR_AUTO_MAXWIDTH "Enable &Auto Max Width"\r
 END\r
 \r
-STRINGTABLE \r
+STRINGTABLE\r
 BEGIN\r
-    IDS_IMAGE_MENU         "&Image"\r
+    IDS_IMAGE_MENU          "&Image"\r
 END\r
 \r
-STRINGTABLE \r
+STRINGTABLE\r
 BEGIN\r
-    IDS_FRHED_NOTINSTALLED   "frhed(http://frhed.sourceforge.net/) not installed"\r
+    IDS_FRHED_NOTINSTALLED  "frhed(http://frhed.sourceforge.net/) not installed"\r
 END\r
 \r
 #endif    // English (United States) resources\r
index 0c9bacb..8e35583 100644 (file)
@@ -36,7 +36,7 @@
 /** @brief RO status panel width */
 static const UINT RO_PANEL_WIDTH = 40;
 /** @brief Encoding status panel width */
-static const UINT ENCODING_PANEL_WIDTH = 80;
+static const UINT ENCODING_PANEL_WIDTH = 230;
 /** @brief EOL type status panel width */
 static const UINT EOL_PANEL_WIDTH = 60;
 
@@ -46,16 +46,21 @@ static const UINT EOL_PANEL_WIDTH = 60;
 enum
 {
        PANE_PANE0_INFO = 0,
-       PANE_PANE0_RO,
+       PANE_PANE0_ENCODING,
        PANE_PANE0_EOL,
+       PANE_PANE0_RO,
        PANE_PANE1_INFO,
-       PANE_PANE1_RO,
+       PANE_PANE1_ENCODING,
        PANE_PANE1_EOL,
+       PANE_PANE1_RO,
        PANE_PANE2_INFO,
-       PANE_PANE2_RO,
+       PANE_PANE2_ENCODING,
        PANE_PANE2_EOL,
+       PANE_PANE2_RO,
 };
 
+const int nColumnsPerPane = PANE_PANE1_INFO - PANE_PANE0_INFO;
+
 /**
  * @brief Bottom statusbar panels and indicators
  */
@@ -70,6 +75,9 @@ static UINT indicatorsBottom[] =
        ID_SEPARATOR,
        ID_SEPARATOR,
        ID_SEPARATOR,
+       ID_SEPARATOR,
+       ID_SEPARATOR,
+       ID_SEPARATOR,
 };
 
 BEGIN_MESSAGE_MAP(CMergeStatusBar, CStatusBar)
@@ -83,8 +91,11 @@ CMergeStatusBar::CMergeStatusBar() : m_nPanes(2)
        for (int pane = 0; pane < sizeof(m_status) / sizeof(m_status[0]); pane++)
        {
                m_status[pane].m_pWndStatusBar = this;
-               m_status[pane].m_base = PANE_PANE0_INFO + pane * 3;
+               m_status[pane].m_base = PANE_PANE0_INFO + pane * nColumnsPerPane;
        }
+       std::fill_n(m_bDiff, sizeof(m_bDiff)/sizeof(m_bDiff[0]), false);
+       std::fill_n(m_dispFlags, sizeof(m_dispFlags)/sizeof(m_dispFlags[0]), 0);
+       Options::DiffColors::Load(GetOptionsMgr(), m_cachedColors);
 }
 
 /**
@@ -104,13 +115,57 @@ BOOL CMergeStatusBar::Create(CWnd* pParentWnd)
        // Set text to read-only info panes
        // Text is hidden if file is writable
        String sText = _("RO");
-       SetPaneText(PANE_PANE0_RO, sText.c_str(), TRUE);
-       SetPaneText(PANE_PANE1_RO, sText.c_str(), TRUE);
-       SetPaneText(PANE_PANE2_RO, sText.c_str(), TRUE);
+       for (auto&& p : { PANE_PANE0_RO, PANE_PANE1_RO, PANE_PANE2_RO })
+               SetPaneText(p, sText.c_str(), TRUE);
 
        return TRUE;
 };
 
+void CMergeStatusBar::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
+{
+       const int pbase = PANE_PANE0_INFO + (lpDrawItemStruct->itemID - PANE_PANE0_INFO) % nColumnsPerPane;
+       const int pcur = (lpDrawItemStruct->itemID - PANE_PANE0_INFO) / nColumnsPerPane;
+       std::vector<CString> ptext(m_nPanes);
+       for (int pane = 0; pane < m_nPanes; ++pane)
+               ptext[pane] = GetPaneText(pbase + pane * nColumnsPerPane);
+       const bool diff = !std::equal(ptext.begin() + 1, ptext.end(), ptext.begin());
+
+       if (!ptext[pcur].IsEmpty())
+               m_dispFlags[pbase] |= 1 << pcur;
+       const bool displayedAll = m_dispFlags[pbase] == (1 << m_nPanes) - 1;
+
+       if (displayedAll && m_bDiff[pbase] != diff)
+       {
+               m_bDiff[pbase] = diff;
+               for (int pane = 0; pane < m_nPanes; ++pane)
+               {
+                       RECT rcColumn;
+                       GetItemRect(pbase + pane * nColumnsPerPane, &rcColumn);
+                       InvalidateRect(&rcColumn);
+               }
+               return;
+       }
+
+       CDC dc;
+       dc.Attach(lpDrawItemStruct->hDC);
+       if (displayedAll && diff)
+       {
+               dc.SetBkMode(OPAQUE);
+               dc.SetTextColor(m_cachedColors.clrWordDiffText);
+               dc.SetBkColor(m_cachedColors.clrWordDiff);
+               dc.ExtTextOut(
+                       lpDrawItemStruct->rcItem.left, lpDrawItemStruct->rcItem.top,
+                       ETO_OPAQUE, &lpDrawItemStruct->rcItem, _T(""), NULL );
+       }
+       else
+       {
+               dc.SetBkMode(TRANSPARENT);
+               dc.SetTextColor(GetSysColor(COLOR_BTNTEXT));
+       }
+       dc.DrawText(ptext[pcur], &lpDrawItemStruct->rcItem, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
+       dc.Detach();
+}
+
 void CMergeStatusBar::Resize(int widths[])
 {
        // Set bottom statusbar panel widths
@@ -118,20 +173,19 @@ void CMergeStatusBar::Resize(int widths[])
        int borderWidth = 4; // GetSystemMetrics(SM_CXEDGE);
        for (int pane = 0; pane < m_nPanes; pane++)
        {
-               int paneWidth = widths[pane] - (RO_PANEL_WIDTH + EOL_PANEL_WIDTH +
+               int paneWidth = widths[pane] - (RO_PANEL_WIDTH + ENCODING_PANEL_WIDTH + EOL_PANEL_WIDTH +
                        (2 * borderWidth));
                if (paneWidth < borderWidth)
                        paneWidth = borderWidth;
 
-               SetPaneStyle(PANE_PANE0_INFO + pane * 3, SBPS_NORMAL);
-               SetPaneInfo(PANE_PANE0_INFO + pane * 3, ID_STATUS_PANE0FILE_INFO + pane,
+               SetPaneInfo(PANE_PANE0_INFO + pane * nColumnsPerPane, ID_STATUS_PANE0FILE_INFO + pane,
                        SBPS_NORMAL, paneWidth);
-               SetPaneStyle(PANE_PANE0_RO + pane * 3, SBPS_NORMAL);
-               SetPaneInfo(PANE_PANE0_RO + pane * 3, ID_STATUS_PANE0FILE_RO + pane,
+               SetPaneInfo(PANE_PANE0_ENCODING + pane * nColumnsPerPane, ID_STATUS_PANE0FILE_ENCODING + pane,
+                       SBT_OWNERDRAW, ENCODING_PANEL_WIDTH - borderWidth);
+               SetPaneInfo(PANE_PANE0_RO + pane * nColumnsPerPane, ID_STATUS_PANE0FILE_RO + pane,
                        SBPS_NORMAL, RO_PANEL_WIDTH - borderWidth);
-               SetPaneStyle(PANE_PANE0_EOL + pane * 3, SBPS_NORMAL);
-               SetPaneInfo(PANE_PANE0_EOL + pane * 3, ID_STATUS_PANE0FILE_EOL + pane,
-                       SBPS_NORMAL, EOL_PANEL_WIDTH - borderWidth);
+               SetPaneInfo(PANE_PANE0_EOL + pane * nColumnsPerPane, ID_STATUS_PANE0FILE_EOL + pane,
+                       SBT_OWNERDRAW, EOL_PANEL_WIDTH - borderWidth);
        }
 }
 
@@ -140,7 +194,7 @@ void CMergeStatusBar::Resize(int widths[])
  */
 void CMergeStatusBar::UpdateResources()
 {
-       for (int pane = 0; pane < sizeof(m_status) / sizeof(m_status[0]); pane++)
+       for (int pane = 0; pane < m_nPanes; pane++)
                m_status[pane].UpdateResources();
 }
 
@@ -162,24 +216,27 @@ void CMergeStatusBar::MergeStatus::Update()
 {
        if (IsWindow(m_pWndStatusBar->m_hWnd))
        {
-               CString str;
+               CString strInfo, strEncoding;
                if (m_nChars == -1)
                {
-                       str.Format(_("Line: %s").c_str(),
+                       strInfo.Format(_("Line: %s").c_str(),
                                m_sLine.c_str());
                }
                else if (m_sEolDisplay.empty())
                {
-                       str.Format(_("Ln: %s  Col: %d/%d  Ch: %d/%d  Cp: %d(%s)").c_str(),
+                       strInfo.Format(_("Ln: %s  Col: %d/%d  Ch: %d/%d").c_str(),
                                m_sLine.c_str(), m_nColumn, m_nColumns, m_nChar, m_nChars, m_nCodepage, m_sCodepageName.c_str());
                }
                else
                {
-                       str.Format(_("Ln: %s  Col: %d/%d  Ch: %d/%d  EOL: %s  Cp: %d(%s)").c_str(),
+                       strInfo.Format(_("Ln: %s  Col: %d/%d  Ch: %d/%d  EOL: %s").c_str(),
                                m_sLine.c_str(), m_nColumn, m_nColumns, m_nChar, m_nChars, m_sEolDisplay.c_str(), m_nCodepage, m_sCodepageName.c_str());
                }
 
-               m_pWndStatusBar->SetPaneText(m_base, str);
+               if (m_nCodepage > 0)
+                       strEncoding.Format(_("%d(%s)").c_str(), m_nCodepage, m_sCodepageName.c_str());
+               m_pWndStatusBar->SetPaneText(m_base, strInfo);
+               m_pWndStatusBar->SetPaneText(m_base + 1, strEncoding);
        }
 }
 
@@ -235,7 +292,7 @@ void CMergeStatusBar::MergeStatus::SetLineInfo(LPCTSTR szLine, int nColumn,
                        const char *pszCodepageName = GetEncodingNameFromCodePage(nCodepage);
                        m_sCodepageName = pszCodepageName ? ucr::toTString(pszCodepageName) : _T("");
                        if (bHasBom)
-                               m_sCodepageName += _T(" with BOM");
+                               m_sCodepageName += _T(" BOM");
                }
                m_nCodepage = nCodepage;
                m_bHasBom = bHasBom;
index fe6d6c0..f9024fd 100644 (file)
@@ -26,6 +26,7 @@
 #pragma once
 
 #include "MergeEditStatus.h"
+#include "OptionsDiffColors.h"
 #include "UnicodeString.h"
 
 class CMergeStatusBar : public CStatusBar
@@ -39,6 +40,7 @@ public :
        void SetPaneCount(int nPanes) { m_nPanes = nPanes; }
        void UpdateResources();
        IMergeEditStatus* GetIMergeEditStatus(int nPane) { return &m_status[nPane]; }
+       void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
 
 protected:
        DECLARE_MESSAGE_MAP();
@@ -46,6 +48,9 @@ protected:
 private:
        // this dialog uses custom edit boxes
        int m_nPanes;
+       COLORSETTINGS m_cachedColors;
+       bool m_bDiff[4];
+       unsigned m_dispFlags[4];
 
 protected:
        // Object that displays status line info for one side of a merge view
index 7d11dbd..36bb6f4 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: WinMerge\n"
 "Report-Msgid-Bugs-To: http://bugs.winmerge.org/\n"
-"POT-Creation-Date: 2016-02-21 21:44+0000\n"
+"POT-Creation-Date: 2016-03-13 11:08+0000\n"
 "PO-Revision-Date: \n"
 "Last-Translator: \n"
 "Language-Team: English <winmerge-translate@lists.sourceforge.net>\n"
@@ -1927,6 +1927,11 @@ msgstr ""
 msgid "Ignore &case"
 msgstr ""
 
+#: Merge.rc:51F11514
+#, c-format
+msgid "Ignore codepage differences"
+msgstr ""
+
 #: Merge.rc:285B56CE
 #, c-format
 msgid "E&nable moved block detection"
@@ -3082,9 +3087,9 @@ msgstr ""
 msgid "Mine File"
 msgstr ""
 
-#: Merge.rc:55269C51
+#: Merge.rc:DD21174
 #, c-format
-msgid "Ln: %s  Col: %d/%d  Ch: %d/%d  EOL: %s  Cp: %d(%s)"
+msgid "Ln: %s  Col: %d/%d  Ch: %d/%d  EOL: %s"
 msgstr ""
 
 #: Merge.rc:15875423
@@ -3092,9 +3097,9 @@ msgstr ""
 msgid "Line: %s"
 msgstr ""
 
-#: Merge.rc:50DE3D68
+#: Merge.rc:6F3BCB35
 #, c-format
-msgid "Ln: %s  Col: %d/%d  Ch: %d/%d  Cp: %d(%s)"
+msgid "Ln: %s  Col: %d/%d  Ch: %d/%d"
 msgstr ""
 
 #: Merge.rc:7C664E1
@@ -3458,7 +3463,7 @@ msgstr ""
 msgid "All (%1)"
 msgstr ""
 
-#: Merge.rc:DD21174
+#: Merge.rc:DD21175
 #, c-format
 msgid "Left side - select destination folder:"
 msgstr ""