* ITERATOR DOCUMENTATION
*
* The iterator functions allow for easy, and convenient iteration
- * over items of interest in the list. Typically, you create a
+ * over items of interest in the list. Typically, you create an
* iterator, use it, and destroy it, as such:
* ITERATOR i;
*
static BOOL LISTVIEW_KeySelection(LISTVIEW_INFO *infoPtr, INT nItem, BOOL space)
{
/* FIXME: pass in the state */
- WORD wShift = HIWORD(GetKeyState(VK_SHIFT));
- WORD wCtrl = HIWORD(GetKeyState(VK_CONTROL));
+ WORD wShift = GetKeyState(VK_SHIFT) & 0x8000;
+ WORD wCtrl = GetKeyState(VK_CONTROL) & 0x8000;
BOOL bResult = FALSE;
TRACE("nItem=%d, wShift=%d, wCtrl=%d\n", nItem, wShift, wCtrl);
if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_GRIDLINES)
rcLabel.bottom--;
+#ifdef __REACTOS__
if ((!(lvItem.state & LVIS_SELECTED) || !infoPtr->bFocus) && (infoPtr->dwLvExStyle & LVS_EX_TRANSPARENTSHADOWTEXT))
DrawShadowText(hdc, lvItem.pszText, -1, &rcLabel, uFormat, RGB(255, 255, 255), RGB(0, 0, 0), 2, 2);
else
+#endif
DrawTextW(hdc, lvItem.pszText, -1, &rcLabel, uFormat);
postpaint:
*/
static BOOL LISTVIEW_DeleteAllItems(LISTVIEW_INFO *infoPtr, BOOL destroy)
{
- NMLISTVIEW nmlv;
HDPA hdpaSubItems = NULL;
- BOOL bSuppress;
+ BOOL suppress = FALSE;
ITEMHDR *hdrItem;
ITEM_INFO *lpItem;
ITEM_ID *lpID;
SetRectEmpty(&infoPtr->rcFocus);
/* But we are supposed to leave nHotItem as is! */
-
/* send LVN_DELETEALLITEMS notification */
- ZeroMemory(&nmlv, sizeof(NMLISTVIEW));
- nmlv.iItem = -1;
- bSuppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv);
+ if (!(infoPtr->dwStyle & LVS_OWNERDATA) || !destroy)
+ {
+ NMLISTVIEW nmlv;
+
+ memset(&nmlv, 0, sizeof(NMLISTVIEW));
+ nmlv.iItem = -1;
+ suppress = notify_listview(infoPtr, LVN_DELETEALLITEMS, &nmlv);
+ }
for (i = infoPtr->nItemCount - 1; i >= 0; i--)
{
{
/* send LVN_DELETEITEM notification, if not suppressed
and if it is not a virtual listview */
- if (!bSuppress) notify_deleteitem(infoPtr, i);
+ if (!suppress) notify_deleteitem(infoPtr, i);
hdpaSubItems = DPA_GetPtr(infoPtr->hdpaItems, i);
lpItem = DPA_GetPtr(hdpaSubItems, 0);
/* free id struct */
WCHAR szDispText[DISP_TEXT_SIZE] = { '\0' };
RECT rcBox, rcBounds, rcState, rcIcon, rcLabel, rcSearch;
POINT Origin, Position, opt;
+ BOOL is_fullrow;
LVITEMW lvItem;
ITERATOR i;
INT iItem;
TRACE("rcBounds=%s\n", wine_dbgstr_rect(&rcBounds));
if (!PtInRect(&rcBounds, opt)) return -1;
+ /* That's a special case - row rectangle is used as item rectangle and
+ returned flags contain all item parts. */
+ is_fullrow = (infoPtr->uView == LV_VIEW_DETAILS) && ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) || (infoPtr->dwStyle & LVS_OWNERDRAWFIXED));
+
if (PtInRect(&rcIcon, opt))
lpht->flags |= LVHT_ONITEMICON;
else if (PtInRect(&rcLabel, opt))
lpht->flags |= LVHT_ONITEMLABEL;
else if (infoPtr->himlState && PtInRect(&rcState, opt))
lpht->flags |= LVHT_ONITEMSTATEICON;
- /* special case for LVS_EX_FULLROWSELECT */
- if (infoPtr->uView == LV_VIEW_DETAILS && infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT &&
- !(lpht->flags & LVHT_ONITEM))
+ if (is_fullrow && !(lpht->flags & LVHT_ONITEM))
{
lpht->flags = LVHT_ONITEM | LVHT_ABOVE;
}
lpht->flags &= ~LVHT_NOWHERE;
TRACE("lpht->flags=0x%x\n", lpht->flags);
- if (select && !(infoPtr->uView == LV_VIEW_DETAILS &&
- ((infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT) ||
- (infoPtr->dwStyle & LVS_OWNERDRAWFIXED))))
+ if (select && !is_fullrow)
{
if (infoPtr->uView == LV_VIEW_DETAILS)
{
INT max_cx = 0;
HDITEMW hdi;
- TRACE("(nColumn=%d, cx=%d\n", nColumn, cx);
+ TRACE("(nColumn=%d, cx=%d)\n", nColumn, cx);
/* set column width only if in report or list mode */
if (infoPtr->uView != LV_VIEW_DETAILS && infoPtr->uView != LV_VIEW_LIST) return FALSE;
INT oldHeight = infoPtr->nItemHeight;
HIMAGELIST himlOld = 0;
- TRACE("(nType=%d, himl=%p\n", nType, himl);
+ TRACE("(nType=%d, himl=%p)\n", nType, himl);
switch (nType)
{
{
POINT Origin, Pt;
- TRACE("(nItem=%d, pt=%s\n", nItem, wine_dbgstr_point(pt));
+ TRACE("(nItem=%d, pt=%s)\n", nItem, wine_dbgstr_point(pt));
if (!pt || nItem < 0 || nItem >= infoPtr->nItemCount ||
!(infoPtr->uView == LV_VIEW_ICON || infoPtr->uView == LV_VIEW_SMALLICON)) return FALSE;