Commit f2519fdc authored by Lei Zhang's avatar Lei Zhang Committed by Alexandre Julliard

comctl32: Set tab focus correctly.

parent 73213d14
......@@ -2325,11 +2325,6 @@ static void TAB_Refresh (TAB_INFO *infoPtr, HDC hdc)
/* Then, draw the selected item */
TAB_DrawItem (infoPtr, hdc, infoPtr->iSelected);
/* If we haven't set the current focus yet, set it now.
* Only happens when we first paint the tab controls */
if (infoPtr->uFocus == -1)
TAB_SetCurFocus(infoPtr, infoPtr->iSelected);
}
SelectObject (hdc, hOldFont);
......@@ -2637,6 +2632,10 @@ TAB_InsertItemT (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
TRACE("[%p]: added item %d %s\n",
infoPtr->hwnd, iItem, debugstr_w(item->pszText));
/* If we haven't set the current focus yet, set it now. */
if (infoPtr->uFocus == -1)
TAB_SetCurFocus(infoPtr, iItem);
return iItem;
}
......
......@@ -876,9 +876,7 @@ static void test_insert_focus(HWND parent_wnd)
expect(1, nTabsRetrieved);
r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0);
todo_wine {
expect(0, r);
}
expect(0, r);
tcNewTab.iImage = 2;
r = SendMessage(hTab, TCM_INSERTITEM, 2, (LPARAM) &tcNewTab);
......@@ -888,9 +886,7 @@ static void test_insert_focus(HWND parent_wnd)
expect(2, nTabsRetrieved);
r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0);
todo_wine {
expect(0, r);
}
expect(0, r);
r = SendMessage(hTab, TCM_SETCURFOCUS, -1, 0);
expect(0, r);
......@@ -903,9 +899,7 @@ static void test_insert_focus(HWND parent_wnd)
expect(2, r);
r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0);
todo_wine {
expect(2, r);
}
expect(2, r);
ok_sequence(sequences, TAB_SEQ_INDEX, insert_focus_seq, "insert_focus test sequence", TRUE);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "insert_focus parent test sequence", FALSE);
......@@ -930,9 +924,7 @@ static void test_delete_focus(HWND parent_wnd)
expect(2, nTabsRetrieved);
r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0);
todo_wine {
expect(0, r);
}
expect(0, r);
r = SendMessage(hTab, TCM_DELETEITEM, 1, 0);
expect(1, r);
......@@ -941,9 +933,7 @@ static void test_delete_focus(HWND parent_wnd)
expect(1, nTabsRetrieved);
r = SendMessage(hTab, TCM_GETCURFOCUS, 0, 0);
todo_wine {
expect(0, r);
}
expect(0, r);
r = SendMessage(hTab, TCM_SETCURFOCUS, -1, 0);
expect(0, r);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment