comctl32/listbox: Update caret index on LB_SETSEL.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47459 Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1a25f47d59
commit
7f498f4607
|
@ -2858,7 +2858,11 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam,
|
|||
case LB_SETSEL:
|
||||
ret = LISTBOX_SetSelection( descr, lParam, wParam, FALSE );
|
||||
if (ret != LB_ERR && wParam)
|
||||
{
|
||||
descr->anchor_item = lParam;
|
||||
if (lParam != -1)
|
||||
LISTBOX_SetCaretIndex( descr, lParam, TRUE );
|
||||
}
|
||||
return ret;
|
||||
|
||||
case LB_SETCURSEL:
|
||||
|
|
|
@ -707,16 +707,22 @@ static void test_LB_SETSEL(void)
|
|||
ok(ret == 0, "Unexpected return value %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0);
|
||||
ok(ret == 0, "Unexpected anchor index %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0);
|
||||
ok(ret == 0, "Unexpected caret index %d.\n", ret);
|
||||
|
||||
ret = SendMessageA(list, LB_SETSEL, TRUE, 1);
|
||||
ok(ret == 0, "Unexpected return value %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected anchor index %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected caret index %d.\n", ret);
|
||||
|
||||
ret = SendMessageA(list, LB_SETSEL, FALSE, 1);
|
||||
ok(ret == 0, "Unexpected return value %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected anchor index %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected caret index %d.\n", ret);
|
||||
|
||||
DestroyWindow(list);
|
||||
|
||||
|
@ -731,16 +737,22 @@ static void test_LB_SETSEL(void)
|
|||
ok(ret == 0, "Unexpected return value %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0);
|
||||
ok(ret == 0, "Unexpected anchor index %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0);
|
||||
ok(ret == 0, "Unexpected caret index %d.\n", ret);
|
||||
|
||||
ret = SendMessageA(list, LB_SETSEL, TRUE, 1);
|
||||
ok(ret == 0, "Unexpected return value %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected anchor index %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected caret index %d.\n", ret);
|
||||
|
||||
ret = SendMessageA(list, LB_SETSEL, FALSE, 1);
|
||||
ok(ret == 0, "Unexpected return value %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETANCHORINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected anchor index %d.\n", ret);
|
||||
ret = SendMessageA(list, LB_GETCARETINDEX, 0, 0);
|
||||
ok(ret == 1, "Unexpected caret index %d.\n", ret);
|
||||
|
||||
DestroyWindow(list);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue