Ignore:
Timestamp:
Sep 26, 1999, 1:01:11 PM (26 years ago)
Author:
achimha
Message:

merged latest WINE 990923 changes

File:
1 edited

Legend:

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

    r496 r1058  
    4343 *   LISTVIEW_Update : not completed
    4444 */
     45
     46/* WINE 990923 level */
    4547
    4648#include <string.h>
     
    35763578  HDC hdc;
    35773579  HFONT hOldFont;
    3578   INT nMaxWidth;
     3580  INT nLeftPos;
    35793581  INT nLabelWidth;
    35803582  TEXTMETRICA tm;
     
    36823684          {
    36833685            bResult = TRUE;
    3684             nMaxWidth = lprc->left = ptItem.x + ptOrigin.x;
     3686            nLeftPos = lprc->left = ptItem.x + ptOrigin.x;
    36853687            lprc->top = ptItem.y + ptOrigin.y;
    36863688            lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    36973699
    36983700            nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
    3699             if (lprc->left + nLabelWidth < nMaxWidth + infoPtr->nItemWidth)
     3701            if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
    37003702            {
    37013703              lprc->right = lprc->left + nLabelWidth;
     
    37033705            else
    37043706            {
    3705               lprc->right = nMaxWidth + infoPtr->nItemWidth;
     3707              lprc->right = nLeftPos + infoPtr->nItemWidth;
    37063708            }
    37073709          }
     
    37103712        {
    37113713          bResult = TRUE;
    3712           lprc->left = ptItem.x;
     3714          nLeftPos = lprc->left = ptItem.x;
    37133715          lprc->top = ptItem.y;
    37143716          lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    37243726          }
    37253727
    3726           lprc->right = lprc->left + LISTVIEW_GetLabelWidth(hwnd, nItem);
     3728          nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3729          if (lprc->left + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
     3730          {
     3731            lprc->right = lprc->left + nLabelWidth;
     3732          }
     3733          else
     3734          {
     3735            lprc->right = nLeftPos + infoPtr->nItemWidth;
     3736          }
    37273737        }
    37283738        break;
     
    37773787          }
    37783788
    3779           lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem);
     3789            nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3790            if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth)
     3791            {
     3792              lprc->right += nLabelWidth;
     3793            }
     3794            else
     3795            {
     3796              lprc->right = lprc->left + infoPtr->nItemWidth;
     3797            }
    37803798        }
    37813799        break;
     
    38013819          {
    38023820            bResult = TRUE;
    3803             lprc->left = ptItem.x + ptOrigin.x;
     3821            nLeftPos= lprc->left = ptItem.x + ptOrigin.x; 
    38043822            lprc->top = ptItem.y + ptOrigin.y;
    38053823            lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    38173835            }
    38183836
    3819             lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem);
     3837          nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3838          if (lprc->right + nLabelWidth < lprc->left + infoPtr->nItemWidth)
     3839          {
     3840            lprc->right += nLabelWidth;
     3841          }
     3842          else
     3843          {
     3844            lprc->right = lprc->left + infoPtr->nItemWidth;
     3845          }
    38203846          }
    38213847        }
     
    38233849        {
    38243850          bResult = TRUE;
    3825           lprc->left = ptItem.x;
     3851          nLeftPos = lprc->left = ptItem.x;
    38263852          lprc->top = ptItem.y;
    38273853          lprc->bottom = lprc->top + infoPtr->nItemHeight;
     
    38393865          }
    38403866
    3841           lprc->right += LISTVIEW_GetLabelWidth(hwnd, nItem);
     3867          nLabelWidth = LISTVIEW_GetLabelWidth(hwnd, nItem);
     3868          if (lprc->right + nLabelWidth < nLeftPos + infoPtr->nItemWidth)
     3869          {
     3870            lprc->right += nLabelWidth;
     3871          }
     3872          else
     3873          {
     3874            lprc->right = nLeftPos + infoPtr->nItemWidth;
     3875          }
    38423876        }
    38433877        break;
     
    38603894 *   FAILURE : zero
    38613895 */
    3862 static INT LISTVIEW_GetLabelWidth(HWND hwnd, INT nItem)
     3896INT LISTVIEW_GetLabelWidth(HWND hwnd, INT nItem)
    38633897{
    38643898  CHAR szDispText[DISP_TEXT_SIZE];
     
    38923926 * Horizontal + vertical spacing
    38933927 */
    3894 static LRESULT LISTVIEW_GetItemSpacing(HWND hwnd, BOOL bSmall)
     3928LRESULT LISTVIEW_GetItemSpacing(HWND hwnd, BOOL bSmall)
    38953929{
    38963930  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
     
    39223956 * State specified by the mask.
    39233957 */
    3924 static LRESULT LISTVIEW_GetItemState(HWND hwnd, INT nItem, UINT uMask)
     3958LRESULT LISTVIEW_GetItemState(HWND hwnd, INT nItem, UINT uMask)
    39253959{
    39263960  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
     
    39563990 *   FAILURE : 0
    39573991 */
    3958 static LRESULT LISTVIEW_GetItemTextA(HWND hwnd, INT nItem, LPLVITEMA lpLVItem)
     3992LRESULT LISTVIEW_GetItemTextA(HWND hwnd, INT nItem, LPLVITEMA lpLVItem)
    39593993{
    39603994  LISTVIEW_INFO *infoPtr = (LISTVIEW_INFO *)GetWindowLongA(hwnd, 0);
     
    45094543}
    45104544
    4511 /* LISTVIEW_InsertColumnW  */
     4545static LRESULT LISTVIEW_InsertColumnW(HWND hwnd, INT nColumn,
     4546                                      LPLVCOLUMNW lpColumn)
     4547{
     4548  LVCOLUMNA     lvca;
     4549  LRESULT               lres;
     4550     
     4551  memcpy(&lvca,lpColumn,sizeof(lvca));
     4552//AH: todo
     4553//  if (lpColumn->mask & LVCF_TEXT)
     4554//    lvca.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpColumn->pszText);
     4555  lres = LISTVIEW_InsertColumnA(hwnd,nColumn,&lvca);
     4556  if (lpColumn->mask & LVCF_TEXT)
     4557    HeapFree(GetProcessHeap(),0,lvca.pszText);
     4558  return lres;
     4559}
    45124560
    45134561/***
     
    46094657}
    46104658
    4611 /* LISTVIEW_InsertItemW */
     4659static LRESULT LISTVIEW_InsertItemW(HWND hwnd, LPLVITEMW lpLVItem) {
     4660  LVITEMA lvia;
     4661  LRESULT lres;
     4662
     4663  memcpy(&lvia,lpLVItem,sizeof(LVITEMA));
     4664  if (lvia.mask & LVIF_TEXT) {
     4665    if (lpLVItem->pszText == LPSTR_TEXTCALLBACKW)
     4666      lvia.pszText = LPSTR_TEXTCALLBACKA;
     4667//AH: todo
     4668//    else
     4669//      lvia.pszText = HEAP_strdupWtoA(GetProcessHeap(),0,lpLVItem->pszText);
     4670  }
     4671  lres = LISTVIEW_InsertItemA(hwnd, &lvia);
     4672  if (lvia.mask & LVIF_TEXT) {
     4673    if (lpLVItem->pszText != LPSTR_TEXTCALLBACKW)
     4674      HeapFree(GetProcessHeap(),0,lvia.pszText);
     4675  }
     4676  return lres;
     4677}
    46124678
    46134679/***
     
    63236389  infoPtr->bFocus = TRUE;
    63246390
     6391  InvalidateRect(hwnd, NULL, TRUE);
     6392  UpdateWindow(hwnd);
     6393
    63256394  return 0;
    63266395}
     
    67226791
    67236792  case LVM_INSERTCOLUMNA:
    6724     return LISTVIEW_InsertColumnA(hwnd, (INT)wParam,
    6725                                     (LPLVCOLUMNA)lParam);
    6726 
    6727 /*      case LVM_INSERTCOLUMNW: */
     6793    return LISTVIEW_InsertColumnA(hwnd, (INT)wParam, (LPLVCOLUMNA)lParam);
     6794
     6795  case LVM_INSERTCOLUMNW:
     6796    return LISTVIEW_InsertColumnW(hwnd, (INT)wParam, (LPLVCOLUMNW)lParam);
    67286797
    67296798  case LVM_INSERTITEMA:
    67306799    return LISTVIEW_InsertItemA(hwnd, (LPLVITEMA)lParam);
    67316800
    6732 /*      case LVM_INSERTITEMW: */
     6801  case LVM_INSERTITEMW:
     6802    return LISTVIEW_InsertItemW(hwnd, (LPLVITEMW)lParam);
    67336803
    67346804  case LVM_REDRAWITEMS:
     
    68276897
    68286898  case WM_GETDLGCODE:
    6829     return DLGC_WANTTAB | DLGC_WANTARROWS;
     6899    return DLGC_WANTCHARS | DLGC_WANTARROWS;
    68306900
    68316901  case WM_GETFONT:
Note: See TracChangeset for help on using the changeset viewer.