Jump to content

? Translucent List Control Selection Rectangle


Guest

Recommended Posts

Hi,

I've got a question for the µTorrent devs. How did you accomplish the translucent selection rectangle in the list controls? Winspy indicates that you are using standard (common controls) list controls, but they don't support the rect on their own. I've seen virtual tree control components for Delphi that can do it, but I don't use Delphi much so that doesn't help.

How did you guys do it?

Thanks.

Link to comment
Share on other sites

(Not a dev here, but...) What translucent selection rectangle do you speak of?

The only things I can guess you mean are the column highlights (which should just be a listview control style, I think), or the highlighting of selected torrent jobs (which... should be characteristic of any Windows listview control, unless you explicitly disable selection).

Link to comment
Share on other sites

  • 4 months later...

In any of the list boxes, when you click and drag the mouse, a translucent rectangle gets drawn like the one that's drawn around files in Explorer (except on the desktop!)

I've been looking for an MFC implementation of this but have only seen it done for Delphi. What do the devs use?

Link to comment
Share on other sites

Wow, that worked so easily, just one little line extra and my list controls are now pretty, oh so pretty. Thanks! :D

Unfortunately, I had to hardcode LVS_EX_DOUBLEBUFFER's actual value because I can't get it to work normally. For some reason, setting _WIN32_WINNT to 0x501 causes a bunch of errors in afx*.inl (oddly enough, the errors are due to undeclared identifiers which are only declared if _WIN32_WINNT is >= 0x501 :/)

Too bad this is so incredibly undocumented (it's not even in MSDN—at least not my three year old copy) so it's impossible to find any useful information about it or how to use it.

Anyway, it's working now and hopefully I'll figure out a way to get it to work without hacking it.

Now, if I could only figure out what the formula is for calculating what the color of the inside of the rectangle is. The border is simply COLOR_HIGHLIGHT, but the rectangle is lighter. I wonder if there is a way to determine a formula from a (large enough) set of data…

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...