Reorganize "Editing" sections in Preferences dialog

pull/14797/head
Don Ho 2024-02-26 01:52:27 +01:00
parent ce8fb873a6
commit 12548b6abb
10 changed files with 331 additions and 287 deletions

View File

@ -970,7 +970,8 @@ Translation note:
<Item id="6123" name="Localization"/>
</Global>
<Scintillas title="Editing">
<Scintillas title="Editing 1">
<Item id="6216" name="Caret Settings"/>
<Item id="6217" name="Width:"/>
<Item id="6219" name="Blink rate:"/>
@ -992,6 +993,12 @@ Translation note:
<Item id="6653" name="Highlight Background"/>
<Item id="6654" name="Frame"/>
<Item id="6655" name="Width:"/>
</Scintillas>
<Scintillas2 title="Editing 2">
<Item id="6521" name="Multi-Editing"/>
<Item id="6522" name="Enable Multi-Editing (Ctrl+Mouse click/selection)"/>
<Item id="6523" name="Enable Column Selection to Multi-Editing"/>
<Item id="6247" name="EOL (CRLF)"/><!-- Don't translate "(CRLF)" -->
<Item id="6248" name="Default"/>
<Item id="6249" name="Plain Text"/>
@ -1001,7 +1008,8 @@ Translation note:
<Item id="6255" name="Codepoint"/>
<Item id="6256" name="Custom Color"/>
<Item id="6258" name="Apply to C0, C1 &amp;&amp; Unicode EOL"/>
</Scintillas>
<Item id="6259" name="Prevent control character (C0 code) typing into document"/>
</Scintillas2>
<DarkMode title="Dark Mode">
<Item id="7131" name="Light mode"/>
@ -1085,6 +1093,7 @@ You can define several column markers by using white space to separate the diffe
<Item id="4009" name="Supported extensions:"/>
<Item id="4010" name="Registered extensions:"/>
</FileAssoc>
<Language title="Language">
<Item id="6505" name="Available items"/>
<Item id="6506" name="Disabled items"/>

View File

@ -970,6 +970,7 @@ Translation note:
<Item id="6123" name="Localization"/>
</Global>
<Scintillas title="Editing">
<Item id="6216" name="Caret Settings"/>
<Item id="6217" name="Width:"/>
@ -992,6 +993,12 @@ Translation note:
<Item id="6653" name="Highlight Background"/>
<Item id="6654" name="Frame"/>
<Item id="6655" name="Width:"/>
</Scintillas>
<Scintillas2 title="Editing 2">
<Item id="6521" name="Multi-Editing"/>
<Item id="6522" name="Enable Multi-Editing (Ctrl+Mouse click/selection)"/>
<Item id="6523" name="Enable Column Selection to Multi-Editing"/>
<Item id="6247" name="EOL (CRLF)"/><!-- Don't translate "(CRLF)" -->
<Item id="6248" name="Default"/>
<Item id="6249" name="Plain Text"/>
@ -1001,7 +1008,8 @@ Translation note:
<Item id="6255" name="Codepoint"/>
<Item id="6256" name="Custom Color"/>
<Item id="6258" name="Apply to C0, C1 &amp;&amp; Unicode EOL"/>
</Scintillas>
<Item id="6259" name="Prevent control character (C0 code) typing into document"/>
</Scintillas2>
<DarkMode title="Dark Mode">
<Item id="7131" name="Light mode"/>

View File

@ -970,7 +970,7 @@ Translation note:
<Item id="6123" name="Langue"/>
</Global>
<Scintillas title="Zones d'édition">
<Scintillas title="Zones d'édition 1">
<Item id="6216" name="Curseur"/>
<Item id="6217" name="Largeur :"/>
<Item id="6219" name="Clignotement :"/>
@ -992,6 +992,11 @@ Translation note:
<Item id="6653" name="Colorer larrière-plan"/>
<Item id="6654" name="Tracer la bordure"/>
<Item id="6655" name="Épaisseur :"/>
</Scintillas>
<Scintillas2 title="Zones d'édition 2">
<Item id="6521" name="Multi-édition"/>
<Item id="6522" name="Activer Multi-édition (Ctrl+Clic/sélection)"/>
<Item id="6523" name="Activer colonne-sélection vers multi-édition"/>
<Item id="6247" name="Saut de ligne (CRLF)"/><!-- Don't translate "(CRLF)" -->
<Item id="6248" name="Défaut"/>
<Item id="6249" name="Texte brut"/>
@ -1001,8 +1006,8 @@ Translation note:
<Item id="6255" name="Point de code"/>
<Item id="6256" name="Couleur personnalisée"/>
<Item id="6258" name="Appliquer à C0, C1 &amp; Unicode EOL"/>
</Scintillas>
<Item id="6259" name="Empêcher la saisie de caractères de contrôle (code C0) dans le document"/>
</Scintillas2>
<DarkMode title="Mode Sombre">
<Item id="7131" name="Mode lumineux"/>
<Item id="7132" name="Mode sombre"/>

View File

@ -928,7 +928,7 @@
<Item id="6127" name="停用副檔名欄"/>
</Global>
<Scintillas title="編輯">
<Scintillas title="編輯">
<Item id="6216" name="游標設定"/>
<Item id="6217" name="寬度:"/>
<Item id="6219" name="閃爍頻率:"/>
@ -950,11 +950,23 @@
<Item id="6653" name="加上背景顏色"/>
<Item id="6654" name="加上邊緣線"/>
<Item id="6655" name="粗細度:"/>
</Scintillas>
<Scintillas2 title="編輯二">
<Item id="6521" name="多位同時編輯"/>
<Item id="6522" name="啟用多個位置同時編輯Ctrl + 滑鼠點擊/選取)"/>
<Item id="6523" name="啟用行列模式自動轉換到多位同時編輯"/>
<Item id="6247" name="換行字符CRLF"/>
<Item id="6248" name="內定"/>
<Item id="6249" name="純文字"/>
<Item id="6250" name="使用自訂顏色"/>
</Scintillas>
<Item id="6252" name="非列印字符"/>
<Item id="6254" name="縮寫"/>
<Item id="6255" name="代碼"/>
<Item id="6256" name="使用自訂顏色"/>
<Item id="6258" name="套用於 C0, C1 &amp;&amp; 萬國碼換行字符"/>
<Item id="6259" name="禁止控制字元C0 代碼)輸入文件"/>
</Scintillas2>
<DarkMode title="黑暗模式">
<Item id="7131" name="鮮明模式"/>

View File

@ -974,12 +974,12 @@ std::pair<intptr_t, intptr_t> WordStyleDlg::goToPreferencesSettings()
}
else if (style._styleDesc == TEXT("EOL custom color"))
{
result.first = 1;
result.first = 2;
result.second = IDC_CHECK_WITHCUSTOMCOLOR_CRLF;
}
else if (style._styleDesc == g_npcStyleName)
{
result.first = 1;
result.first = 2;
result.second = IDC_CHECK_NPC_COLOR;
}

View File

@ -83,50 +83,51 @@ BEGIN
CONTROL "",IDC_CARETLINEFRAME_WIDTH_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,68,59,57,13
LTEXT "1",IDC_CARETLINEFRAME_WIDTH_DISPLAY,127,60,12,8
GROUPBOX "EOL (CRLF)",IDC_GB_STATIC_CRLF,11,83,150,59,BS_CENTER
CONTROL "Default",IDC_RADIO_ROUNDCORNER_CRLF,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP,17,96,100,10
CONTROL "Plain Text",IDC_RADIO_PLEINTEXT_CRLF,"Button",BS_AUTORADIOBUTTON,17,111,100,10
CONTROL "Custom Color",IDC_CHECK_WITHCUSTOMCOLOR_CRLF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,17,127,100,10
PUSHBUTTON "...",IDC_BUTTON_LAUNCHSTYLECONF_CRLF,141,124,16,14
GROUPBOX "Caret Settings",IDC_CARETSETTING_STATIC,11,83,150,47,BS_CENTER
RTEXT "Width:",IDC_WIDTH_STATIC,30,99,37,8
COMBOBOX IDC_WIDTH_COMBO,73,97,40,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Blink rate:",IDC_BLINKRATE_STATIC,14,114,53,8
CONTROL "",IDC_CARETBLINKRATE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,81,113,57,13
LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,140,114,12,8
RTEXT "F",IDC_CARETBLINKRATE_F_STATIC,68,114,12,8
GROUPBOX "Caret Settings",IDC_CARETSETTING_STATIC,11,148,150,47,BS_CENTER
RTEXT "Width:",IDC_WIDTH_STATIC,30,164,37,8
COMBOBOX IDC_WIDTH_COMBO,73,162,40,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
RTEXT "Blink rate:",IDC_BLINKRATE_STATIC,14,179,53,8
CONTROL "",IDC_CARETBLINKRATE_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,81,178,57,13
LTEXT "S",IDC_CARETBLINKRATE_S_STATIC,140,179,12,8
RTEXT "F",IDC_CARETBLINKRATE_F_STATIC,68,179,12,8
GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,11,138,150,59,BS_CENTER
CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,16,151,68,10
CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,16,166,68,10
CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,16,181,68,10
GROUPBOX "Non-Printing Characters",IDC_GB_STATIC_NPC,171,3,188,74,BS_CENTER
PUSHBUTTON "?",IDC_BUTTON_NPC_NOTE,339,14,16,14,NOT WS_TABSTOP
CONTROL "Abbreviation",IDC_RADIO_NPC_ABBREVIATION,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP | WS_GROUP,177,16,110,10
CONTROL "Codepoint",IDC_RADIO_NPC_CODEPOINT,"Button",BS_AUTORADIOBUTTON,177,31,110,10
CONTROL "Custom Color",IDC_CHECK_NPC_COLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,47,110,10
PUSHBUTTON "...",IDC_BUTTON_NPC_LAUNCHSTYLECONF,339,44,16,14
CONTROL "Apply to C0, C1 && Unicode EOL",IDC_CHECK_NPC_INCLUDECCUNIEOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,177,62,178,10
GROUPBOX "Line Wrap",IDC_LW_GB_STATIC,369,3,80,59,BS_CENTER
CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,375,16,68,10
CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,375,31,68,10
CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,375,46,68,10
CONTROL "Enable smooth font",IDC_CHECK_SMOOTHFONT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,88,270,10
CONTROL "Enable virtual space",IDC_CHECK_VIRTUALSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,103,270,10
CONTROL "Make current level folding/unfolding commands toggleable",IDC_CHECK_FOLDINGTOGGLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,118,270,10
CONTROL "Keep selection when right-click outside of selection", IDC_CHECK_RIGHTCLICKKEEPSSELECTION, "Button", BS_AUTOCHECKBOX | WS_TABSTOP, 173, 133, 270, 10
CONTROL "Enable scrolling beyond last line",IDC_CHECK_SCROLLBEYONDLASTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,148,270,10
CONTROL "Disable advanced scrolling feature due to touchpad issue",IDC_CHECK_DISABLEADVANCEDSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,163,270,10
CONTROL "Enable Copy/Cut Line without selection",IDC_CHECK_LINECUTCOPYWITHOUTSELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,178,270,10
CONTROL "Enable smooth font",IDC_CHECK_SMOOTHFONT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,13,270,10
CONTROL "Enable virtual space",IDC_CHECK_VIRTUALSPACE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,28,270,10
CONTROL "Make current level folding/unfolding commands toggleable",IDC_CHECK_FOLDINGTOGGLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,43,270,10
CONTROL "Keep selection when right-click outside of selection",IDC_CHECK_RIGHTCLICKKEEPSSELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,58,270,10
CONTROL "Enable scrolling beyond last line",IDC_CHECK_SCROLLBEYONDLASTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,73,270,10
CONTROL "Disable advanced scrolling feature due to touchpad issue",IDC_CHECK_DISABLEADVANCEDSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,88,270,10
CONTROL "Enable Copy/Cut Line without selection",IDC_CHECK_LINECUTCOPYWITHOUTSELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,173,103,270,10
END
IDD_PREFERENCE_SUB_EDITING2 DIALOGEX 115, 10, 460, 205
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
GROUPBOX "Multi-Editing",IDC_GB_STATIC_MULTIEDITING,80,25,290,50,BS_CENTER
CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,85,40,270,10
CONTROL "Enable Column Selection to Multi-Editing",IDC_CHECK_COLUMN2MULTIEDITING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,97,55,270,10
GROUPBOX "Multi-Editing",IDC_GB_STATIC_MULTIEDITING,12,13,290,59,BS_CENTER
CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,31,270,10
CONTROL "Enable Column Selection to Multi-Editing",IDC_CHECK_COLUMN2MULTIEDITING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,46,270,10
GROUPBOX "EOL (CRLF)",IDC_GB_STATIC_CRLF,318,13,131,59,BS_CENTER
CONTROL "Default",IDC_RADIO_ROUNDCORNER_CRLF,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,324,23,100,10
CONTROL "Plain Text",IDC_RADIO_PLEINTEXT_CRLF,"Button",BS_AUTORADIOBUTTON,324,37,100,10
CONTROL "Custom Color",IDC_CHECK_WITHCUSTOMCOLOR_CRLF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,324,57,100,10
PUSHBUTTON "...",IDC_BUTTON_LAUNCHSTYLECONF_CRLF,429,54,16,14
GROUPBOX "Non-Printing Characters",IDC_GB_STATIC_NPC,12,83,290,106,BS_CENTER
GROUPBOX "",IDC_STATIC,21,92,200,63,BS_CENTER
CONTROL "Abbreviation",IDC_RADIO_NPC_ABBREVIATION,"Button",BS_AUTORADIOBUTTON | WS_GROUP | WS_TABSTOP,33,101,110,10
PUSHBUTTON "?",IDC_BUTTON_NPC_NOTE,147,99,16,14,NOT WS_TABSTOP
CONTROL "Codepoint",IDC_RADIO_NPC_CODEPOINT,"Button",BS_AUTORADIOBUTTON,33,115,110,10
CONTROL "Custom Color",IDC_CHECK_NPC_COLOR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,33,132,110,10
PUSHBUTTON "...",IDC_BUTTON_NPC_LAUNCHSTYLECONF,147,129,16,14
CONTROL "Apply to C0, C1 && Unicode EOL",IDC_CHECK_NPC_INCLUDECCUNIEOL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,152,178,10
//CONTROL "Prevent control character (C0 code) typing into document",IDC_CHECK_NPC_NOC0CODETYPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,18,173,281,10
END

View File

@ -238,10 +238,10 @@ intptr_t CALLBACK PreferenceDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
{
NppDarkMode::autoThemeChildControls(_hSelf);
if (_editingSubDlg._tip != nullptr)
NppDarkMode::setDarkTooltips(_editingSubDlg._tip, NppDarkMode::ToolTipsType::tooltip);
if (_editing2SubDlg._tip != nullptr)
NppDarkMode::setDarkTooltips(_editing2SubDlg._tip, NppDarkMode::ToolTipsType::tooltip);
for (auto& tip : _editingSubDlg._tips)
for (auto& tip : _editing2SubDlg._tips)
{
if (tip != nullptr)
{
@ -973,102 +973,6 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
::SendMessage(::GetDlgItem(_hSelf, IDC_CARETLINEFRAME_WIDTH_SLIDER), TBM_SETPOS, TRUE, svp._currentLineFrameWidth);
::SetDlgItemInt(_hSelf, IDC_CARETLINEFRAME_WIDTH_DISPLAY, svp._currentLineFrameWidth, FALSE);
// defaul => (svp._eolMode == svp.roundedRectangleText)
bool checkDefaultCRLF = true;
bool checkPlainTextCRLF = false;
bool checkWithColorCRLF = false;
if (svp._eolMode == svp.plainText)
{
checkDefaultCRLF = false;
checkPlainTextCRLF = true;
checkWithColorCRLF = false;
}
else if (svp._eolMode == svp.plainTextCustomColor)
{
checkDefaultCRLF = false;
checkPlainTextCRLF = true;
checkWithColorCRLF = true;
}
else if (svp._eolMode == svp.roundedRectangleTextCustomColor)
{
checkDefaultCRLF = true;
checkPlainTextCRLF = false;
checkWithColorCRLF = true;
}
::SendDlgItemMessage(_hSelf, IDC_RADIO_ROUNDCORNER_CRLF, BM_SETCHECK, checkDefaultCRLF, 0);
::SendDlgItemMessage(_hSelf, IDC_RADIO_PLEINTEXT_CRLF, BM_SETCHECK, checkPlainTextCRLF, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_WITHCUSTOMCOLOR_CRLF, BM_SETCHECK, checkWithColorCRLF, 0);
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
generic_string tip2show = pNativeSpeaker->getLocalizedStrFromID("eol-custom-color-tip", TEXT("Go to Style Configurator to change the default EOL custom color (\"EOL custom color\")."));
_tip = CreateToolTip(IDC_BUTTON_LAUNCHSTYLECONF_CRLF, _hSelf, _hInst, const_cast<PTSTR>(tip2show.c_str()), pNativeSpeaker->isRTL());
const bool isNpcModeAbbrv = svp._npcMode == svp.abbreviation;
setChecked(IDC_RADIO_NPC_ABBREVIATION, isNpcModeAbbrv);
setChecked(IDC_RADIO_NPC_CODEPOINT, !isNpcModeAbbrv);
setChecked(IDC_CHECK_NPC_COLOR, svp._npcCustomColor);
setChecked(IDC_CHECK_NPC_INCLUDECCUNIEOL, svp._npcIncludeCcUniEol);
generic_string tipNote2Show = pNativeSpeaker->getLocalizedStrFromID("npcNote-tip",
L"Representation of selected \"non-ASCII\" whitespace and non-printing (control) characters.\n\n"\
L"NOTE:\n"\
L"Using representation will disable character effects on text.\n\n"\
L"For the full list of selected whitespace and non-printing characters check User Manual.\n\n"\
L"Click on this button to open website with User Manual.");
generic_string tipAb2Show = pNativeSpeaker->getLocalizedStrFromID("npcAbbreviation-tip",
L"Abbreviation : name\n"\
L"NBSP : no-break space\n"\
L"ZWSP : zero-width space\n"\
L"ZWNBSP : zero-width no-break space\n\n"\
L"For the full list check User Manual.\n"\
L"Click on \"?\" button on right to open website with User Manual.");
generic_string tipCp2Show = pNativeSpeaker->getLocalizedStrFromID("npcCodepoint-tip",
L"Codepoint : name\n"\
L"U+00A0 : no-break space\n"\
L"U+200B : zero-width space\n"\
L"U+FEFF : zero-width no-break space\n\n"\
L"For the full list check User Manual.\n"\
L"Click on \"?\" button on right to open website with User Manual.");
generic_string tipNpcCol2show = pNativeSpeaker->getLocalizedStrFromID("npcCustomColor-tip",
L"Go to Style Configurator to change the default custom color for selected whitespace and non-printing characters (\"Non-printing characters custom color\").");
generic_string tipNpcInc2show = pNativeSpeaker->getLocalizedStrFromID("npcIncludeCcUniEol-tip",
L"Apply non-printing characters appearance settings to C0, C1 control and Unicode EOL (next line, line separator and paragraph separator) characters.");
_tipNote = CreateToolTip(IDC_BUTTON_NPC_NOTE, _hSelf, _hInst, const_cast<PTSTR>(tipNote2Show.c_str()), pNativeSpeaker->isRTL());
_tipAbb = CreateToolTip(IDC_RADIO_NPC_ABBREVIATION, _hSelf, _hInst, const_cast<PTSTR>(tipAb2Show.c_str()), pNativeSpeaker->isRTL());
_tipCodepoint = CreateToolTip(IDC_RADIO_NPC_CODEPOINT, _hSelf, _hInst, const_cast<PTSTR>(tipCp2Show.c_str()), pNativeSpeaker->isRTL());
_tipNpcColor = CreateToolTip(IDC_BUTTON_NPC_LAUNCHSTYLECONF, _hSelf, _hInst, const_cast<PTSTR>(tipNpcCol2show.c_str()), pNativeSpeaker->isRTL());
_tipNpcInclude = CreateToolTip(IDC_CHECK_NPC_INCLUDECCUNIEOL, _hSelf, _hInst, const_cast<PTSTR>(tipNpcInc2show.c_str()), pNativeSpeaker->isRTL());
_tips.push_back(_tipNote);
_tips.push_back(_tipAbb);
_tips.push_back(_tipCodepoint);
_tips.push_back(_tipNpcColor);
_tips.push_back(_tipNpcInclude);
for (auto& tip : _tips)
{
if (tip != nullptr)
{
::SendMessage(tip, TTM_SETMAXTIPWIDTH, 0, 260);
}
}
if (_tipNote != nullptr)
{
// Make tip stay 30 seconds
::SendMessage(_tipNote, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELPARAM((30000), (0)));
}
initScintParam();
return TRUE;
@ -1159,6 +1063,229 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
changeLineHiliteMode(true);
return TRUE;
case IDC_CHECK_VIRTUALSPACE:
svp._virtualSpace = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_VIRTUALSPACE, BM_GETCHECK, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_VIRTUALSPACE, 0, 0);
return TRUE;
case IDC_CHECK_SCROLLBEYONDLASTLINE:
svp._scrollBeyondLastLine = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_SCROLLBEYONDLASTLINE, BM_GETCHECK, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SCROLLBEYONDLASTLINE, 0, 0);
return TRUE;
case IDC_CHECK_LINECUTCOPYWITHOUTSELECTION:
{
bool isChecked = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_LINECUTCOPYWITHOUTSELECTION, BM_GETCHECK, 0, 0);
svp._lineCopyCutWithoutSelection = isChecked;
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_LINECUTCOPYWITHOUTSELECTION, 0, 0);
return TRUE;
}
case IDC_CHECK_RIGHTCLICKKEEPSSELECTION:
svp._rightClickKeepsSelection = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_RIGHTCLICKKEEPSSELECTION, BM_GETCHECK, 0, 0));
return TRUE;
case IDC_CHECK_DISABLEADVANCEDSCROLL:
svp._disableAdvancedScrolling = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_DISABLEADVANCEDSCROLL, BM_GETCHECK, 0, 0));
return TRUE;
case IDC_CHECK_FOLDINGTOGGLE:
nppGUI._enableFoldCmdToggable = isCheckedOrNot(IDC_CHECK_FOLDINGTOGGLE);
return TRUE;
case IDC_RADIO_LWDEF:
svp._lineWrapMethod = LINEWRAP_DEFAULT;
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWDEF, 0);
return TRUE;
case IDC_RADIO_LWALIGN:
svp._lineWrapMethod = LINEWRAP_ALIGNED;
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWALIGN, 0);
return TRUE;
case IDC_RADIO_LWINDENT:
svp._lineWrapMethod = LINEWRAP_INDENT;
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWINDENT, 0);
return TRUE;
default :
switch (HIWORD(wParam))
{
case CBN_SELCHANGE : // == case LBN_SELCHANGE :
{
if (LOWORD(wParam) == IDC_WIDTH_COMBO)
{
nppGUI._caretWidth = static_cast<int32_t>(::SendDlgItemMessage(_hSelf, IDC_WIDTH_COMBO, CB_GETCURSEL, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETCARETWIDTH, 0, 0);
return TRUE;
}
}
break;
}
}
}
}
return FALSE;
}
intptr_t CALLBACK Editing2SubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM /*lParam*/)
{
NppParameters& nppParam = NppParameters::getInstance();
ScintillaViewParams& svp = (ScintillaViewParams&)nppParam.getSVP();
switch (message)
{
case WM_INITDIALOG:
{
// defaul => (svp._eolMode == svp.roundedRectangleText)
bool checkDefaultCRLF = true;
bool checkPlainTextCRLF = false;
bool checkWithColorCRLF = false;
if (svp._eolMode == svp.plainText)
{
checkDefaultCRLF = false;
checkPlainTextCRLF = true;
checkWithColorCRLF = false;
}
else if (svp._eolMode == svp.plainTextCustomColor)
{
checkDefaultCRLF = false;
checkPlainTextCRLF = true;
checkWithColorCRLF = true;
}
else if (svp._eolMode == svp.roundedRectangleTextCustomColor)
{
checkDefaultCRLF = true;
checkPlainTextCRLF = false;
checkWithColorCRLF = true;
}
::SendDlgItemMessage(_hSelf, IDC_RADIO_ROUNDCORNER_CRLF, BM_SETCHECK, checkDefaultCRLF, 0);
::SendDlgItemMessage(_hSelf, IDC_RADIO_PLEINTEXT_CRLF, BM_SETCHECK, checkPlainTextCRLF, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_WITHCUSTOMCOLOR_CRLF, BM_SETCHECK, checkWithColorCRLF, 0);
NppParameters& nppParam = NppParameters::getInstance();
ScintillaViewParams& svp = const_cast<ScintillaViewParams&>(nppParam.getSVP());
::SendDlgItemMessage(_hSelf, IDC_CHECK_MULTISELECTION, BM_SETCHECK, svp._multiSelection, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING, BM_SETCHECK, svp._columnSel2MultiEdit, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING), svp._multiSelection);
NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker();
generic_string tip2show = pNativeSpeaker->getLocalizedStrFromID("eol-custom-color-tip", TEXT("Go to Style Configurator to change the default EOL custom color (\"EOL custom color\")."));
_tip = CreateToolTip(IDC_BUTTON_LAUNCHSTYLECONF_CRLF, _hSelf, _hInst, const_cast<PTSTR>(tip2show.c_str()), pNativeSpeaker->isRTL());
const bool isNpcModeAbbrv = svp._npcMode == svp.abbreviation;
setChecked(IDC_RADIO_NPC_ABBREVIATION, isNpcModeAbbrv);
setChecked(IDC_RADIO_NPC_CODEPOINT, !isNpcModeAbbrv);
setChecked(IDC_CHECK_NPC_COLOR, svp._npcCustomColor);
setChecked(IDC_CHECK_NPC_INCLUDECCUNIEOL, svp._npcIncludeCcUniEol);
generic_string tipNote2Show = pNativeSpeaker->getLocalizedStrFromID("npcNote-tip",
L"Representation of selected \"non-ASCII\" whitespace and non-printing (control) characters.\n\n"\
L"NOTE:\n"\
L"Using representation will disable character effects on text.\n\n"\
L"For the full list of selected whitespace and non-printing characters check User Manual.\n\n"\
L"Click on this button to open website with User Manual.");
generic_string tipAb2Show = pNativeSpeaker->getLocalizedStrFromID("npcAbbreviation-tip",
L"Abbreviation : name\n"\
L"NBSP : no-break space\n"\
L"ZWSP : zero-width space\n"\
L"ZWNBSP : zero-width no-break space\n\n"\
L"For the full list check User Manual.\n"\
L"Click on \"?\" button on right to open website with User Manual.");
generic_string tipCp2Show = pNativeSpeaker->getLocalizedStrFromID("npcCodepoint-tip",
L"Codepoint : name\n"\
L"U+00A0 : no-break space\n"\
L"U+200B : zero-width space\n"\
L"U+FEFF : zero-width no-break space\n\n"\
L"For the full list check User Manual.\n"\
L"Click on \"?\" button on right to open website with User Manual.");
generic_string tipNpcCol2show = pNativeSpeaker->getLocalizedStrFromID("npcCustomColor-tip",
L"Go to Style Configurator to change the default custom color for selected whitespace and non-printing characters (\"Non-printing characters custom color\").");
generic_string tipNpcInc2show = pNativeSpeaker->getLocalizedStrFromID("npcIncludeCcUniEol-tip",
L"Apply non-printing characters appearance settings to C0, C1 control and Unicode EOL (next line, line separator and paragraph separator) characters.");
_tipNote = CreateToolTip(IDC_BUTTON_NPC_NOTE, _hSelf, _hInst, const_cast<PTSTR>(tipNote2Show.c_str()), pNativeSpeaker->isRTL());
_tipAbb = CreateToolTip(IDC_RADIO_NPC_ABBREVIATION, _hSelf, _hInst, const_cast<PTSTR>(tipAb2Show.c_str()), pNativeSpeaker->isRTL());
_tipCodepoint = CreateToolTip(IDC_RADIO_NPC_CODEPOINT, _hSelf, _hInst, const_cast<PTSTR>(tipCp2Show.c_str()), pNativeSpeaker->isRTL());
_tipNpcColor = CreateToolTip(IDC_BUTTON_NPC_LAUNCHSTYLECONF, _hSelf, _hInst, const_cast<PTSTR>(tipNpcCol2show.c_str()), pNativeSpeaker->isRTL());
_tipNpcInclude = CreateToolTip(IDC_CHECK_NPC_INCLUDECCUNIEOL, _hSelf, _hInst, const_cast<PTSTR>(tipNpcInc2show.c_str()), pNativeSpeaker->isRTL());
_tips.push_back(_tipNote);
_tips.push_back(_tipAbb);
_tips.push_back(_tipCodepoint);
_tips.push_back(_tipNpcColor);
_tips.push_back(_tipNpcInclude);
for (auto& tip : _tips)
{
if (tip != nullptr)
{
::SendMessage(tip, TTM_SETMAXTIPWIDTH, 0, 260);
}
}
if (_tipNote != nullptr)
{
// Make tip stay 30 seconds
::SendMessage(_tipNote, TTM_SETDELAYTIME, TTDT_AUTOPOP, MAKELPARAM((30000), (0)));
}
}
return TRUE;
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
{
if (NppDarkMode::isEnabled())
{
return TRUE;
}
break;
}
case WM_COMMAND:
{
NppParameters& nppParam = NppParameters::getInstance();
ScintillaViewParams& svp = const_cast<ScintillaViewParams&>(nppParam.getSVP());
switch (wParam)
{
case IDC_CHECK_MULTISELECTION:
{
svp._multiSelection = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_MULTISELECTION, BM_GETCHECK, 0, 0));
if (!svp._multiSelection)
{
::SendDlgItemMessage(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING, BM_SETCHECK, FALSE, 0);
svp._columnSel2MultiEdit = false;
}
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING), svp._multiSelection);
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETMULTISELCTION, 0, 0);
}
return TRUE;
case IDC_CHECK_COLUMN2MULTIEDITING:
{
svp._columnSel2MultiEdit = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING, BM_GETCHECK, 0, 0));
}
return TRUE;
case IDC_RADIO_ROUNDCORNER_CRLF:
case IDC_RADIO_PLEINTEXT_CRLF:
case IDC_CHECK_WITHCUSTOMCOLOR_CRLF:
@ -1243,131 +1370,6 @@ intptr_t CALLBACK EditingSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
::SendMessage(grandParent, NPPM_INTERNAL_SETNPC, IDC_CHECK_NPC_INCLUDECCUNIEOL, 0);
return TRUE;
}
case IDC_CHECK_VIRTUALSPACE:
svp._virtualSpace = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_VIRTUALSPACE, BM_GETCHECK, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_VIRTUALSPACE, 0, 0);
return TRUE;
case IDC_CHECK_SCROLLBEYONDLASTLINE:
svp._scrollBeyondLastLine = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_SCROLLBEYONDLASTLINE, BM_GETCHECK, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SCROLLBEYONDLASTLINE, 0, 0);
return TRUE;
case IDC_CHECK_LINECUTCOPYWITHOUTSELECTION:
{
bool isChecked = BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_LINECUTCOPYWITHOUTSELECTION, BM_GETCHECK, 0, 0);
svp._lineCopyCutWithoutSelection = isChecked;
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_LINECUTCOPYWITHOUTSELECTION, 0, 0);
return TRUE;
}
case IDC_CHECK_RIGHTCLICKKEEPSSELECTION:
svp._rightClickKeepsSelection = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_RIGHTCLICKKEEPSSELECTION, BM_GETCHECK, 0, 0));
return TRUE;
case IDC_CHECK_DISABLEADVANCEDSCROLL:
svp._disableAdvancedScrolling = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_DISABLEADVANCEDSCROLL, BM_GETCHECK, 0, 0));
return TRUE;
case IDC_CHECK_FOLDINGTOGGLE:
nppGUI._enableFoldCmdToggable = isCheckedOrNot(IDC_CHECK_FOLDINGTOGGLE);
return TRUE;
case IDC_RADIO_LWDEF:
svp._lineWrapMethod = LINEWRAP_DEFAULT;
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWDEF, 0);
return TRUE;
case IDC_RADIO_LWALIGN:
svp._lineWrapMethod = LINEWRAP_ALIGNED;
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWALIGN, 0);
return TRUE;
case IDC_RADIO_LWINDENT:
svp._lineWrapMethod = LINEWRAP_INDENT;
::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LWINDENT, 0);
return TRUE;
default :
switch (HIWORD(wParam))
{
case CBN_SELCHANGE : // == case LBN_SELCHANGE :
{
if (LOWORD(wParam) == IDC_WIDTH_COMBO)
{
nppGUI._caretWidth = static_cast<int32_t>(::SendDlgItemMessage(_hSelf, IDC_WIDTH_COMBO, CB_GETCURSEL, 0, 0));
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETCARETWIDTH, 0, 0);
return TRUE;
}
}
break;
}
}
}
}
return FALSE;
}
intptr_t CALLBACK Editing2SubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM /*lParam*/)
{
switch (message)
{
case WM_INITDIALOG:
{
NppParameters& nppParam = NppParameters::getInstance();
ScintillaViewParams& svp = const_cast<ScintillaViewParams&>(nppParam.getSVP());
::SendDlgItemMessage(_hSelf, IDC_CHECK_MULTISELECTION, BM_SETCHECK, svp._multiSelection, 0);
::SendDlgItemMessage(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING, BM_SETCHECK, svp._columnSel2MultiEdit, 0);
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING), svp._multiSelection);
}
return TRUE;
case WM_CTLCOLOREDIT:
{
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam));
}
case WM_CTLCOLORDLG:
case WM_CTLCOLORSTATIC:
{
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam));
}
case WM_PRINTCLIENT:
{
if (NppDarkMode::isEnabled())
{
return TRUE;
}
break;
}
case WM_COMMAND:
{
NppParameters& nppParam = NppParameters::getInstance();
ScintillaViewParams& svp = const_cast<ScintillaViewParams&>(nppParam.getSVP());
switch (wParam)
{
case IDC_CHECK_MULTISELECTION:
{
svp._multiSelection = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_MULTISELECTION, BM_GETCHECK, 0, 0));
if (!svp._multiSelection)
{
::SendDlgItemMessage(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING, BM_SETCHECK, FALSE, 0);
svp._columnSel2MultiEdit = false;
}
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING), svp._multiSelection);
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETMULTISELCTION, 0, 0);
}
return TRUE;
case IDC_CHECK_COLUMN2MULTIEDITING:
{
svp._columnSel2MultiEdit = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_COLUMN2MULTIEDITING, BM_GETCHECK, 0, 0));
}
return TRUE;
}
}
return TRUE;

View File

@ -47,7 +47,20 @@ class EditingSubDlg : public StaticDialog
friend class PreferenceDlg;
public :
EditingSubDlg() = default;
~EditingSubDlg() {
~EditingSubDlg() = default;
private :
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
void initScintParam();
void changeLineHiliteMode(bool enableSlider);
};
class Editing2SubDlg : public StaticDialog
{
friend class PreferenceDlg;
public :
Editing2SubDlg() = default;
~Editing2SubDlg() {
if (_tip != nullptr)
{
::DestroyWindow(_tip);
@ -64,7 +77,7 @@ public :
}
};
private :
private:
HWND _tip = nullptr;
HWND _tipNote = nullptr;
HWND _tipAbb = nullptr;
@ -73,20 +86,6 @@ private :
HWND _tipNpcInclude = nullptr;
std::vector<HWND> _tips;
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
void initScintParam();
void changeLineHiliteMode(bool enableSlider);
};
class Editing2SubDlg : public StaticDialog
{
friend class PreferenceDlg;
public :
Editing2SubDlg() = default;
~Editing2SubDlg() = default;
private:
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override;
};

View File

@ -166,6 +166,7 @@
#define IDC_CHECK_NPC_COLOR (IDD_PREFERENCE_SUB_EDITING + 56)
#define IDC_BUTTON_NPC_LAUNCHSTYLECONF (IDD_PREFERENCE_SUB_EDITING + 57)
#define IDC_CHECK_NPC_INCLUDECCUNIEOL (IDD_PREFERENCE_SUB_EDITING + 58)
#define IDC_CHECK_NPC_NOC0CODETYPING (IDD_PREFERENCE_SUB_EDITING + 59)
#define IDD_PREFERENCE_SUB_DELIMITER 6250 //(IDD_PREFERENCE_BOX + 250)
#define IDC_DELIMITERSETTINGS_GB_STATIC (IDD_PREFERENCE_SUB_DELIMITER + 1)

View File

@ -944,6 +944,13 @@ void NativeLangSpeaker::changePrefereceDlgLang(PreferenceDlg & preference)
preference.renameDialogTitle(TEXT("Scintillas"), nameW);
}
changeDlgLang(preference._editing2SubDlg.getHSelf(), "Scintillas2", titre, titreMaxSize);
if (titre[0] != '\0')
{
const wchar_t *nameW = wmc.char2wchar(titre, _nativeLangEncoding);
preference.renameDialogTitle(TEXT("Scintillas2"), nameW);
}
changeDlgLang(preference._darkModeSubDlg.getHSelf(), "DarkMode", titre, titreMaxSize);
if (titre[0] != '\0')
{