Skip to content
Snippets Groups Projects
Commit f9b58070 authored by Eric Kohl's avatar Eric Kohl Committed by Alexandre Julliard
Browse files

Some more messages.

parent e2ab4d03
No related branches found
No related tags found
No related merge requests found
/*
* Listview control
*
* Copyright 1998 Eric Kohl
* Copyright 1998, 1999 Eric Kohl
* Copyright 1999 Luc Tourangeau
*
* NOTES
......@@ -10,6 +10,7 @@
* TODO:
* 1. No horizontal scrolling when header is larger than the client area.
* 2. Drawing optimizations.
* 3. Hot item handling.
*
* Notifications:
* LISTVIEW_Notify : most notifications from children (editbox and header)
......@@ -18,20 +19,21 @@
* LISTVIEW_SetItemCount : empty stub
*
* Unicode:
* LISTVIEW_SetItem32W : no unicode support
* LISTVIEW_InsertItem32W : no unicode support
* LISTVIEW_InsertColumn32W : no unicode support
* LISTVIEW_SetItemW : no unicode support
* LISTVIEW_InsertItemW : no unicode support
* LISTVIEW_InsertColumnW : no unicode support
* LISTVIEW_GetColumnW : no unicode support
* LISTVIEW_SetColumnW : no unicode support
*
* Advanced functionality:
* LISTVIEW_GetNumberOfWorkAreas : not implemented
* LISTVIEW_GetHotCursor : not implemented
* LISTVIEW_GetHotItem : not implemented
* LISTVIEW_GetHoverTime : not implemented
* LISTVIEW_GetISearchString : not implemented
* LISTVIEW_GetBkImage : not implemented
* LISTVIEW_EditLabel : REPORT (need to implement a timer)
* LISTVIEW_GetColumnOrderArray : not implemented
* LISTVIEW_SetColumnOrderArray : not implemented
* LISTVIEW_Arrange : empty stub
* LISTVIEW_ApproximateViewRect : incomplete
* LISTVIEW_Scroll : not implemented
......@@ -3161,7 +3163,28 @@ static LRESULT LISTVIEW_GetCountPerPage(HWND hwnd)
}
/* LISTVIEW_GetEditControl */
/* LISTVIEW_GetExtendedListViewStyle */
/***
* DESCRIPTION:
* Retrieves the extended listview style.
*
* PARAMETERS:
* [I] HWND : window handle
*
* RETURN:
* SUCCESS : previous style
* FAILURE : 0
*/
static LRESULT LISTVIEW_GetExtendedListViewStyle(HWND hwnd)
{
LISTVIEW_INFO *infoPtr;
/* make sure we can get the listview info */
if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
return (0);
return (infoPtr->dwExStyle);
}
/***
* DESCRIPTION:
......@@ -3416,8 +3439,30 @@ static LRESULT LISTVIEW_GetItemA(HWND hwnd, LPLVITEMA lpLVItem)
/* LISTVIEW_GetItemW */
/* LISTVIEW_GetHotCursor */
/* LISTVIEW_GetHotItem */
/* LISTVIEW_GetHoverTime> */
/***
* DESCRIPTION:
* Retrieves the index of the hot item.
*
* PARAMETERS:
* [I] HWND : window handle
*
* RETURN:
* SUCCESS : hot item index
* FAILURE : -1 (no hot item)
*/
static LRESULT LISTVIEW_GetHotItem(HWND hwnd)
{
LISTVIEW_INFO *infoPtr;
/* make sure we can get the listview info */
if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
return (-1);
return (infoPtr->nHotItem);
}
/* LISTVIEW_GetHoverTime */
/***
* DESCRIPTION:
......@@ -4632,6 +4677,8 @@ static LRESULT LISTVIEW_SetBkColor(HWND hwnd, COLORREF clrBk)
return TRUE;
}
/* LISTVIEW_SetBkImage */
/***
* DESCRIPTION:
* Sets the callback mask. This mask will be used when the parent
......@@ -4762,6 +4809,9 @@ static LRESULT LISTVIEW_SetColumnA(HWND hwnd, INT nColumn,
return bResult;
}
/* LISTVIEW_SetColumnW */
/* LISTVIEW_SetColumnOrderArray */
/***
* DESCRIPTION:
* Sets the width of a column
......@@ -4812,6 +4862,71 @@ static LRESULT LISTVIEW_SetColumnWidth(HWND hwnd, INT iCol, INT cx)
return lret;
}
/***
* DESCRIPTION:
* Sets the extended listview style.
*
* PARAMETERS:
* [I] HWND : window handle
* [I] DWORD : mask
* [I] DWORD : style
*
* RETURN:
* SUCCESS : previous style
* FAILURE : 0
*/
static LRESULT LISTVIEW_SetExtendedListViewStyle(HWND hwnd, DWORD dwMask, DWORD dwStyle)
{
LISTVIEW_INFO *infoPtr;
DWORD dwOldStyle;
/* make sure we can get the listview info */
if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
return (0);
/* store previous style */
dwOldStyle = infoPtr->dwExStyle;
/* set new style */
infoPtr->dwExStyle = (dwOldStyle & ~dwMask) | (dwStyle & dwMask);
return (dwOldStyle);
}
/* LISTVIEW_SetHotCursor */
/***
* DESCRIPTION:
* Sets the hot item index.
*
* PARAMETERS:
* [I] HWND : window handle
* [I] INT : index
*
* RETURN:
* SUCCESS : previous hot item index
* FAILURE : -1 (no hot item)
*/
static LRESULT LISTVIEW_SetHotItem(HWND hwnd, INT iIndex)
{
LISTVIEW_INFO *infoPtr;
INT iOldIndex;
/* make sure we can get the listview info */
if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
return (-1);
/* store previous index */
iOldIndex = infoPtr->nHotItem;
/* set new style */
infoPtr->nHotItem = iIndex;
return (iOldIndex);
}
/* LISTVIEW_SetIconSpacing */
/***
* DESCRIPTION:
* Sets image lists.
......@@ -4898,13 +5013,35 @@ static LRESULT LISTVIEW_SetItemA(HWND hwnd, LPLVITEMA lpLVItem)
* PARAMETER(S):
* [I] HWND : window handle
* [I] INT : item count (prjected number of items)
* [I] DWORD : update flags
*
* RETURN:
* None
* SUCCESS : TRUE
* FAILURE : FALSE
*/
static VOID LISTVIEW_SetItemCount(HWND hwnd, INT nItemCount)
static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags)
{
LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)GetWindowLongA(hwnd, 0);
FIXME("(%d %08lx)empty stub!\n", nItems, dwFlags);
if (nItems == 0)
return LISTVIEW_DeleteAllItems (hwnd);
if (nItems > GETITEMCOUNT(infoPtr))
{
FIXME("empty stub!\n");
/* append items */
FIXME("append items\n");
}
else if (nItems < GETITEMCOUNT(infoPtr))
{
/* remove items */
FIXME("remove items\n");
}
return TRUE;
}
/***
......@@ -4953,6 +5090,8 @@ static BOOL LISTVIEW_SetItemPosition(HWND hwnd, INT nItem,
return bResult;
}
/* LISTVIEW_SetItemPosition32 */
/***
* DESCRIPTION:
* Sets the state of one or many items.
......@@ -5036,6 +5175,29 @@ static BOOL LISTVIEW_SetItemTextA(HWND hwnd, INT nItem, LPLVITEMA lpLVItem)
return bResult;
}
/* LISTVIEW_SetItemTextW */
/***
* DESCRIPTION:
* Set item index that marks the start of a multiple selection.
*
* PARAMETER(S):
* [I] HWND : window handle
* [I] INT : index
*
* RETURN:
* Index number or -1 if there is no selection mark.
*/
static LRESULT LISTVIEW_SetSelectionMark(HWND hwnd, INT nIndex)
{
LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
INT nOldIndex = infoPtr->nSelectionMark;
infoPtr->nSelectionMark = nIndex;
return nOldIndex;
}
/***
* DESCRIPTION:
* Sets the text background color.
......@@ -5080,6 +5242,9 @@ static LRESULT LISTVIEW_SetTextColor (HWND hwnd, COLORREF clrText)
return TRUE;
}
/* LISTVIEW_SetToolTips */
/* LISTVIEW_SetUnicodeFormat */
/* LISTVIEW_SetWorkAreas */
/***
* DESCRIPTION:
......@@ -5168,6 +5333,8 @@ static LRESULT LISTVIEW_SortItems(HWND hwnd, WPARAM wParam, LPARAM lParam)
return TRUE;
}
/* LISTVIEW_SubItemHitTest */
/***
* DESCRIPTION:
* Updates an items or rearranges the listview control.
......@@ -5246,6 +5413,7 @@ static LRESULT LISTVIEW_Create(HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->uCallbackMask = 0;
infoPtr->nFocusedItem = -1;
infoPtr->nSelectionMark = -1;
infoPtr->nHotItem = -1;
infoPtr->iconSpacing.cx = GetSystemMetrics(SM_CXICONSPACING);
infoPtr->iconSpacing.cy = GetSystemMetrics(SM_CYICONSPACING);
ZeroMemory(&infoPtr->rcList, sizeof(RECT));
......@@ -6480,7 +6648,10 @@ LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return LISTVIEW_GetColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam);
/* case LVM_GETCOLUMNW: */
/* case LVM_GETCOLUMNORDERARRAY: */
case LVM_GETCOLUMNORDERARRAY:
FIXME("Unimplemented msg LVM_GETCOLUMNORDERARRAY\n");
return 0;
case LVM_GETCOLUMNWIDTH:
return LISTVIEW_GetColumnWidth(hwnd, (INT)wParam);
......@@ -6489,13 +6660,18 @@ LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
return LISTVIEW_GetCountPerPage(hwnd);
/* case LVM_GETEDITCONTROL: */
/* case LVM_GETEXTENDEDLISTVIEWSTYLE: */
case LVM_GETEXTENDEDLISTVIEWSTYLE:
return LISTVIEW_GetExtendedListViewStyle(hwnd);
case LVM_GETHEADER:
return LISTVIEW_GetHeader(hwnd);
/* case LVM_GETHOTCURSOR: */
/* case LVM_GETHOTITEM: */
case LVM_GETHOTITEM:
return LISTVIEW_GetHotItem(hwnd);
/* case LVM_GETHOVERTIME: */
case LVM_GETIMAGELIST:
......@@ -6598,15 +6774,25 @@ LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
case LVM_SETCOLUMNA:
return LISTVIEW_SetColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam);
/* case LVM_SETCOLUMNW: */
/* case LVM_SETCOLUMNORDERARRAY: */
case LVM_SETCOLUMNW:
FIXME("Unimplemented msg LVM_SETCOLUMNW\n");
return 0;
case LVM_SETCOLUMNORDERARRAY:
FIXME("Unimplemented msg LVM_SETCOLUMNORDERARRAY\n");
return 0;
case LVM_SETCOLUMNWIDTH:
return LISTVIEW_SetColumnWidth(hwnd, (INT)wParam, (INT)lParam);
/* case LVM_SETEXTENDEDLISTVIEWSTYLE: */
case LVM_SETEXTENDEDLISTVIEWSTYLE:
return LISTVIEW_SetExtendedListViewStyle(hwnd, (DWORD)wParam, (DWORD)lParam);
/* case LVM_SETHOTCURSOR: */
/* case LVM_SETHOTITEM: */
case LVM_SETHOTITEM:
return LISTVIEW_SetHotItem(hwnd, (INT)wParam);
/* case LVM_SETHOVERTIME: */
/* case LVM_SETICONSPACING: */
......@@ -6619,14 +6805,13 @@ LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
/* case LVM_SETITEMW: */
case LVM_SETITEMCOUNT:
LISTVIEW_SetItemCount(hwnd, (INT)wParam);
break;
return LISTVIEW_SetItemCount(hwnd, (INT)wParam, (DWORD)lParam);
case LVM_SETITEMPOSITION:
return LISTVIEW_SetItemPosition(hwnd, (INT)wParam, (INT)LOWORD(lParam),
(INT)HIWORD(lParam));
/* case LVM_SETITEMPOSITION: */
/* case LVM_SETITEMPOSITION32: */
case LVM_SETITEMSTATE:
return LISTVIEW_SetItemState(hwnd, (INT)wParam, (LPLVITEMA)lParam);
......@@ -6634,7 +6819,10 @@ LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
case LVM_SETITEMTEXTA:
return LISTVIEW_SetItemTextA(hwnd, (INT)wParam, (LPLVITEMA)lParam);
/* case LVM_SETSELECTIONMARK: */
/* case LVM_SETITEMTEXTW: */
case LVM_SETSELECTIONMARK:
return LISTVIEW_SetSelectionMark(hwnd, (INT)lParam);
case LVM_SETTEXTBKCOLOR:
return LISTVIEW_SetTextBkColor(hwnd, (COLORREF)lParam);
......
......@@ -1461,7 +1461,8 @@ LRESULT WINAPI TREEVIEW_Sort (
/* undocumented feature: TVI_ROOT means `sort the whole tree' */
if (parent==TVI_ROOT) parent=infoPtr->TopRootItem;
if (parent==TVI_ROOT)
parent=infoPtr->TopRootItem;
/* Check for a valid handle to the parent item */
if (!TREEVIEW_ValidItem(infoPtr, parent))
......@@ -1870,6 +1871,8 @@ TREEVIEW_InsertItemA (HWND hwnd, WPARAM wParam, LPARAM lParam)
return (LRESULT) iItem;
}
static LRESULT
TREEVIEW_InsertItemW(HWND hwnd, WPARAM wParam, LPARAM lParam)
{
......@@ -1921,8 +1924,6 @@ TREEVIEW_InsertItemW(HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
TREEVIEW_DeleteItem (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
......@@ -2176,6 +2177,7 @@ TREEVIEW_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
infoPtr->clrText=-1; /* use system color */
infoPtr->dropItem=0;
infoPtr->pCallBackSort=NULL;
infoPtr->uScrollTime = 300; /* milliseconds */
/*
infoPtr->hwndNotify = GetParent32 (hwnd);
......@@ -3498,6 +3500,27 @@ TREEVIEW_KeyDown (HWND hwnd, WPARAM wParam, LPARAM lParam)
}
static LRESULT
TREEVIEW_GetScrollTime (HWND hwnd)
{
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
return infoPtr->uScrollTime;
}
static LRESULT
TREEVIEW_SetScrollTime (HWND hwnd, UINT uScrollTime)
{
TREEVIEW_INFO *infoPtr = TREEVIEW_GetInfoPtr(hwnd);
UINT uOldScrollTime = infoPtr->uScrollTime;
infoPtr->uScrollTime = min (uScrollTime, 100);
return uOldScrollTime;
}
LRESULT WINAPI
TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
......@@ -3542,7 +3565,7 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_GetItemA (hwnd, wParam, lParam);
case TVM_GETITEMW:
FIXME("Unimplemented msg TVM_GETITEM32W\n");
FIXME("Unimplemented msg TVM_GETITEMW\n");
return 0;
case TVM_SETITEMA:
......@@ -3553,11 +3576,11 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return 0;
case TVM_EDITLABELA:
FIXME("Unimplemented msg TVM_EDITLABEL32A \n");
FIXME("Unimplemented msg TVM_EDITLABELA \n");
return 0;
case TVM_EDITLABELW:
FIXME("Unimplemented msg TVM_EDITLABEL32W \n");
FIXME("Unimplemented msg TVM_EDITLABELW \n");
return 0;
case TVM_GETEDITCONTROL:
......@@ -3586,11 +3609,11 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_EndEditLabelNow (hwnd, wParam, lParam);
case TVM_GETISEARCHSTRINGA:
FIXME("Unimplemented msg TVM_GETISEARCHSTRING32A\n");
FIXME("Unimplemented msg TVM_GETISEARCHSTRINGA\n");
return 0;
case TVM_GETISEARCHSTRINGW:
FIXME("Unimplemented msg TVM_GETISEARCHSTRING32W\n");
FIXME("Unimplemented msg TVM_GETISEARCHSTRINGW\n");
return 0;
case TVM_GETTOOLTIPS:
......@@ -3622,12 +3645,10 @@ TREEVIEW_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TREEVIEW_GetTextColor (hwnd);
case TVM_SETSCROLLTIME:
FIXME("Unimplemented msg TVM_SETSCROLLTIME\n");
return 0;
return TREEVIEW_SetScrollTime (hwnd, (UINT)wParam);
case TVM_GETSCROLLTIME:
FIXME("Unimplemented msg TVM_GETSCROLLTIME\n");
return 0;
return TREEVIEW_GetScrollTime (hwnd);
case TVM_GETITEMSTATE:
return TREEVIEW_GetItemState (hwnd,wParam, lParam);
......
......@@ -45,6 +45,7 @@ typedef struct tagLISTVIEW_INFO
INT nItemHeight;
INT nItemWidth;
INT nSelectionMark;
INT nHotItem;
SHORT notifyFormat;
RECT rcList;
RECT rcView;
......
......@@ -53,6 +53,7 @@ typedef struct tagTREEVIEW_INFO
HTREEITEM uMaxHandle; /* needed for delete_item */
HTREEITEM TopRootItem; /* handle to first item in treeview */
INT cdmode; /* last custom draw setting */
UINT uScrollTime; /* max. time for scrolling in milliseconds*/
UINT uItemHeight; /* item height, -1 for default item height */
UINT uRealItemHeight;/* current item height in pixels */
UINT uVisibleHeight; /* visible height of treeview in pixels */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment