|
|
|
@ -2100,14 +2100,14 @@ intptr_t CALLBACK MiscSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM)
|
|
|
|
|
{ |
|
|
|
|
case IDC_EDIT_SESSIONFILEEXT: |
|
|
|
|
{ |
|
|
|
|
TCHAR sessionExt[MAX_PATH]; |
|
|
|
|
TCHAR sessionExt[MAX_PATH] = { '\0' }; |
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_EDIT_SESSIONFILEEXT, WM_GETTEXT, MAX_PATH, reinterpret_cast<LPARAM>(sessionExt)); |
|
|
|
|
nppGUI._definedSessionExt = sessionExt; |
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
case IDC_EDIT_WORKSPACEFILEEXT: |
|
|
|
|
{ |
|
|
|
|
TCHAR workspaceExt[MAX_PATH]; |
|
|
|
|
TCHAR workspaceExt[MAX_PATH] = { '\0' }; |
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_EDIT_WORKSPACEFILEEXT, WM_GETTEXT, MAX_PATH, reinterpret_cast<LPARAM>(workspaceExt)); |
|
|
|
|
nppGUI._definedWorkspaceExt = workspaceExt; |
|
|
|
|
return TRUE; |
|
|
|
@ -2826,10 +2826,7 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
//
|
|
|
|
|
// Tab settings
|
|
|
|
|
//
|
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, nppGUI._tabSize, FALSE); |
|
|
|
|
|
|
|
|
|
_tabSizeVal.init(_hInst, _hSelf); |
|
|
|
|
_tabSizeVal.create(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), IDC_TABSIZEVAL_STATIC); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, nppGUI._tabSize, FALSE); |
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_REPLACEBYSPACE, BM_SETCHECK, nppGUI._tabReplacedBySpace, 0); |
|
|
|
|
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(TEXT("[Default]"))); |
|
|
|
@ -2842,31 +2839,44 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_SETCURSEL, index2Begin, 0); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_GR_TABVALUE_STATIC), SW_HIDE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), SW_HIDE); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), FALSE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE); |
|
|
|
|
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_BACKSLASHISESCAPECHARACTERFORSQL, BM_SETCHECK, nppGUI._backSlashIsEscapeCharacterForSql, 0); |
|
|
|
|
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORLISTBOX: |
|
|
|
|
case WM_CTLCOLOREDIT: |
|
|
|
|
{ |
|
|
|
|
if (NppDarkMode::isEnabled()) |
|
|
|
|
return NppDarkMode::onCtlColorSofter(reinterpret_cast<HDC>(wParam)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORLISTBOX: |
|
|
|
|
{ |
|
|
|
|
return NppDarkMode::onCtlColorListbox(wParam, lParam); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORDLG: |
|
|
|
|
{ |
|
|
|
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORSTATIC: |
|
|
|
|
{ |
|
|
|
|
if (NppDarkMode::isEnabled()) |
|
|
|
|
const int dlgCtrlID = ::GetDlgCtrlID(reinterpret_cast<HWND>(lParam)); |
|
|
|
|
const auto& hdcStatic = reinterpret_cast<HDC>(wParam); |
|
|
|
|
// handle blurry text with disabled states for the affected static controls
|
|
|
|
|
const size_t index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
if ((index > 0) && (dlgCtrlID == IDC_TABSIZE_STATIC)) |
|
|
|
|
{ |
|
|
|
|
return NppDarkMode::onCtlColorDarker(reinterpret_cast<HDC>(wParam)); |
|
|
|
|
const Lang* lang = nppParam.getLangFromIndex(index - 1); |
|
|
|
|
if (lang == nullptr) |
|
|
|
|
{ |
|
|
|
|
return NppDarkMode::onCtlColorDarker(hdcStatic); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
const bool useDefaultTab = isCheckedOrNot(IDC_CHECK_DEFAULTTABVALUE); |
|
|
|
|
return NppDarkMode::onCtlColorDarkerBGStaticText(hdcStatic, !useDefaultTab); |
|
|
|
|
} |
|
|
|
|
return NppDarkMode::onCtlColorDarker(hdcStatic); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case WM_PRINTCLIENT: |
|
|
|
@ -2880,7 +2890,9 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
|
|
|
|
|
case WM_COMMAND :
|
|
|
|
|
{ |
|
|
|
|
if (HIWORD(wParam) == LBN_SELCHANGE) |
|
|
|
|
switch (HIWORD(wParam)) |
|
|
|
|
{ |
|
|
|
|
case LBN_SELCHANGE: |
|
|
|
|
{ |
|
|
|
|
// Lang Menu
|
|
|
|
|
if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG) |
|
|
|
@ -2903,7 +2915,7 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
if (i != LB_ERR) |
|
|
|
|
{ |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, idButton2Enable), TRUE); |
|
|
|
|
int idListbox2Disable = (LOWORD(wParam)== IDC_LIST_ENABLEDLANG)?IDC_LIST_DISABLEDLANG:IDC_LIST_ENABLEDLANG; |
|
|
|
|
int idListbox2Disable = (LOWORD(wParam) == IDC_LIST_ENABLEDLANG) ? IDC_LIST_DISABLEDLANG : IDC_LIST_ENABLEDLANG; |
|
|
|
|
::SendDlgItemMessage(_hSelf, idListbox2Disable, LB_SETCURSEL, static_cast<WPARAM>(-1), 0); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, idButton2Disable), FALSE); |
|
|
|
|
} |
|
|
|
@ -2916,51 +2928,47 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
auto index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
if (index == LB_ERR) |
|
|
|
|
return FALSE; |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_GR_TABVALUE_STATIC), index ? SW_SHOW : SW_HIDE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), index ? SW_SHOW : SW_HIDE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_GR_TABVALUE_STATIC), index > 0 ? SW_SHOW : SW_HIDE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), index > 0 ? SW_SHOW : SW_HIDE); |
|
|
|
|
|
|
|
|
|
if (index) |
|
|
|
|
if (index > 0) |
|
|
|
|
{ |
|
|
|
|
Lang *lang = nppParam.getLangFromIndex(index - 1); |
|
|
|
|
Lang* lang = nppParam.getLangFromIndex(index - 1); |
|
|
|
|
if (!lang) return FALSE; |
|
|
|
|
bool useDefaultTab = (lang->_tabSize == -1 || lang->_tabSize == 0); |
|
|
|
|
|
|
|
|
|
::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), BM_SETCHECK, useDefaultTab, 0); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZE_STATIC), !useDefaultTab); |
|
|
|
|
|
|
|
|
|
int size = useDefaultTab ? nppGUI._tabSize : lang->_tabSize; |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, size, FALSE); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC, size, FALSE); |
|
|
|
|
|
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), useDefaultTab); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, size, FALSE); |
|
|
|
|
::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, useDefaultTab ? nppGUI._tabReplacedBySpace : lang->_isTabReplacedBySpace, 0); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), !useDefaultTab); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_EDIT_TABSIZEVAL), !useDefaultTab); |
|
|
|
|
|
|
|
|
|
if (!useDefaultTab) |
|
|
|
|
{ |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, lang->_tabSize, FALSE); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, lang->_tabSize, FALSE); |
|
|
|
|
::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, lang->_isTabReplacedBySpace, 0); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZE_STATIC), TRUE); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), TRUE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), SW_SHOW); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, nppGUI._tabSize, FALSE); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), SW_HIDE); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, nppGUI._tabSize, FALSE); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), TRUE); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_EDIT_TABSIZEVAL), TRUE); |
|
|
|
|
::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, nppGUI._tabReplacedBySpace, 0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
redrawDlgItem(IDC_TABSIZE_STATIC); |
|
|
|
|
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Check if it is double click
|
|
|
|
|
else if (HIWORD(wParam) == LBN_DBLCLK) |
|
|
|
|
case LBN_DBLCLK: |
|
|
|
|
{ |
|
|
|
|
// Lang Menu
|
|
|
|
|
if (LOWORD(wParam) == IDC_LIST_DISABLEDLANG || LOWORD(wParam) == IDC_LIST_ENABLEDLANG) |
|
|
|
@ -2978,8 +2986,108 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
/*else if (LOWORD(wParam) == IDC_LIST_TABSETTNG)
|
|
|
|
|
{ |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case EN_CHANGE: |
|
|
|
|
{ |
|
|
|
|
switch (LOWORD(wParam)) |
|
|
|
|
{ |
|
|
|
|
case IDC_EDIT_TABSIZEVAL: |
|
|
|
|
{ |
|
|
|
|
const auto tabSize = ::GetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, nullptr, FALSE); |
|
|
|
|
if (tabSize < 1) |
|
|
|
|
{ |
|
|
|
|
return FALSE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const bool useDefaultTab = isCheckedOrNot(IDC_CHECK_DEFAULTTABVALUE); |
|
|
|
|
const size_t index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
if (!useDefaultTab && index > 0) |
|
|
|
|
{ |
|
|
|
|
Lang* lang = nppParam.getLangFromIndex(index - 1); |
|
|
|
|
if (lang == nullptr) |
|
|
|
|
{ |
|
|
|
|
return FALSE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (lang->_langID == L_JS) |
|
|
|
|
{ |
|
|
|
|
Lang* ljs = nppParam.getLangFromID(L_JAVASCRIPT); |
|
|
|
|
ljs->_tabSize = tabSize; |
|
|
|
|
} |
|
|
|
|
else if (lang->_langID == L_JAVASCRIPT) |
|
|
|
|
{ |
|
|
|
|
Lang* ljavascript = nppParam.getLangFromID(L_JS); |
|
|
|
|
ljavascript->_tabSize = tabSize; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lang->_tabSize = tabSize; |
|
|
|
|
|
|
|
|
|
// write in langs.xml
|
|
|
|
|
nppParam.insertTabInfo(lang->getLangName(), lang->getTabInfo()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
nppGUI._tabSize = tabSize; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETTING_TAB_SIZE, 0, 0); |
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case EN_KILLFOCUS: |
|
|
|
|
{ |
|
|
|
|
switch (LOWORD(wParam)) |
|
|
|
|
{ |
|
|
|
|
case IDC_EDIT_TABSIZEVAL: |
|
|
|
|
{ |
|
|
|
|
const auto tabSize = ::GetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, nullptr, FALSE); |
|
|
|
|
|
|
|
|
|
if (tabSize < 1) |
|
|
|
|
{ |
|
|
|
|
const bool useDefaultTab = isCheckedOrNot(IDC_CHECK_DEFAULTTABVALUE); |
|
|
|
|
const size_t index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
auto prevSize = nppGUI._tabSize; |
|
|
|
|
if (!useDefaultTab && index > 0) |
|
|
|
|
{ |
|
|
|
|
Lang* lang = nppParam.getLangFromIndex(index - 1); |
|
|
|
|
if (lang != nullptr && lang->_tabSize > 0) |
|
|
|
|
{ |
|
|
|
|
prevSize = lang->_tabSize; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, prevSize, FALSE); |
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
return FALSE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (wParam) |
|
|
|
|
{ |
|
|
|
|
//
|
|
|
|
@ -3031,7 +3139,7 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
return TRUE; |
|
|
|
|
|
|
|
|
|
const size_t sL = 31; |
|
|
|
|
TCHAR s[sL + 1]; |
|
|
|
|
TCHAR s[sL + 1] = { '\0' }; |
|
|
|
|
auto lbTextLen = ::SendDlgItemMessage(_hSelf, list2Remove, LB_GETTEXTLEN, iRemove, 0); |
|
|
|
|
if (static_cast<size_t>(lbTextLen) > sL) |
|
|
|
|
return TRUE; |
|
|
|
@ -3101,56 +3209,6 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
// Tab setting
|
|
|
|
|
//
|
|
|
|
|
case IDC_TABSIZEVAL_STATIC: |
|
|
|
|
{ |
|
|
|
|
generic_string staticText = pNativeSpeaker->getLocalizedStrFromID("language-tabsize", TEXT("Tab Size: ")); |
|
|
|
|
ValueDlg tabSizeDlg; |
|
|
|
|
tabSizeDlg.init(_hInst, _hParent, nppGUI._tabSize, staticText.c_str()); |
|
|
|
|
POINT p; |
|
|
|
|
::GetCursorPos(&p); |
|
|
|
|
int size = tabSizeDlg.doDialog(p); |
|
|
|
|
|
|
|
|
|
//Tab size 0 removal
|
|
|
|
|
if (size <= 0) return FALSE; |
|
|
|
|
|
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, size, FALSE); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC, size, FALSE); |
|
|
|
|
|
|
|
|
|
auto index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
if (index == LB_ERR) return FALSE; |
|
|
|
|
|
|
|
|
|
if (index != 0) |
|
|
|
|
{ |
|
|
|
|
Lang *lang = nppParam.getLangFromIndex(index - 1); |
|
|
|
|
if (!lang) return FALSE; |
|
|
|
|
if (lang->_langID == L_JS) |
|
|
|
|
{ |
|
|
|
|
Lang *ljs = nppParam.getLangFromID(L_JAVASCRIPT); |
|
|
|
|
ljs->_tabSize = size; |
|
|
|
|
} |
|
|
|
|
else if (lang->_langID == L_JAVASCRIPT) |
|
|
|
|
{ |
|
|
|
|
Lang *ljavascript = nppParam.getLangFromID(L_JS); |
|
|
|
|
ljavascript->_tabSize = size; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
lang->_tabSize = size; |
|
|
|
|
|
|
|
|
|
// write in langs.xml
|
|
|
|
|
nppParam.insertTabInfo(lang->getLangName(), lang->getTabInfo()); |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
nppGUI._tabSize = size; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
::SendMessage(::GetParent(_hParent), NPPM_INTERNAL_SETTING_TAB_SIZE, 0, 0); |
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
case IDC_CHECK_REPLACEBYSPACE: |
|
|
|
|
{ |
|
|
|
|
bool isTabReplacedBySpace = BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_GETCHECK, 0, 0); |
|
|
|
@ -3189,8 +3247,8 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
|
|
|
|
|
case IDC_CHECK_DEFAULTTABVALUE: |
|
|
|
|
{ |
|
|
|
|
bool useDefaultTab = BST_CHECKED == ::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_DEFAULTTABVALUE), BM_GETCHECK, 0, 0); |
|
|
|
|
auto index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
const bool useDefaultTab = isCheckedOrNot(IDC_CHECK_DEFAULTTABVALUE); |
|
|
|
|
const auto index = ::SendDlgItemMessage(_hSelf, IDC_LIST_TABSETTNG, LB_GETCURSEL, 0, 0); |
|
|
|
|
if (index == LB_ERR || index == 0) // index == 0 shouldn't happen
|
|
|
|
|
return FALSE; |
|
|
|
|
|
|
|
|
@ -3203,21 +3261,30 @@ intptr_t CALLBACK LanguageSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|
|
|
|
lang->_isTabReplacedBySpace = useDefaultTab ? false : nppGUI._tabReplacedBySpace; |
|
|
|
|
|
|
|
|
|
//- set visual effect
|
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZE_STATIC), !useDefaultTab); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_TABSIZEVAL_STATIC, useDefaultTab ? nppGUI._tabSize : lang->_tabSize, FALSE); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_DISABLE_STATIC), useDefaultTab); |
|
|
|
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_TABSIZEVAL_STATIC), !useDefaultTab); |
|
|
|
|
::SendMessage(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), BM_SETCHECK, useDefaultTab ? nppGUI._tabReplacedBySpace : lang->_isTabReplacedBySpace, 0); |
|
|
|
|
::SetDlgItemInt(_hSelf, IDC_EDIT_TABSIZEVAL, useDefaultTab ? nppGUI._tabSize : lang->_tabSize, FALSE); |
|
|
|
|
setChecked(IDC_CHECK_REPLACEBYSPACE, useDefaultTab ? nppGUI._tabReplacedBySpace : lang->_isTabReplacedBySpace); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_REPLACEBYSPACE), !useDefaultTab); |
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_EDIT_TABSIZEVAL), !useDefaultTab); |
|
|
|
|
|
|
|
|
|
// write in langs.xml
|
|
|
|
|
if (useDefaultTab) |
|
|
|
|
nppParam.insertTabInfo(lang->getLangName(), -1); |
|
|
|
|
|
|
|
|
|
redrawDlgItem(IDC_TABSIZE_STATIC); |
|
|
|
|
|
|
|
|
|
return TRUE; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
default: |
|
|
|
|
{ |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return FALSE; |
|
|
|
|