Ignore:
Timestamp:
Aug 14, 1999, 6:13:16 PM (26 years ago)
Author:
cbratschi
Message:

wine-990731 update

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/listview.c

    r295 r496  
    22 * Listview control
    33 *
    4  * Copyright 1998 Eric Kohl
     4 * Copyright 1998, 1999 Eric Kohl
    55 * Copyright 1999 Luc Tourangeau
    66 * Copyright 1999 Achim Hasenmueller
     
    1313 *   1. No horizontal scrolling when header is larger than the client area.
    1414 *   2. Drawing optimizations.
     15 *   3. Hot item handling.
    1516 *
    1617 * Notifications:
     
    2122 *
    2223 * Unicode:
    23  *   LISTVIEW_SetItem32W : no unicode support
    24  *   LISTVIEW_InsertItem32W : no unicode support
    25  *   LISTVIEW_InsertColumn32W : no unicode support
     24 *   LISTVIEW_SetItemW : no unicode support
     25 *   LISTVIEW_InsertItemW : no unicode support
     26 *   LISTVIEW_InsertColumnW : no unicode support
    2627 *   LISTVIEW_GetColumnW : no unicode support
     28 *   LISTVIEW_SetColumnW : no unicode support
    2729 *
    2830 * Advanced functionality:
    2931 *   LISTVIEW_GetNumberOfWorkAreas : not implemented
    3032 *   LISTVIEW_GetHotCursor : not implemented
    31  *   LISTVIEW_GetHotItem : not implemented
    3233 *   LISTVIEW_GetHoverTime : not implemented
    3334 *   LISTVIEW_GetISearchString : not implemented
     
    3536 *   LISTVIEW_EditLabel : REPORT (need to implement a timer)
    3637 *   LISTVIEW_GetColumnOrderArray : not implemented
     38 *   LISTVIEW_SetColumnOrderArray : not implemented
    3739 *   LISTVIEW_Arrange : empty stub
    3840 *   LISTVIEW_ApproximateViewRect : incomplete
     
    31573159
    31583160/* LISTVIEW_GetEditControl */
    3159 /* LISTVIEW_GetExtendedListViewStyle */
     3161
     3162/***
     3163 * DESCRIPTION:
     3164 * Retrieves the extended listview style.
     3165 *
     3166 * PARAMETERS:
     3167 * [I] HWND  : window handle
     3168 *
     3169 * RETURN:
     3170 *   SUCCESS : previous style
     3171 *   FAILURE : 0
     3172 */
     3173static LRESULT LISTVIEW_GetExtendedListViewStyle(HWND hwnd)
     3174{
     3175    LISTVIEW_INFO *infoPtr;
     3176    /* make sure we can get the listview info */
     3177    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
     3178        return (0);
     3179    return (infoPtr->dwExStyle);
     3180}
    31603181
    31613182/***
     
    34123433/* LISTVIEW_GetItemW */
    34133434/* LISTVIEW_GetHotCursor */
    3414 /* LISTVIEW_GetHotItem */
    3415 /* LISTVIEW_GetHoverTime> */
     3435
     3436/***
     3437 * DESCRIPTION:
     3438 * Retrieves the index of the hot item.
     3439 *
     3440 * PARAMETERS:
     3441 * [I] HWND  : window handle
     3442 *
     3443 * RETURN:
     3444 *   SUCCESS : hot item index
     3445 *   FAILURE : -1 (no hot item)
     3446 */
     3447static LRESULT LISTVIEW_GetHotItem(HWND hwnd)
     3448{
     3449    LISTVIEW_INFO *infoPtr;
     3450    /* make sure we can get the listview info */
     3451    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
     3452        return (-1);
     3453    return (infoPtr->nHotItem);
     3454}
     3455
     3456/* LISTVIEW_GetHoverTime */
    34163457
    34173458/***
     
    46284669}
    46294670
     4671/* LISTVIEW_SetBkImage */
     4672
    46304673/***
    46314674 * DESCRIPTION:
     
    47584801}
    47594802
     4803/* LISTVIEW_SetColumnW */
     4804/* LISTVIEW_SetColumnOrderArray */
     4805
    47604806/***
    47614807 * DESCRIPTION:
     
    48094855/***
    48104856 * DESCRIPTION:
     4857 * Sets the extended listview style.
     4858 *
     4859 * PARAMETERS:
     4860 * [I] HWND  : window handle
     4861 * [I] DWORD : mask
     4862 * [I] DWORD : style
     4863 *
     4864 * RETURN:
     4865 *   SUCCESS : previous style
     4866 *   FAILURE : 0
     4867 */
     4868static LRESULT LISTVIEW_SetExtendedListViewStyle(HWND hwnd, DWORD dwMask, DWORD dwStyle)
     4869{
     4870    LISTVIEW_INFO *infoPtr;
     4871    DWORD dwOldStyle;
     4872    /* make sure we can get the listview info */
     4873    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
     4874        return (0);
     4875    /* store previous style */
     4876    dwOldStyle = infoPtr->dwExStyle;
     4877    /* set new style */
     4878    infoPtr->dwExStyle = (dwOldStyle & ~dwMask) | (dwStyle & dwMask);
     4879    return (dwOldStyle);
     4880}
     4881
     4882/* LISTVIEW_SetHotCursor */
     4883
     4884/***
     4885 * DESCRIPTION:
     4886 * Sets the hot item index.
     4887 *
     4888 * PARAMETERS:
     4889 * [I] HWND  : window handle
     4890 * [I] INT   : index
     4891 *
     4892 * RETURN:
     4893 *   SUCCESS : previous hot item index
     4894 *   FAILURE : -1 (no hot item)
     4895 */
     4896static LRESULT LISTVIEW_SetHotItem(HWND hwnd, INT iIndex)
     4897{
     4898    LISTVIEW_INFO *infoPtr;
     4899    INT iOldIndex;
     4900    /* make sure we can get the listview info */
     4901    if (!(infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0)))
     4902        return (-1);
     4903    /* store previous index */
     4904    iOldIndex = infoPtr->nHotItem;
     4905    /* set new style */
     4906    infoPtr->nHotItem = iIndex;
     4907    return (iOldIndex);
     4908}
     4909
     4910/* LISTVIEW_SetIconSpacing */
     4911
     4912/***
     4913 * DESCRIPTION:
    48114914 * Sets image lists.
    48124915 *
     
    48934996 * [I] HWND : window handle
    48944997 * [I] INT : item count (prjected number of items)
    4895  *
    4896  * RETURN:
    4897  * None
    4898  */
    4899 static VOID LISTVIEW_SetItemCount(HWND hwnd, INT nItemCount)
    4900 {
    4901   FIXME("empty stub!\n");
     4998 * [I] DWORD : update flags
     4999 *
     5000 * RETURN:
     5001 *   SUCCESS : TRUE
     5002 *   FAILURE : FALSE
     5003 */
     5004static BOOL LISTVIEW_SetItemCount(HWND hwnd, INT nItems, DWORD dwFlags)
     5005{
     5006  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO*)GetWindowLongA(hwnd, 0);
     5007  FIXME("(%d %08lx)empty stub!\n", nItems, dwFlags);
     5008  if (nItems == 0)
     5009    return LISTVIEW_DeleteAllItems (hwnd);
     5010  if (nItems > GETITEMCOUNT(infoPtr))
     5011{
     5012    /* append items */
     5013    FIXME("append items\n");
     5014  }
     5015  else if (nItems < GETITEMCOUNT(infoPtr))
     5016  {
     5017    /* remove items */
     5018    FIXME("remove items\n");
     5019  }
     5020  return TRUE;
    49025021}
    49035022
     
    49475066  return bResult;
    49485067}
     5068
     5069/* LISTVIEW_SetItemPosition32 */
    49495070
    49505071/***
     
    50315152}
    50325153
     5154/* LISTVIEW_SetItemTextW */
     5155
     5156/***
     5157 * DESCRIPTION:
     5158 * Set item index that marks the start of a multiple selection.
     5159 *
     5160 * PARAMETER(S):
     5161 * [I] HWND : window handle
     5162 * [I] INT  : index
     5163 *
     5164 * RETURN:
     5165 * Index number or -1 if there is no selection mark.
     5166 */
     5167static LRESULT LISTVIEW_SetSelectionMark(HWND hwnd, INT nIndex)
     5168{
     5169  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
     5170  INT nOldIndex = infoPtr->nSelectionMark;
     5171  infoPtr->nSelectionMark = nIndex;
     5172  return nOldIndex;
     5173}
     5174
    50335175/***
    50345176 * DESCRIPTION:
     
    50755217}
    50765218
     5219/* LISTVIEW_SetToolTips */
     5220/* LISTVIEW_SetUnicodeFormat */
     5221/* LISTVIEW_SetWorkAreas */
    50775222
    50785223/***
     
    51635308}
    51645309
     5310/* LISTVIEW_SubItemHitTest */
     5311
    51655312/***
    51665313 * DESCRIPTION:
     
    52415388  infoPtr->nFocusedItem = -1;
    52425389  infoPtr->nSelectionMark = -1;
     5390  infoPtr->nHotItem = -1;
    52435391  infoPtr->iconSpacing.cx = GetSystemMetrics(SM_CXICONSPACING);
    52445392  infoPtr->iconSpacing.cy = GetSystemMetrics(SM_CYICONSPACING);
     
    64336581 *
    64346582 */
    6435 LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
     6583static LRESULT WINAPI LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
    64366584                                   LPARAM lParam)
    64376585{
     
    64756623
    64766624/*      case LVM_GETCOLUMNW: */
    6477 /*      case LVM_GETCOLUMNORDERARRAY: */
     6625
     6626  case LVM_GETCOLUMNORDERARRAY:
     6627    //FIXME("Unimplemented msg LVM_GETCOLUMNORDERARRAY\n");
     6628    return 0;
     6629
    64786630
    64796631  case LVM_GETCOLUMNWIDTH:
     
    64846636
    64856637/*      case LVM_GETEDITCONTROL: */
    6486 /*      case LVM_GETEXTENDEDLISTVIEWSTYLE: */
     6638  case LVM_GETEXTENDEDLISTVIEWSTYLE:
     6639    return LISTVIEW_GetExtendedListViewStyle(hwnd);
    64876640
    64886641  case LVM_GETHEADER:
     
    64906643
    64916644/*      case LVM_GETHOTCURSOR: */
    6492 /*      case LVM_GETHOTITEM: */
     6645
     6646  case LVM_GETHOTITEM:
     6647    return LISTVIEW_GetHotItem(hwnd);
     6648
    64936649/*      case LVM_GETHOVERTIME: */
    64946650
     
    65936749    return LISTVIEW_SetColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam);
    65946750
    6595 /*      case LVM_SETCOLUMNW: */
    6596 /*      case LVM_SETCOLUMNORDERARRAY: */
     6751  case LVM_SETCOLUMNW:
     6752    //FIXME("Unimplemented msg LVM_SETCOLUMNW\n");
     6753    return 0;
     6754
     6755  case LVM_SETCOLUMNORDERARRAY:
     6756    //FIXME("Unimplemented msg LVM_SETCOLUMNORDERARRAY\n");
     6757    return 0;
    65976758
    65986759  case LVM_SETCOLUMNWIDTH:
    65996760    return LISTVIEW_SetColumnWidth(hwnd, (INT)wParam, (INT)lParam);
    66006761
    6601 /*      case LVM_SETEXTENDEDLISTVIEWSTYLE: */
     6762  case LVM_SETEXTENDEDLISTVIEWSTYLE:
     6763    return LISTVIEW_SetExtendedListViewStyle(hwnd, (DWORD)wParam, (DWORD)lParam);
     6764
    66026765/*      case LVM_SETHOTCURSOR: */
    6603 /*      case LVM_SETHOTITEM: */
     6766
     6767  case LVM_SETHOTITEM:
     6768    return LISTVIEW_SetHotItem(hwnd, (INT)wParam);
     6769
    66046770/*      case LVM_SETHOVERTIME: */
    66056771/*      case LVM_SETICONSPACING: */
     
    66146780
    66156781  case LVM_SETITEMCOUNT:
    6616     LISTVIEW_SetItemCount(hwnd, (INT)wParam);
    6617     break;
     6782    return LISTVIEW_SetItemCount(hwnd, (INT)wParam, (DWORD)lParam);
    66186783
    66196784  case LVM_SETITEMPOSITION:
     
    66216786                                    (INT)HIWORD(lParam));
    66226787
    6623 /*      case LVM_SETITEMPOSITION: */
     6788/*      case LVM_SETITEMPOSITION32: */
    66246789
    66256790  case LVM_SETITEMSTATE:
     
    66296794    return LISTVIEW_SetItemTextA(hwnd, (INT)wParam, (LPLVITEMA)lParam);
    66306795
    6631 /*      case LVM_SETSELECTIONMARK: */
     6796/*      case LVM_SETITEMTEXTW: */
     6797
     6798  case LVM_SETSELECTIONMARK:
     6799    return LISTVIEW_SetSelectionMark(hwnd, (INT)lParam);
    66326800
    66336801  case LVM_SETTEXTBKCOLOR:
Note: See TracChangeset for help on using the changeset viewer.