Owen Rudge wrote:
Hi Nikolay,
I don't think you need such duplication. Why not to use a single rectangle? Looks like you always offset it to listview origin, so these rectangle differ in offset only, that's why you introduced another iterator_* helper. If I'm right about that it's better to add another OffsetRect than consistently maintain two variables with same meaning.
I think I originally found myself implementing it in this manner, but ended up duplicating the offsetting code in a couple of locations while drawing/invalidating, so reworked it. However, the patch did grow a bit since then, a bit more than I think I expected it would, so it probably would be tidier to go back and simplify that again, with a couple of OffsetRect calls where appropriate. I'll have a look at tidying it up a bit more tomorrow.
Sure. Another thing, I'm not sure about that, maybe you could tell me - if a window loses focus with active timer, what happens? First time I thought about that a month ago working on Monthcal. I know that it isn't every day case, but probably we need just to KillTimer on WM_KILLFOCUS or WM_CAPTURECHANGED...Or LButtonUp event will be fired anyway if I didn't even release button?
Cheers,
Owen