diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index 5da35ef04..2fd20d691 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -516,9 +516,9 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM notifyDataModified(); apply(GENERAL_CHANGE); break; - case IDC_LANGUAGES_LIST : + case IDC_LANGUAGES_COMBO : { - int i = static_cast(::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETCURSEL, 0, 0)); + int i = static_cast(::SendDlgItemMessage(_hSelf, LOWORD(wParam), CB_GETCURSEL, 0, 0)); if (i != LB_ERR) { bool prevThemeState = _isThemeDirty; @@ -641,17 +641,17 @@ void WordStyleDlg::loadLangListFromNppParam() _globalStyles = nppParamInst.getGlobalStylers(); // Clean up Language List - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_RESETCONTENT, 0, 0); + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_RESETCONTENT, 0, 0); - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, reinterpret_cast(L"Global Styles")); + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_ADDSTRING, 0, reinterpret_cast(L"Global Styles")); // All the lexers for (size_t i = 0, nb = _lsArray.getNbLexer() ; i < nb ; ++i) { - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, reinterpret_cast(_lsArray.getLexerDescFromIndex(i))); + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_ADDSTRING, 0, reinterpret_cast(_lsArray.getLexerDescFromIndex(i))); } const int index2Begin = 0; - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_SETCURSEL, index2Begin, 0); + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_SETCURSEL, index2Begin, 0); setStyleListFromLexer(index2Begin); } @@ -993,10 +993,10 @@ bool WordStyleDlg::goToSection(const wchar_t* sectionNames) if (sections.size() == 0 || sections.size() >= 3) return false; - auto i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_FINDSTRING, (WPARAM)-1, (LPARAM)sections[0].c_str()); + auto i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_FINDSTRING, (WPARAM)-1, (LPARAM)sections[0].c_str()); if (i == LB_ERR) return false; - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_SETCURSEL, i, 0); + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_SETCURSEL, i, 0); setStyleListFromLexer(static_cast(i)); if (sections.size() == 1) @@ -1204,14 +1204,14 @@ void WordStyleDlg::setVisualFromStyleList() str[0] = '\0'; - auto i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETCURSEL, 0, 0); + auto i = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_GETCURSEL, 0, 0); if (i == LB_ERR) return; - auto lbTextLen = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETTEXTLEN, i, 0); + auto lbTextLen = ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_GETLBTEXTLEN, i, 0); if (static_cast(lbTextLen) > strLen) return; - ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_GETTEXT, i, reinterpret_cast(str)); + ::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_COMBO, CB_GETLBTEXT, i, reinterpret_cast(str)); i = ::SendDlgItemMessage(_hSelf, IDC_STYLES_LIST, LB_GETCURSEL, 0, 0); if (i == LB_ERR) diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.rc b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.rc index 13338964b..5c48cde48 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.rc +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.rc @@ -32,10 +32,10 @@ BEGIN COMBOBOX IDC_SWITCH2THEME_COMBO,95,7,104,78,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP GROUPBOX "",IDC_STATIC,7,24,166,212 - LTEXT "Language:",IDC_LANGDESC_STATIC,20,35,61,8 - LISTBOX IDC_LANGUAGES_LIST,17,46,59,146,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP - LTEXT "Style:",IDC_STYLEDESC_STATIC,89,35,68,8 - LISTBOX IDC_STYLES_LIST,86,46,77,146,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP + LTEXT "Language:",IDC_LANGDESC_STATIC,20,35,137,8 + COMBOBOX IDC_LANGUAGES_COMBO,17,46,146,36, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP + LTEXT "Style:",IDC_STYLEDESC_STATIC,20,63,137,8 + LISTBOX IDC_STYLES_LIST,17,74,146,118,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP LTEXT "Default ext.:",IDC_DEF_EXT_STATIC,20,203,61,8 EDITTEXT IDC_DEF_EXT_EDIT,17,214,59,12,ES_AUTOHSCROLL | ES_READONLY LTEXT "+",IDC_PLUSSYMBOL2_STATIC,82,216,8,8 diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlgRes.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlgRes.h index 2b3a6e784..cbf75593d 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlgRes.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlgRes.h @@ -62,7 +62,7 @@ #define IDC_SAVECLOSE_BUTTON (IDD_GLOBAL_STYLER_DLG + 1) #define IDC_SC_PERCENTAGE_SLIDER (IDD_GLOBAL_STYLER_DLG + 2) #define IDC_SC_TRANSPARENT_CHECK (IDD_GLOBAL_STYLER_DLG + 3) - #define IDC_LANGUAGES_LIST (IDD_GLOBAL_STYLER_DLG + 4) + #define IDC_LANGUAGES_COMBO (IDD_GLOBAL_STYLER_DLG + 4) #define IDC_STYLES_LIST (IDD_GLOBAL_STYLER_DLG + 5) #define IDC_SWITCH2THEME_STATIC (IDD_GLOBAL_STYLER_DLG + 6) #define IDC_SWITCH2THEME_COMBO (IDD_GLOBAL_STYLER_DLG + 7)