comctl32/tab: Return default tab width in TCM_SETMINTABWIDTH if lParam is a negative value.

This commit is contained in:
Aric Stewart 2008-12-02 08:14:35 -06:00 committed by Alexandre Julliard
parent 7981d6c736
commit 110a6048af
2 changed files with 8 additions and 5 deletions

View File

@ -2662,7 +2662,10 @@ static inline LRESULT TAB_SetMinTabWidth (TAB_INFO *infoPtr, INT cx)
TRACE("(%p,%d)\n", infoPtr, cx); TRACE("(%p,%d)\n", infoPtr, cx);
oldcx = infoPtr->tabMinWidth; if (infoPtr->tabMinWidth < 0)
oldcx = DEFAULT_MIN_TAB_WIDTH;
else
oldcx = infoPtr->tabMinWidth;
infoPtr->tabMinWidth = cx; infoPtr->tabMinWidth = cx;
TAB_SetItemBounds(infoPtr); TAB_SetItemBounds(infoPtr);
return oldcx; return oldcx;

View File

@ -509,6 +509,9 @@ static void test_tab(INT nMinTabWidth)
hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE); hwTab = create_tabcontrol(TCS_FIXEDWIDTH, TCIF_TEXT|TCIF_IMAGE);
SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth); SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth);
/* Get System default MinTabWidth */
if (nMinTabWidth < 0)
nMinTabWidth = SendMessage(hwTab, TCM_SETMINTABWIDTH, 0, nMinTabWidth);
hdc = GetDC(hwTab); hdc = GetDC(hwTab);
dpi = GetDeviceCaps(hdc, LOGPIXELSX); dpi = GetDeviceCaps(hdc, LOGPIXELSX);
@ -663,10 +666,7 @@ static void test_getters_setters(HWND parent_wnd, INT nTabs)
"Parent after sequence, adding tab control to parent", TRUE); "Parent after sequence, adding tab control to parent", TRUE);
flush_sequences(sequences, NUM_MSG_SEQUENCES); flush_sequences(sequences, NUM_MSG_SEQUENCES);
todo_wine{ ok(SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1) > 0,"TCM_SETMINTABWIDTH returned < 0\n");
expect(DEFAULT_MIN_TAB_WIDTH, (int)SendMessage(hTab, TCM_SETMINTABWIDTH, 0, -1));
}
ok_sequence(sequences, TAB_SEQ_INDEX, set_min_tab_width_seq, "Set minTabWidth test sequence", FALSE);
ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Set minTabWidth test parent sequence", FALSE); ok_sequence(sequences, PARENT_SEQ_INDEX, empty_sequence, "Set minTabWidth test parent sequence", FALSE);
/* Testing GetItemCount */ /* Testing GetItemCount */