GUI Enhancement: Preference Print sub-dialog
- add initializers - reorder controls for tab focus - add accelerators - make comboboxes larger - replace variable static text with edit control - fix override warnings Fix #13601, fix #12812, close #13602pull/13616/head
parent
23a0cfb3aa
commit
6b194453b8
|
@ -1071,30 +1071,30 @@ You can define several column markers by using white space to separate the diffe
|
|||
</Highlighting>
|
||||
|
||||
<Print title="Print">
|
||||
<Item id="6601" name="Print line number"/>
|
||||
<Item id="6601" name="Print line n&umber"/>
|
||||
<Item id="6602" name="Color Options"/>
|
||||
<Item id="6603" name="WYSIWYG"/>
|
||||
<Item id="6604" name="Invert"/>
|
||||
<Item id="6605" name="Black on white"/>
|
||||
<Item id="6606" name="No background color"/>
|
||||
<Item id="6603" name="W&YSIWYG"/>
|
||||
<Item id="6604" name="I&nvert"/>
|
||||
<Item id="6605" name="Black on &white"/>
|
||||
<Item id="6606" name="No bac&kground color"/>
|
||||
<Item id="6607" name="Margin Settings (Unit:mm)"/>
|
||||
<Item id="6612" name="Left"/>
|
||||
<Item id="6613" name="Top"/>
|
||||
<Item id="6614" name="Right"/>
|
||||
<Item id="6615" name="Bottom"/>
|
||||
<Item id="6706" name="Bold"/>
|
||||
<Item id="6707" name="Italic"/>
|
||||
<Item id="6612" name="&Left"/>
|
||||
<Item id="6613" name="&Top"/>
|
||||
<Item id="6614" name="&Right"/>
|
||||
<Item id="6615" name="Botto&m"/>
|
||||
<Item id="6706" name="&Bold"/>
|
||||
<Item id="6707" name="&Italic"/>
|
||||
<Item id="6708" name="Header"/>
|
||||
<Item id="6709" name="Left part"/>
|
||||
<Item id="6710" name="Middle part"/>
|
||||
<Item id="6711" name="Right part"/>
|
||||
<Item id="6717" name="Bold"/>
|
||||
<Item id="6718" name="Italic"/>
|
||||
<Item id="6709" name="L&eft part"/>
|
||||
<Item id="6710" name="&Middle part"/>
|
||||
<Item id="6711" name="Ri&ght part"/>
|
||||
<Item id="6717" name="Bol&d"/>
|
||||
<Item id="6718" name="Itali&c"/>
|
||||
<Item id="6719" name="Footer"/>
|
||||
<Item id="6720" name="Left part"/>
|
||||
<Item id="6721" name="Middle part"/>
|
||||
<Item id="6722" name="Right part"/>
|
||||
<Item id="6723" name="Add"/>
|
||||
<Item id="6720" name="Le&ft part"/>
|
||||
<Item id="6721" name="Middle &part"/>
|
||||
<Item id="6722" name="Rig&ht part"/>
|
||||
<Item id="6723" name="&Add"/>
|
||||
<ComboBox id="6724">
|
||||
<Element name="Full file name path"/>
|
||||
<Element name="File name"/>
|
||||
|
@ -1104,7 +1104,7 @@ You can define several column markers by using white space to separate the diffe
|
|||
<Element name="Long date format"/>
|
||||
<Element name="Time"/>
|
||||
</ComboBox>
|
||||
<Item id="6725" name="Variable:"/>
|
||||
<Item id="6725" name="&Variable:"/>
|
||||
<Item id="6727" name="Here display your variable settings"/>
|
||||
<Item id="6728" name="Header and Footer"/>
|
||||
</Print>
|
||||
|
|
|
@ -1066,30 +1066,30 @@ You can define several column markers by using white space to separate the diffe
|
|||
</Highlighting>
|
||||
|
||||
<Print title="Print">
|
||||
<Item id="6601" name="Print line number"/>
|
||||
<Item id="6601" name="Print line n&umber"/>
|
||||
<Item id="6602" name="Color Options"/>
|
||||
<Item id="6603" name="WYSIWYG"/>
|
||||
<Item id="6604" name="Invert"/>
|
||||
<Item id="6605" name="Black on white"/>
|
||||
<Item id="6606" name="No background color"/>
|
||||
<Item id="6603" name="W&YSIWYG"/>
|
||||
<Item id="6604" name="I&nvert"/>
|
||||
<Item id="6605" name="Black on &white"/>
|
||||
<Item id="6606" name="No bac&kground color"/>
|
||||
<Item id="6607" name="Margin Settings (Unit:mm)"/>
|
||||
<Item id="6612" name="Left"/>
|
||||
<Item id="6613" name="Top"/>
|
||||
<Item id="6614" name="Right"/>
|
||||
<Item id="6615" name="Bottom"/>
|
||||
<Item id="6706" name="Bold"/>
|
||||
<Item id="6707" name="Italic"/>
|
||||
<Item id="6612" name="&Left"/>
|
||||
<Item id="6613" name="&Top"/>
|
||||
<Item id="6614" name="&Right"/>
|
||||
<Item id="6615" name="Botto&m"/>
|
||||
<Item id="6706" name="&Bold"/>
|
||||
<Item id="6707" name="&Italic"/>
|
||||
<Item id="6708" name="Header"/>
|
||||
<Item id="6709" name="Left part"/>
|
||||
<Item id="6710" name="Middle part"/>
|
||||
<Item id="6711" name="Right part"/>
|
||||
<Item id="6717" name="Bold"/>
|
||||
<Item id="6718" name="Italic"/>
|
||||
<Item id="6709" name="L&eft part"/>
|
||||
<Item id="6710" name="&Middle part"/>
|
||||
<Item id="6711" name="Ri&ght part"/>
|
||||
<Item id="6717" name="Bol&d"/>
|
||||
<Item id="6718" name="Itali&c"/>
|
||||
<Item id="6719" name="Footer"/>
|
||||
<Item id="6720" name="Left part"/>
|
||||
<Item id="6721" name="Middle part"/>
|
||||
<Item id="6722" name="Right part"/>
|
||||
<Item id="6723" name="Add"/>
|
||||
<Item id="6720" name="Le&ft part"/>
|
||||
<Item id="6721" name="Middle &part"/>
|
||||
<Item id="6722" name="Rig&ht part"/>
|
||||
<Item id="6723" name="&Add"/>
|
||||
<ComboBox id="6724">
|
||||
<Element name="Full file name path"/>
|
||||
<Element name="File name"/>
|
||||
|
@ -1099,7 +1099,7 @@ You can define several column markers by using white space to separate the diffe
|
|||
<Element name="Long date format"/>
|
||||
<Element name="Time"/>
|
||||
</ComboBox>
|
||||
<Item id="6725" name="Variable:"/>
|
||||
<Item id="6725" name="&Variable:"/>
|
||||
<Item id="6727" name="Here display your variable settings"/>
|
||||
<Item id="6728" name="Header and Footer"/>
|
||||
</Print>
|
||||
|
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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<HWND>(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<HDC>(wParam));
|
||||
}
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
{
|
||||
const auto hdcStatic = reinterpret_cast<HDC>(wParam);
|
||||
const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(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<LPARAM>(str));
|
||||
::SendDlgItemMessage(_hSelf, IDC_EDIT_VIEWPANEL, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(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<LPARAM>(str));
|
||||
::SendDlgItemMessage(_hSelf, IDC_EDIT_VIEWPANEL, WM_SETTEXT, 0, reinterpret_cast<LPARAM>(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<LPARAM>(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<size_t>(lbTextLen) >= intStrLen)
|
||||
|
@ -3781,11 +3791,16 @@ intptr_t CALLBACK PrintSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
|||
}
|
||||
break;
|
||||
|
||||
case IDC_COMBO_VARLIST :
|
||||
case IDC_COMBO_VARLIST:
|
||||
{
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
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<WPARAM>(&selStart), reinterpret_cast<LPARAM>(&selEnd));
|
||||
|
||||
const int stringSize = 256;
|
||||
TCHAR str[stringSize];
|
||||
constexpr int stringSize = 256;
|
||||
TCHAR str[stringSize]{};
|
||||
::SendDlgItemMessage(_hSelf, _focusedEditCtrl, WM_GETTEXT, stringSize, reinterpret_cast<LPARAM>(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<int32_t>(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)
|
||||
|
|
|
@ -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<LangMenuItem> _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<generic_string> 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())
|
||||
{
|
||||
create(IDD_PREFERENCE_BOX, isRTL);
|
||||
goToCenter();
|
||||
goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE);
|
||||
}
|
||||
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;
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue