ListView painting (was Re: Mouse up vs Mouse click)
Cenedese at indel.ch
Fri Jan 30 06:55:01 CST 2004
>> That was my weak try to explain what I see :)
>> Ok, again in short what happens: I can click on a cell in the first column,
>> it gets selected, I can release the mouse button, everything fine.
>> But when I press on a cell in another column it shortly gets selected
>> and immediately the selection again disappears, even while still
>> holding the mouse button. The logical selection seems to be ok
>> as I can move it to another cell with the cursor keys (and it strangely
>> stays there unlike if done so with the mouse).
>OK, so it seems that your app uses the listview in LVS_REPORT mode,
>and that it wants to make it bahave like a spreadsheet (that is,
>you want to be able to individually select any cell from the
>row/column matrix of the listview). Hence the OWNERDRAW, as by
>default a listview in REPORT more can either select the cell in
>the first column or the entire row.
Hmm... that might be a thing to try too as it works for the first column.
That would be LVS_EX_FULLROWSELECT... Nah, didn't change
anything except some flicker.
>Now, I haven't used MFC before, so I don't know if this behaviour
>is done in your app or in MFC code. If it's in your app, it should
>be simple enough to add some print statements to figure out the
>paint order and to confirm/ruleout this theory. If it's done in
>MFC, I'm afraid you'll need to get creative, 'cause I can't help.
Of course some is application code as the listcontrol doesn't
behave like that. But it doesn't need that much as there are already
a lot of useful functions (SubItemHitTest, DrawItem...) I just need
to keep an index of the selected column in addition to the already
exisiting SelectedRow. And the painting of just this one cell instead
of the whole line. The bigger stuff is to include other controls (text,
combo) in the cells.
>But the problem seems to be in the order of events (or some missing
>notifications). Print statements are what you want: they'll help you
>figure out (1) if you get all required notifications, and (2) if they
>arrive in the right order.
I think I already found the (apparent) difference in the events, the
(not) hanging in the OnLButtonDown. I need to find out why it doesn't
stay in there and if it's in listview, message, events...
More information about the wine-devel