Ignore:
Timestamp:
May 28, 2003, 10:53:38 AM (22 years ago)
Author:
sandervl
Message:

PF: OWNERDRAW fixes for ListView control

File:
1 edited

Legend:

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

    r10115 r10125  
    278278  WCHAR szSearchParam[ MAX_PATH ];
    279279  BOOL bIsDrawing;
     280#ifdef __WIN32OS2__
     281  BOOL              bDragInProcess;
     282#endif
    280283} LISTVIEW_INFO;
    281284
     
    24002403        if (infoPtr->himlState || infoPtr->himlSmall)
    24012404            nItemHeight += HEIGHT_PADDING;
     2405
     2406#ifdef __WIN32OS2__
     2407        if(infoPtr->dwStyle & LVS_OWNERDRAWFIXED) {
     2408            /* Get item height */
     2409
     2410           MEASUREITEMSTRUCT mis;
     2411           UINT              id = GetWindowLongA(infoPtr->hwndSelf,GWL_ID);
     2412
     2413           mis.CtlType    = ODT_LISTVIEW;
     2414           mis.CtlID      = id;
     2415           mis.itemID     = 0;
     2416           mis.itemData   = 0;     //TODO:!!!!
     2417           mis.itemHeight = nItemHeight;
     2418           SendMessageA(GetParent(infoPtr->hwndSelf), WM_MEASUREITEM, id, (LPARAM)&mis );
     2419           nItemHeight = mis.itemHeight;
     2420       }
     2421#endif
    24022422    }
    24032423
     
    31683188    }
    31693189  }
    3170 
     3190#ifdef __WIN32OS2__
     3191  else
     3192  if(!infoPtr->bDragInProcess && (infoPtr->bLButtonDown || infoPtr->bRButtonDown) && infoPtr->nSelectionMark != -1) {
     3193      NMLISTVIEW nml = {0};
     3194      nml.iItem = infoPtr->nSelectionMark;
     3195      notify_listview(infoPtr, (infoPtr->bLButtonDown) ? LVN_BEGINDRAG : LVN_BEGINRDRAG, &nml);
     3196      infoPtr->bDragInProcess = TRUE;
     3197  }
     3198#endif 
    31713199  return 0;
    31723200}
     
    58445872        SelectObject(hdc, hOldFont);
    58455873        ReleaseDC(infoPtr->hwndSelf, hdc);
     5874#ifdef __WIN32OS2__
     5875        if(infoPtr->dwStyle & LVS_OWNERDRAWFIXED) {
     5876        /* Get item width */
     5877
     5878        MEASUREITEMSTRUCT mis;
     5879        UINT             id = GetWindowLongA(infoPtr->hwndSelf,GWL_ID);
     5880        mis.CtlType    = ODT_LISTVIEW;
     5881        mis.CtlID      = id;
     5882        mis.itemID     = 0;
     5883        mis.itemData   = 0;     //TODO:!!!!
     5884        mis.itemHeight = 0;
     5885        mis.itemWidth  = 0;
     5886        if (isW) 
     5887         SendMessageW(GetParent(infoPtr->hwndSelf), WM_MEASUREITEM, id, (LPARAM)&mis );
     5888        else
     5889         SendMessageA(GetParent(infoPtr->hwndSelf), WM_MEASUREITEM, id, (LPARAM)&mis );
     5890        stringSize.cx  = (mis.itemWidth) ? mis.itemWidth : infoPtr->nItemWidth;
     5891    }
     5892#endif
    58465893    }
    58475894    return stringSize.cx;
     
    76867733  nmKeyDown.wVKey = nVirtualKey;
    76877734  nmKeyDown.flags = 0;
     7735#ifdef __WIN32OS2__
     7736  if(notify_hdr(infoPtr, LVN_KEYDOWN, &nmKeyDown.hdr) == TRUE)
     7737    return 0;    //application processed this key press
     7738#else
    76887739  notify_hdr(infoPtr, LVN_KEYDOWN, &nmKeyDown.hdr);
     7740#endif
    76897741
    76907742  switch (nVirtualKey)
     
    79117963  }
    79127964
     7965#ifdef __WIN32OS2__
     7966  //SvL: Send WM_COMMAND as well. (also done by NT's comctl32)
     7967  SendMessageA(GetParent(infoPtr->hwndSelf), WM_COMMAND, (1<<16) | GetWindowLongW(infoPtr->hwndSelf, GWL_ID), infoPtr->hwndSelf);
     7968#endif
     7969
    79137970  return 0;
    79147971}
     
    79478004    if(lvHitTestInfo.iItem == infoPtr->nEditLabelItem && (lvHitTestInfo.flags & LVHT_ONITEMLABEL))
    79488005        LISTVIEW_EditLabelT(infoPtr, lvHitTestInfo.iItem, TRUE);
     8006
     8007#ifdef __WIN32OS2__
     8008  if(infoPtr->bDragInProcess) {
     8009      infoPtr->bDragInProcess = FALSE;
     8010  }
     8011#endif 
    79498012
    79508013    return 0;
Note: See TracChangeset for help on using the changeset viewer.