* Gets the Reference data from a subclass.
*
* PARAMS
- * hWnd [in] Handle to window which were subclassing
+ * hWnd [in] Handle to the window which we are subclassing
* pfnSubclass [in] Pointer to the subclass procedure
* uID [in] Unique identifier of the subclassing procedure
* pdwRef [out] Pointer to the reference data
* Removes a window subclass.
*
* PARAMS
- * hWnd [in] Handle to the window were subclassing
+ * hWnd [in] Handle to the window which we are subclassing
* pfnSubclass [in] Pointer to the subclass procedure
* uID [in] Unique identifier of this subclass
*
TRACE("(%d %d 0x%x %d %d)\n", cx, cy, flags, cInitial, cGrow);
- if (cx <= 0 || cy <= 0) return NULL;
+ if (cx < 0 || cy < 0) return NULL;
+ if (!((flags&ILC_COLORDDB) == ILC_COLORDDB) && (cx == 0 || cy == 0)) return NULL;
/* Create the IImageList interface for the image list */
if (FAILED(ImageListImpl_CreateInstance(NULL, &IID_IImageList, (void **)&himl)))
return ImageList_DrawIndirect (&imldp);
}
-
+#ifdef __REACTOS__
static BOOL alpha_blend_image( HIMAGELIST himl, HDC srce_dc, HDC dest_dc, int dest_x, int dest_y,
+#else
+static BOOL alpha_blend_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int dest_y,
+#endif
int src_x, int src_y, int cx, int cy, BLENDFUNCTION func,
UINT style, COLORREF blend_col )
{
info->bmiHeader.biYPelsPerMeter = 0;
info->bmiHeader.biClrUsed = 0;
info->bmiHeader.biClrImportant = 0;
+#ifdef __REACTOS__
if (!(bmp = CreateDIBSection( srce_dc, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done;
+#else
+ if (!(bmp = CreateDIBSection( himl->hdcImage, info, DIB_RGB_COLORS, &bits, 0, 0 ))) goto done;
+#endif
SelectObject( hdc, bmp );
+#ifdef __REACTOS__
BitBlt( hdc, 0, 0, cx, cy, srce_dc, src_x, src_y, SRCCOPY );
+#else
+ BitBlt( hdc, 0, 0, cx, cy, himl->hdcImage, src_x, src_y, SRCCOPY );
+#endif
if (blend_col != CLR_NONE)
{
return ret;
}
+#ifdef __REACTOS__
HDC saturate_image( HIMAGELIST himl, HDC dest_dc, int dest_x, int dest_y,
int src_x, int src_y, int cx, int cy, COLORREF rgbFg)
{
/* return the handle to our desaturated dc, that will substitute its original counterpart in the next calls */
return hdc;
}
+#endif /* __REACTOS__ */
/*************************************************************************
* ImageList_DrawIndirect [COMCTL32.@]
oldImageFg = SetTextColor( hImageDC, RGB( 0, 0, 0 ) );
oldImageBk = SetBkColor( hImageDC, RGB( 0xff, 0xff, 0xff ) );
+#ifdef __REACTOS__
/*
* If the ILS_SATURATE bit is enabled we should multiply the
* RGB colors of the original image by the contents of rgbFg.
pt.x = 0;
pt.y = 0;
}
+#endif
has_alpha = (himl->has_alpha && himl->has_alpha[pimldp->i]);
if (!bMask && (has_alpha || (fState & ILS_ALPHA)))
if (bIsTransparent)
{
+#ifdef __REACTOS__
bResult = alpha_blend_image( himl, hImageListDC, pimldp->hdcDst, pimldp->x, pimldp->y,
+#else
+ bResult = alpha_blend_image( himl, pimldp->hdcDst, pimldp->x, pimldp->y,
+#endif
pt.x, pt.y, cx, cy, func, fStyle, blend_col );
goto end;
}
hOldBrush = SelectObject (hImageDC, CreateSolidBrush (colour));
PatBlt( hImageDC, 0, 0, cx, cy, PATCOPY );
+#ifdef __REACTOS__
alpha_blend_image( himl, hImageListDC, hImageDC, 0, 0, pt.x, pt.y, cx, cy, func, fStyle, blend_col );
+#else
+ alpha_blend_image( himl, hImageDC, 0, 0, pt.x, pt.y, cx, cy, func, fStyle, blend_col );
+#endif
DeleteObject (SelectObject (hImageDC, hOldBrush));
bResult = BitBlt( pimldp->hdcDst, pimldp->x, pimldp->y, cx, cy, hImageDC, 0, 0, SRCCOPY );
goto end;
}
}
+#ifndef __REACTOS__
+ if (fState & ILS_SATURATE) FIXME("ILS_SATURATE: unimplemented!\n");
+#endif
if (fState & ILS_GLOW) FIXME("ILS_GLOW: unimplemented!\n");
if (fState & ILS_SHADOW) FIXME("ILS_SHADOW: unimplemented!\n");
{
if (!is_valid(himl) || !cx || !cy)
return FALSE;
- if ((himl->cx <= 0) || (himl->cy <= 0))
- return FALSE;
*cx = himl->cx;
*cy = himl->cy;
if (infoPtr->dwStyle & LVS_OWNERDATA)
{
INT nOldCount = infoPtr->nItemCount;
+ infoPtr->nItemCount = nItems;
if (nItems < nOldCount)
{
}
}
- infoPtr->nItemCount = nItems;
LISTVIEW_UpdateScroll(infoPtr);
/* the flags are valid only in ownerdata report and list modes */
}
}
+ if (!infoPtr->bFocus)
+ SetFocus(infoPtr->hwndSelf);
+
if (infoPtr->dwLvExStyle & LVS_EX_ONECLICKACTIVATE)
if(lvHitTestInfo.iItem != -1) notify_itemactivate(infoPtr,&lvHitTestInfo);
}
LISTVIEW_DelayedEditItem);
}
- if (!infoPtr->bFocus)
- SetFocus(infoPtr->hwndSelf);
-
return 0;
}
static LRESULT
+#ifdef __REACTOS__
REBAR_SizeToRect (REBAR_INFO *infoPtr, WPARAM flags, RECT *lpRect)
+#else
+REBAR_SizeToRect (REBAR_INFO *infoPtr, const RECT *lpRect)
+#endif
{
if (!lpRect) return FALSE;
return REBAR_ShowBand (infoPtr, wParam, lParam);
case RB_SIZETORECT:
+#ifdef __REACTOS__
return REBAR_SizeToRect (infoPtr, wParam, (LPRECT)lParam);
+#else
+ return REBAR_SizeToRect (infoPtr, (LPCRECT)lParam);
+#endif
/* Messages passed to parent */
infoPtr->clrBtnShadow = CLR_DEFAULT;
infoPtr->szPadding.cx = DEFPAD_CX;
infoPtr->szPadding.cy = DEFPAD_CY;
+#ifdef __REACTOS__
infoPtr->szSpacing.cx = DEFSPACE_CX;
infoPtr->szSpacing.cy = DEFSPACE_CY;
+#endif
infoPtr->iListGap = DEFLISTGAP;
infoPtr->iTopMargin = default_top_margin(infoPtr);
infoPtr->dwStyle = lpcs->style;
return TOOLBAR_MouseLeave (infoPtr);
case WM_CAPTURECHANGED:
+ if (hwnd == (HWND)lParam) return 0;
return TOOLBAR_CaptureChanged(infoPtr);
case WM_NCACTIVATE:
#include "comctl32.h"
+#include <wine/exception.h>
+
WINE_DEFAULT_DEBUG_CHANNEL(tooltips);
static HICON hTooltipIcons[TTI_ERROR+1];
toolPtr->lpszText = LPSTR_TEXTCALLBACKW;
}
else if (isW) {
- INT len = lstrlenW (ti->lpszText);
- TRACE("add text %s!\n", debugstr_w(ti->lpszText));
- toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
- strcpyW (toolPtr->lpszText, ti->lpszText);
+ __TRY
+ {
+ INT len = lstrlenW (ti->lpszText);
+ TRACE("add text %s!\n", debugstr_w(ti->lpszText));
+ toolPtr->lpszText = Alloc ((len + 1)*sizeof(WCHAR));
+ strcpyW (toolPtr->lpszText, ti->lpszText);
+ }
+ __EXCEPT_PAGE_FAULT
+ {
+ WARN("Invalid lpszText.\n");
+ return FALSE;
+ }
+ __ENDTRY
}
else {
INT len = MultiByteToWideChar(CP_ACP, 0, (LPSTR)ti->lpszText, -1, NULL, 0);
if (infoPtr->lPos > infoPtr->lRangeMax)
infoPtr->lPos = infoPtr->lRangeMax;
- infoPtr->flags |= TB_THUMBPOSCHANGED;
- if (fPosition && oldPos != lPosition) TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition);
+ if (fPosition && oldPos != lPosition)
+ {
+ TRACKBAR_UpdateThumb(infoPtr);
+ TRACKBAR_InvalidateThumbMove(infoPtr, oldPos, lPosition);
+ }
return 0;
}
}
if (pos != infoPtr->lPos) {
- infoPtr->flags |=TB_THUMBPOSCHANGED;
+ TRACKBAR_UpdateThumb (infoPtr);
TRACKBAR_InvalidateThumbMove (infoPtr, pos, infoPtr->lPos);
}
case WM_CAPTURECHANGED:
+ if (hwnd == (HWND)lParam) return 0;
return TRACKBAR_CaptureChanged (infoPtr);
case WM_CREATE:
HTREEITEM focusedItem; /* item that was under the cursor when WM_LBUTTONDOWN was received */
HTREEITEM editItem; /* item being edited with builtin edit box */
- HTREEITEM firstVisible; /* handle to first visible item */
+ HTREEITEM firstVisible; /* handle to item whose top edge is at y = 0 */
LONG maxVisibleOrder;
HTREEITEM dropItem; /* handle to item selected by drag cursor */
HTREEITEM insertMarkItem; /* item after which insertion mark is placed */
LONG imageOffset;
LONG textOffset;
LONG textWidth; /* horizontal text extent for pszText */
- LONG visibleOrder; /* visible ordering, 0 is first visible item */
+ LONG visibleOrder; /* Depth-first numbering of the items whose ancestors are all expanded,
+ corresponding to a top-to-bottom ordering in the tree view.
+ Each item takes up "item.iIntegral" spots in the visible order.
+ 0 is the root's first child. */
const TREEVIEW_INFO *infoPtr; /* tree data this item belongs to */
} TREEVIEW_ITEM;
NMTREEVIEWW nmhdr;
BOOL ret;
- TRACE("code:%d action:%x olditem:%p newitem:%p\n",
+ TRACE("code:%d action:0x%x olditem:%p newitem:%p\n",
code, action, oldItem, newItem);
memset(&nmhdr, 0, sizeof(NMTREEVIEWW));
NMTVCUSTOMDRAW nmcdhdr;
NMCUSTOMDRAW *nmcd;
- TRACE("drawstage:%x hdc:%p\n", dwDrawStage, hdc);
+ TRACE("drawstage:0x%x hdc:%p\n", dwDrawStage, hdc);
nmcd = &nmcdhdr.nmcd;
nmcd->dwDrawStage = dwDrawStage;
nmcd->lItemlParam = item->lParam;
nmcdhdr->iLevel = item->iLevel;
- TRACE("drawstage:%x hdc:%p item:%lx, itemstate:%x, lItemlParam:%lx\n",
+ TRACE("drawstage:0x%x hdc:%p item:%lx, itemstate:0x%x, lItemlParam:0x%lx\n",
nmcd->dwDrawStage, nmcd->hdc, nmcd->dwItemSpec,
nmcd->uItemState, nmcd->lItemlParam);
TREEVIEW_HasChildren(const TREEVIEW_INFO *infoPtr, TREEVIEW_ITEM *item)
{
TREEVIEW_UpdateDispInfo(infoPtr, item, TVIF_CHILDREN);
-
- return item->cChildren > 0;
+ /* Protect for a case when callback field is not changed by a host,
+ otherwise negative values trigger normal notifications. */
+ return item->cChildren != 0 && item->cChildren != I_CHILDRENCALLBACK;
}
static INT TREEVIEW_NotifyFormat (TREEVIEW_INFO *infoPtr, HWND hwndFrom, UINT nCommand)
if (tvItem->mask & TVIF_STATE)
{
- TRACE("prevstate,state,mask:%x,%x,%x\n", item->state, tvItem->state,
+ TRACE("prevstate 0x%x, state 0x%x, mask 0x%x\n", item->state, tvItem->state,
tvItem->stateMask);
item->state &= ~tvItem->stateMask;
item->state |= (tvItem->state & tvItem->stateMask);
if (tvItem->mask & TVIF_STATEEX)
{
- FIXME("New extended state: %x\n", tvItem->uStateEx);
+ FIXME("New extended state: 0x%x\n", tvItem->uStateEx);
}
item->callbackMask |= callbackSet;
}
- TRACE("new item %p; parent %p, mask %x\n", newItem,
+ TRACE("new item %p; parent %p, mask 0x%x\n", newItem,
newItem->parent, tvItem->mask);
newItem->iLevel = newItem->parent->iLevel + 1;
static void
TREEVIEW_UnlinkItem(const TREEVIEW_ITEM *item)
{
- TREEVIEW_ITEM *parentItem = item->parent;
+ TREEVIEW_ITEM *parentItem;
assert(item != NULL);
assert(item->parent != NULL); /* i.e. it must not be the root */
+ parentItem = item->parent;
+
if (parentItem->firstChild == item)
parentItem->firstChild = item->nextSibling;
if (infoPtr->firstVisible == item)
{
+ visible = TRUE;
if (item->nextSibling)
newFirstVisible = item->nextSibling;
else if (item->prevSibling)
TREEVIEW_VerifyTree(infoPtr);
+ if (visible)
+ TREEVIEW_SetFirstVisible(infoPtr, newFirstVisible, TRUE);
+
if (!infoPtr->bRedraw) return TRUE;
if (visible)
{
- TREEVIEW_SetFirstVisible(infoPtr, newFirstVisible, TRUE);
TREEVIEW_RecalculateVisibleOrder(infoPtr, prev);
TREEVIEW_UpdateScrollBars(infoPtr);
TREEVIEW_Invalidate(infoPtr, NULL);
{
COLORREF prevColor = infoPtr->clrInsertMark;
- TRACE("%x\n", color);
+ TRACE("0x%08x\n", color);
infoPtr->clrInsertMark = color;
return (LRESULT)prevColor;
tvItem->uStateEx = 0;
}
- TRACE("item <%p>, txt %p, img %d, mask %x\n",
+ TRACE("item <%p>, txt %p, img %d, mask 0x%x\n",
item, tvItem->pszText, tvItem->iImage, tvItem->mask);
return TRUE;
item = tvItem->hItem;
- TRACE("item %d,mask %x\n", TREEVIEW_GetItemIndex(infoPtr, item),
+ TRACE("item %d, mask 0x%x\n", TREEVIEW_GetItemIndex(infoPtr, item),
tvItem->mask);
if (!TREEVIEW_ValidItem(infoPtr, item))
if (retval)
{
- TRACE("flags:%x, returns %p\n", which, retval);
+ TRACE("flags:0x%x, returns %p\n", which, retval);
return (LRESULT)retval;
}
retval = TREEVIEW_GetPrevListItem(infoPtr, item);
break;
default:
- TRACE("Unknown msg %x,item %p\n", which, item);
+ TRACE("Unknown msg 0x%x, item %p\n", which, item);
break;
}
- TRACE("flags:%x, item %p;returns %p\n", which, item, retval);
+ TRACE("flags: 0x%x, item %p;returns %p\n", which, item, retval);
return (LRESULT)retval;
}
unsigned int state;
state = STATEIMAGEINDEX(item->state);
- TRACE("state:%x\n", state);
+ TRACE("state: 0x%x\n", state);
item->state &= ~TVIS_STATEIMAGEMASK;
if (state < 3)
item->state |= INDEXTOSTATEIMAGEMASK(state);
- TRACE("state:%x\n", state);
+ TRACE("state: 0x%x\n", state);
TREEVIEW_Invalidate(infoPtr, item);
}
}
}
lpht->hItem = item;
- TRACE("(%d,%d):result %x\n", lpht->pt.x, lpht->pt.y, lpht->flags);
+ TRACE("(%d,%d):result 0x%x\n", lpht->pt.x, lpht->pt.y, lpht->flags);
return (LRESULT)item;
}
static LRESULT
TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
{
- TRACE("code=%x, id=%x, handle=%lx\n", HIWORD(wParam), LOWORD(wParam), lParam);
+ TRACE("code=0x%x, id=0x%x, handle=0x%lx\n", HIWORD(wParam), LOWORD(wParam), lParam);
switch (HIWORD(wParam))
{
assert(newSelect == NULL || TREEVIEW_ValidItem(infoPtr, newSelect));
- TRACE("Entering item %p (%s), flag %x, cause %x, state %d\n",
+ TRACE("Entering item %p (%s), flag 0x%x, cause 0x%x, state %d\n",
newSelect, TREEVIEW_ItemName(newSelect), action, cause,
newSelect ? newSelect->state : 0);
TREEVIEW_INFO *infoPtr;
LOGFONTW lf;
- TRACE("wnd %p, style %x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
+ TRACE("wnd %p, style 0x%x\n", hwnd, GetWindowLongW(hwnd, GWL_STYLE));
infoPtr = Alloc(sizeof(TREEVIEW_INFO));
reactos/dll/win32/cabinet # Synced to WineStaging-1.9.4
reactos/dll/win32/clusapi # Synced to WineStaging-1.7.55
reactos/dll/win32/comcat # Synced to WineStaging-1.7.55
-reactos/dll/win32/comctl32 # Synced to WineStaging-1.7.55
+reactos/dll/win32/comctl32 # Synced to WineStaging-1.9.4
reactos/dll/win32/comdlg32 # Synced to WineStaging-1.7.55
reactos/dll/win32/compstui # Synced to WineStaging-1.7.55
reactos/dll/win32/credui # Synced to WineStaging-1.7.55