Added implementation of SetItemW.

This commit is contained in:
Aric Stewart 2002-02-04 18:37:32 +00:00 committed by Alexandre Julliard
parent d9c1fc339a
commit 9d366f1f40
1 changed files with 35 additions and 1 deletions

View File

@ -1987,6 +1987,40 @@ TREEVIEW_GetItemW(TREEVIEW_INFO *infoPtr, LPTVITEMEXA tvItem)
return TRUE; return TRUE;
} }
static LRESULT
TREEVIEW_SetItemW(TREEVIEW_INFO *infoPtr, LPTVITEMEXW tvItem)
{
TVITEMEXA tvItemA;
INT len;
LRESULT rc;
tvItemA.mask = tvItem->mask;
tvItemA.hItem = tvItem->hItem;
tvItemA.state = tvItem->state;
tvItemA.stateMask = tvItem->stateMask;
len = WideCharToMultiByte(CP_ACP, 0, tvItem->pszText, -1,
NULL ,0 , NULL,NULL);
if (len)
{
len ++;
tvItemA.pszText = HeapAlloc(GetProcessHeap(),0,len);
len = WideCharToMultiByte(CP_ACP, 0, tvItem->pszText, -1,
tvItemA.pszText ,len , NULL,NULL);
}
else
tvItemA.pszText = NULL;
tvItemA.cchTextMax = tvItem->cchTextMax;
tvItemA.iImage = tvItem->iImage;
tvItemA.iSelectedImage = tvItem->iSelectedImage;
tvItemA.cChildren = tvItem->cChildren;
tvItemA.lParam = tvItem->lParam;
tvItemA.iIntegral = tvItem->iIntegral;
rc = TREEVIEW_SetItemA(infoPtr,&tvItemA);
HeapFree(GetProcessHeap(),0,tvItemA.pszText);
return rc;
}
static LRESULT static LRESULT
TREEVIEW_GetItemState(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem, UINT mask) TREEVIEW_GetItemState(TREEVIEW_INFO *infoPtr, HTREEITEM wineItem, UINT mask)
{ {
@ -5043,7 +5077,7 @@ TREEVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_SetItemA(infoPtr, (LPTVITEMEXA)lParam); return TREEVIEW_SetItemA(infoPtr, (LPTVITEMEXA)lParam);
case TVM_SETITEMW: case TVM_SETITEMW:
FIXME("Unimplemented msg TVM_SETITEMW\n"); return TREEVIEW_SetItemW(infoPtr, (LPTVITEMEXW)lParam);
return 0; return 0;
case TVM_SETLINECOLOR: case TVM_SETLINECOLOR: