diff --git a/Build/Changes.txt b/Build/Changes.txt index 599a5ab52..448cc2b74 100644 --- a/Build/Changes.txt +++ b/Build/Changes.txt @@ -31,12 +31,15 @@ UCD - (UCD)ARDET is an Encoding Detector Library ===================================================== -Current RC1 Version 5.20.303.(build_#) (2020-03-03) +Current RC3 Version 5.20.307.(build_#) (2020-03-07) +// Version 5.20.3xx.x (xx March 2020) ===================================================== ----------------------------------------------------- NEW: ----------------------------------------------------- +- remove scaling of Toolbar image for DPI (avoid blurry images) +- "Open with Notepad3" Right-Click in Explorer Context Menu. - In About Resources: Data Sharing Service from https://workupload.com/. - Automatic scrolling when dragging text near window edge. Patch by McLoo from https://sourceforge.net/p/scintilla/feature-requests/497/. @@ -54,9 +57,9 @@ NEW: ----------------------------------------------------- CHANGES: ----------------------------------------------------- -- Add file history to to recent docs jumplist. -- AddFileToRecentDocs. -- INI file read/write using synchronous file locking (shared read / exclusive write). +- Split undo typing sequence by line-breaks default -> true +- Add file history to to recent docs (taskbar) jumplist. +- NP3 INI file read/write using file locking (shared read / exclusive write) for multiple instances. - Reset build-of-the-day number in AppVeyor on new day. - Change version numbering of build_# (the build number is now daily based). - Remove AppVeyors build number, add build-of-the-day number, add short version of commit/local build ID. @@ -67,41 +70,31 @@ CHANGES: - Add current Encoding and Lexer to "Copy Version Text". - Lexer keyword initializer list simplified. - Find/Replace dialog: in case of "transform backslashes" do Esc control seqs. -- Remove "extra" drag n' drop handler. -- Upper confidence level for UCHARDET to: "AnalyzeReliableConfidenceLevel=70". -- UCHARDET: Confidence calculation for Single Byte Character Set (SBCS). -- Replace "save modified file warning" by (silent) custom messagebox if message beeps are muted. +- Upper confidence level for UCHARDET to: "AnalyzeReliableConfidenceLevel=92". +- UCHARDET: Enhanced confidence calculation for Single Byte Character Set (SBCS). +- Replace std messagebox "save modified file warning" by (silent) custom messagebox if message beeps are muted. - Don't Auto-Close blank untitled document, only empty untitled document. -- Encoding detection fallback: explicitly defined or (UTF-8 (if valid) else current ANSI code-page). +- Encoding detection fallback: if "Load ASCII as UTF-8" is checked use UTF-8 (if valid) else current ANSI code-page. - Use Ctrl+Shift+L for toggle "Menu: Reuse Window" option. - Inversion of Accelerator key Ctrl+Alt+L with Ctrl+Shift+L - Change wording "Administrator" to "Elevated". -- MiniPath - Notepad3 communication. - Hidden "ExitOnESCSkipLevel" feature (Exit on ESC can ignore a selection). -- ESC Key clears active selection (before exiting Notepad3). -- Refactoring source code (encoding detection). -- Reduce big file size limit to 2GB (INT_MAX). -- Conversion all *.RC files to encoding UTF-8 (no BOM/Signature). +- ESC Key clears active selection (not exiting Notepad3 if configured) (Config: ExitOnESCSkipLevel=2). +- Set large file size limit to 2GB (INT32_MAX). +- Set big file size limit warning to 64MB (syntax highlighting is switched off) (Config: FileLoadWarningMB=64). - New Notepad3 Icon (Notepad3 icon by Vexels.com designed by smanashova@gmail.com). - Initial default big toolbar only for monitors > Full-HD. -- Copy instead of insert (filename, path, GUID). -- Load (internal) Flags (Settings2) as part of LoadSettings() - one pass .ini-read. +- Copy to clipboard instead of insert (filename, path, GUID). - Option [Settings2] LexerSQLNumberSignAsComment. - Option [Settings2] LineCommentPortfixStrg= e.g. add a space to comment chars. - Option [Settings2] NoCopyLineOnEmptySelection and NoCutLineOnEmptySelection. - Appearance of INFOBOX4 (MB_YESNOCANCEL). -- Thin rectangular (multi) selection after toggeling line-comment block. -- Scintilla (SCI): allow CamelCase/StartCase word lists. -- Borderless in Full Screen Mode. -- Maximize window if "full work area" is requested. -- Full Work Area Mode (F11) -> Full Screen Mode. -- Relax UTF-8 orientation (lower confidence level for UCHARDET - and use system's code-page as detection fallback by default). +- Thin rectangular (multi) selection after toggeling line-comment block for multi insertion. +- Full Work Area Mode (F11) -> Full Screen Mode (Maximize window if "full work area" is requested) - Ctrl+Alt+Enter AutoCompletion behaviour. -- Changed version of MarkDown-Lexer. - Menu and behavior for copy/paste and copy/paste line. -- Allow each modification step to split undo typing sequence (set timeout < 20ms). -- Split undo typing sequence (by line-breaks and/or timeout). +- Allow each modification step to split undo typing sequence (set timeout 0 < to < 20ms). +- Split undo typing sequence (by line-breaks and/or timeout) (UndoTransactionTimeout=0, LnBrk via Menu). - Update Oniguruma Regex (ONI) engine version 6.9.5 (2020/01/28). - Update Scintilla Library (SCI) version 4.3.1 (2020/03/04). @@ -123,6 +116,9 @@ ENHANCEMENT: ----------------------------------------------------- FIXES: ----------------------------------------------------- +- Common controls will use preffered/available MUI language +- Sticky window position handling. +- Initial, default and current window position handling. - Debug assertion (isspace() called on non ASCII char). - Correct return result of Styles export. - Scintilla method declaration. @@ -1457,3 +1453,49 @@ Version 1 Build 330 (24 June 2016) - Fixed Favorites Function - Removed Visual Studio 2010 to 2013 Support + + +----------------------------------------------------- +MAIN KNOWN ISSUES AND TO DO LIST: +----------------------------------------------------- +- Support for Fortran syntax scheme (#1766). +- Support for kotlin syntax scheme (#1761). +- Support for REXX syntax scheme (#1610). +- Support for TypeScript syntax (#911). +- Support for TOML syntax scheme (#832). +- Selection of complex script is not properly handled (#2019). +- Search multifiles or path (#2018). +- Add text to multi-line to the end of another text after select with ALT+Mouse (#1911). +- Ability to make our own language similar to notepad++ (#1902). +- Detect Dark mode of Win10 (#1811). +- Restore selection when reopen file (#1793). +- Search the content of the files in a directory (#1728). +- Can't handle files >=4GB (#1713). +- Is there any autosave option? (#1665). +- Make Lexer's Keyword-Lists Case Sensitive (#1647). +- Enhancement Request: CSV Syntax Scheme (#1603). +- Right-to-Left (RTL) Alignment (#1558). +- Insert HTML/XML tag - remembering last inserted tag (#1532). +- Highlight matches position in the scroll bar (#1466). +- Custom keywords for syntax highlighter (#1336). +- Add a Tools menu to call external programs from Notepad3 (#1332). +- Snippets engine (#1306). +- Multiple word editing (#1126). +- Easy syntax customizer (#916). +- Minimal Find/Replace with advanced expand (#914). +- Add support to create/modify keyboard shortcuts (#595). +- Periodic backup of unsaved documents (#512). +- Intellegent Backup with optional versioning (#370). +- Change of behaviour for handling folded blocks (#331). + +----------------------------------------------------- +TRANSLATIONS (MUI): +----------------------------------------------------- +- Korean (ko-KR) (to resume). +- Portuguese Brazilian (pt-BR) (in progress). +- Slovak (sk-SK) (to resume). +- Turkish (tr-TR) (to resume). + + + + diff --git a/Build/notepad3_setup.iss b/Build/notepad3_setup.iss index 0cc1bc4bb..6b0348d1b 100644 --- a/Build/notepad3_setup.iss +++ b/Build/notepad3_setup.iss @@ -1,6 +1,6 @@ ;* Notepad3 - Installer script ;* -;* (c) Rizonesoft 2008-2019 +;* (c) Rizonesoft 2008-2020 ; Requirements: ; Inno Setup: http://www.jrsoftware.org/isdl.php @@ -28,8 +28,8 @@ #error Compile MiniPath x64 first #endif -#define app_name Notepad3 -#define app_publisher Rizonesoft +#define app_name "Notepad3" +#define app_publisher "Rizonesoft" #define app_version GetFileVersion(bindir + "\Release_x86_v142\Notepad3.exe") #define app_copyright "(c) Rizonesoft 2008-2019" #define quick_launch "{userappdata}\Microsoft\Internet Explorer\Quick Launch" @@ -200,10 +200,10 @@ Source: Docs\uthash\banner.svg; DestDir: {ap Source: Docs\uthash\ChangeLog.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion Source: Docs\uthash\index.html; DestDir: {app}\Docs\uthash; Flags: ignoreversion Source: Docs\uthash\license.html; DestDir: {app}\Docs\uthash; Flags: ignoreversion -Source: Docs\uthash\rss.png; DestDir: {app}\Docs\uthash; Flags: ignoreversion -Source: Docs\uthash\styles.css; DestDir: {app}\Docs\uthash; Flags: ignoreversion -Source: Docs\uthash\userguide.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion -Source: Docs\uthash\utarray.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion +Source: Docs\uthash\rss.png; DestDir: {app}\Docs\uthash; Flags: ignoreversion +Source: Docs\uthash\styles.css; DestDir: {app}\Docs\uthash; Flags: ignoreversion +Source: Docs\uthash\userguide.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion +Source: Docs\uthash\utarray.txt; DestDir: {app}\Docs\uthash; Flags: ignoreversion Source: Docs\uthash\uthash.png; DestDir: {app}\Docs\uthash; Flags: ignoreversion Source: Docs\uthash\uthash-mini.png; DestDir: {app}\Docs\uthash; Flags: ignoreversion Source: Docs\uthash\uthash-mini.svg; DestDir: {app}\Docs\uthash; Flags: ignoreversion @@ -379,6 +379,10 @@ begin RegWriteStringValue(HKCR, 'Applications\notepad3.exe', 'AppUserModelID', 'Rizonesoft.Notepad3'); RegWriteStringValue(HKCR, 'Applications\notepad3.exe\shell\open\command', '', ExpandConstant('"{app}\Notepad3.exe" %1')); RegWriteStringValue(HKCR, '*\OpenWithList\notepad3.exe', '', ''); + + RegWriteStringValue(HKCR, '*\shell\Open with Notepad3', 'Icon', 'C:\\Program Files\\Notepad3\\Notepad3.exe,0') + RegWriteStringValue(HKCR, '*\shell\Open with Notepad3\command', '', '"C:\\Program Files\\Notepad3\\Notepad3.exe" %1') + end; @@ -394,6 +398,8 @@ procedure RemoveReg(); begin RegDeleteKeyIncludingSubkeys(HKCR, 'Applications\notepad3.exe'); RegDeleteKeyIncludingSubkeys(HKCR, '*\OpenWithList\notepad3.exe'); + + RegDeleteKeyIncludingSubkeys(HKCR, '*\shell\Open with Notepad3'); end; diff --git a/Build/notepad3_x86_setup.iss b/Build/notepad3_x86_setup.iss index 20c11eea1..a7d0dc59a 100644 --- a/Build/notepad3_x86_setup.iss +++ b/Build/notepad3_x86_setup.iss @@ -1,6 +1,6 @@ ;* Notepad3 - Installer script ;* -;* (c) Rizonesoft 2008-2019 +;* (c) Rizonesoft 2008-2020 ; Requirements: ; Inno Setup: http://www.jrsoftware.org/isdl.php @@ -20,8 +20,8 @@ #error Compile MiniPath x86 first #endif -#define app_name Notepad3 -#define app_publisher Rizonesoft +#define app_name "Notepad3" +#define app_publisher "Rizonesoft" #define app_version GetFileVersion(bindir + "\Release_x86_v142\Notepad3.exe") #define app_copyright "(c) Rizonesoft 2008-2019" #define quick_launch "{userappdata}\Microsoft\Internet Explorer\Quick Launch" @@ -336,7 +336,11 @@ begin RegWriteStringValue(HKCR, 'Applications\notepad3.exe', 'AppUserModelID', 'Rizonesoft.Notepad3'); RegWriteStringValue(HKCR, 'Applications\notepad3.exe\shell\open\command', '', ExpandConstant('"{app}\Notepad3.exe" %1')); RegWriteStringValue(HKCR, '*\OpenWithList\notepad3.exe', '', ''); -end; + + RegWriteStringValue(HKCR, '*\shell\Open with Notepad3', 'Icon', 'C:\\Program Files (x86)\\Notepad3\\Notepad3.exe,0'); + RegWriteStringValue(HKCR, '*\shell\Open with Notepad3\command', '', ExpandConstant('"{app}\Notepad3.exe" %1')); + + end; procedure CleanUpSettings(); @@ -351,6 +355,8 @@ procedure RemoveReg(); begin RegDeleteKeyIncludingSubkeys(HKCR, 'Applications\notepad3.exe'); RegDeleteKeyIncludingSubkeys(HKCR, '*\OpenWithList\notepad3.exe'); + + RegDeleteKeyIncludingSubkeys(HKCR, '*\shell\Open with Notepad3'); end; diff --git a/Version_RC.cmd b/Version_RC.cmd index d5fbbf7e9..9f21c9858 100644 --- a/Version_RC.cmd +++ b/Version_RC.cmd @@ -1,6 +1,6 @@ @echo off setlocal -set _VERPATCH_=RC2 +set _VERPATCH_=RC3 echo."%_VERPATCH_%">.\np3portableapp\_buildname.txt Version -VerPatch "%_VERPATCH_%" endlocal diff --git a/Versions/day.txt b/Versions/day.txt index 67d04b9fe..ae4cf41b2 100644 --- a/Versions/day.txt +++ b/Versions/day.txt @@ -1 +1 @@ -305 +307 diff --git a/language/np3_af_za/menu_af_za.rc b/language/np3_af_za/menu_af_za.rc index 04db181f6..719fd12b9 100644 --- a/language/np3_af_za/menu_af_za.rc +++ b/language/np3_af_za/menu_af_za.rc @@ -447,10 +447,10 @@ BEGIN BEGIN POPUP "&Lewering" BEGIN - MENUITEM "Verstek &GDI (no ligatures)", IDM_SET_RENDER_TECH_DEFAULT - MENUITEM "DirectWrite (&Direct2D)", IDM_SET_RENDER_TECH_D2D - MENUITEM "DirectWrite &Behou", IDM_SET_RENDER_TECH_D2DRETAIN - MENUITEM "Direct&Write GDI DC", IDM_SET_RENDER_TECH_D2DDC + MENUITEM "Verstek &GDI (Geen ligature nie)", IDM_SET_RENDER_TECH_DEFAULT + MENUITEM "DirectWrite (&Direct2D)", IDM_SET_RENDER_TECH_D2D + MENUITEM "DirectWrite &Behou", IDM_SET_RENDER_TECH_D2DRETAIN + MENUITEM "Direct&Write GDI DC", IDM_SET_RENDER_TECH_D2DDC END POPUP "Bidirectionele" BEGIN diff --git a/language/np3_af_za/strings_af_za.rc b/language/np3_af_za/strings_af_za.rc index b9a55f4a8..84aeff970 100644 --- a/language/np3_af_za/strings_af_za.rc +++ b/language/np3_af_za/strings_af_za.rc @@ -146,7 +146,7 @@ BEGIN "Die lêer %s kan nie gestoor word nie en kan beskermd wees.\n\nWil jy begin %s as 'n 'Verhoogde' toepassing?" IDS_MUI_ERR_ADMINEXE "Kon geen administrasie uitvoerbaar vind nie. \nGaan na https://www.rizonesoft.com vir meer?" IDS_MUI_WARN_LOAD_BIG_FILE - "Is jy seker jy wil hierdie groot lêer oopmaak?\n\t(Grootte: %s >= %s)!\n(Styling and Syntax Highlighting will not be applied!)" + "Is jy seker jy wil hierdie groot lêer oopmaak?\n\t(Grootte: %s >= %s)!\n(Styling en sintaksis-uitlig word nie toegepas nie!)" IDS_MUI_ERR_FILE_TOO_LARGE "Kan nie daardie groot lêer hanteer nie (Grootte: %s)!" IDS_MUI_WARN_UNKNOWN_EXT diff --git a/np3portableapp/_buildname.txt b/np3portableapp/_buildname.txt index cac2b49e6..847557314 100644 --- a/np3portableapp/_buildname.txt +++ b/np3portableapp/_buildname.txt @@ -1 +1 @@ -"NF" +"RC3" diff --git a/res/Notepad3.exe.manifest.conf b/res/Notepad3.exe.manifest.conf index 4153e8eb7..da734175a 100644 --- a/res/Notepad3.exe.manifest.conf +++ b/res/Notepad3.exe.manifest.conf @@ -3,8 +3,8 @@ - Notepad3 NF + Notepad3 RC3 diff --git a/src/Config/Config.cpp b/src/Config/Config.cpp index 4ec0abfc8..d3cbd0a48 100644 --- a/src/Config/Config.cpp +++ b/src/Config/Config.cpp @@ -1107,7 +1107,7 @@ void LoadSettings() GET_INT_VALUE_FROM_INISECTION(Bidirectional, Defaults.Bidirectional, 0, 2); // set before Defaults.Bidirectional = SC_BIDIRECTIONAL_DISABLED; // reset GET_BOOL_VALUE_FROM_INISECTION(MuteMessageBeep, false); - GET_BOOL_VALUE_FROM_INISECTION(SplitUndoTypingSeqOnLnBreak, false); + GET_BOOL_VALUE_FROM_INISECTION(SplitUndoTypingSeqOnLnBreak, true); ///~Settings2.IMEInteraction = clampi(IniSectionGetInt(IniSecSettings, L"IMEInteraction", Settings2.IMEInteraction), SC_IME_WINDOWED, SC_IME_INLINE); diff --git a/src/Dialogs.c b/src/Dialogs.c index 6bf428b86..4a11c6881 100644 --- a/src/Dialogs.c +++ b/src/Dialogs.c @@ -3981,9 +3981,9 @@ int Toolbar_GetButtons(HANDLE hwnd, int cmdBase, LPWSTR lpszButtons, int cchButt WCHAR tchItem[32] = { L'\0' }; StringCchCopy(tchButtons, COUNTOF(tchButtons), L""); - int const c = min_i(50, (int)SendMessage(hwnd, TB_BUTTONCOUNT, 0, 0)); + int const cnt = min_i(50, (int)SendMessage(hwnd, TB_BUTTONCOUNT, 0, 0)); - for (int i = 0; i < c; i++) { + for (int i = 0; i < cnt; i++) { TBBUTTON tbb; SendMessage(hwnd, TB_GETBUTTON, (WPARAM)i, (LPARAM)&tbb); StringCchPrintf(tchItem, COUNTOF(tchItem), L"%i ", @@ -3992,9 +3992,10 @@ int Toolbar_GetButtons(HANDLE hwnd, int cmdBase, LPWSTR lpszButtons, int cchButt } TrimSpcW(tchButtons); StringCchCopyN(lpszButtons, cchButtons, tchButtons, COUNTOF(tchButtons)); - return(c); + return cnt; } + int Toolbar_SetButtons(HANDLE hwnd, int cmdBase, LPCWSTR lpszButtons, LPCTBBUTTON ptbb, int ctbb) { WCHAR tchButtons[MIDSZ_BUFFER]; diff --git a/src/Edit.c b/src/Edit.c index e79b01e9e..6e7fc957d 100644 --- a/src/Edit.c +++ b/src/Edit.c @@ -7401,6 +7401,7 @@ void EditDoStyling(DocPos iStartPos, DocPos iEndPos) else { iStartPos = SciCall_PositionFromLine(SciCall_LineFromPosition(iStartPos)); } + if (iEndPos < 0) { Sci_ApplyLexerStyle(iStartPos, -1); } diff --git a/src/MuiLanguage.c b/src/MuiLanguage.c index ebd6eb566..c55f82a5a 100644 --- a/src/MuiLanguage.c +++ b/src/MuiLanguage.c @@ -17,6 +17,7 @@ #include #include +#include #include "resource.h" #include "Dialogs.h" @@ -58,6 +59,21 @@ MUILANGUAGE MUI_LanguageDLLs[] = //NUM_OF_MUI_LANGUAGES int MuiLanguages_CountOf() { return COUNTOF(MUI_LanguageDLLs); }; +//============================================================================= +// +// GetMUILanguageIndexByLangID +// +int GetMUILanguageIndexByLangID(LANGID iLanguageID) +{ + for (int lng = 0; lng < MuiLanguages_CountOf(); ++lng) { + if (MUI_LanguageDLLs[lng].LangId == iLanguageID) { + return lng; + } + } + return -1; +} + + //============================================================================= // // CheckAvailableLanguages @@ -193,28 +209,30 @@ bool GetUserPreferredLanguage(LPWSTR pszPrefLocaleName, int cchBuffer, LANGID* p } + //============================================================================= // // SetPreferredLanguage // void SetPreferredLanguage(LANGID iPreferredLanguageID) { - LANGID const prevLngID = Globals.iPrefLANGID; - Globals.iPrefLANGID = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US); // internal - const WCHAR* szLocaleName = NULL; - for (int lng = 0; lng < MuiLanguages_CountOf(); ++lng) { - if (MUI_LanguageDLLs[lng].LangId == iPreferredLanguageID) { - Globals.iPrefLANGID = iPreferredLanguageID; - szLocaleName = MUI_LanguageDLLs[lng].szLocaleName; - } - } - if ((Globals.iPrefLANGID != prevLngID) && szLocaleName) + int const langIdx = GetMUILanguageIndexByLangID(iPreferredLanguageID); + if (langIdx < 0) { - if (StringCchCompareXIW(Settings2.PreferredLanguageLocaleName, szLocaleName) != 0) + Globals.iPrefLANGID = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US); // internal + return; + } + + if (iPreferredLanguageID != Globals.iPrefLANGID) + { + Globals.iPrefLANGID = iPreferredLanguageID; // == MUI_LanguageDLLs[langIdx].LangId + const WCHAR* szLocaleName = MUI_LanguageDLLs[langIdx].szLocaleName; + + if (StringCchCompareXIW(Settings2.PreferredLanguageLocaleName, szLocaleName) != 0) { StringCchCopyW(Settings2.PreferredLanguageLocaleName, COUNTOF(Settings2.PreferredLanguageLocaleName), szLocaleName); - - if (StringCchCompareXIW(Settings2.PreferredLanguageLocaleName, Defaults2.PreferredLanguageLocaleName) != 0) + + if (StringCchCompareXIW(Settings2.PreferredLanguageLocaleName, Defaults2.PreferredLanguageLocaleName) != 0) { IniFileSetString(Globals.IniFile, Constants.Settings2_Section, L"PreferredLanguageLocaleName", Settings2.PreferredLanguageLocaleName); } @@ -243,13 +261,13 @@ LANGID LoadLanguageResources() if (StringCchCompareXIW(MUI_LanguageDLLs[lng].szLocaleName, Settings2.PreferredLanguageLocaleName) == 0) { if (MUI_LanguageDLLs[lng].bHasDLL && (lng > 0)) { StringCchCatW(tchAvailLngs, COUNTOF(tchAvailLngs), MUI_LanguageDLLs[lng].szLocaleName); - StringCchCatW(tchAvailLngs, COUNTOF(tchAvailLngs), L" "); + StringCchCatW(tchAvailLngs, COUNTOF(tchAvailLngs), L";"); } iPrefLngIndex = lng; break; } } - StringCchCatW(tchAvailLngs, COUNTOF(tchAvailLngs), MUI_LanguageDLLs[0].szLocaleName); // en-US + StringCchCatW(tchAvailLngs, COUNTOF(tchAvailLngs), MUI_LanguageDLLs[0].szLocaleName); // en-US fallback // NOTES: // an application developer that makes the assumption the fallback list provided by the @@ -264,19 +282,24 @@ LANGID LoadLanguageResources() { MsgBoxLastError(L"Trying to load Language resource!", ERROR_MUI_INVALID_LOCALE_NAME); } - DWORD langCount = 0; + ULONG langCount = 0; // using SetProcessPreferredUILanguages is recommended for new applications (esp. multi-threaded applications) - if (!SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, tchUserLangMultiStrg, &langCount) || (langCount == 0)) + SetProcessPreferredUILanguages(0, L"\0\0", &langCount); // clear + if (!SetProcessPreferredUILanguages(MUI_LANGUAGE_NAME, tchUserLangMultiStrg, &langCount) || (langCount == 0)) { MsgBoxLastError(L"Trying to set preferred Language!", ERROR_RESOURCE_LANG_NOT_FOUND); } + //else { + // SetThreadPreferredUILanguages(0, L"\0\0", &langCount); // clear + // SetThreadPreferredUILanguages(MUI_LANGUAGE_NAME, tchUserLangMultiStrg, &langCount); + //} // obtains access to the proper resource container // for standard Win32 resource loading this is normally a PE module - use LoadLibraryEx HINSTANCE _hLangResourceContainer = NULL; Globals.bPrefLngNotAvail = (iPrefLngIndex < 0); - int iUsedLngId = (iPrefLngIndex >= 0) ? iPrefLngIndex : 0; + int iUsedLngIdx = (iPrefLngIndex >= 0) ? iPrefLngIndex : 0; if ((iPrefLngIndex >= 0) && MUI_LanguageDLLs[iPrefLngIndex].bHasDLL) { _hLangResourceContainer = (iPrefLngIndex == 0) ? Globals.hInstance : @@ -284,7 +307,7 @@ LANGID LoadLanguageResources() if (_hLangResourceContainer) { MUI_LanguageDLLs[0].bIsActive = false; MUI_LanguageDLLs[iPrefLngIndex].bIsActive = true; - iUsedLngId = iPrefLngIndex; + iUsedLngIdx = iPrefLngIndex; } } @@ -294,11 +317,13 @@ LANGID LoadLanguageResources() Globals.bPrefLngNotAvail = (iPrefLngIndex != 0); _hLangResourceContainer = Globals.hInstance; MUI_LanguageDLLs[0].bIsActive = true; - iUsedLngId = 0; + iUsedLngIdx = 0; } + // MUI Language for common controls + InitMUILanguage(MUI_LanguageDLLs[iUsedLngIdx].LangId); + Globals.hLngResContainer = _hLangResourceContainer; - SetThreadUILanguage(MUI_LanguageDLLs[iUsedLngId].LangId); // === update language dependent items === @@ -322,7 +347,7 @@ LANGID LoadLanguageResources() IniSectionGetString(StatusBar_Section, L"SectionPostfixes", tchDefaultStrg, tchStatusBar, COUNTOF(tchStatusBar)); ReadStrgsFromCSV(tchStatusBar, g_mxSBPostfix, STATUS_SECTOR_COUNT, MICRO_BUFFER, L"_POFX_"); - return MUI_LanguageDLLs[iUsedLngId].LangId; + return MUI_LanguageDLLs[iUsedLngIdx].LangId; } diff --git a/src/MuiLanguage.h b/src/MuiLanguage.h index e0c7c9660..ef68b880d 100644 --- a/src/MuiLanguage.h +++ b/src/MuiLanguage.h @@ -32,6 +32,7 @@ typedef struct _muilanguage extern MUILANGUAGE MUI_LanguageDLLs[]; int MuiLanguages_CountOf(); +int GetMUILanguageIndexByLangID(LANGID iLanguageID); bool GetUserPreferredLanguage(LPWSTR pszPrefLocaleName, int cchBuffer, LANGID* pLangID); void SetPreferredLanguage(LANGID iPreferredLanguageID); diff --git a/src/Notepad3.c b/src/Notepad3.c index eaf859ea0..aabb71344 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -2176,7 +2176,7 @@ void CreateBars(HWND hwnd, HINSTANCE hInstance) // use copy for alphablend a disabled Toolbar (if not provided) hbmpCopy = CopyImage(hbmp, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); - // do not adjust to current DPI -> else "blurry" images + // don't adjust toolbar bitmap to current DPI //~hbmp = ResizeImageForCurrentDPI(hbmp); //~hbmpCopy = ResizeImageForCurrentDPI(hbmpCopy); @@ -2230,7 +2230,7 @@ void CreateBars(HWND hwnd, HINSTANCE hInstance) himlOld = bi.himl; } if (hbmp) { - // do not adjust to current DPI -> else "blurry" images + // don't adjust toolbar bitmap to current DPI //~hbmp = ResizeImageForCurrentDPI(hbmp); GetObject(hbmp, sizeof(BITMAP), &bmp); @@ -2278,7 +2278,7 @@ void CreateBars(HWND hwnd, HINSTANCE hInstance) himlOld = bi.himl; } if (hbmp) { - // do not adjust to current DPI -> else "blurry" images + // don't adjust toolbar bitmap to current DPI //~hbmp = ResizeImageForCurrentDPI(hbmp); GetObject(hbmp, sizeof(BITMAP), &bmp); @@ -2510,12 +2510,10 @@ LRESULT MsgDPIChanged(HWND hwnd, WPARAM wParam, LPARAM lParam) // LRESULT MsgThemeChanged(HWND hwnd, WPARAM wParam ,LPARAM lParam) { - UNUSED(hwnd); UNUSED(lParam); UNUSED(wParam); RECT rc, rc2; - HINSTANCE hInstance = (HINSTANCE)(INT_PTR)GetWindowLongPtr(hwnd,GWLP_HINSTANCE); // reinitialize edit frame @@ -2551,9 +2549,7 @@ LRESULT MsgThemeChanged(HWND hwnd, WPARAM wParam ,LPARAM lParam) } // recreate toolbar and statusbar - Toolbar_GetButtons(Globals.hwndToolbar,IDT_FILE_NEW,Settings.ToolbarButtons,COUNTOF(Settings.ToolbarButtons)); - - CreateBars(hwnd,hInstance); + CreateBars(hwnd,Globals.hInstance); SendWMSize(hwnd, NULL); if (FocusedView.HideNonMatchedLines) { EditToggleView(Globals.hwndEdit); } @@ -3453,12 +3449,11 @@ static void _DynamicLanguageMenuCmd(int cmd) DestroyMenu(Globals.hMainMenu); // desired language - SetPreferredLanguage(MUI_LanguageDLLs[iLngIdx].LangId); + LANGID const desiredLngID = MUI_LanguageDLLs[iLngIdx].LangId; + SetPreferredLanguage(desiredLngID); FreeLanguageResources(); - - // change to available (fall back: en-US) - SetPreferredLanguage(LoadLanguageResources()); + LoadLanguageResources(); Globals.hMainMenu = LoadMenu(Globals.hLngResContainer, MAKEINTRESOURCE(IDR_MUI_MAINMENU)); if (!Globals.hMainMenu) { @@ -3468,11 +3463,8 @@ static void _DynamicLanguageMenuCmd(int cmd) } _InsertLanguageMenu(Globals.hMainMenu); - Style_InsertThemesMenu(Globals.hMainMenu); - SetMenu(Globals.hwndMain, (Settings.ShowMenubar ? Globals.hMainMenu : NULL)); - DrawMenuBar(Globals.hwndMain); MsgThemeChanged(Globals.hwndMain, (WPARAM)NULL, (LPARAM)NULL); @@ -3513,6 +3505,7 @@ LRESULT MsgCommand(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) UpdateStatusbar(false); break; + case IDT_TIMER_UPDATE_STATUSBAR: _UpdateStatusbarDelayed((bool)lParam); return FALSE; diff --git a/src/VersionEx.h b/src/VersionEx.h index 4149fc4fe..4bb480f20 100644 --- a/src/VersionEx.h +++ b/src/VersionEx.h @@ -8,12 +8,12 @@ #define SAPPNAME "Notepad3" #define VERSION_MAJOR 5 #define VERSION_MINOR 20 -#define VERSION_REV 305 +#define VERSION_REV 307 #define VERSION_BUILD 1 #define SCINTILLA_VER 431 #define ONIGURUMA_REGEX_VER 6.9.4 #define UCHARDET_VER 2018.09.27 #define TINYEXPR_VER 2018.05.11 #define UTHASH_VER 2.1.0 -#define VERSION_PATCH NF +#define VERSION_PATCH RC3 #define VERSION_COMMIT_ID nebukadn