News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Virtual Listview with Full Row Selection

Started by Ratch, November 24, 2006, 11:30:04 PM

Previous topic - Next topic

Ratch

To the Ineffable All,

     In the ZIP below, are the pertenent parts of my listvew trial.  Everything works OK so far except that the background color 'spills' over into the first column.  I cannot seem to get rid of that no matter how hard I try.  Any ideas?  Ratch

[attachment deleted by admin]

zooba

Do you mean the orange bar down the left hand side? I would've expected the background colour to be behind all the text - if you want a white background you choose white and if you want orange, well... :wink

Can you override the paint message and draw over that bit? There was no painting code in your snippet file, so is this just how a SysListView32 is implemented? Is there another place to set the background colour? Just throwing up ideas :thumbu

Cheers,

Zooba :U

Ratch

zooba,

     Thanks for replying.

QuoteDo you mean the orange bar down the left hand side?

     Yes.

QuoteCan you override the paint message and draw over that bit?

     Maybe, but why should I have to subclass on the first column when I don't have to do it on the other columns?

QuoteThere was no painting code in your snippet file,

     That's right, I take the default processing.

Quote...so is this just how a SysListView32 is implemented?

     That's one way do doing it.

QuoteIs there another place to set the background colour?

     By changing the background color of the class perhaps.  But why do it that way when the way I did it was successful.

     The background is not the problem.  Not left justfying the text up to the listview boundary is.  The orange color shows that the first column is short.  I will remove the orange background and you can see that the first column does not display the same as the other columns.  Ratch


[attachment deleted by admin]

zooba

You're right, of course. The column isn't left aligned.

I had a closer look at the code and I think this may be the culprit:

S1 = LVM_SETEXTENDEDLISTVIEWSTYLE OR LVS_EX_GRIDLINES
INVOKE SendMessage,[hwndList1],LVM_SETEXTENDEDLISTVIEWSTYLE,S1,S1


You've got the message in the style value as well as the gridlines value, so you're really passing 1037h instead of simply 1h. So the style, instead of being LVS_EX_GRIDLINES, is really GRIDLINES | SUBITEMIMAGES | CHECKBOXES | HEADERDRAGDROP | FULLROWSELECT | UNDERLINECOLD. I imagine SUBITEMIMAGES is the one causing the little gap at the left. No it's not. Possibly CHECKBOXES or it may simply be space for an image (small icon) which hasn't been specified.

Ratch

zooba,

     OK, I nuked the LSV_EX_GRIDLINES style, and it still does not display correctly.  I can't get anymore simpler than that.  Ratch

[attachment deleted by admin]

zooba

The LVS_EX_GRIDLINES was fine, but you were passing LVM_SETEXTENDEDLISTVIEWSTYLE as the value of styles to set:

(after expanding S1)
INVOKE SendMessage,[hwndList1],LVM_SETEXTENDEDLISTVIEWSTYLE,LVM_SETEXTENDEDLISTVIEWSTYLE,LVM_SETEXTENDEDLISTVIEWSTYLE

Only constants starting with LVS_EX (List View Style EXtended) should be passed to the message.

However, I think you may need to find a style somewhere to disable images completely. Report views can have images down the left where your gap is (ie. Details view in Explorer). If you can turn images off somehow it may be fixable.

Cheers,

Zooba :U

Ratch

zooba,

QuoteThe LVS_EX_GRIDLINES was fine, but you were passing LVM_SETEXTENDEDLISTVIEWSTYLE as the value of styles to set:

     Yes, you are correct.  I just saw that too, and was just about to post a message to that effect, but you beat me to it.  Dumb mistake.  Thanks for the help.  Everything works fine now with full row select.   Ratch

[attachment deleted by admin]

zooba