diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 41f01139b..36045f252 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -1071,30 +1071,30 @@ You can define several column markers by using white space to separate the diffe - + - - - - + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - + + + + @@ -1104,7 +1104,7 @@ You can define several column markers by using white space to separate the diffe - + diff --git a/PowerEditor/installer/nativeLang/english_customizable.xml b/PowerEditor/installer/nativeLang/english_customizable.xml index d6e4524a6..f00281e31 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -1066,30 +1066,30 @@ You can define several column markers by using white space to separate the diffe - + - - - - + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - + + + + @@ -1099,7 +1099,7 @@ You can define several column markers by using white space to separate the diffe - + diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 07550ce32..abcd3d697 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -292,49 +292,55 @@ IDD_PREFERENCE_SUB_PRINT DIALOGEX 115, 10, 460, 205 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 BEGIN - CONTROL "WYSIWYG",IDC_RADIO_WYSIWYG,"Button",BS_AUTORADIOBUTTON,12,30,123,10 - CONTROL "Invert",IDC_RADIO_INVERT,"Button",BS_AUTORADIOBUTTON,12,45,90,10 - CONTROL "Black on white",IDC_RADIO_BW,"Button",BS_AUTORADIOBUTTON,12,60,90,10 - CONTROL "No background colour",IDC_RADIO_NOBG,"Button",BS_AUTORADIOBUTTON,12,76,123,10 - GROUPBOX "Colour Options",IDC_COLOUROPT_STATIC,6,20,133,73,BS_CENTER - CONTROL "Print line number",IDC_CHECK_PRINTLINENUM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,6,133,10 - EDITTEXT IDC_EDIT_ML,42,136,17,14,ES_NUMBER - EDITTEXT IDC_EDIT_MT,59,120,17,14,ES_NUMBER - EDITTEXT IDC_EDIT_MR,77,136,17,14,ES_NUMBER - EDITTEXT IDC_EDIT_MB,59,152,17,14,ES_NUMBER - RTEXT "Left",IDC_ML_STATIC,9,139,30,8 - CTEXT "Top",IDC_MT_STATIC,41,110,54,8 - LTEXT "Right",IDC_MR_STATIC,99,139,29,8 - CTEXT "Bottom",IDC_MB_STATIC,41,167,54,8 - GROUPBOX "Margin Setting (Unit:mm)",IDC_MARGESETTINGS_STATIC,6,98,133,82,BS_CENTER - EDITTEXT IDC_EDIT_HLEFT,166,58,83,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_HMIDDLE,256,58,83,14,ES_CENTER | ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_HRIGHT,346,58,83,14,ES_RIGHT | ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_HFONTNAME,166,76,84,104,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO_HFONTSIZE,256,76,31,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Bold",IDC_CHECK_HBOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,296,76,46,10 - CONTROL "Italic",IDC_CHECK_HITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,356,76,43,10 - GROUPBOX "Header",IDC_HGB_STATIC,158,39,279,56,BS_CENTER - CTEXT "Left part",IDC_HL_STATIC,168,49,79,8 - CTEXT "Middle part",IDC_HM_STATIC,260,49,75,8 - CTEXT "Right part",IDC_HR_STATIC,348,49,78,8 - EDITTEXT IDC_EDIT_FLEFT,166,116,83,14,ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_FMIDDLE,257,116,83,14,ES_CENTER | ES_AUTOHSCROLL - EDITTEXT IDC_EDIT_FRIGHT,346,116,83,14,ES_RIGHT | ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_FFONTNAME,166,134,84,119,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - COMBOBOX IDC_COMBO_FFONTSIZE,258,134,31,71,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - CONTROL "Bold",IDC_CHECK_FBOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,297,136,46,10 - CONTROL "Italic",IDC_CHECK_FITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,356,136,47,10 - GROUPBOX "Footer",IDC_FGB_STATIC,158,97,279,58,BS_CENTER - CTEXT "Left part",IDC_FL_STATIC,168,107,78,8 - CTEXT "Middle part",IDC_FM_STATIC,257,107,82,8 - CTEXT "Right part",IDC_FR_STATIC,348,107,79,8 - COMBOBOX IDC_COMBO_VARLIST,259,24,70,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - PUSHBUTTON "Add",IDC_BUTTON_ADDVAR,337,24,44,12 - RTEXT "Variable :",IDC_VAR_STATIC,198,26,59,8 - RTEXT "Here display your variable settings",IDC_WHICHPART_STATIC,155,161,120,8 - LTEXT "",IDC_VIEWPANEL_STATIC,277,161,180,8 - GROUPBOX "Header and Footer",IDC_HEADERFPPTER_GR_STATIC,150,7,296,172,BS_CENTER + CONTROL "Print line n&umber",IDC_CHECK_PRINTLINENUM,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,3,133,10 + + GROUPBOX "Color Options",IDC_COLOUROPT_STATIC,6,18,133,74,BS_CENTER + CONTROL "W&YSIWYG",IDC_RADIO_WYSIWYG,"Button",BS_AUTORADIOBUTTON,12,31,121,10 + CONTROL "I&nvert",IDC_RADIO_INVERT,"Button",BS_AUTORADIOBUTTON,12,46,121,10 + CONTROL "Black on &white",IDC_RADIO_BW,"Button",BS_AUTORADIOBUTTON,12,61,121,10 + CONTROL "No bac&kground color",IDC_RADIO_NOBG,"Button",BS_AUTORADIOBUTTON,12,76,121,10 + + GROUPBOX "Margin Setting (Unit:mm)",IDC_MARGESETTINGS_STATIC,6,98,133,83,BS_CENTER + CTEXT "&Top",IDC_MT_STATIC,43,110,54,8 + EDITTEXT IDC_EDIT_MT,61,120,17,12,ES_CENTER | ES_NUMBER + RTEXT "&Left",IDC_ML_STATIC,9,139,30,8 + EDITTEXT IDC_EDIT_ML,43,136,17,12,ES_CENTER | ES_NUMBER + LTEXT "&Right",IDC_MR_STATIC,101,139,30,8 + EDITTEXT IDC_EDIT_MR,79,136,17,12,ES_CENTER | ES_NUMBER + CTEXT "Botto&m",IDC_MB_STATIC,43,167,54,8 + EDITTEXT IDC_EDIT_MB,61,152,17,12,ES_CENTER | ES_NUMBER + + GROUPBOX "Header and Footer",IDC_HEADERFPPTER_GR_STATIC,148,3,300,178,BS_CENTER + RTEXT "&Variable:",IDC_VAR_STATIC,181,16,60,8 + COMBOBOX IDC_COMBO_VARLIST,244,14,122,58,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + PUSHBUTTON "&Add",IDC_BUTTON_ADDVAR,369,14,50,13 + + GROUPBOX "Header",IDC_HGB_STATIC,156,30,284,57,BS_CENTER + CTEXT "L&eft part",IDC_HL_STATIC,166,40,81,8 + EDITTEXT IDC_EDIT_HLEFT,164,49,85,12,ES_AUTOHSCROLL + CTEXT "&Middle part",IDC_HM_STATIC,257,40,82,8 + EDITTEXT IDC_EDIT_HMIDDLE,255,49,86,12,ES_CENTER | ES_AUTOHSCROLL + CTEXT "Ri&ght part",IDC_HR_STATIC,349,40,81,8 + EDITTEXT IDC_EDIT_HRIGHT,347,49,85,12,ES_RIGHT | ES_AUTOHSCROLL + COMBOBOX IDC_COMBO_HFONTNAME,164,67,134,119,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_HFONTSIZE,302,67,31,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "&Bold",IDC_CHECK_HBOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,338,69,47,10 + CONTROL "&Italic",IDC_CHECK_HITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,388,69,50,10 + + GROUPBOX "Footer",IDC_FGB_STATIC,156,90,284,57,BS_CENTER + CTEXT "Le&ft part",IDC_FL_STATIC,168,100,81,8 + EDITTEXT IDC_EDIT_FLEFT,164,109,85,12,ES_AUTOHSCROLL + CTEXT "Middle &part",IDC_FM_STATIC,257,100,82,8 + EDITTEXT IDC_EDIT_FMIDDLE,255,109,86,12,ES_CENTER | ES_AUTOHSCROLL + CTEXT "Rig&ht part",IDC_FR_STATIC,349,100,81,8 + EDITTEXT IDC_EDIT_FRIGHT,347,109,85,12,ES_RIGHT | ES_AUTOHSCROLL + COMBOBOX IDC_COMBO_FFONTNAME,164,127,134,119,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_COMBO_FFONTSIZE,302,127,31,72,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + CONTROL "Bol&d",IDC_CHECK_FBOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,338,129,47,10 + CONTROL "Itali&c",IDC_CHECK_FITALIC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,388,129,50,10 + + CTEXT "Here display your variable settings",IDC_WHICHPART_STATIC,158,152,280,8,NOT WS_TABSTOP + EDITTEXT IDC_EDIT_VIEWPANEL,158,161,280,12,ES_AUTOHSCROLL | ES_READONLY END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index 4f8801a13..424ff3795 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1581,7 +1581,7 @@ intptr_t CALLBACK DarkModeSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA { case CPN_COLOURPICKED: { - COLORREF c; + COLORREF c = 0; if (reinterpret_cast(lParam) == _pBackgroundColorPicker->getHSelf()) { c = _pBackgroundColorPicker->getColour(); @@ -3522,7 +3522,7 @@ intptr_t CALLBACK HighlightingSubDlg::run_dlgProc(UINT message, WPARAM wParam, L return FALSE; } -intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) +intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) { NppParameters& nppParam = NppParameters::getInstance(); NppGUI & nppGUI = (NppGUI & )nppParam.getNppGUI(); @@ -3563,7 +3563,7 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) ::SetDlgItemText(_hSelf, IDC_EDIT_FMIDDLE, nppGUI._printSettings._footerMiddle.c_str()); ::SetDlgItemText(_hSelf, IDC_EDIT_FRIGHT, nppGUI._printSettings._footerRight.c_str()); - TCHAR intStr[5]; + TCHAR intStr[5]{}; for (int i = 6 ; i < 15 ; ++i) { wsprintf(intStr, TEXT("%d"), i); @@ -3631,11 +3631,21 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) } case WM_CTLCOLORDLG: - case WM_CTLCOLORSTATIC: { return NppDarkMode::onCtlColorDarker(reinterpret_cast(wParam)); } + case WM_CTLCOLORSTATIC: + { + const auto hdcStatic = reinterpret_cast(wParam); + const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast(lParam)); + if (dlgCtrlID == IDC_EDIT_VIEWPANEL) + { + return NppDarkMode::onCtlColor(hdcStatic); + } + return NppDarkMode::onCtlColorDarker(hdcStatic); + } + case WM_PRINTCLIENT: { if (NppDarkMode::isEnabled()) @@ -3645,9 +3655,9 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) break; } - case WM_COMMAND : + case WM_COMMAND: { - if (HIWORD(wParam) == EN_CHANGE) + if (HIWORD(wParam) == EN_CHANGE && LOWORD(wParam) != IDC_EDIT_VIEWPANEL) { switch (LOWORD(wParam)) { @@ -3667,13 +3677,13 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) nppGUI._printSettings._marge.bottom = ::GetDlgItemInt(_hSelf, IDC_EDIT_MB, NULL, FALSE); return TRUE; - default : + default: { - const int stringSize = 256; - TCHAR str[stringSize]; + constexpr int stringSize = 256; + TCHAR str[stringSize]{}; _focusedEditCtrl = LOWORD(wParam); ::GetDlgItemText(_hSelf, _focusedEditCtrl, str, stringSize); - ::SendDlgItemMessage(_hSelf, IDC_VIEWPANEL_STATIC, WM_SETTEXT, 0, reinterpret_cast(str)); + ::SendDlgItemMessage(_hSelf, IDC_EDIT_VIEWPANEL, WM_SETTEXT, 0, reinterpret_cast(str)); switch (LOWORD(wParam)) { case IDC_EDIT_HLEFT: @@ -3712,10 +3722,10 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) } } } - else if (HIWORD(wParam) == EN_SETFOCUS) + else if (HIWORD(wParam) == EN_SETFOCUS && LOWORD(wParam) != IDC_EDIT_VIEWPANEL) { - const int stringSize = 256; - TCHAR str[stringSize]; + constexpr int stringSize = 256; + TCHAR str[stringSize]{}; _focusedEditCtrl = LOWORD(wParam); int focusedEditStatic = 0; @@ -3731,15 +3741,15 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) default : return TRUE; } ::GetDlgItemText(_hSelf, _focusedEditCtrl, str, stringSize); - ::SendDlgItemMessage(_hSelf, IDC_VIEWPANEL_STATIC, WM_SETTEXT, 0, reinterpret_cast(str)); + ::SendDlgItemMessage(_hSelf, IDC_EDIT_VIEWPANEL, WM_SETTEXT, 0, reinterpret_cast(str)); ::GetDlgItemText(_hSelf, groupStatic, str, stringSize); generic_string title = str; title += TEXT(" "); ::GetDlgItemText(_hSelf, focusedEditStatic, str, stringSize); title += str; - title += TEXT(" : "); - + title = purgeMenuItemString(title.c_str()); // use purgeMenuItemString to clean '&' ::SendDlgItemMessage(_hSelf, IDC_WHICHPART_STATIC, WM_SETTEXT, 0, reinterpret_cast(title.c_str())); + redrawDlgItem(IDC_WHICHPART_STATIC); return TRUE; } else if (HIWORD(wParam) == CBN_SELCHANGE) @@ -3763,8 +3773,8 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) case IDC_COMBO_HFONTSIZE : case IDC_COMBO_FFONTSIZE : { - const size_t intStrLen = 3; - TCHAR intStr[intStrLen]; + constexpr size_t intStrLen = 3; + TCHAR intStr[intStrLen]{}; auto lbTextLen = ::SendDlgItemMessage(_hSelf, LOWORD(wParam), CB_GETLBTEXTLEN, iSel, 0); if (static_cast(lbTextLen) >= intStrLen) @@ -3781,10 +3791,15 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) } break; - case IDC_COMBO_VARLIST : + case IDC_COMBO_VARLIST: { + break; + } + + default: + { + break; } - break; } return TRUE; @@ -3842,8 +3857,8 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM) size_t selEnd = 0; ::SendDlgItemMessage(_hSelf, _focusedEditCtrl, EM_GETSEL, reinterpret_cast(&selStart), reinterpret_cast(&selEnd)); - const int stringSize = 256; - TCHAR str[stringSize]; + constexpr int stringSize = 256; + TCHAR str[stringSize]{}; ::SendDlgItemMessage(_hSelf, _focusedEditCtrl, WM_GETTEXT, stringSize, reinterpret_cast(str)); generic_string str2Set(str); @@ -3977,8 +3992,8 @@ intptr_t CALLBACK BackupSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM case IDC_BACKUPDIR_RESTORESESSION_EDIT: { - const int stringSize = 16; - TCHAR str[stringSize]; + constexpr int stringSize = 16; + TCHAR str[stringSize]{}; ::GetDlgItemText(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, str, stringSize); @@ -4002,8 +4017,8 @@ intptr_t CALLBACK BackupSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM case IDC_BACKUPDIR_RESTORESESSION_EDIT: { //printStr(TEXT("")); - const int stringSize = 16; - TCHAR str[stringSize]; + constexpr int stringSize = 16; + TCHAR str[stringSize]{}; ::GetDlgItemText(_hSelf, IDC_BACKUPDIR_RESTORESESSION_EDIT, str, stringSize); @@ -4453,7 +4468,7 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam, case IDD_AUTOC_QUOTESCHECK : { bool isChecked = isCheckedOrNot(static_cast(wParam)); - const TCHAR *label; + const TCHAR *label = nullptr; if (wParam == IDD_AUTOCPARENTHESES_CHECK) { nppGUI._matchedPairConf._doParentheses = isChecked; @@ -4558,8 +4573,8 @@ intptr_t CALLBACK MultiInstanceSubDlg::run_dlgProc(UINT message, WPARAM wParam, { if (HIWORD(wParam) == EN_CHANGE && LOWORD(wParam) == IDC_DATETIMEFORMAT_EDIT) { - const size_t inputLen = 256; - TCHAR input[inputLen]; + constexpr size_t inputLen = 256; + TCHAR input[inputLen]{}; ::GetDlgItemText(_hSelf, IDC_DATETIMEFORMAT_EDIT, input, inputLen); nppGUI._dateTimeFormat = input; @@ -4775,10 +4790,10 @@ intptr_t CALLBACK DelimiterSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR // // Delimiter // - TCHAR opener[2]; + TCHAR opener[2]{}; opener[0] = nppGUI._leftmostDelimiter; opener[1] = '\0'; - TCHAR closer[2]; + TCHAR closer[2]{}; closer[0] = nppGUI._rightmostDelimiter; closer[1] = '\0'; bool onSeveralLines = nppGUI._delimiterSelectionOnEntireDocument; @@ -5185,8 +5200,8 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L { case IDC_EDIT_PERFORMANCE_FILESIZE: { - const int stringSize = 16; - TCHAR str[stringSize]; + constexpr int stringSize = 16; + TCHAR str[stringSize]{}; ::GetDlgItemText(_hSelf, IDC_EDIT_PERFORMANCE_FILESIZE, str, stringSize); @@ -5212,8 +5227,8 @@ intptr_t CALLBACK PerformanceSubDlg::run_dlgProc(UINT message , WPARAM wParam, L { case IDC_EDIT_PERFORMANCE_FILESIZE: { - const int stringSize = 16; - TCHAR str[stringSize]; + constexpr int stringSize = 16; + TCHAR str[stringSize]{}; ::GetDlgItemText(_hSelf, IDC_EDIT_PERFORMANCE_FILESIZE, str, stringSize); if (lstrcmp(str, TEXT("")) == 0) diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index a5aa95dfe..f795df3c2 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -29,7 +29,7 @@ public : MiscSubDlg() = default; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class GeneralSubDlg : public StaticDialog @@ -39,7 +39,7 @@ public : void setTabbarAlternateIcons(bool enable = false); private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class EditingSubDlg : public StaticDialog @@ -98,7 +98,7 @@ private: ColourPicker* _pHotEdgeColorPicker = nullptr; ColourPicker* _pDisabledEdgeColorPicker = nullptr; - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; void enableCustomizedColorCtrls(bool doEnable); void move2CtrlLeft(int ctrlID, HWND handle2Move, int handle2MoveWidth, int handle2MoveHeight); }; @@ -131,7 +131,7 @@ private : ::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, BST_UNCHECKED, 0); ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), doIt); }; - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class DefaultDirectorySubDlg : public StaticDialog @@ -140,7 +140,7 @@ public : DefaultDirectorySubDlg() = default; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class RecentFilesHistorySubDlg : public StaticDialog @@ -159,7 +159,7 @@ public : private : LexerStylerArray _lsArray; - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; std::vector _langList; }; @@ -170,7 +170,7 @@ public : private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; @@ -180,7 +180,7 @@ public: SearchingSubDlg() = default; private: - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class PrintSubDlg : public StaticDialog @@ -189,7 +189,7 @@ public : PrintSubDlg() = default; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; std::vector varList; int _focusedEditCtrl = 0; }; @@ -202,7 +202,7 @@ public : private : void updateBackupSessionGUI(); void updateBackupOnSaveGUI(); - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; @@ -211,7 +211,7 @@ class AutoCompletionSubDlg : public StaticDialog public : AutoCompletionSubDlg() = default; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class MultiInstanceSubDlg : public StaticDialog @@ -221,7 +221,7 @@ public : private : const SYSTEMTIME _BTTF_time = {1985, 10, 6, 26, 16, 24, 42, 0}; - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class DelimiterSubDlg : public StaticDialog @@ -241,7 +241,7 @@ private : RECT _closerLabelRect = {}; HWND _tip = nullptr; - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; void detectSpace(const char *text2Check, int & nbSp, int & nbTab) const; generic_string getWarningText(size_t nbSp, size_t nbTab) const; void setWarningIfNeed() const; @@ -253,7 +253,7 @@ public : CloudAndLinkSubDlg() = default; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class SearchEngineSubDlg : public StaticDialog @@ -262,7 +262,7 @@ public : SearchEngineSubDlg() = default; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; }; class PerformanceSubDlg : public StaticDialog @@ -276,7 +276,7 @@ public : }; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; HWND _largeFileRestrictionTip = nullptr; }; @@ -288,18 +288,15 @@ friend class Notepad_plus; public : PreferenceDlg() = default; - void init(HINSTANCE hInst, HWND parent) { - Window::init(hInst, parent); - }; - - void doDialog(bool isRTL = false) { - if (!isCreated()) + void doDialog(bool isRTL = false) { + if (!isCreated()) { create(IDD_PREFERENCE_BOX, isRTL); - goToCenter(); + goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE); } - display(); - }; + display(); + }; + bool renameDialogTitle(const TCHAR *internalName, const TCHAR *newName); int getListSelectedIndex() const { @@ -311,10 +308,10 @@ public : bool goToSection(size_t iPage, intptr_t ctrlID = -1); - virtual void destroy(); + void destroy() override; private : - intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam); + intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override; void makeCategoryList(); int32_t getIndexFromName(const TCHAR *name) const; void showDialogByIndex(size_t index) const; diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index ce5a56607..b993c13ec 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -368,7 +368,7 @@ #define IDC_BUTTON_ADDVAR (IDD_PREFERENCE_PRINT2_BOX + 23) #define IDC_COMBO_VARLIST (IDD_PREFERENCE_PRINT2_BOX + 24) #define IDC_VAR_STATIC (IDD_PREFERENCE_PRINT2_BOX + 25) - #define IDC_VIEWPANEL_STATIC (IDD_PREFERENCE_PRINT2_BOX + 26) + #define IDC_EDIT_VIEWPANEL (IDD_PREFERENCE_PRINT2_BOX + 26) #define IDC_WHICHPART_STATIC (IDD_PREFERENCE_PRINT2_BOX + 27) #define IDC_HEADERFPPTER_GR_STATIC (IDD_PREFERENCE_PRINT2_BOX + 28)