diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index a0b05a3e7..45dcab4dc 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -490,15 +490,15 @@ The comments are here for explanation, it's not necessary to translate them. - - - - + + + + - + diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index 24ba71ecb..ae5bc2945 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -485,15 +485,15 @@ The comments are here for explanation, it's not necessary to translate them. - - - - + + + + - + diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 95e830cf3..558f90c11 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -2160,7 +2160,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa // and defer any cleanup operations until it receives WM_ENDSESSION (with WPARAM TRUE) // for a bigger tidy-up/save operations we can kick off a background thread here to prepare for shutdown - // and when we get the WM_END­SESSION TRUE, we wait there until that background operation completes + // and when we get the WM_ENDSESSION TRUE, we wait there until that background operation completes // before telling the system, "ok, you can shut down now...", i.e. returning 0 there // whatever we do from here - make sure that it is ok for the operation to occur even if the shutdown diff --git a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp index f1a4f819c..ceb353f03 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp +++ b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp @@ -20,11 +20,11 @@ #include "Parameters.h" #include "localization.h" -intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) +intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { - case WM_INITDIALOG : + case WM_INITDIALOG: { NppDarkMode::autoSubclassAndThemeChildControls(_hSelf); @@ -32,27 +32,40 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, ::SendDlgItemMessage(_hSelf, IDC_RANGEEND_EDIT, EM_LIMITTEXT, 3, 0); ::SendDlgItemMessage(_hSelf, IDC_NONASCCI_RADIO, BM_SETCHECK, TRUE, 0); ::SendDlgItemMessage(_hSelf, ID_FINDCHAR_DIRDOWN, BM_SETCHECK, TRUE, 0); - goToCenter(); + + ::SetDlgItemInt(_hSelf, IDC_RANGESTART_EDIT, 0, FALSE); + ::SetDlgItemInt(_hSelf, IDC_RANGEEND_EDIT, 255, FALSE); + + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RANGESTART_EDIT), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RANGEEND_EDIT), FALSE); + + goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE); + return TRUE; } case WM_CTLCOLOREDIT: { - if (NppDarkMode::isEnabled()) - { - return NppDarkMode::onCtlColorSofter(reinterpret_cast(wParam)); - } - break; + return NppDarkMode::onCtlColorSofter(reinterpret_cast(wParam)); } case WM_CTLCOLORDLG: + { + return NppDarkMode::onCtlColorDarker(reinterpret_cast(wParam)); + } + case WM_CTLCOLORSTATIC: { - if (NppDarkMode::isEnabled()) + const auto hdcStatic = reinterpret_cast(wParam); + const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast(lParam)); + + //set the static text colors to show enable/disable instead of ::EnableWindow which causes blurry text + if (dlgCtrlID == IDC_STATIC) { - return NppDarkMode::onCtlColorDarker(reinterpret_cast(wParam)); + const bool isTextEnabled = isCheckedOrNot(IDC_MYRANGE_RADIO); + return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled); } - break; + return NppDarkMode::onCtlColorDarker(hdcStatic); } case WM_PRINTCLIENT: @@ -68,7 +81,7 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, { if (NppDarkMode::isEnabled()) { - RECT rc = {}; + RECT rc{}; getClientRect(rc); ::FillRect(reinterpret_cast(wParam), &rc, NppDarkMode::getDarkerBackgroundBrush()); return TRUE; @@ -82,11 +95,30 @@ intptr_t CALLBACK FindCharsInRangeDlg::run_dlgProc(UINT message, WPARAM wParam, return TRUE; } - case WM_COMMAND : + case WM_COMMAND: { switch (wParam) { - case IDCANCEL : // Close + case IDC_NONASCCI_RADIO: + case IDC_ASCCI_RADIO: + { + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RANGESTART_EDIT), FALSE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RANGEEND_EDIT), FALSE); + redrawDlgItem(IDC_STATIC); + + return TRUE; + } + + case IDC_MYRANGE_RADIO: + { + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RANGESTART_EDIT), TRUE); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RANGEEND_EDIT), TRUE); + redrawDlgItem(IDC_STATIC); + + return TRUE; + } + + case IDCANCEL: // Close display(false); return TRUE; @@ -204,7 +236,8 @@ bool FindCharsInRangeDlg::getRangeFromUI(unsigned char & startRange, unsigned ch if (isCheckedOrNot(IDC_MYRANGE_RADIO)) { - BOOL startBool, endBool; + BOOL startBool = FALSE; + BOOL endBool = FALSE; int start = ::GetDlgItemInt(_hSelf, IDC_RANGESTART_EDIT, &startBool, FALSE); int end = ::GetDlgItemInt(_hSelf, IDC_RANGEEND_EDIT, &endBool, FALSE); diff --git a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.h b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.h index 6890c71e2..66a8c1478 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.h +++ b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.h @@ -32,25 +32,21 @@ public : _ppEditView = ppEditView; }; - virtual void create(int dialogID, bool isRTL = false, bool msgDestParent = true) { - StaticDialog::create(dialogID, isRTL, msgDestParent); - }; - void doDialog(bool isRTL = false) { if (!isCreated()) create(IDD_FINDCHARACTERS, isRTL); display(); }; - virtual void display(bool toShow = true) const { - Window::display(toShow); - }; + void display(bool toShow = true) const override { + Window::display(toShow); + }; protected : - virtual intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; private : - ScintillaEditView **_ppEditView = nullptr; + ScintillaEditView **_ppEditView = nullptr; bool findCharInRange(unsigned char beginRange, unsigned char endRange, intptr_t startPos, bool direction, bool wrap); bool getRangeFromUI(unsigned char & startRange, unsigned char & endRange); void getDirectionFromUI(bool & whichDirection, bool & isWrap); diff --git a/PowerEditor/src/WinControls/FindCharsInRange/findCharsInRange.rc b/PowerEditor/src/WinControls/FindCharsInRange/findCharsInRange.rc index a2876b6e7..289e975d7 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/findCharsInRange.rc +++ b/PowerEditor/src/WinControls/FindCharsInRange/findCharsInRange.rc @@ -14,26 +14,30 @@ // 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 "findCharsInRange_rc.h" -IDD_FINDCHARACTERS DIALOGEX 26, 41, 263, 126 +IDD_FINDCHARACTERS DIALOGEX 0, 0, 267, 99 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE CAPTION "Find Characters in Range..." FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - CONTROL "Non-ASCII Characters (128-255)",IDC_NONASCCI_RADIO,"Button",BS_AUTORADIOBUTTON,22,13,146,10 - CONTROL "ASCII Characters (0 - 127)",IDC_ASCCI_RADIO,"Button",BS_AUTORADIOBUTTON,22,32,151,10 - CONTROL "My Range:",IDC_MYRANGE_RADIO,"Button",BS_AUTORADIOBUTTON,22,51,67,10 - EDITTEXT IDC_RANGESTART_EDIT,91,49,25,14,ES_AUTOHSCROLL | ES_NUMBER - LTEXT "-",IDC_STATIC,122,52,8,8 - EDITTEXT IDC_RANGEEND_EDIT,129,49,25,14,ES_AUTOHSCROLL | ES_NUMBER - CONTROL "&Up",ID_FINDCHAR_DIRUP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,25,91,64,12 - CONTROL "&Down",ID_FINDCHAR_DIRDOWN,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,25,103,63,12 - GROUPBOX "Direction",IDC_FINDCHAR_DIR_STATIC,19,79,74,42,WS_GROUP - CONTROL "Wra&p around",ID_FINDCHAR_WRAP,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,105,102,110,15 - DEFPUSHBUTTON "Find",ID_FINDCHAR_NEXT,182,8,70,14,BS_NOTIFY - PUSHBUTTON "Close",IDCANCEL,181,27,70,14,BS_NOTIFY + CONTROL "&Non-ASCII characters (128–255)",IDC_NONASCCI_RADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,7,6,160,10 + CONTROL "&ASCII characters (0–127)",IDC_ASCCI_RADIO,"Button",BS_AUTORADIOBUTTON,7,21,160,10 + CONTROL "Custom &range (0–255):",IDC_MYRANGE_RADIO,"Button",BS_AUTORADIOBUTTON,7,36,110,10 + EDITTEXT IDC_RANGESTART_EDIT,120,35,20,12,ES_AUTOHSCROLL | ES_CENTER | ES_NUMBER + CTEXT "–",IDC_STATIC,143,37,8,8 + EDITTEXT IDC_RANGEEND_EDIT,154,35,20,12,ES_AUTOHSCROLL | ES_CENTER | ES_NUMBER + + GROUPBOX "Direction",IDC_FINDCHAR_DIR_STATIC,7,56,74,36,WS_GROUP + CONTROL "&Up",ID_FINDCHAR_DIRUP,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,13,68,64,10 + CONTROL "&Down",ID_FINDCHAR_DIRDOWN,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,13,80,63,10 + + CONTROL "Wra&p around",ID_FINDCHAR_WRAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,85,80,110,10 + + DEFPUSHBUTTON "&Find",ID_FINDCHAR_NEXT,190,6,70,14 + PUSHBUTTON "&Close",IDCANCEL,190,24,70,14 END diff --git a/PowerEditor/visual.net/notepadPlus.Cpp.props b/PowerEditor/visual.net/notepadPlus.Cpp.props index 3e4876f80..d857bc5d7 100644 --- a/PowerEditor/visual.net/notepadPlus.Cpp.props +++ b/PowerEditor/visual.net/notepadPlus.Cpp.props @@ -33,7 +33,7 @@ ProgramDatabase true 4456;4457;4459 - /w15262 %(AdditionalOptions) + /Zc:__cplusplus /source-charset:utf-8 /Zc:strictStrings /w15262 %(AdditionalOptions) true stdcpp20 true @@ -57,7 +57,7 @@ false - -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-reserved-id-macro -Wno-pragma-pack -Wno-unknown-pragmas -Wno-unused-command-line-argument -Wno-overloaded-virtual %(AdditionalOptions) + -Wextra -Wimplicit-fallthrough -Wformat=2 -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-reserved-id-macro -Wno-pragma-pack -Wno-unknown-pragmas -Wno-unused-command-line-argument -Wno-overloaded-virtual %(AdditionalOptions) @@ -66,7 +66,6 @@ _DEBUG;%(PreprocessorDefinitions) UninitializedLocalUsageCheck MultiThreadedDebug - /Zc:strictStrings %(AdditionalOptions) false @@ -77,7 +76,7 @@ - /Zc:strictStrings /analyze:WX- %(AdditionalOptions) + /analyze:WX- %(AdditionalOptions) true @@ -90,7 +89,7 @@ MultiThreaded true true - /Zc:strictStrings /Gw %(AdditionalOptions) + /Gw /GA %(AdditionalOptions) true