From e8ffcaa3723b1b5f4c8f82a5f9fb088e3ba194fd Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Mon, 16 Apr 2001 19:32:19 +0000 Subject: [PATCH] Slightly improve keyboard tracking in combobox. --- controls/listbox.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/controls/listbox.c b/controls/listbox.c index 252cff7e587..5960c4563e8 100644 --- a/controls/listbox.c +++ b/controls/listbox.c @@ -753,6 +753,8 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPARAM lParam, BOOL if (!lParam) return strlenW(descr->items[index].str); + TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(descr->items[index].str)); + if(unicode) { LPWSTR buffer = (LPWSTR)lParam; @@ -2046,6 +2048,7 @@ static LRESULT LISTBOX_HandleLButtonDownCombo( WND *pWnd, LB_DESCR *pDescr, if(!PtInRect(&screenRect, screenMousePos)) { + LISTBOX_SetCaretIndex( pWnd, pDescr, pDescr->lphc->droppedIndex, FALSE ); LISTBOX_SetSelection( pWnd, pDescr, pDescr->lphc->droppedIndex, FALSE, FALSE ); COMBO_FlipListbox( pDescr->lphc, FALSE, FALSE ); return 0; @@ -2745,6 +2748,10 @@ static LRESULT WINAPI ListBoxWndProc_locked( WND* wnd, UINT msg, { INT index; LPWSTR textW; + + if(HAS_STRINGS(descr)) + TRACE("LB_SELECTSTRING: %s\n", unicode ? debugstr_w((LPWSTR)lParam) : + debugstr_a((LPSTR)lParam)); if(unicode || !HAS_STRINGS(descr)) textW = (LPWSTR)lParam; else @@ -2758,7 +2765,10 @@ static LRESULT WINAPI ListBoxWndProc_locked( WND* wnd, UINT msg, if(!unicode && HAS_STRINGS(descr)) HeapFree(GetProcessHeap(), 0, textW); if (index != LB_ERR) + { + LISTBOX_SetCaretIndex( wnd, descr, index, TRUE ); LISTBOX_SetSelection( wnd, descr, index, TRUE, FALSE ); + } return index; } @@ -3061,7 +3071,7 @@ static LRESULT WINAPI ComboLBWndProc_locked( WND* wnd, UINT msg, WPARAM wParam, LPARAM lParam, BOOL unicode ) { LRESULT lRet = 0; - HWND hwnd = wnd->hwndSelf; + HWND hwnd; if (wnd) { @@ -3070,6 +3080,8 @@ static LRESULT WINAPI ComboLBWndProc_locked( WND* wnd, UINT msg, TRACE_(combo)("[%04x]: msg %s wp %08x lp %08lx\n", wnd->hwndSelf, SPY_GetMsgName(msg), wParam, lParam ); + hwnd = wnd->hwndSelf; + if( descr || msg == WM_CREATE ) { LPHEADCOMBO lphc = (descr) ? descr->lphc : NULL; -- 2.11.4.GIT