some apps of mine needs this to get going: can someone with good listview knowledge confirm ? (or find the correct fix) TIA
On Fri, 22 Aug 2003, Eric Pouech wrote:
some apps of mine needs this to get going: can someone with good listview knowledge confirm ? (or find the correct fix)
- if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) + if (uView == LVS_REPORT /*&& (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)*/)
If you do this, you will be able to select a row in REPORT mode when you are not in LVS_EX_FULLROWSELECT, when you just click in a sub item.
This is easy enough to test (I can't do it right now, sorry), and if that's how the native control behaves, then let's just get rid of it.
What's the problem with your app?
Dimitrie O. Paun wrote:
On Fri, 22 Aug 2003, Eric Pouech wrote:
some apps of mine needs this to get going: can someone with good listview knowledge confirm ? (or find the correct fix)
- if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
- if (uView == LVS_REPORT /*&& (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)*/)
If you do this, you will be able to select a row in REPORT mode when you are not in LVS_EX_FULLROWSELECT, when you just click in a sub item.
This is easy enough to test (I can't do it right now, sorry), and if that's how the native control behaves, then let's just get rid of it.
What's the problem with your app?
but here's the differences I get between running native Win98 comctl and Wine's builtin
listview: multicolumn, in report mode, without LVS_EX_FULLROWSELECT extended style
message concerned: NM_CLICK notification for left click in LV (mainly in a column for any subitem)
native: iItem: always set to -1 iSubItem: set to the subItem of the column clicked
builtin: iItem: set to the row number iSubItem: always set to 0
(Note: I don't like either the iItem value I get from the native DLL (didn't test LVM_GETITEMHITTEST information though)
also, as a noted difference, in selection. Wine's only draws a dotted rect around the selected item (or row in full row select mode). In native, the rect interior is grayed if the control doesn't have the focus, and filled in blue if control has the focus.
if everything goes smoothly full code of the app should be posted this weekend (app will allow, among other things, to enable/disable debug channels on any running wine app)
A+
On August 23, 2003 04:32 am, Eric Pouech wrote:
listview: multicolumn, in report mode, without LVS_EX_FULLROWSELECT extended style
message concerned: NM_CLICK notification for left click in LV (mainly in a column for any subitem)
native: iItem: always set to -1 iSubItem: set to the subItem of the column clicked
builtin: iItem: set to the row number iSubItem: always set to 0
(Note: I don't like either the iItem value I get from the native DLL (didn't test LVM_GETITEMHITTEST information though)
Can you please give this one a try? Sorry, my Wine crashes ATM so I can not test, but I hope it Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.357 diff -u -r1.357 listview.c --- dlls/comctl32/listview.c 24 Jul 2003 00:03:13 -0000 1.357 +++ dlls/comctl32/listview.c 23 Aug 2003 15:02:54 -0000 @@ -5768,6 +5768,7 @@ POINT Origin, Position, opt; LVITEMW lvItem; ITERATOR i; + INT iItem;
TRACE("(pt=%s, subitem=%d, select=%d)\n", debugpoint(&lpht->pt), subitem, select);
@@ -5800,17 +5801,17 @@
iterator_frameditems(&i, infoPtr, &rcSearch); iterator_next(&i); /* go to first item in the sequence */ - lpht->iItem = i.nItem; + iItem = i.nItem; iterator_destroy(&i);
- TRACE("lpht->iItem=%d\n", lpht->iItem); - if (lpht->iItem == -1) return -1; + TRACE("lpht->iItem=%d\n", iItem); + if (iItem == -1) return -1;
lvItem.mask = LVIF_STATE | LVIF_TEXT; if (uView == LVS_REPORT) lvItem.mask |= LVIF_INDENT; lvItem.stateMask = LVIS_STATEIMAGEMASK; if (uView == LVS_ICON) lvItem.stateMask |= LVIS_FOCUSED; - lvItem.iItem = lpht->iItem; + lvItem.iItem = iItem; lvItem.iSubItem = 0; lvItem.pszText = szDispText; lvItem.cchTextMax = DISP_TEXT_SIZE; @@ -5818,11 +5819,11 @@ if (!infoPtr->bFocus) lvItem.state &= ~LVIS_FOCUSED;
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, &rcState, &rcIcon, &rcLabel); - LISTVIEW_GetItemOrigin(infoPtr, lpht->iItem, &Position); + LISTVIEW_GetItemOrigin(infoPtr, iItem, &Position); opt.x = lpht->pt.x - Position.x - Origin.x; opt.y = lpht->pt.y - Position.y - Origin.y;
- if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) + if (uView == LVS_REPORT) rcBounds = rcBox; else UnionRect(&rcBounds, &rcIcon, &rcLabel); @@ -5839,7 +5840,7 @@ lpht->flags &= ~LVHT_NOWHERE;
TRACE("lpht->flags=0x%x\n", lpht->flags); - if (uView == LVS_REPORT && lpht->iItem != -1 && subitem) + if (uView == LVS_REPORT && subitem) { INT j;
@@ -5856,12 +5857,12 @@ } }
- if (!select || lpht->iItem == -1) return lpht->iItem; - - if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) return lpht->iItem; - - if (uView == LVS_REPORT) UnionRect(&rcBounds, &rcIcon, &rcLabel); - return PtInRect(&rcBounds, opt) ? lpht->iItem : -1; + if (select && !(uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))) + { + if (uView == LVS_REPORT) UnionRect(&rcBounds, &rcIcon, &rcLabel); + if (!PtInRect(&rcBounds, opt)) iItem = -1; + } + return lpht->iItem = iItem; }
implements what you described.
implements what you described.
thanks... works like a charm now impressive turn around time btw!! A+
On August 23, 2003 11:37 am, Eric Pouech wrote:
thanks... works like a charm now impressive turn around time btw!!
Oh, thank you, you are too kind. I just happened to have a few moments free in the morning (thanks to my g/f who did not complain too loudly about me being late for breakfast :)).
So I guess we can include it...
ChangeLog Fix the hit test for full row select in REPORT mode. (Found, debugged, and tested by Eric Pouech)
Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.357 diff -u -r1.357 listview.c --- dlls/comctl32/listview.c 24 Jul 2003 00:03:13 -0000 1.357 +++ dlls/comctl32/listview.c 23 Aug 2003 15:02:54 -0000 @@ -5768,6 +5768,7 @@ POINT Origin, Position, opt; LVITEMW lvItem; ITERATOR i; + INT iItem;
TRACE("(pt=%s, subitem=%d, select=%d)\n", debugpoint(&lpht->pt), subitem, select);
@@ -5800,17 +5801,17 @@
iterator_frameditems(&i, infoPtr, &rcSearch); iterator_next(&i); /* go to first item in the sequence */ - lpht->iItem = i.nItem; + iItem = i.nItem; iterator_destroy(&i);
- TRACE("lpht->iItem=%d\n", lpht->iItem); - if (lpht->iItem == -1) return -1; + TRACE("lpht->iItem=%d\n", iItem); + if (iItem == -1) return -1;
lvItem.mask = LVIF_STATE | LVIF_TEXT; if (uView == LVS_REPORT) lvItem.mask |= LVIF_INDENT; lvItem.stateMask = LVIS_STATEIMAGEMASK; if (uView == LVS_ICON) lvItem.stateMask |= LVIS_FOCUSED; - lvItem.iItem = lpht->iItem; + lvItem.iItem = iItem; lvItem.iSubItem = 0; lvItem.pszText = szDispText; lvItem.cchTextMax = DISP_TEXT_SIZE; @@ -5818,11 +5819,11 @@ if (!infoPtr->bFocus) lvItem.state &= ~LVIS_FOCUSED;
LISTVIEW_GetItemMetrics(infoPtr, &lvItem, &rcBox, &rcState, &rcIcon, &rcLabel); - LISTVIEW_GetItemOrigin(infoPtr, lpht->iItem, &Position); + LISTVIEW_GetItemOrigin(infoPtr, iItem, &Position); opt.x = lpht->pt.x - Position.x - Origin.x; opt.y = lpht->pt.y - Position.y - Origin.y;
- if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) + if (uView == LVS_REPORT) rcBounds = rcBox; else UnionRect(&rcBounds, &rcIcon, &rcLabel); @@ -5839,7 +5840,7 @@ lpht->flags &= ~LVHT_NOWHERE;
TRACE("lpht->flags=0x%x\n", lpht->flags); - if (uView == LVS_REPORT && lpht->iItem != -1 && subitem) + if (uView == LVS_REPORT && subitem) { INT j;
@@ -5856,12 +5857,12 @@ } }
- if (!select || lpht->iItem == -1) return lpht->iItem; - - if (uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) return lpht->iItem; - - if (uView == LVS_REPORT) UnionRect(&rcBounds, &rcIcon, &rcLabel); - return PtInRect(&rcBounds, opt) ? lpht->iItem : -1; + if (select && !(uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))) + { + if (uView == LVS_REPORT) UnionRect(&rcBounds, &rcIcon, &rcLabel); + if (!PtInRect(&rcBounds, opt)) iItem = -1; + } + return lpht->iItem = iItem; }
On August 23, 2003 04:32 am, Eric Pouech wrote:
also, as a noted difference, in selection. Wine's only draws a dotted rect around the selected item (or row in full row select mode). In native, the rect interior is grayed if the control doesn't have the focus, and filled in blue if control has the focus.
Yes, this patch broke selection drawing:
http://www.winehq.org/hypermail/wine-cvs/2003/04/0243.html
<blush>It's my patch, mea culpa</blush>.
I'll have to look into it, it's not obvious why it broke. It will have to wait a bit, I don't have time now.
On August 24, 2003 05:44 pm, Dimitrie O. Paun wrote:
Yes, this patch broke selection drawing:
http://www.winehq.org/hypermail/wine-cvs/2003/04/0243.html
<blush>It's my patch, mea culpa</blush>.
Yeah, at a second look, it was rather obvious what went wrong.
ChangeLog Always setup the selection colour, not just in custom draw.
Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.357 diff -u -r1.357 listview.c --- dlls/comctl32/listview.c 24 Jul 2003 00:03:13 -0000 1.357 +++ dlls/comctl32/listview.c 24 Aug 2003 23:30:31 -0000 @@ -882,15 +882,10 @@ return result; }
-static DWORD notify_prepaint (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd) +static void prepaint_setup (LISTVIEW_INFO *infoPtr, HDC hdc, NMLVCUSTOMDRAW *lpnmlvcd) { - BOOL isSelected = lpnmlvcd->nmcd.uItemState & CDIS_SELECTED; - DWORD cditemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, lpnmlvcd); - - if (cditemmode & CDRF_SKIPDEFAULT) return cditemmode; - /* apprently, for selected items, we have to override the returned values */ - if (isSelected) + if (lpnmlvcd->nmcd.uItemState & CDIS_SELECTED) { if (infoPtr->bFocus) { @@ -916,8 +911,6 @@ else SetBkMode(hdc, TRANSPARENT); SetTextColor(hdc, lpnmlvcd->clrText); - - return cditemmode; }
static inline DWORD notify_postpaint (LISTVIEW_INFO *infoPtr, NMLVCUSTOMDRAW *lpnmlvcd) @@ -3569,9 +3562,10 @@
if (nSubItem > 0) cdmode = infoPtr->cditemmode; if (cdmode & CDRF_NOTIFYITEMDRAW) - cdsubitemmode = notify_prepaint ( infoPtr, hdc, &nmlvcd); + cdsubitemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); if (nSubItem == 0) infoPtr->cditemmode = cdsubitemmode; if (cdsubitemmode & CDRF_SKIPDEFAULT) goto postpaint; + prepaint_setup(infoPtr, hdc, &nmlvcd);
/* in full row select, subitems, will just use main item's colors */ if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT)) @@ -3697,11 +3691,14 @@ if (cdmode & CDRF_NOTIFYITEMDRAW) { customdraw_fill(&nmlvcd, infoPtr, hdc, &dis.rcItem, &item); - cditemmode = notify_prepaint (infoPtr, hdc, &nmlvcd); + cditemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); }
if (!(cditemmode & CDRF_SKIPDEFAULT)) + { + prepaint_setup (infoPtr, hdc, &nmlvcd); SendMessageW(hwndParent, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis); + }
if (cditemmode & CDRF_NOTIFYPOSTPAINT) notify_postpaint(infoPtr, &nmlvcd); @@ -3848,8 +3845,9 @@
GetClientRect(infoPtr->hwndSelf, &rcClient); customdraw_fill(&nmlvcd, infoPtr, hdc, &rcClient, 0); - cdmode = notify_prepaint(infoPtr, hdc, &nmlvcd); + cdmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); if (cdmode & CDRF_SKIPDEFAULT) goto enddraw; + prepaint_setup(infoPtr, hdc, &nmlvcd);
/* Use these colors to draw the items */ infoPtr->clrTextBk = nmlvcd.clrTextBk;
On Sun, 24 Aug 2003 19:34:36 -0400, you wrote:
On August 24, 2003 05:44 pm, Dimitrie O. Paun wrote:
Yes, this patch broke selection drawing:
http://www.winehq.org/hypermail/wine-cvs/2003/04/0243.html
<blush>It's my patch, mea culpa</blush>.
Yeah, at a second look, it was rather obvious what went wrong.
ChangeLog Always setup the selection colour, not just in custom draw.
Index: dlls/comctl32/listview.c
RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.357 diff -u -r1.357 listview.c --- dlls/comctl32/listview.c 24 Jul 2003 00:03:13 -0000 1.357 +++ dlls/comctl32/listview.c 24 Aug 2003 23:30:31 -0000
Hi Dimitrie,
This is causing a regression in newsbin pro.
New postings are highlighted by a green background colour. With the patch the text in the second and higher columns is painted with a normal backgound colour instead of green. Selected rows are OK.
Rein.
On Fri, 29 Aug 2003, Rein Klazes wrote:
New postings are highlighted by a green background colour. With the patch the text in the second and higher columns is painted with a normal backgound colour instead of green. Selected rows are OK.
OK, I think I know what the problem is, I'll fix it when I get home.
On Fri, 29 Aug 2003, Rein Klazes wrote:
Hi Dimitrie,
This is causing a regression in newsbin pro.
New postings are highlighted by a green background colour. With the patch the text in the second and higher columns is painted with a normal backgound colour instead of green. Selected rows are OK.
Can you give this a try please and tell me if it works:
Index: dlls/comctl32/listview.c =================================================================== RCS file: /var/cvs/wine/dlls/comctl32/listview.c,v retrieving revision 1.359 diff -u -r1.359 listview.c --- dlls/comctl32/listview.c 25 Aug 2003 23:44:51 -0000 1.359 +++ dlls/comctl32/listview.c 29 Aug 2003 20:13:33 -0000 @@ -3565,7 +3565,8 @@ cdsubitemmode = notify_customdraw(infoPtr, CDDS_PREPAINT, &nmlvcd); if (nSubItem == 0) infoPtr->cditemmode = cdsubitemmode; if (cdsubitemmode & CDRF_SKIPDEFAULT) goto postpaint; - prepaint_setup(infoPtr, hdc, &nmlvcd); + if (nSubItem == 0 || (cdmode & CDRF_NOTIFYITEMDRAW)) + prepaint_setup(infoPtr, hdc, &nmlvcd);
/* in full row select, subitems, will just use main item's colors */ if (nSubItem && uView == LVS_REPORT && (infoPtr->dwLvExStyle & LVS_EX_FULLROWSELECT))
Thanks!
On Fri, 29 Aug 2003 16:15:17 -0400 (EDT), you wrote:
On Fri, 29 Aug 2003, Rein Klazes wrote:
Hi Dimitrie,
This is causing a regression in newsbin pro.
New postings are highlighted by a green background colour. With the patch the text in the second and higher columns is painted with a normal backgound colour instead of green. Selected rows are OK.
Can you give this a try please and tell me if it works:
Index: dlls/comctl32/listview.c
Yes, that fixes it.
Thank you,
Rein.