Commit 0e5dac61 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/tab: Selected item should have TCIS_BUTTONPRESSED state.

parent db60f69c
...@@ -252,6 +252,9 @@ static inline LRESULT TAB_SetCurSel (TAB_INFO *infoPtr, INT iItem) ...@@ -252,6 +252,9 @@ static inline LRESULT TAB_SetCurSel (TAB_INFO *infoPtr, INT iItem)
return -1; return -1;
else { else {
if (infoPtr->iSelected != iItem) { if (infoPtr->iSelected != iItem) {
infoPtr->items[prevItem].dwState &= ~TCIS_BUTTONPRESSED;
infoPtr->items[iItem].dwState |= TCIS_BUTTONPRESSED;
infoPtr->iSelected=iItem; infoPtr->iSelected=iItem;
infoPtr->uFocus=iItem; infoPtr->uFocus=iItem;
TAB_EnsureSelectionVisible(infoPtr); TAB_EnsureSelectionVisible(infoPtr);
...@@ -489,12 +492,8 @@ static LRESULT TAB_KeyUp(TAB_INFO* infoPtr, WPARAM keyCode) ...@@ -489,12 +492,8 @@ static LRESULT TAB_KeyUp(TAB_INFO* infoPtr, WPARAM keyCode)
{ {
if (!TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGING)) if (!TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGING))
{ {
infoPtr->iSelected = newItem; TAB_SetCurSel(infoPtr, newItem);
infoPtr->uFocus = newItem;
TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGE); TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGE);
TAB_EnsureSelectionVisible(infoPtr);
TAB_InvalidateTabArea(infoPtr);
} }
} }
...@@ -615,13 +614,8 @@ TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam) ...@@ -615,13 +614,8 @@ TAB_LButtonDown (TAB_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{ {
if (!TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGING)) if (!TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGING))
{ {
infoPtr->iSelected = newItem; TAB_SetCurSel(infoPtr, newItem);
infoPtr->uFocus = newItem;
TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGE); TAB_SendSimpleNotify(infoPtr, TCN_SELCHANGE);
TAB_EnsureSelectionVisible(infoPtr);
TAB_InvalidateTabArea(infoPtr);
} }
} }
return 0; return 0;
......
...@@ -727,6 +727,7 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs) ...@@ -727,6 +727,7 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
{ {
INT selectionIndex; INT selectionIndex;
INT focusIndex; INT focusIndex;
TCITEM tcItem;
flush_sequences(sequences, NUM_MSG_SEQUENCES); flush_sequences(sequences, NUM_MSG_SEQUENCES);
...@@ -756,6 +757,15 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs) ...@@ -756,6 +757,15 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
ok_sequence(sequences, TAB_SEQ_INDEX, getset_cur_sel_seq, "Getset curSel test sequence", FALSE); ok_sequence(sequences, TAB_SEQ_INDEX, getset_cur_sel_seq, "Getset curSel test sequence", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Getset curSel test parent sequence", FALSE); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Getset curSel test parent sequence", FALSE);
/* selected item should have TCIS_BUTTONPRESSED state
It doesn't depend on button state */
memset(&tcItem, 0, sizeof(TCITEM));
tcItem.mask = TCIF_STATE;
tcItem.dwStateMask = TCIS_BUTTONPRESSED;
selectionIndex = SendMessage(hTab, TCM_GETCURSEL, 0, 0);
SendMessage(hTab, TCM_GETITEM, selectionIndex, (LPARAM) &tcItem);
ok (tcItem.dwState & TCIS_BUTTONPRESSED, "Selected item should have TCIS_BUTTONPRESSED\n");
} }
/* Testing ExtendedStyle */ /* Testing ExtendedStyle */
......
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