|
|
|
@ -1911,28 +1911,41 @@ INT_PTR CALLBACK NewDocumentSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_CHECK_OPENANSIASUTF8, BM_SETCHECK, (ID2Check == IDC_RADIO_UTF8SANSBOM && ndds._openAnsiAsUtf8)?BST_CHECKED:BST_UNCHECKED, 0);
|
|
|
|
|
::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_OPENANSIASUTF8), ID2Check == IDC_RADIO_UTF8SANSBOM);
|
|
|
|
|
|
|
|
|
|
size_t index = 0;
|
|
|
|
|
for (int i = L_TEXT ; i < nppParam.L_END ; ++i)
|
|
|
|
|
for (int i = L_TEXT + 1 ; i < nppParam.L_END ; ++i) // Skip L_TEXT
|
|
|
|
|
{
|
|
|
|
|
LangType lt = static_cast<LangType>(i);
|
|
|
|
|
str.clear();
|
|
|
|
|
if (static_cast<LangType>(i) != L_USER)
|
|
|
|
|
if (lt != L_USER && lt != L_JS)
|
|
|
|
|
{
|
|
|
|
|
int cmdID = nppParam.langTypeToCommandID(static_cast<LangType>(i));
|
|
|
|
|
int cmdID = nppParam.langTypeToCommandID(lt);
|
|
|
|
|
if ((cmdID != -1))
|
|
|
|
|
{
|
|
|
|
|
getNameStrFromCmd(cmdID, str);
|
|
|
|
|
if (str.length() > 0)
|
|
|
|
|
{
|
|
|
|
|
_langList.push_back(LangID_Name(static_cast<LangType>(i), str));
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(str.c_str()));
|
|
|
|
|
if (ndds._lang == i)
|
|
|
|
|
index = _langList.size() - 1;
|
|
|
|
|
size_t index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_ADDSTRING, 0, reinterpret_cast<LPARAM>(str.c_str()));
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_SETITEMDATA, index, lt);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_SETCURSEL, index, 0);
|
|
|
|
|
|
|
|
|
|
// Insert L_TEXT to the 1st position
|
|
|
|
|
int normalTextCmdID = nppParam.langTypeToCommandID(L_TEXT);
|
|
|
|
|
getNameStrFromCmd(normalTextCmdID, str);
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(str.c_str()));
|
|
|
|
|
|
|
|
|
|
// Set chosen language
|
|
|
|
|
LangType l = L_TEXT;
|
|
|
|
|
size_t cbCount = ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_GETCOUNT, 0, 0);
|
|
|
|
|
size_t j = 0;
|
|
|
|
|
for (; j < cbCount; ++j)
|
|
|
|
|
{
|
|
|
|
|
l = static_cast<LangType>(::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_GETITEMDATA, j, 0));
|
|
|
|
|
if (ndds._lang == l)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_SETCURSEL, j, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case WM_CTLCOLORLISTBOX:
|
|
|
|
@ -2038,7 +2051,7 @@ INT_PTR CALLBACK NewDocumentSubDlg::run_dlgProc(UINT message, WPARAM wParam, LPA
|
|
|
|
|
if (LOWORD(wParam) == IDC_COMBO_DEFAULTLANG)
|
|
|
|
|
{
|
|
|
|
|
auto index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_GETCURSEL, 0, 0);
|
|
|
|
|
ndds._lang = _langList[index]._id;
|
|
|
|
|
ndds._lang = static_cast<LangType>(::SendDlgItemMessage(_hSelf, IDC_COMBO_DEFAULTLANG, CB_GETITEMDATA, index, 0));
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else if (LOWORD(wParam) == IDC_COMBO_OTHERCP)
|
|
|
|
|