diff --git a/PowerEditor/installer/nativeLang/english.xml b/PowerEditor/installer/nativeLang/english.xml index 21fca6f6d..c79528643 100644 --- a/PowerEditor/installer/nativeLang/english.xml +++ b/PowerEditor/installer/nativeLang/english.xml @@ -838,7 +838,10 @@ 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 3d57614a5..bb9ae20d1 100644 --- a/PowerEditor/installer/nativeLang/english_customizable.xml +++ b/PowerEditor/installer/nativeLang/english_customizable.xml @@ -835,7 +835,10 @@ - + + + + diff --git a/PowerEditor/installer/nativeLang/french.xml b/PowerEditor/installer/nativeLang/french.xml index 193921e87..36db6de08 100644 --- a/PowerEditor/installer/nativeLang/french.xml +++ b/PowerEditor/installer/nativeLang/french.xml @@ -800,20 +800,23 @@ - - - - - + + + + + + + + diff --git a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml index 7d2c75765..11b95a98f 100644 --- a/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml +++ b/PowerEditor/installer/nativeLang/taiwaneseMandarin.xml @@ -813,7 +813,10 @@ - + + + + diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index 58d6d963b..842d85a9e 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -1340,4 +1340,27 @@ void trim(generic_string& str) if (pos != generic_string::npos) str.erase(0, pos); } else str.erase(str.begin(), str.end()); -}; +} + +int nbDigitsFromNbLines(size_t nbLines) +{ + int nbDigits = 0; // minimum number of digit should be 4 + if (nbLines < 10) nbDigits = 1; + else if (nbLines < 100) nbDigits = 2; + else if (nbLines < 1000) nbDigits = 3; + else if (nbLines < 10000) nbDigits = 4; + else if (nbLines < 100000) nbDigits = 5; + else if (nbLines < 1000000) nbDigits = 6; + else // rare case + { + nbDigits = 7; + nbLines /= 1000000; + + while (nbLines) + { + nbLines /= 10; + ++nbDigits; + } + } + return nbDigits; +} diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index cd18ae13e..3a43308a7 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -235,3 +235,5 @@ template size_t vecRemoveDuplicates(std::vector& vec, bool isSort } void trim(generic_string& str); + +int nbDigitsFromNbLines(size_t nbLines); diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index c7462ad8e..aead46f51 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -436,6 +436,19 @@ enum Platform { PF_UNKNOWN, PF_X86, PF_X64, PF_IA64 }; // Users should call it with settingsCloudPath be NULL to get the required number of TCHAR (not including the terminating nul character), // allocate settingsCloudPath buffer with the return value + 1, then call it again to get the path. + #define NPPM_SETLINENUMBERWIDTHMODE (NPPMSG + 99) + #define LINENUMWIDTH_DYNAMIC 0 + #define LINENUMWIDTH_CONSTANT 1 + // BOOL NPPM_SETLINENUMBERWIDTHMODE(0, INT widthMode) + // Set line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + // It may help some plugins to disable non-dynamic line number margins width to have a smoothly visual effect while vertical scrolling the content in Notepad++ + // If calling is successful return TRUE, otherwise return FALSE. + + #define NPPM_GETLINENUMBERWIDTHMODE (NPPMSG + 100) + // INT NPPM_GETLINENUMBERWIDTHMODE(0, 0) + // Get line number margin width in dynamic width mode (LINENUMWIDTH_DYNAMIC) or constant width mode (LINENUMWIDTH_CONSTANT) + + #define VAR_NOT_RECOGNIZED 0 #define FULL_CURRENT_PATH 1 #define CURRENT_DIRECTORY 2 diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index cd69e14a4..0011c7d93 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -2639,7 +2639,7 @@ bool isUrlSchemeSupported(INTERNET_SCHEME s, TCHAR *url) case INTERNET_SCHEME_FILE: return true; } - generic_string const mySchemes = (NppParameters::getInstance()).getNppGUI()._uriShemes + TEXT(" "); + generic_string const mySchemes = (NppParameters::getInstance()).getNppGUI()._uriSchemes + TEXT(" "); TCHAR *p = (TCHAR *)mySchemes.c_str(); while (*p) { diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index eab5cc129..90e4248a3 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -1429,7 +1429,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa case NPPM_INTERNAL_SCROLLBEYONDLASTLINE: { - const bool endAtLastLine = not (nppParam.getSVP())._scrollBeyondLastLine; + const bool endAtLastLine = !(nppParam.getSVP())._scrollBeyondLastLine; _mainEditView.execute(SCI_SETENDATLASTLINE, endAtLastLine); _subEditView.execute(SCI_SETENDATLASTLINE, endAtLastLine); return TRUE; @@ -2124,6 +2124,24 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa return settingsOnCloudPath.length(); } + case NPPM_SETLINENUMBERWIDTHMODE: + { + if (lParam != LINENUMWIDTH_DYNAMIC || lParam != LINENUMWIDTH_CONSTANT) + return FALSE; + + ScintillaViewParams &svp = const_cast(nppParam.getSVP()); + svp._lineNumberMarginDynamicWidth = lParam == LINENUMWIDTH_DYNAMIC; + ::SendMessage(hwnd, WM_COMMAND, IDM_VIEW_LINENUMBER, 0); + + return TRUE; + } + + case NPPM_GETLINENUMBERWIDTHMODE: + { + const ScintillaViewParams &svp = nppParam.getSVP(); + return svp._lineNumberMarginDynamicWidth ? LINENUMWIDTH_DYNAMIC : LINENUMWIDTH_CONSTANT; + } + case NPPM_MSGTOPLUGIN : { return _pluginsManager.relayPluginMessages(message, wParam, lParam); @@ -2387,7 +2405,7 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa _mainEditView.execute(SCI_MULTIEDGECLEARALL); _subEditView.execute(SCI_MULTIEDGECLEARALL); - ScintillaViewParams & svp = (ScintillaViewParams &)nppParam.getSVP(); + ScintillaViewParams &svp = const_cast(nppParam.getSVP()); StyleArray & stylers = NppParameters::getInstance().getMiscStylerArray(); COLORREF multiEdgeColor = liteGrey; diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 66ae39c48..cd1604c81 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -1012,7 +1012,9 @@ BOOL Notepad_plus::notify(SCNotification *notification) _subEditView.restoreCurrentPosPreStep(); _subEditView.setWrapRestoreNeeded(false); } + notifyView->updateLineNumberWidth(); + if (_syncInfo.doSync()) doSynScorll(HWND(notification->nmhdr.hwndFrom)); diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 4a9207866..8a5aeb817 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -4449,7 +4449,7 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) { const TCHAR* val = n->Value(); if (val) - _nppGUI._uriShemes = val; + _nppGUI._uriSchemes = val; } } @@ -5270,6 +5270,16 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) _svp._lineNumberMarginShow = false; } + // Line Number Margin dynamic width + nm = element->Attribute(TEXT("lineNumberDynamicWidth")); + if (nm) + { + if (!lstrcmp(nm, TEXT("yes"))) + _svp._lineNumberMarginDynamicWidth = true; + else if (!lstrcmp(nm, TEXT("no"))) + _svp._lineNumberMarginDynamicWidth = false; + } + // Bookmark Margin nm = element->Attribute(TEXT("bookMarkMargin")); if (nm) @@ -5671,6 +5681,7 @@ bool NppParameters::writeScintillaParams() } (scintNode->ToElement())->SetAttribute(TEXT("lineNumberMargin"), _svp._lineNumberMarginShow?TEXT("show"):TEXT("hide")); + (scintNode->ToElement())->SetAttribute(TEXT("lineNumberDynamicWidth"), _svp._lineNumberMarginDynamicWidth ?TEXT("yes"):TEXT("no")); (scintNode->ToElement())->SetAttribute(TEXT("bookMarkMargin"), _svp._bookMarkMarginShow?TEXT("show"):TEXT("hide")); (scintNode->ToElement())->SetAttribute(TEXT("indentGuideLine"), _svp._indentGuideLineShow?TEXT("show"):TEXT("hide")); const TCHAR *pFolderStyleStr = (_svp._folderStyle == FOLDER_STYLE_SIMPLE)?TEXT("simple"): @@ -6013,7 +6024,7 @@ void NppParameters::createXmlTreeFromGUIParams() { TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); GUIConfigElement->SetAttribute(TEXT("name"), TEXT("uriCustomizedSchemes")); - GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._uriShemes.c_str())); + GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._uriSchemes.c_str())); } // { diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 0d5ee62c2..6eab38ea9 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -849,7 +849,7 @@ struct NppGUI final bool _isWordCharDefault = true; std::string _customWordChars; urlMode _styleURL = urlUnderLineFg; - generic_string _uriShemes = TEXT("svn:// cvs:// git:// imap:// irc:// irc6:// ircs:// ldap:// ldaps:// news: telnet:// gopher:// ssh:// sftp:// smb:// skype: snmp:// spotify: steam:// sms: slack:// chrome:// bitcoin:"); + generic_string _uriSchemes = TEXT("svn:// cvs:// git:// imap:// irc:// irc6:// ircs:// ldap:// ldaps:// news: telnet:// gopher:// ssh:// sftp:// smb:// skype: snmp:// spotify: steam:// sms: slack:// chrome:// bitcoin:"); NewDocDefaultSettings _newDocDefaultSettings; @@ -919,6 +919,7 @@ struct NppGUI final struct ScintillaViewParams { bool _lineNumberMarginShow = true; + bool _lineNumberMarginDynamicWidth = true; bool _bookMarkMarginShow = true; folderStyle _folderStyle = FOLDER_STYLE_BOX; //"simple", "arrow", "circle", "box" and "none" lineWrapMethod _lineWrapMethod = LINEWRAP_ALIGNED; @@ -935,7 +936,7 @@ struct ScintillaViewParams bool _whiteSpaceShow = false; bool _eolShow = false; int _borderWidth = 2; - bool _scrollBeyondLastLine = false; + bool _scrollBeyondLastLine = true; bool _rightClickKeepsSelection = false; bool _disableAdvancedScrolling = false; bool _doSmoothFont = false; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 98ef5fe25..252d6f2ce 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -2731,38 +2731,37 @@ void ScintillaEditView::setLineIndent(int line, int indent) const void ScintillaEditView::updateLineNumberWidth() { - if (_lineNumbersShown) + const ScintillaViewParams& svp = NppParameters::getInstance().getSVP(); + if (svp._lineNumberMarginShow) { auto linesVisible = execute(SCI_LINESONSCREEN); if (linesVisible) { - auto firstVisibleLineVis = execute(SCI_GETFIRSTVISIBLELINE); - auto lastVisibleLineVis = linesVisible + firstVisibleLineVis + 1; + int nbDigits = 0; - auto lastVisibleLineDoc = execute(SCI_DOCLINEFROMVISIBLE, lastVisibleLineVis); - - int nbDigits = 3; // minimum number of digit should be 3 - if (lastVisibleLineDoc < 1000) {} //nbDigits = 3; - else if (lastVisibleLineDoc < 10000) nbDigits = 4; - else if (lastVisibleLineDoc < 100000) nbDigits = 5; - else if (lastVisibleLineDoc < 1000000) nbDigits = 6; - else // rare case + if (svp._lineNumberMarginDynamicWidth) { - nbDigits = 7; - lastVisibleLineDoc /= 1000000; + auto firstVisibleLineVis = execute(SCI_GETFIRSTVISIBLELINE); + auto lastVisibleLineVis = linesVisible + firstVisibleLineVis + 1; + auto lastVisibleLineDoc = execute(SCI_DOCLINEFROMVISIBLE, lastVisibleLineVis); - while (lastVisibleLineDoc) - { - lastVisibleLineDoc /= 10; - ++nbDigits; - } + nbDigits = nbDigitsFromNbLines(lastVisibleLineDoc); + nbDigits = nbDigits < 3 ? 3 : nbDigits; } + else + { + auto nbLines = execute(SCI_GETLINECOUNT); + nbDigits = nbDigitsFromNbLines(nbLines); + nbDigits = nbDigits < 4 ? 4 : nbDigits; + } + auto pixelWidth = 8 + nbDigits * execute(SCI_TEXTWIDTH, STYLE_LINENUMBER, reinterpret_cast("8")); execute(SCI_SETMARGINWIDTHN, _SC_MARGE_LINENUMBER, pixelWidth); } } } + const char * ScintillaEditView::getCompleteKeywordList(std::basic_string & kwl, LangType langType, int keywordIndex) { kwl += " "; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index a6c515a55..a200990d8 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -326,7 +326,7 @@ public: void showMargin(int whichMarge, bool willBeShowed = true) { if (whichMarge == _SC_MARGE_LINENUMBER) - showLineNumbersMargin(willBeShowed); + updateLineNumbersMargin(); else { int width = 3; @@ -473,11 +473,9 @@ public: void setLineIndent(int line, int indent) const; - void showLineNumbersMargin(bool show) - { - if (show == _lineNumbersShown) return; - _lineNumbersShown = show; - if (show) + void updateLineNumbersMargin() { + const ScintillaViewParams& svp = NppParameters::getInstance().getSVP(); + if (svp._lineNumberMarginShow) { updateLineNumberWidth(); } @@ -488,6 +486,7 @@ public: } void updateLineNumberWidth(); + void setCurrentLineHiLiting(bool isHiliting, COLORREF bgColor) const { execute(SCI_SETCARETLINEVISIBLE, isHiliting); @@ -666,7 +665,6 @@ protected: Buffer * _currentBuffer = nullptr; int _codepage = CP_ACP; - bool _lineNumbersShown = false; bool _wrapRestoreNeeded = false; bool _positionRestoreNeeded = false; uint32_t _restorePositionRetryCount = 0; diff --git a/PowerEditor/src/WinControls/Preference/preference.rc b/PowerEditor/src/WinControls/Preference/preference.rc index 23795e15a..19ac3d556 100644 --- a/PowerEditor/src/WinControls/Preference/preference.rc +++ b/PowerEditor/src/WinControls/Preference/preference.rc @@ -91,15 +91,16 @@ BEGIN CONTROL "Default",IDC_RADIO_LWDEF,"Button",BS_AUTORADIOBUTTON | WS_GROUP,275,21,59,10 CONTROL "Aligned",IDC_RADIO_LWALIGN,"Button",BS_AUTORADIOBUTTON,275,36,60,10 CONTROL "Indent",IDC_RADIO_LWINDENT,"Button",BS_AUTORADIOBUTTON,275,51,62,10 - CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,90,230,10 - CONTROL "Enable current line highlighting",IDC_CHECK_CURRENTLINEHILITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,103,160,10 - CONTROL "Enable smooth font",IDC_CHECK_SMOOTHFONT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,116,130,10 - CONTROL "Enable scrolling beyond last line",IDC_CHECK_SCROLLBEYONDLASTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,129,160,10 - CONTROL "Keep selection when right-click outside of selection",IDC_CHECK_RIGHTCLICKKEEPSSELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,142,230,10 + CONTROL "Enable Multi-Editing (Ctrl+Mouse click/selection)",IDC_CHECK_MULTISELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,90,270,10 + CONTROL "Enable current line highlighting",IDC_CHECK_CURRENTLINEHILITE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,103,270,10 + CONTROL "Enable smooth font",IDC_CHECK_SMOOTHFONT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,116,250,10 + CONTROL "Enable scrolling beyond last line",IDC_CHECK_SCROLLBEYONDLASTLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,129,270,10 + CONTROL "Keep selection when right-click outside of selection",IDC_CHECK_RIGHTCLICKKEEPSSELECTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,142,270,10 CONTROL "Disable advanced scrolling feature due to touchpad issue",IDC_CHECK_DISABLEADVANCEDSCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,54,155,270,10 END + IDD_PREFERENCE_SUB_MARGING_BORDER_EDGE DIALOGEX 0, 0, 455, 185 STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD FONT 8, "MS Shell Dlg", 0, 0, 0x1 @@ -110,16 +111,19 @@ BEGIN CONTROL "Circle tree",IDC_RADIO_CIRCLE,"Button",BS_AUTORADIOBUTTON,31,63,62,10 CONTROL "None",IDC_RADIO_FOLDMARGENONE,"Button",BS_AUTORADIOBUTTON,31,92,61,10 CONTROL "Box tree",IDC_RADIO_BOX,"Button",BS_AUTORADIOBUTTON,31,77,61,10 - GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,118,21,148,135,BS_CENTER - CONTROL "Background mode",IDC_CHECK_EDGEBGMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,129,138,122,10 - LTEXT "Add your column marker by indicating its position with a decimal number.\nYou can define several column markers by using white space to separate the different numbers.",IDC_STATIC_MULTILNMODE_TIP,126,36,134,55 - EDITTEXT IDC_COLUMNPOS_EDIT,128,93,125,36,ES_MULTILINE + GROUPBOX "Vertical Edge Settings",IDC_VES_GB_STATIC,116,21,148,135,BS_CENTER + LTEXT "Add your column marker by indicating its position with a decimal number.\nYou can define several column markers by using white space to separate the different numbers.",IDC_STATIC_MULTILNMODE_TIP,124,36,134,55 + EDITTEXT IDC_COLUMNPOS_EDIT,126,93,125,36,ES_MULTILINE + CONTROL "Background mode",IDC_CHECK_EDGEBGMODE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,127,138,122,10 GROUPBOX "Border Width",IDC_BORDERWIDTH_STATIC,21,112,85,45,BS_CENTER CONTROL "",IDC_BORDERWIDTH_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,24,125,67,13 LTEXT "0",IDC_BORDERWIDTHVAL_STATIC,92,125,12,8 CONTROL "No edge",IDC_CHECK_NOEDGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,29,142,60,10 - CONTROL "Display line number",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,283,27,141,10 - CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,283,39,150,10 + GROUPBOX "Line Number",IDC_LINENUMBERMARGE_GB_STATIC,275,21,135,66,BS_CENTER + CONTROL "Display",IDC_CHECK_LINENUMBERMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,281,35,85,10 + CONTROL "Dynamic width",IDC_RADIO_DYNAMIC,"Button",BS_AUTORADIOBUTTON | WS_GROUP,293,51,110,10 + CONTROL "Constant width",IDC_RADIO_CONSTANT,"Button",BS_AUTORADIOBUTTON,293,65,108,10 + CONTROL "Display bookmark",IDC_CHECK_BOOKMARKMARGE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,281,97,150,10 END diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index abf36eb05..9384965b2 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -786,6 +786,11 @@ void MarginsBorderEdgeSubDlg::initScintParam() ::SendDlgItemMessage(_hSelf, id, BM_SETCHECK, TRUE, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_LINENUMBERMARGE, BM_SETCHECK, svp._lineNumberMarginShow, 0); + ::SendDlgItemMessage(_hSelf, IDC_RADIO_DYNAMIC, BM_SETCHECK, svp._lineNumberMarginDynamicWidth, 0); + ::SendDlgItemMessage(_hSelf, IDC_RADIO_CONSTANT, BM_SETCHECK, !svp._lineNumberMarginDynamicWidth, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RADIO_DYNAMIC), svp._lineNumberMarginShow); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RADIO_CONSTANT), svp._lineNumberMarginShow); + ::SendDlgItemMessage(_hSelf, IDC_CHECK_BOOKMARKMARGE, BM_SETCHECK, svp._bookMarkMarginShow, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_NOEDGE, BM_SETCHECK, !svp._showBorderEdge, 0); @@ -857,6 +862,16 @@ INT_PTR CALLBACK MarginsBorderEdgeSubDlg::run_dlgProc(UINT message, WPARAM wPara { case IDC_CHECK_LINENUMBERMARGE: svp._lineNumberMarginShow = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_CHECK_LINENUMBERMARGE, BM_GETCHECK, 0, 0)); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RADIO_DYNAMIC), svp._lineNumberMarginShow); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_RADIO_CONSTANT), svp._lineNumberMarginShow); + ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LINENUMBER, 0); + return TRUE; + case IDC_RADIO_DYNAMIC: + svp._lineNumberMarginDynamicWidth = (BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_RADIO_DYNAMIC, BM_GETCHECK, 0, 0)); + ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LINENUMBER, 0); + return TRUE; + case IDC_RADIO_CONSTANT: + svp._lineNumberMarginDynamicWidth = !(BST_CHECKED == ::SendDlgItemMessage(_hSelf, IDC_RADIO_CONSTANT, BM_GETCHECK, 0, 0)); ::SendMessage(_hParent, WM_COMMAND, IDM_VIEW_LINENUMBER, 0); return TRUE; @@ -3346,7 +3361,7 @@ INT_PTR CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP { TCHAR uriScheme[uriSchemesMaxLength] = { '\0' }; ::SendDlgItemMessage(_hSelf, IDC_URISCHEMES_EDIT, WM_GETTEXT, uriSchemesMaxLength, reinterpret_cast(uriScheme)); - nppGUI._uriShemes = uriScheme; + nppGUI._uriSchemes = uriScheme; HWND grandParent = ::GetParent(_hParent); ::SendMessage(grandParent, NPPM_INTERNAL_UPDATECLICKABLELINKS, 0, 0); return TRUE; @@ -3380,7 +3395,7 @@ INT_PTR CALLBACK CloudAndLinkSubDlg::run_dlgProc(UINT message, WPARAM wParam, LP BOOL dontUnderline = (nppGUI._styleURL == urlNoUnderLineFg) || (nppGUI._styleURL == urlNoUnderLineBg); BOOL roundBoxMode = (nppGUI._styleURL == urlNoUnderLineBg) || (nppGUI._styleURL == urlUnderLineBg); ::SendDlgItemMessage(_hSelf, IDC_URISCHEMES_EDIT, EM_SETLIMITTEXT, uriSchemesMaxLength, 0); - ::SetWindowText(::GetDlgItem(_hSelf, IDC_URISCHEMES_EDIT), nppGUI._uriShemes.c_str()); + ::SetWindowText(::GetDlgItem(_hSelf, IDC_URISCHEMES_EDIT), nppGUI._uriSchemes.c_str()); ::SendDlgItemMessage(_hSelf, IDC_CHECK_CLICKABLELINK_ENABLE, BM_SETCHECK, linkEnable, 0); ::SendDlgItemMessage(_hSelf, IDC_CHECK_CLICKABLELINK_NOUNDERLINE, BM_SETCHECK, dontUnderline, 0); diff --git a/PowerEditor/src/WinControls/Preference/preference_rc.h b/PowerEditor/src/WinControls/Preference/preference_rc.h index c4222d494..52a5e2901 100644 --- a/PowerEditor/src/WinControls/Preference/preference_rc.h +++ b/PowerEditor/src/WinControls/Preference/preference_rc.h @@ -161,6 +161,9 @@ #define IDC_SEARCHENGINE_STACKOVERFLOW_RADIO (IDD_PREFERENCE_SUB_SEARCHENGINE + 9) #define IDD_PREFERENCE_SUB_MARGING_BORDER_EDGE 6290 //(IDD_PREFERENCE_BOX + 290) + #define IDC_LINENUMBERMARGE_GB_STATIC (IDD_PREFERENCE_SUB_MARGING_BORDER_EDGE + 1) + #define IDC_RADIO_DYNAMIC (IDD_PREFERENCE_SUB_MARGING_BORDER_EDGE + 2) + #define IDC_RADIO_CONSTANT (IDD_PREFERENCE_SUB_MARGING_BORDER_EDGE + 3) #define IDD_PREFERENCE_SUB_MISC 6300 //(IDD_PREFERENCE_BOX + 300) #define IDC_TABSETTING_GB_STATIC (IDD_PREFERENCE_SUB_MISC + 1)