#1228 Imagelist bleeds in listcontrol with checkboxes extended style

ooDialog (58)
Jon Wolfers

Windows 7 Pro 32 bit
NB:This behaviour is seen in previous versions also

When using an imagelist with a listcontrol having extended styles ONECLICKACTIVATE, FULLROWSELECT & CHECKBOXES the images from the imagelist bleed.

Removing the CHECKBOXES style corrects this.

I include a test script with a couple of images.
Also a jpg of how it renders on my screen in case this is operating system or video card related.




  • Mark Miesfeld

    Mark Miesfeld - 2013-12-23

    Hi Jon - I don't see either the jpg or the test script. Maybe I'm being too quick because I just happen to be on line now? ;-)

  • Jon Wolfers

    Jon Wolfers - 2013-12-23

    Attempting to re-upload zip file with attachments (SF gave no indication it failed before but I admit they are not here).

  • Mark Miesfeld

    Mark Miesfeld - 2013-12-23
    • labels: --> ooDialog
    • status: open --> invalid
    • assigned_to: Mark Miesfeld
  • Mark Miesfeld

    Mark Miesfeld - 2013-12-23

    Hi Jon,

    I do not think this is an ooDialog bug. The reason is this: The underlying list-view does all of the drawing of its client rectangle; ooDialog does absolutely none of the drawing of the client rectangle. All ooDialog does is set the style(s) of the list-view to that specified by the ooDialog programmer.

    The poor painting you see is, I believe, due to using inappropriately sized icons.

    MSDN says about the size of the icons: " You can use the GetSystemMetrics function to determine appropriate dimensions for the full-sized and small icons."

    The .SM class can be used to retrieve the small icon dimensions using the cxSmIcon attribute. (Well sort of, I guess you need to know that the small icons are square. It might also help if you knew that the small icon size is 16 x 16 from at least XP through Windows 7.)

    Anyhow, I experimented with the existing list-view examples that use small icons by giving the list-views the same style(s) as in your test example. They all displayed without the bleeding through problem.

    I then reproduced your .bmp files as 16 x 16 bitmaps. When I use those files for the small icons, there is no bleeding through problem. I have attached that test program as noBug.zip.

    Initially, I was surprised that your 32 X 12 bitmaps showed up at all. However, with your program you can also see something is not right when you select an item in either list-view.

    The colored selection over the text portion of the item is higher than that of the icon portion of the item. In fact it looks like over the icon portion it is 12 pixels high and over the text it is 16 pixels high.

    So, it seems as though you need to use 16 x 16 icons, or the internal drawing of the list-view gets screwed up.

    P.S. my copy of the colored icon is not great, I'm not very artistic. Feel free to sue them if you want, but you might be able to do better yourself. ;-)

  • Mark Miesfeld

    Mark Miesfeld - 2013-12-23

    My test example.

  • Mark Miesfeld

    Mark Miesfeld - 2013-12-23

    Oh, one other point. You might be able to make your icon 32 x 16 and eliminate the bleeding through problem.

    As I said, I was surprised that the 32 x 12 showed up at all. I thought the list-view only reserved 16 pixels of space for the icon. So, you could try it, although in a more complicated list-view it might not work.

  • Jon Wolfers

    Jon Wolfers - 2013-12-24

    Hi Mark,

    Many thanks. Quick work as usual. I have happily substituted 16x16 bmps.

    Strangely, I have been successfully using 20x20bmp images in another context for years, and successfully converted them to an image list, however, in that case, all the images (1200 of them) are in a single long thin bmp and I do not use the checkboxes style.

    Thanks for your help here.




Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks