diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml
index d71992dd0..bb980274a 100644
--- a/PowerEditor/installer/nativeLang/english.xml
+++ b/PowerEditor/installer/nativeLang/english.xml
@@ -864,7 +864,9 @@ The comments are here for explanation, it's not necessary to translate them.
+
+
diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml
index a2ddc226e..d502a9e40 100644
--- a/PowerEditor/installer/nativeLang/french.xml
+++ b/PowerEditor/installer/nativeLang/french.xml
@@ -863,8 +863,9 @@ The comments are here for explanation, it's not necessary to translate them.
-
+
+
diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
index d0bacde4a..137ecb181 100644
--- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
+++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml
@@ -854,7 +854,9 @@
+
+
diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp
index 78626ed42..036a2d97a 100644
--- a/PowerEditor/src/Notepad_plus.cpp
+++ b/PowerEditor/src/Notepad_plus.cpp
@@ -686,6 +686,28 @@ LRESULT Notepad_plus::init(HWND hwnd)
checkMenuItem(IDM_LANG_USER_DLG, uddShow);
_toolBar.setCheck(IDM_LANG_USER_DLG, uddShow);
+ //Hide or show the right shortcuts "+" "▼" "✕" of main menu bar
+ if (nppGUI._hideMenuRightShortcuts)
+ {
+ int nbRemoved = 0;
+ const int bufferSize = 64;
+ TCHAR buffer[bufferSize];
+ int nbItem = GetMenuItemCount(_mainMenuHandle);
+ for (int i = nbItem - 1; i >= 0; --i)
+ {
+ ::GetMenuStringW(_mainMenuHandle, i, buffer, bufferSize, MF_BYPOSITION);
+ if (lstrcmp(buffer, L"✕") == 0 || lstrcmp(buffer, L"▼") == 0 || lstrcmp(buffer, L"+") == 0)
+ {
+ ::RemoveMenu(_mainMenuHandle, i, MF_BYPOSITION);
+ ++nbRemoved;
+ }
+ if (nbRemoved == 3)
+ break;
+ }
+ if (nbRemoved > 0)
+ ::DrawMenuBar(hwnd);
+ }
+
//
// Initialize the default foreground & background color
//
diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp
index 9b5fb8853..f2bcb997f 100644
--- a/PowerEditor/src/Parameters.cpp
+++ b/PowerEditor/src/Parameters.cpp
@@ -5543,6 +5543,10 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
const TCHAR * optEnableFoldCmdToggable = element->Attribute(TEXT("enableFoldCmdToggable"));
if (optEnableFoldCmdToggable)
_nppGUI._enableFoldCmdToggable = lstrcmp(optEnableFoldCmdToggable, TEXT("yes")) == 0;
+
+ const TCHAR * hideMenuRightShortcuts = element->Attribute(TEXT("hideMenuRightShortcuts"));
+ if (hideMenuRightShortcuts)
+ _nppGUI._hideMenuRightShortcuts = lstrcmp(hideMenuRightShortcuts, TEXT("yes")) == 0;
}
else if (!lstrcmp(nm, TEXT("commandLineInterpreter")))
{
@@ -6665,6 +6669,7 @@ void NppParameters::createXmlTreeFromGUIParams()
GUIConfigElement->SetAttribute(TEXT("saveDlgExtFilterToAllTypes"), _nppGUI._setSaveDlgExtFiltToAllTypes ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("muteSounds"), _nppGUI._muteSounds ? TEXT("yes") : TEXT("no"));
GUIConfigElement->SetAttribute(TEXT("enableFoldCmdToggable"), _nppGUI._enableFoldCmdToggable ? TEXT("yes") : TEXT("no"));
+ GUIConfigElement->SetAttribute(TEXT("hideMenuRightShortcuts"), _nppGUI._hideMenuRightShortcuts ? TEXT("yes") : TEXT("no"));
}
//
diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h
index 86bc7f7e4..008477a0a 100644
--- a/PowerEditor/src/Parameters.h
+++ b/PowerEditor/src/Parameters.h
@@ -806,6 +806,7 @@ struct NppGUI final
bool _replaceStopsWithoutFindingNext = false;
bool _muteSounds = false;
bool _enableFoldCmdToggable = false;
+ bool _hideMenuRightShortcuts = false;
writeTechnologyEngine _writeTechnologyEngine = defaultTechnology;
bool _isWordCharDefault = true;
std::string _customWordChars;
diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc
index addc8d88a..85ef5e75e 100644
--- a/PowerEditor/src/WinControls/Preference/preference.rc
+++ b/PowerEditor/src/WinControls/Preference/preference.rc
@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see .
+#pragma code_page(65001)
#include
#include "preference_rc.h"
@@ -28,38 +29,40 @@ EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE
CAPTION "Preferences"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LISTBOX IDC_LIST_DLGTITLE,10,10,80,185,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
+ LISTBOX IDC_LIST_DLGTITLE,10,10,80,203,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
PUSHBUTTON "Close",IDC_BUTTON_CLOSE,255,215,45,14
END
-IDD_PREFERENCE_SUB_GENRAL DIALOGEX 0, 0, 455, 185
+IDD_PREFERENCE_SUB_GENRAL DIALOGEX 0, 0, 455, 203
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- RTEXT "Localization:",IDC_LOCALIZATION_GB_STATIC,2,7,78,8
- COMBOBOX IDC_COMBO_LOCALIZATION,83,5,119,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- GROUPBOX "Toolbar",IDC_TOOLBAR_GB_STATIC,57,22,147,97,BS_CENTER
- CONTROL "Hide",IDC_CHECK_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,64,30,94,10
- CONTROL "Fluent UI: small",IDC_RADIO_SMALLICON,"Button",BS_AUTORADIOBUTTON,64,45,114,10
- CONTROL "Fluent UI: large",IDC_RADIO_BIGICON,"Button",BS_AUTORADIOBUTTON,64,59,109,10
- CONTROL "Filled Fluent UI: small",IDC_RADIO_SMALLICON2,"Button",BS_AUTORADIOBUTTON,64,73,114,10
- CONTROL "Filled Fluent UI: large",IDC_RADIO_BIGICON2,"Button",BS_AUTORADIOBUTTON,64,87,109,10
- CONTROL "Standard icons: small",IDC_RADIO_STANDARD,"Button",BS_AUTORADIOBUTTON,64,101,119,10
- GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,223,6,176,156,BS_CENTER
- CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,15,108,10
- CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,29,134,10
- CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,41,134,10
- CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,54,108,10
- CONTROL "Alternate icons",IDC_CHECK_TAB_ALTICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,67,164,10
- CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,80,134,10
- CONTROL "Darken inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,93,134,10
- CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,106,137,10
- CONTROL "Show close button on each tab",IDC_CHECK_ENABLETABCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,119,133,10
- CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,132,133,10
- CONTROL "Exit on close the last tab",IDC_CHECK_TAB_LAST_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,145,165,10
- CONTROL "Show status bar",IDC_CHECK_SHOWSTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,64,132,130,10
- CONTROL "Hide menu bar (use Alt or F10 key to toggle)",IDC_CHECK_HIDEMENUBAR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,223,169,218,10
+ RTEXT "Localization:",IDC_LOCALIZATION_GB_STATIC,2,10,78,8
+ COMBOBOX IDC_COMBO_LOCALIZATION,83,8,119,80,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ GROUPBOX "Toolbar",IDC_TOOLBAR_GB_STATIC,27,59,147,97,BS_CENTER
+ CONTROL "Hide",IDC_CHECK_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,34,67,94,10
+ CONTROL "Fluent UI: small",IDC_RADIO_SMALLICON,"Button",BS_AUTORADIOBUTTON,34,82,114,10
+ CONTROL "Fluent UI: large",IDC_RADIO_BIGICON,"Button",BS_AUTORADIOBUTTON,34,96,109,10
+ CONTROL "Filled Fluent UI: small",IDC_RADIO_SMALLICON2,"Button",BS_AUTORADIOBUTTON,34,110,114,10
+ CONTROL "Filled Fluent UI: large",IDC_RADIO_BIGICON2,"Button",BS_AUTORADIOBUTTON,34,124,109,10
+ CONTROL "Standard icons: small",IDC_RADIO_STANDARD,"Button",BS_AUTORADIOBUTTON,34,138,119,10
+ GROUPBOX "Tab Bar",IDC_TABBAR_GB_STATIC,223,0,176,156,BS_CENTER
+ CONTROL "Hide",IDC_CHECK_TAB_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,9,108,10
+ CONTROL "Multi-line",IDC_CHECK_TAB_MULTILINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,23,134,10
+ CONTROL "Vertical",IDC_CHECK_TAB_VERTICAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,35,134,10
+ CONTROL "Reduce",IDC_CHECK_REDUCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,48,108,10
+ CONTROL "Alternate icons",IDC_CHECK_TAB_ALTICONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,61,164,10
+ CONTROL "Lock (no drag and drop)",IDC_CHECK_LOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,74,134,10
+ CONTROL "Darken inactive tabs",IDC_CHECK_DRAWINACTIVE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,87,134,10
+ CONTROL "Draw a coloured bar on active tab",IDC_CHECK_ORANGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,100,137,10
+ CONTROL "Show close button on each tab",IDC_CHECK_ENABLETABCLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,113,133,10
+ CONTROL "Double click to close document",IDC_CHECK_DBCLICK2CLOSE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,126,133,10
+ CONTROL "Exit on close the last tab",IDC_CHECK_TAB_LAST_EXIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,229,139,165,10
+ CONTROL "Show status bar",IDC_CHECK_SHOWSTATUSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,28,37,130,10
+ GROUPBOX "Menu",IDC_MENU_GB_STATIC,27,160,373,42,BS_CENTER
+ CONTROL "Hide menu bar (use Alt or F10 key to toggle)",IDC_CHECK_HIDEMENUBAR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,34,173,218,10
+ CONTROL "Hide right shortcuts + ▼ ✕ from the menu bar (Need to restart Notepad++)",IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,34,185,350,10
END
diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
index 2743f094a..25107468a 100644
--- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
+++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp
@@ -454,6 +454,7 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
bool showTool = nppGUI._toolbarShow;
bool showStatus = nppGUI._statusBarShow;
bool showMenu = nppGUI._menuBarShow;
+ bool hideRightShortcutsFromMenu = nppGUI._hideMenuRightShortcuts;
::SendDlgItemMessage(_hSelf, IDC_CHECK_HIDE, BM_SETCHECK, showTool?BST_UNCHECKED:BST_CHECKED, 0);
int ID2Check = 0;
@@ -492,6 +493,7 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
::SendMessage(_hSelf, WM_COMMAND, IDC_CHECK_TAB_HIDE, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_SHOWSTATUSBAR, BM_SETCHECK, showStatus, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_HIDEMENUBAR, BM_SETCHECK, !showMenu, 0);
+ ::SendDlgItemMessage(_hSelf, IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR, BM_SETCHECK, hideRightShortcutsFromMenu, 0);
LocalizationSwitcher & localizationSwitcher = nppParam.getLocalizationSwitcher();
@@ -560,6 +562,14 @@ intptr_t CALLBACK GeneralSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
}
return TRUE;
+ case IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR:
+ {
+ bool isChecked = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR, BM_GETCHECK, 0, 0));
+ NppGUI& nppGUI = nppParam.getNppGUI();
+ nppGUI._hideMenuRightShortcuts = isChecked;
+ }
+ return TRUE;
+
case IDC_CHECK_TAB_HIDE :
{
bool toBeHidden = (BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_TAB_HIDE), BM_GETCHECK, 0, 0));
diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h
index 71d212898..84cb60afd 100644
--- a/PowerEditor/src/WinControls/Preference/preference_rc.h
+++ b/PowerEditor/src/WinControls/Preference/preference_rc.h
@@ -54,6 +54,8 @@
#define IDC_CHECK_TAB_ALTICONS (IDD_PREFERENCE_SUB_GENRAL + 28)
#define IDC_RADIO_SMALLICON2 (IDD_PREFERENCE_SUB_GENRAL + 29)
#define IDC_RADIO_BIGICON2 (IDD_PREFERENCE_SUB_GENRAL + 30)
+ #define IDC_MENU_GB_STATIC (IDD_PREFERENCE_SUB_GENRAL + 31)
+ #define IDC_CHECK_HIDERIGHTSHORTCUTSOFMENUBAR (IDD_PREFERENCE_SUB_GENRAL + 32)
#define IDD_PREFERENCE_SUB_MULTIINSTANCE 6150 //(IDD_PREFERENCE_BOX + 150)
#define IDC_MULTIINST_GB_STATIC (IDD_PREFERENCE_SUB_MULTIINSTANCE + 1)