GUI enhancement: replace auto-complete link mini dlg with slider
Fix #13162, close #13163
This commit is contained in:
parent
5e2f5d79aa
commit
caff51c788
|
@ -1146,7 +1146,6 @@ You can define several column markers by using white space to separate the diffe
|
||||||
<Item id="6824" name="Ignore numbers"/>
|
<Item id="6824" name="Ignore numbers"/>
|
||||||
<Item id="6811" name="From"/>
|
<Item id="6811" name="From"/>
|
||||||
<Item id="6813" name="th character"/>
|
<Item id="6813" name="th character"/>
|
||||||
<Item id="6814" name="Valid value : 1 - 9"/>
|
|
||||||
<Item id="6872" name="Make auto-completion list brief"/>
|
<Item id="6872" name="Make auto-completion list brief"/>
|
||||||
<Item id="6815" name="Function parameters hint on input"/>
|
<Item id="6815" name="Function parameters hint on input"/>
|
||||||
<Item id="6851" name="Auto-Insert"/>
|
<Item id="6851" name="Auto-Insert"/>
|
||||||
|
@ -1615,7 +1614,6 @@ Find in all files but exclude all folders log or logs recursively:
|
||||||
<userdefined-title-new value="Create New Language..."/>
|
<userdefined-title-new value="Create New Language..."/>
|
||||||
<userdefined-title-save value="Save Current Language Name As..."/>
|
<userdefined-title-save value="Save Current Language Name As..."/>
|
||||||
<userdefined-title-rename value="Rename Current Language Name"/>
|
<userdefined-title-rename value="Rename Current Language Name"/>
|
||||||
<autocomplete-nb-char value="Nb char: "/>
|
|
||||||
<edit-verticaledge-nb-col value="Nb of Column:"/>
|
<edit-verticaledge-nb-col value="Nb of Column:"/>
|
||||||
<summary value="Summary"/>
|
<summary value="Summary"/>
|
||||||
<summary-filepath value="Full file path: "/>
|
<summary-filepath value="Full file path: "/>
|
||||||
|
|
|
@ -851,7 +851,7 @@ struct NppGUI final
|
||||||
GlobalOverride _globalOverride;
|
GlobalOverride _globalOverride;
|
||||||
enum AutocStatus{autoc_none, autoc_func, autoc_word, autoc_both};
|
enum AutocStatus{autoc_none, autoc_func, autoc_word, autoc_both};
|
||||||
AutocStatus _autocStatus = autoc_both;
|
AutocStatus _autocStatus = autoc_both;
|
||||||
size_t _autocFromLen = 1;
|
UINT _autocFromLen = 1;
|
||||||
bool _autocIgnoreNumbers = true;
|
bool _autocIgnoreNumbers = true;
|
||||||
bool _autocInsertSelectedUseENTER = true;
|
bool _autocInsertSelectedUseENTER = true;
|
||||||
bool _autocInsertSelectedUseTAB = true;
|
bool _autocInsertSelectedUseTAB = true;
|
||||||
|
|
|
@ -375,40 +375,46 @@ IDD_PREFERENCE_SUB_AUTOCOMPLETION DIALOGEX 115, 10, 460, 205
|
||||||
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
|
||||||
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
FONT 8, "MS Shell Dlg", 0, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,347,15,100,10
|
GROUPBOX "Auto-Completion",IDD_AUTOC_GRPSTATIC,33,3,289,105,BS_CENTER
|
||||||
GROUPBOX "Auto-Completion",IDD_AUTOC_GRPSTATIC,33,4,289,100,BS_CENTER
|
CONTROL "Enable auto-completion on each input",IDD_AUTOC_ENABLECHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,39,16,160,10
|
||||||
CONTROL "Enable auto-completion on each input",IDD_AUTOC_ENABLECHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,15,150,10
|
CONTROL "Function completion",IDD_AUTOC_FUNCRADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,51,31,145,10
|
||||||
CONTROL "Function completion",IDD_AUTOC_FUNCRADIO,"Button",BS_AUTORADIOBUTTON | WS_GROUP,65,27,145,10
|
CONTROL "Word completion",IDD_AUTOC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,51,46,145,10
|
||||||
CONTROL "Word completion",IDD_AUTOC_WORDRADIO,"Button",BS_AUTORADIOBUTTON,65,41,145,10
|
CONTROL "Function and word completion",IDD_AUTOC_BOTHRADIO,"Button",BS_AUTORADIOBUTTON,51,61,145,10
|
||||||
CONTROL "Function and word completion",IDD_AUTOC_BOTHRADIO,"Button",BS_AUTORADIOBUTTON,65,55,145,10
|
CONTROL "Make auto-completion list brief",IDD_AUTOC_BRIEF_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,39,76,160,10
|
||||||
RTEXT "From",IDD_AUTOC_STATIC_FROM,195,12,47,8
|
CONTROL "Function parameters hint on input",IDD_FUNC_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,39,93,160,10
|
||||||
CTEXT "1",IDD_AUTOC_STATIC_N,246,12,8,8,WS_TABSTOP
|
|
||||||
LTEXT "th character",IDD_AUTOC_STATIC_CHAR,260,12,57,8
|
RTEXT "From",IDD_AUTOC_STATIC_FROM,195,16,47,8
|
||||||
LTEXT "Valid value : 1 - 9",IDD_AUTOC_STATIC_NOTE,225,22,93,8
|
CTEXT "1",IDD_AUTOC_STATIC_N,246,16,8,8
|
||||||
GROUPBOX "Insert Selection",IDD_AUTOC_USEKEY_GRP_STATIC,218,36,96,38,BS_CENTER
|
LTEXT "th character",IDD_AUTOC_STATIC_CHAR,260,16,57,8
|
||||||
CONTROL "TAB",IDD_AUTOC_USETAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,240,49,54,10
|
CONTROL "",IDC_AUTOC_CHAR_SLIDER,"msctls_trackbar32",TBS_AUTOTICKS | TBS_BOTH | TBS_NOTICKS | TBS_TRANSPARENTBKGND | WS_TABSTOP,233,29,66,13
|
||||||
CONTROL "ENTER",IDD_AUTOC_USEENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,240,61,55,10
|
RTEXT "1",IDD_AUTOC_SLIDER_MIN_STATIC,223,30,8,8
|
||||||
CONTROL "Ignore numbers",IDD_AUTOC_IGNORENUMBERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,219,79,80,10
|
LTEXT "9",IDD_AUTOC_SLIDER_MAX_STATIC,301,30,8,8
|
||||||
CONTROL "Make auto-completion list brief",IDD_AUTOC_BRIEF_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,69,160,10
|
GROUPBOX "Insert Selection",IDD_AUTOC_USEKEY_GRP_STATIC,218,44,96,43,BS_CENTER
|
||||||
CONTROL "Function parameters hint on input",IDD_FUNC_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,38,88,160,10
|
CONTROL "TAB",IDD_AUTOC_USETAB,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,57,54,10
|
||||||
GROUPBOX "Auto-Insert",IDD_AUTOCINSERT_GRPSTATIC,33,109,289,84,BS_CENTER
|
CONTROL "ENTER",IDD_AUTOC_USEENTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,72,55,10
|
||||||
CONTROL " (",IDD_AUTOCPARENTHESES_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,130,24,10
|
CONTROL "Ignore numbers",IDD_AUTOC_IGNORENUMBERS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,218,93,80,10
|
||||||
CONTROL " [",IDD_AUTOCBRACKET_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,148,24,10
|
|
||||||
CONTROL " {",IDD_AUTOCCURLYBRACKET_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,48,167,24,10
|
CONTROL "Auto-indent",IDC_CHECK_MAINTAININDENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,347,16,100,10
|
||||||
CONTROL " """,IDD_AUTOC_DOUBLEQUOTESCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,131,24,10
|
|
||||||
CONTROL " '",IDD_AUTOC_QUOTESCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,148,24,10
|
GROUPBOX "Auto-Insert",IDD_AUTOCINSERT_GRPSTATIC,33,114,289,83,BS_CENTER
|
||||||
CONTROL " html/xml close tag",IDD_AUTOCTAG_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,92,167,76,10
|
CONTROL " (",IDD_AUTOCPARENTHESES_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,140,24,10
|
||||||
RTEXT "Open",IDC_MACHEDPAIROPEN_STATIC,254,118,25,8
|
CONTROL " [",IDD_AUTOCBRACKET_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,160,24,10
|
||||||
LTEXT "Close",IDC_MACHEDPAIRCLOSE_STATIC,292,118,25,8
|
CONTROL " {",IDD_AUTOCCURLYBRACKET_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,50,180,24,10
|
||||||
RTEXT "Matched pair 1:",IDC_MACHEDPAIR_STATIC1,195,132,70,8
|
CONTROL " """,IDD_AUTOC_DOUBLEQUOTESCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,94,140,24,10
|
||||||
EDITTEXT IDC_MACHEDPAIROPEN_EDIT1,267,130,14,14
|
CONTROL " '",IDD_AUTOC_QUOTESCHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,94,160,24,10
|
||||||
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT1,295,130,14,14
|
CONTROL " html/xml close tag",IDD_AUTOCTAG_CHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,94,180,76,10
|
||||||
RTEXT "Matched pair 2:",IDC_MACHEDPAIR_STATIC2,195,152,70,8
|
|
||||||
EDITTEXT IDC_MACHEDPAIROPEN_EDIT2,267,150,14,14
|
RTEXT "Open",IDC_MACHEDPAIROPEN_STATIC,254,126,25,8
|
||||||
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT2,295,150,14,14
|
LTEXT "Close",IDC_MACHEDPAIRCLOSE_STATIC,292,126,25,8
|
||||||
RTEXT "Matched pair 3:",IDC_MACHEDPAIR_STATIC3,195,172,70,8
|
RTEXT "Matched pair 1:",IDC_MACHEDPAIR_STATIC1,190,140,70,8
|
||||||
EDITTEXT IDC_MACHEDPAIROPEN_EDIT3,267,170,14,14
|
EDITTEXT IDC_MACHEDPAIROPEN_EDIT1,264,138,14,12,ES_CENTER
|
||||||
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT3,295,170,14,14
|
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT1,292,138,14,12,ES_CENTER
|
||||||
|
RTEXT "Matched pair 2:",IDC_MACHEDPAIR_STATIC2,190,160,70,8
|
||||||
|
EDITTEXT IDC_MACHEDPAIROPEN_EDIT2,264,158,14,12,ES_CENTER
|
||||||
|
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT2,292,158,14,12,ES_CENTER
|
||||||
|
RTEXT "Matched pair 3:",IDC_MACHEDPAIR_STATIC3,190,180,70,8
|
||||||
|
EDITTEXT IDC_MACHEDPAIROPEN_EDIT3,264,178,14,12,ES_CENTER
|
||||||
|
EDITTEXT IDC_MACHEDPAIRCLOSE_EDIT3,292,178,14,12,ES_CENTER
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -44,6 +44,10 @@ const int DISTRACTIONFREE_SMALLEST = 3;
|
||||||
const int DISTRACTIONFREE_LARGEST = 9;
|
const int DISTRACTIONFREE_LARGEST = 9;
|
||||||
const int DISTRACTIONFREE_INTERVAL = 1;
|
const int DISTRACTIONFREE_INTERVAL = 1;
|
||||||
|
|
||||||
|
constexpr int AUTOCOMPLETEFROMCHAR_SMALLEST = 1;
|
||||||
|
constexpr int AUTOCOMPLETEFROMCHAR_LARGEST = 9;
|
||||||
|
constexpr int AUTOCOMPLETEFROMCHAR_INTERVAL = 1;
|
||||||
|
|
||||||
// This int encoding array is built from "EncodingUnit encodings[]" (see EncodingMapper.cpp)
|
// This int encoding array is built from "EncodingUnit encodings[]" (see EncodingMapper.cpp)
|
||||||
// And NewDocumentSubDlg will use "int encoding array" to get more info from "EncodingUnit encodings[]"
|
// And NewDocumentSubDlg will use "int encoding array" to get more info from "EncodingUnit encodings[]"
|
||||||
static int encodings[] = {
|
static int encodings[] = {
|
||||||
|
@ -4013,9 +4017,13 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG :
|
case WM_INITDIALOG :
|
||||||
{
|
{
|
||||||
::SetDlgItemInt(_hSelf, IDD_AUTOC_STATIC_N, static_cast<UINT>(nppGUI._autocFromLen), FALSE);
|
::SetDlgItemInt(_hSelf, IDD_AUTOC_STATIC_N, nppGUI._autocFromLen, FALSE);
|
||||||
_nbCharVal.init(_hInst, _hSelf);
|
|
||||||
_nbCharVal.create(::GetDlgItem(_hSelf, IDD_AUTOC_STATIC_N), IDD_AUTOC_STATIC_N);
|
const HWND hNbCharSlider = ::GetDlgItem(_hSelf, IDC_AUTOC_CHAR_SLIDER);
|
||||||
|
::SendMessage(hNbCharSlider, TBM_SETRANGEMIN, TRUE, AUTOCOMPLETEFROMCHAR_SMALLEST);
|
||||||
|
::SendMessage(hNbCharSlider, TBM_SETRANGEMAX, TRUE, AUTOCOMPLETEFROMCHAR_LARGEST);
|
||||||
|
::SendMessage(hNbCharSlider, TBM_SETPAGESIZE, 0, AUTOCOMPLETEFROMCHAR_INTERVAL);
|
||||||
|
::SendMessage(hNbCharSlider, TBM_SETPOS, TRUE, nppGUI._autocFromLen);
|
||||||
|
|
||||||
bool isEnableAutoC = nppGUI._autocStatus != nppGUI.autoc_none;
|
bool isEnableAutoC = nppGUI._autocStatus != nppGUI.autoc_none;
|
||||||
|
|
||||||
|
@ -4047,6 +4055,7 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USEENTER), FALSE);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USEENTER), FALSE);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USETAB), FALSE);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USETAB), FALSE);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_IGNORENUMBERS), FALSE);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_IGNORENUMBERS), FALSE);
|
||||||
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_AUTOC_CHAR_SLIDER), FALSE);
|
||||||
}
|
}
|
||||||
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, nppGUI._maitainIndent, 0);
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_MAINTAININDENT, BM_SETCHECK, nppGUI._maitainIndent, 0);
|
||||||
|
|
||||||
|
@ -4087,10 +4096,10 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
nbMatchedPair = 3;
|
nbMatchedPair = 3;
|
||||||
for (size_t i = 0; i < nbMatchedPair; ++i)
|
for (size_t i = 0; i < nbMatchedPair; ++i)
|
||||||
{
|
{
|
||||||
TCHAR openChar[2];
|
TCHAR openChar[2]{};
|
||||||
openChar[0] = nppGUI._matchedPairConf._matchedPairsInit[i].first;
|
openChar[0] = nppGUI._matchedPairConf._matchedPairsInit[i].first;
|
||||||
openChar[1] = '\0';
|
openChar[1] = '\0';
|
||||||
TCHAR closeChar[2];
|
TCHAR closeChar[2]{};
|
||||||
closeChar[0] = nppGUI._matchedPairConf._matchedPairsInit[i].second;
|
closeChar[0] = nppGUI._matchedPairConf._matchedPairsInit[i].second;
|
||||||
closeChar[1] = '\0';
|
closeChar[1] = '\0';
|
||||||
|
|
||||||
|
@ -4134,19 +4143,19 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
|
|
||||||
case WM_CTLCOLORSTATIC:
|
case WM_CTLCOLORSTATIC:
|
||||||
{
|
{
|
||||||
auto hdcStatic = reinterpret_cast<HDC>(wParam);
|
const auto hdcStatic = reinterpret_cast<HDC>(wParam);
|
||||||
auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
|
const auto dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam));
|
||||||
|
|
||||||
bool isStaticText = (dlgCtrlID == IDD_AUTOC_STATIC_FROM ||
|
const bool isStaticText = (dlgCtrlID == IDD_AUTOC_STATIC_FROM ||
|
||||||
dlgCtrlID == IDD_AUTOC_STATIC_CHAR ||
|
dlgCtrlID == IDD_AUTOC_STATIC_CHAR ||
|
||||||
dlgCtrlID == IDD_AUTOC_STATIC_NOTE);
|
dlgCtrlID == IDD_AUTOC_STATIC_N ||
|
||||||
|
dlgCtrlID == IDD_AUTOC_SLIDER_MIN_STATIC ||
|
||||||
|
dlgCtrlID == IDD_AUTOC_SLIDER_MAX_STATIC);
|
||||||
//set the static text colors to show enable/disable instead of ::EnableWindow which causes blurry text
|
//set the static text colors to show enable/disable instead of ::EnableWindow which causes blurry text
|
||||||
if (isStaticText)
|
if (isStaticText)
|
||||||
{
|
{
|
||||||
bool isTextEnabled = isCheckedOrNot(IDD_AUTOC_ENABLECHECK);
|
const bool isTextEnabled = isCheckedOrNot(IDD_AUTOC_ENABLECHECK);
|
||||||
auto result = NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
|
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, isTextEnabled);
|
||||||
_nbCharVal.display(isTextEnabled);
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NppDarkMode::isEnabled())
|
if (NppDarkMode::isEnabled())
|
||||||
|
@ -4165,6 +4174,18 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case WM_HSCROLL:
|
||||||
|
{
|
||||||
|
const HWND hNbCharSlider = ::GetDlgItem(_hSelf, IDC_AUTOC_CHAR_SLIDER);
|
||||||
|
if (hNbCharSlider == reinterpret_cast<HWND>(lParam))
|
||||||
|
{
|
||||||
|
nppGUI._autocFromLen = static_cast<UINT>(::SendMessage(hNbCharSlider, TBM_GETPOS, 0, 0));
|
||||||
|
::SetDlgItemInt(_hSelf, IDD_AUTOC_STATIC_N, nppGUI._autocFromLen, FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0; //return zero when handled
|
||||||
|
}
|
||||||
|
|
||||||
case WM_COMMAND :
|
case WM_COMMAND :
|
||||||
{
|
{
|
||||||
if (HIWORD(wParam) == EN_CHANGE)
|
if (HIWORD(wParam) == EN_CHANGE)
|
||||||
|
@ -4243,6 +4264,7 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USEENTER), isEnableAutoC);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USEENTER), isEnableAutoC);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USETAB), isEnableAutoC);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_USETAB), isEnableAutoC);
|
||||||
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_IGNORENUMBERS), isEnableAutoC);
|
::EnableWindow(::GetDlgItem(_hSelf, IDD_AUTOC_IGNORENUMBERS), isEnableAutoC);
|
||||||
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_AUTOC_CHAR_SLIDER), isEnableAutoC);
|
||||||
|
|
||||||
redraw();
|
redraw();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -4304,35 +4326,6 @@ intptr_t CALLBACK AutoCompletionSubDlg::run_dlgProc(UINT message, WPARAM wParam,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
case IDD_AUTOC_STATIC_N :
|
|
||||||
{
|
|
||||||
const int NB_MIN_CHAR = 1;
|
|
||||||
const int NB_MAX_CHAR = 9;
|
|
||||||
|
|
||||||
NativeLangSpeaker *pNativeSpeaker = nppParam.getNativeLangSpeaker();
|
|
||||||
generic_string strNbChar = pNativeSpeaker->getLocalizedStrFromID("autocomplete-nb-char", TEXT("Nb char : "));
|
|
||||||
|
|
||||||
ValueDlg valDlg;
|
|
||||||
valDlg.init(NULL, _hSelf, static_cast<int32_t>(nppGUI._autocFromLen), strNbChar.c_str());
|
|
||||||
valDlg.setNBNumber(1);
|
|
||||||
|
|
||||||
POINT p;
|
|
||||||
::GetCursorPos(&p);
|
|
||||||
|
|
||||||
int size = valDlg.doDialog(p);
|
|
||||||
if (size != -1)
|
|
||||||
{
|
|
||||||
if (size > NB_MAX_CHAR)
|
|
||||||
size = NB_MAX_CHAR;
|
|
||||||
else if (size < NB_MIN_CHAR)
|
|
||||||
size = NB_MIN_CHAR;
|
|
||||||
|
|
||||||
nppGUI._autocFromLen = size;
|
|
||||||
::SetDlgItemInt(_hSelf, IDD_AUTOC_STATIC_N, static_cast<int32_t>(nppGUI._autocFromLen), FALSE);
|
|
||||||
}
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
case IDD_AUTOCPARENTHESES_CHECK :
|
case IDD_AUTOCPARENTHESES_CHECK :
|
||||||
case IDD_AUTOCBRACKET_CHECK :
|
case IDD_AUTOCBRACKET_CHECK :
|
||||||
case IDD_AUTOCCURLYBRACKET_CHECK :
|
case IDD_AUTOCCURLYBRACKET_CHECK :
|
||||||
|
|
|
@ -220,7 +220,6 @@ class AutoCompletionSubDlg : public StaticDialog
|
||||||
public :
|
public :
|
||||||
AutoCompletionSubDlg() = default;
|
AutoCompletionSubDlg() = default;
|
||||||
private :
|
private :
|
||||||
URLCtrl _nbCharVal;
|
|
||||||
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -380,7 +380,7 @@
|
||||||
#define IDD_AUTOC_STATIC_FROM (IDD_PREFERENCE_SUB_BACKUP + 11)
|
#define IDD_AUTOC_STATIC_FROM (IDD_PREFERENCE_SUB_BACKUP + 11)
|
||||||
#define IDD_AUTOC_STATIC_N (IDD_PREFERENCE_SUB_BACKUP + 12)
|
#define IDD_AUTOC_STATIC_N (IDD_PREFERENCE_SUB_BACKUP + 12)
|
||||||
#define IDD_AUTOC_STATIC_CHAR (IDD_PREFERENCE_SUB_BACKUP + 13)
|
#define IDD_AUTOC_STATIC_CHAR (IDD_PREFERENCE_SUB_BACKUP + 13)
|
||||||
#define IDD_AUTOC_STATIC_NOTE (IDD_PREFERENCE_SUB_BACKUP + 14)
|
//#define IDD_AUTOC_STATIC_NOTE (IDD_PREFERENCE_SUB_BACKUP + 14)
|
||||||
#define IDD_FUNC_CHECK (IDD_PREFERENCE_SUB_BACKUP + 15)
|
#define IDD_FUNC_CHECK (IDD_PREFERENCE_SUB_BACKUP + 15)
|
||||||
#define IDD_AUTOC_BOTHRADIO (IDD_PREFERENCE_SUB_BACKUP + 16)
|
#define IDD_AUTOC_BOTHRADIO (IDD_PREFERENCE_SUB_BACKUP + 16)
|
||||||
#define IDC_BACKUPDIR_RESTORESESSION_GRP_STATIC (IDD_PREFERENCE_SUB_BACKUP + 17)
|
#define IDC_BACKUPDIR_RESTORESESSION_GRP_STATIC (IDD_PREFERENCE_SUB_BACKUP + 17)
|
||||||
|
@ -415,6 +415,9 @@
|
||||||
#define IDD_AUTOC_USETAB (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 20)
|
#define IDD_AUTOC_USETAB (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 20)
|
||||||
#define IDD_AUTOC_USEENTER (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 21)
|
#define IDD_AUTOC_USEENTER (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 21)
|
||||||
#define IDD_AUTOC_BRIEF_CHECK (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 22)
|
#define IDD_AUTOC_BRIEF_CHECK (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 22)
|
||||||
|
#define IDC_AUTOC_CHAR_SLIDER (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 23)
|
||||||
|
#define IDD_AUTOC_SLIDER_MIN_STATIC (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 24)
|
||||||
|
#define IDD_AUTOC_SLIDER_MAX_STATIC (IDD_PREFERENCE_SUB_AUTOCOMPLETION + 25)
|
||||||
|
|
||||||
#define IDD_PREFERENCE_SUB_SEARCHING 6900 //(IDD_PREFERENCE_BOX + 900)
|
#define IDD_PREFERENCE_SUB_SEARCHING 6900 //(IDD_PREFERENCE_BOX + 900)
|
||||||
//#define IDC_CHECK_STOPFILLINGFINDFIELD (IDD_PREFERENCE_SUB_SEARCHING + 1)
|
//#define IDC_CHECK_STOPFILLINGFINDFIELD (IDD_PREFERENCE_SUB_SEARCHING + 1)
|
||||||
|
|
Loading…
Reference in New Issue