[COMCTL32]

* Sync with Wine 1.5.26.

svn path=/trunk/; revision=58521
This commit is contained in:
Amine Khaldi 2013-03-16 17:06:48 +00:00
parent 92de840cb7
commit bb286fcb5a
14 changed files with 492 additions and 403 deletions

View file

@ -147,8 +147,8 @@ DWORD WINAPI GetSize (LPVOID lpMem)
* MRU-Functions {COMCTL32}
*
* NOTES
* The MRU-Api is a set of functions to manipulate lists of M.R.U. (Most Recently
* Used) items. It is an undocumented Api that is used (at least) by the shell
* The MRU-API is a set of functions to manipulate lists of M.R.U. (Most Recently
* Used) items. It is an undocumented API that is used (at least) by the shell
* and explorer to implement their recent documents feature.
*
* Since these functions are undocumented, they are unsupported by MS and

View file

@ -205,16 +205,16 @@ DATETIME_SetSystemTime (DATETIME_INFO *infoPtr, DWORD flag, const SYSTEMTIME *sy
systime->wHour, systime->wMinute, systime->wSecond);
if (flag == GDT_VALID) {
if (systime->wYear == 0 ||
systime->wMonth < 1 || systime->wMonth > 12 ||
systime->wDay < 1 ||
systime->wDay > MONTHCAL_MonthLength(systime->wMonth, systime->wYear) ||
systime->wHour > 23 ||
systime->wMinute > 59 ||
systime->wSecond > 59 ||
systime->wMilliseconds > 999
)
return FALSE;
if (systime->wYear == 0 ||
systime->wMonth < 1 || systime->wMonth > 12 ||
systime->wDay < 1 ||
systime->wDay > MONTHCAL_MonthLength(systime->wMonth, systime->wYear) ||
systime->wHour > 23 ||
systime->wMinute > 59 ||
systime->wSecond > 59 ||
systime->wMilliseconds > 999
)
return FALSE;
/* Windows returns true if the date is valid but outside the limits set */
if (DATETIME_IsDateInValidRange(infoPtr, systime) == FALSE)

View file

@ -459,7 +459,7 @@ BOOL WINAPI DPA_Grow (HDPA hdpa, INT nGrow)
/**************************************************************************
* DPA_Clone [COMCTL32.331]
*
* Copies a pointer array to an other one or creates a copy
* Copies a pointer array to another one or creates a copy
*
* PARAMS
* hdpa [I] handle (pointer) to the existing (source) pointer array

View file

@ -118,6 +118,7 @@ typedef struct
{
HWND hwnd;
HIMAGELIST himl;
HIMAGELIST himlNoCursor;
/* position of the drag image relative to the window */
INT x;
INT y;
@ -130,7 +131,7 @@ typedef struct
HBITMAP hbmBg;
} INTERNALDRAG;
static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, FALSE, 0 };
static INTERNALDRAG InternalDrag = { 0, 0, 0, 0, 0, 0, 0, FALSE, 0 };
static HBITMAP ImageList_CreateImage(HDC hdc, HIMAGELIST himl, UINT count);
static HRESULT ImageListImpl_CreateInstance(const IUnknown *pUnkOuter, REFIID iid, void** ppv);
@ -611,7 +612,7 @@ ImageList_BeginDrag (HIMAGELIST himlTrack, INT iTrack,
cx = himlTrack->cx;
cy = himlTrack->cy;
InternalDrag.himl = ImageList_Create (cx, cy, himlTrack->flags, 1, 1);
InternalDrag.himlNoCursor = InternalDrag.himl = ImageList_Create (cx, cy, himlTrack->flags, 1, 1);
if (InternalDrag.himl == NULL) {
WARN("Error creating drag image list!\n");
return FALSE;
@ -1639,8 +1640,10 @@ ImageList_EndDrag (void)
{
/* cleanup the InternalDrag struct */
InternalDrag.hwnd = 0;
if (InternalDrag.himl != InternalDrag.himlNoCursor)
ImageList_Destroy (InternalDrag.himlNoCursor);
ImageList_Destroy (InternalDrag.himl);
InternalDrag.himl = 0;
InternalDrag.himlNoCursor = InternalDrag.himl = 0;
InternalDrag.x= 0;
InternalDrag.y= 0;
InternalDrag.dxHotspot = 0;
@ -2083,6 +2086,7 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
INT cxDst, cyDst;
INT xOff1, yOff1, xOff2, yOff2;
POINT pt1, pt2;
INT newFlags;
TRACE("(himl1=%p i1=%d himl2=%p i2=%d dx=%d dy=%d)\n", himl1, i1, himl2,
i2, dx, dy);
@ -2122,7 +2126,10 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
yOff2 = 0;
}
himlDst = ImageList_Create (cxDst, cyDst, ILC_MASK | ILC_COLOR, 1, 1);
newFlags = (himl1->flags > himl2->flags ? himl1->flags : himl2->flags) & ILC_COLORDDB;
if (newFlags == ILC_COLORDDB && (himl1->flags & ILC_COLORDDB) == ILC_COLOR16)
newFlags = ILC_COLOR16; /* this is what native (at least v5) does, don't know why */
himlDst = ImageList_Create (cxDst, cyDst, ILC_MASK | newFlags, 1, 1);
if (himlDst)
{
@ -2135,8 +2142,13 @@ ImageList_Merge (HIMAGELIST himl1, INT i1, HIMAGELIST himl2, INT i2,
BitBlt (himlDst->hdcImage, xOff1, yOff1, himl1->cx, himl1->cy, himl1->hdcImage, pt1.x, pt1.y, SRCCOPY);
if (i2 >= 0 && i2 < himl2->cCurImage)
{
BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , pt2.x, pt2.y, SRCAND);
BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCPAINT);
if (himl2->flags & ILC_MASK)
{
BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcMask , pt2.x, pt2.y, SRCAND);
BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCPAINT);
}
else
BitBlt (himlDst->hdcImage, xOff2, yOff2, himl2->cx, himl2->cy, himl2->hdcImage, pt2.x, pt2.y, SRCCOPY);
}
/* copy mask */
@ -2239,7 +2251,7 @@ HIMAGELIST WINAPI ImageList_Read (LPSTREAM pstm)
void *image_bits, *mask_bits = NULL;
ILHEAD ilHead;
HIMAGELIST himl;
int i;
unsigned int i;
TRACE("%p\n", pstm);
@ -2703,7 +2715,7 @@ ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag,
visible = InternalDrag.bShow;
himlTemp = ImageList_Merge (InternalDrag.himl, 0, himlDrag, iDrag,
himlTemp = ImageList_Merge (InternalDrag.himlNoCursor, 0, himlDrag, iDrag,
dxHotspot, dyHotspot);
if (visible) {
@ -2717,7 +2729,8 @@ ImageList_SetDragCursorImage (HIMAGELIST himlDrag, INT iDrag,
InternalDrag.hbmBg = 0;
}
ImageList_Destroy (InternalDrag.himl);
if (InternalDrag.himl != InternalDrag.himlNoCursor)
ImageList_Destroy (InternalDrag.himl);
InternalDrag.himl = himlTemp;
if (visible) {

File diff suppressed because it is too large Load diff

View file

@ -1076,7 +1076,8 @@ static void MONTHCAL_PaintFocusAndCircle(const MONTHCAL_INFO *infoPtr, HDC hdc,
/* months before first calendar month and after last calendar month */
static void MONTHCAL_PaintLeadTrailMonths(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps)
{
INT mask, length, index;
INT mask, index;
UINT length;
SYSTEMTIME st_max, st;
if (infoPtr->dwStyle & MCS_NOTRAILINGDATES) return;
@ -1116,7 +1117,8 @@ static void MONTHCAL_PaintLeadTrailMonths(const MONTHCAL_INFO *infoPtr, HDC hdc,
static void MONTHCAL_PaintCalendar(const MONTHCAL_INFO *infoPtr, HDC hdc, const PAINTSTRUCT *ps, INT calIdx)
{
const SYSTEMTIME *date = &infoPtr->calendars[calIdx].month;
INT i, j, length;
INT i, j;
UINT length;
RECT r, fill_bk_rect;
SYSTEMTIME st;
WCHAR buf[80];

View file

@ -168,7 +168,7 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
int index,
int skipdir,
HPROPSHEETPAGE hpage);
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo);
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo, int original_index);
static PADDING_INFO PROPSHEET_GetPaddingInfoWizard(HWND hwndDlg, const PropSheetInfo* psInfo);
static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID);
static BOOL PROPSHEET_RemovePage(HWND hwndDlg, int index, HPROPSHEETPAGE hpage);
@ -1998,9 +1998,8 @@ static BOOL PROPSHEET_SetCurSel(HWND hwndDlg,
HWND hwndTabControl = GetDlgItem(hwndDlg, IDC_TABCONTROL);
TRACE("index %d, skipdir %d, hpage %p\n", index, skipdir, hpage);
/* hpage takes precedence over index */
if (hpage != NULL)
index = PROPSHEET_GetPageIndex(hpage, psInfo);
index = PROPSHEET_GetPageIndex(hpage, psInfo, index);
if (index < 0 || index >= psInfo->nPages)
{
@ -2331,13 +2330,8 @@ static BOOL PROPSHEET_RemovePage(HWND hwndDlg,
if (!psInfo) {
return FALSE;
}
/*
* hpage takes precedence over index.
*/
if (hpage != 0)
{
index = PROPSHEET_GetPageIndex(hpage, psInfo);
}
index = PROPSHEET_GetPageIndex(hpage, psInfo, index);
/* Make sure that index is within range */
if (index < 0 || index >= psInfo->nPages)
@ -2575,16 +2569,11 @@ static LRESULT PROPSHEET_IndexToHwnd(HWND hwndDlg, int iPageIndex)
*/
static LRESULT PROPSHEET_PageToIndex(HWND hwndDlg, HPROPSHEETPAGE hPage)
{
int index;
PropSheetInfo * psInfo = GetPropW(hwndDlg, PropSheetInfoStr);
TRACE("(%p, %p)\n", hwndDlg, hPage);
for (index = 0; index < psInfo->nPages; index++)
if (psInfo->proppage[index].hpage == hPage)
return index;
WARN("%p not found\n", hPage);
return -1;
return PROPSHEET_GetPageIndex(hPage, psInfo, -1);
}
/******************************************************************************
@ -2660,26 +2649,20 @@ static BOOL PROPSHEET_RecalcPageSizes(HWND hwndDlg)
* PROPSHEET_GetPageIndex
*
* Given a HPROPSHEETPAGE, returns the index of the corresponding page from
* the array of PropPageInfo.
* the array of PropPageInfo. If page is not found original index is used
* (page takes precedence over index).
*/
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE hpage, const PropSheetInfo* psInfo)
static int PROPSHEET_GetPageIndex(HPROPSHEETPAGE page, const PropSheetInfo* psInfo, int original_index)
{
BOOL found = FALSE;
int index = 0;
int index;
TRACE("hpage %p\n", hpage);
while ((index < psInfo->nPages) && (found == FALSE))
{
if (psInfo->proppage[index].hpage == hpage)
found = TRUE;
else
index++;
}
TRACE("page %p index %d\n", page, original_index);
if (found == FALSE)
index = -1;
for (index = 0; index < psInfo->nPages; index++)
if (psInfo->proppage[index].hpage == page)
return index;
return index;
return original_index;
}
/******************************************************************************

View file

@ -1123,7 +1123,7 @@ REBAR_MoveChildWindows (const REBAR_INFO *infoPtr, UINT start, UINT endplus)
* or infoPtr->uNumBands if none */
static int next_visible(const REBAR_INFO *infoPtr, int i)
{
int n;
unsigned int n;
for (n = i + 1; n < infoPtr->uNumBands; n++)
if (!HIDDENBAND(REBAR_GetBand(infoPtr, n)))
break;

View file

@ -285,7 +285,6 @@ STATUSBAR_RefreshPart (const STATUS_INFO *infoPtr, HDC hdc, const STATUSWINDOWPA
static LRESULT
STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
{
int i;
RECT rect;
HBRUSH hbrBk;
HFONT hOldFont;
@ -319,6 +318,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
if (infoPtr->simple) {
STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->part0, 0);
} else {
unsigned int i;
for (i = 0; i < infoPtr->numParts; i++) {
STATUSBAR_RefreshPart (infoPtr, hdc, &infoPtr->parts[i], i);
}
@ -336,7 +337,8 @@ STATUSBAR_Refresh (STATUS_INFO *infoPtr, HDC hdc)
static int
STATUSBAR_InternalHitTest(const STATUS_INFO *infoPtr, const POINT *pt)
{
int i;
unsigned int i;
if (infoPtr->simple)
return 255;
@ -352,7 +354,7 @@ STATUSBAR_SetPartBounds (STATUS_INFO *infoPtr)
{
STATUSWINDOWPART *part;
RECT rect, *r;
int i;
UINT i;
/* get our window size */
GetClientRect (infoPtr->Self, &rect);
@ -883,7 +885,7 @@ STATUSBAR_Simple (STATUS_INFO *infoPtr, BOOL simple)
static LRESULT
STATUSBAR_WMDestroy (STATUS_INFO *infoPtr)
{
int i;
unsigned int i;
TRACE("\n");
for (i = 0; i < infoPtr->numParts; i++) {

View file

@ -5212,9 +5212,9 @@ TOOLBAR_Destroy (TOOLBAR_INFO *infoPtr)
if (infoPtr->himlInt)
ImageList_Destroy (infoPtr->himlInt);
TOOLBAR_DeleteImageList(&infoPtr->himlDef, &infoPtr->cimlDef);
TOOLBAR_DeleteImageList(&infoPtr->himlDis, &infoPtr->cimlDis);
TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot);
TOOLBAR_DeleteImageList(&infoPtr->himlDef, &infoPtr->cimlDef);
TOOLBAR_DeleteImageList(&infoPtr->himlDis, &infoPtr->cimlDis);
TOOLBAR_DeleteImageList(&infoPtr->himlHot, &infoPtr->cimlHot);
/* delete default font */
DeleteObject (infoPtr->hDefaultFont);

View file

@ -991,9 +991,17 @@ TOOLTIPS_CheckTool (const TOOLTIPS_INFO *infoPtr, BOOL bShowTest)
if (nTool == -1)
return -1;
if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest) {
if (!TOOLTIPS_IsWindowActive (GetWindow (infoPtr->hwndSelf, GW_OWNER)))
return -1;
if (!(GetWindowLongW (infoPtr->hwndSelf, GWL_STYLE) & TTS_ALWAYSTIP) && bShowTest)
{
TTTOOL_INFO *ti = &infoPtr->tools[nTool];
HWND hwnd = (ti->uFlags & TTF_IDISHWND) ? (HWND)ti->uId : ti->hwnd;
if (!TOOLTIPS_IsWindowActive(hwnd))
{
TRACE("not active: hwnd %p, parent %p, active %p\n",
hwnd, GetParent(hwnd), GetActiveWindow());
return -1;
}
}
TRACE("tool %d\n", nTool);

View file

@ -102,6 +102,7 @@ typedef struct tagTREEVIEW_INFO
BOOL insertBeforeorAfter; /* flag used by TVM_SETINSERTMARK */
HIMAGELIST dragList; /* Bitmap of dragged item */
LONG scrollX;
INT wheelRemainder;
COLORREF clrBk;
COLORREF clrText;
COLORREF clrLine;
@ -110,6 +111,7 @@ typedef struct tagTREEVIEW_INFO
HFONT hDefaultFont;
HFONT hBoldFont;
HFONT hUnderlineFont;
HFONT hBoldUnderlineFont;
HCURSOR hcurHand;
HWND hwndToolTip;
@ -303,11 +305,22 @@ TREEVIEW_CreateUnderlineFont(HFONT hOrigFont)
return CreateFontIndirectW(&font);
}
static HFONT
TREEVIEW_CreateBoldUnderlineFont(HFONT hfont)
{
LOGFONTW font;
GetObjectW(hfont, sizeof(font), &font);
font.lfWeight = FW_BOLD;
font.lfUnderline = TRUE;
return CreateFontIndirectW(&font);
}
static inline HFONT
TREEVIEW_FontForItem(const TREEVIEW_INFO *infoPtr, const TREEVIEW_ITEM *item)
{
if ((infoPtr->dwStyle & TVS_TRACKSELECT) && (item == infoPtr->hotItem))
return infoPtr->hUnderlineFont;
return item->state & TVIS_BOLD ? infoPtr->hBoldUnderlineFont : infoPtr->hUnderlineFont;
if (item->state & TVIS_BOLD)
return infoPtr->hBoldFont;
return infoPtr->hFont;
@ -1562,7 +1575,7 @@ TREEVIEW_DeleteItem(TREEVIEW_INFO *infoPtr, HTREEITEM item)
newFirstVisible = item->prevSibling;
else if (item->parent != infoPtr->root)
newFirstVisible = item->parent;
TREEVIEW_SetFirstVisible(infoPtr, NULL, TRUE);
TREEVIEW_SetFirstVisible(infoPtr, NULL, TRUE);
}
else
newFirstVisible = infoPtr->firstVisible;
@ -1903,8 +1916,10 @@ TREEVIEW_SetFont(TREEVIEW_INFO *infoPtr, HFONT hFont, BOOL bRedraw)
DeleteObject(infoPtr->hBoldFont);
DeleteObject(infoPtr->hUnderlineFont);
DeleteObject(infoPtr->hBoldUnderlineFont);
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
infoPtr->hBoldUnderlineFont = TREEVIEW_CreateBoldUnderlineFont(infoPtr->hFont);
if (!infoPtr->bHeightSet)
infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
@ -3155,10 +3170,10 @@ TREEVIEW_Sort(TREEVIEW_INFO *infoPtr, HTREEITEM parent,
{
int visOrder = infoPtr->firstVisible->visibleOrder;
if (parent == infoPtr->root)
TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL);
else
TREEVIEW_RecalculateVisibleOrder(infoPtr, parent);
if (parent == infoPtr->root)
TREEVIEW_RecalculateVisibleOrder(infoPtr, NULL);
else
TREEVIEW_RecalculateVisibleOrder(infoPtr, parent);
if (TREEVIEW_IsChildOf(parent, infoPtr->firstVisible))
{
@ -4916,7 +4931,7 @@ scroll:
static LRESULT
TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
short gcWheelDelta;
short wheelDelta;
UINT pulScrollLines = 3;
if (wParam & (MK_SHIFT | MK_CONTROL))
@ -4927,13 +4942,25 @@ TREEVIEW_MouseWheel(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
SystemParametersInfoW(SPI_GETWHEELSCROLLLINES, 0, &pulScrollLines, 0);
gcWheelDelta = -(short)HIWORD(wParam);
pulScrollLines *= (gcWheelDelta / WHEEL_DELTA);
wheelDelta = GET_WHEEL_DELTA_WPARAM(wParam);
/* if scrolling changes direction, ignore left overs */
if ((wheelDelta < 0 && infoPtr->wheelRemainder < 0) ||
(wheelDelta > 0 && infoPtr->wheelRemainder > 0))
infoPtr->wheelRemainder += wheelDelta;
else
infoPtr->wheelRemainder = wheelDelta;
if (abs(gcWheelDelta) >= WHEEL_DELTA && pulScrollLines)
if (infoPtr->wheelRemainder && pulScrollLines)
{
int newDy = infoPtr->firstVisible->visibleOrder + pulScrollLines;
int maxDy = infoPtr->maxVisibleOrder;
int newDy;
int maxDy;
int lineScroll;
lineScroll = pulScrollLines * (float)infoPtr->wheelRemainder / WHEEL_DELTA;
infoPtr->wheelRemainder -= WHEEL_DELTA * lineScroll / (int)pulScrollLines;
newDy = infoPtr->firstVisible->visibleOrder - lineScroll;
maxDy = infoPtr->maxVisibleOrder;
if (newDy > maxDy)
newDy = maxDy;
@ -5038,6 +5065,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
/* dragList */
infoPtr->scrollX = 0;
infoPtr->wheelRemainder = 0;
infoPtr->clrBk = CLR_NONE; /* use system color */
infoPtr->clrText = CLR_NONE; /* use system color */
@ -5064,6 +5092,7 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectW(&lf);
infoPtr->hBoldFont = TREEVIEW_CreateBoldFont(infoPtr->hFont);
infoPtr->hUnderlineFont = TREEVIEW_CreateUnderlineFont(infoPtr->hFont);
infoPtr->hBoldUnderlineFont = TREEVIEW_CreateBoldUnderlineFont(infoPtr->hFont);
infoPtr->hcurHand = LoadCursorW(NULL, (LPWSTR)IDC_HAND);
infoPtr->uItemHeight = TREEVIEW_NaturalHeight(infoPtr);
@ -5123,6 +5152,7 @@ TREEVIEW_Destroy(TREEVIEW_INFO *infoPtr)
DeleteObject(infoPtr->hDefaultFont);
DeleteObject(infoPtr->hBoldFont);
DeleteObject(infoPtr->hUnderlineFont);
DeleteObject(infoPtr->hBoldUnderlineFont);
Free(infoPtr);
return 0;

View file

@ -1026,10 +1026,10 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
if (TRACE_ON(updown))
{
INT i;
UINT i;
for (i = 0; i < wParam; i++)
TRACE("%d: nSec %u nInc %u\n", i,
TRACE("%u: nSec %u nInc %u\n", i,
infoPtr->AccelVect[i].nSec, infoPtr->AccelVect[i].nInc);
}

View file

@ -48,7 +48,7 @@ reactos/dll/win32/browseui # Out of sync
reactos/dll/win32/cabinet # Synced to Wine-1.5.19
reactos/dll/win32/clusapi # Synced to Wine-1.5.19
reactos/dll/win32/comcat # Synced to Wine-1.5.4
reactos/dll/win32/comctl32 # Synced to Wine 1.5.19
reactos/dll/win32/comctl32 # Synced to Wine 1.5.26
reactos/dll/win32/comdlg32 # Synced to Wine 1.3.37
reactos/dll/win32/compstui # Synced to Wine-1.5.19
reactos/dll/win32/credui # Synced to Wine-1.5.4