On Mon, 3 Feb 2003, Duane Clark wrote:
This is a separate bug from the other listview patches. If an app sends a LISTVIEW_Paint to a new listview before adding any items (which an app was :-) the item size was not getting set, causing subsequent LISTVIEW_Paint calls to clip the painting.
Sorry Duane, maybe it's just Monday morning, but I don't understand this. If the listview has no items, what is it supposed to paint?
Also, this just doesn't seem like the right place to place this check. What if the app doesn't call LVM_SETITEMCOUNT?
Dimitrie O. Paun wrote:
On Mon, 3 Feb 2003, Duane Clark wrote:
This is a separate bug from the other listview patches. If an app sends a LISTVIEW_Paint to a new listview before adding any items (which an app was :-) the item size was not getting set, causing subsequent LISTVIEW_Paint calls to clip the painting.
Sorry Duane, maybe it's just Monday morning, but I don't understand this. If the listview has no items, what is it supposed to paint?
It paints the headers. And the problem comes about because in LISTVIEW_Paint, a test is made for the first paint, and if it is the first paint, the item size is updated.
if (infoPtr->bFirstPaint) { UINT uView = infoPtr->dwStyle & LVS_TYPEMASK; infoPtr->bFirstPaint = FALSE; LISTVIEW_UpdateItemSize(infoPtr); ...
Also, this just doesn't seem like the right place to place this check. What if the app doesn't call LVM_SETITEMCOUNT?
It has nothing to do with LVM_SETITEMCOUNT that I know, or am I missing something? This bug is not related to the other bug.
Duane Clark wrote:
It paints the headers. And the problem comes about because in LISTVIEW_Paint, a test is made for the first paint, and if it is the first paint, the item size is updated.
I guess I should have said something like "...and only if it is the first paint...". Hopefully that was reasonably obvious anyway.
On Mon, 3 Feb 2003, Duane Clark wrote:
It has nothing to do with LVM_SETITEMCOUNT that I know, or am I missing something? This bug is not related to the other bug.
Sorry, my mistake, I registered it automatically as part of SetItemCount when you send it bundled with the other stuff. I'll review it when I get home.