Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 40 |
Nodes: | 6 (0 / 6) |
Uptime: | 10:01:38 |
Calls: | 291 |
Files: | 910 |
Messages: | 76,421 |
Hello all,
In a listview in basic LVS_ICON mode (no grouping) I'm trying the get the location of an item. For that I'm using LVM_GETITEMPOSITION.
The problem is that it gives a way to large X position for all items (iow, its a constant value of "too big").
Also, the first item gives a LVM_GETITEMPOSITION result of 0x00000015 0x00000002. The same item gives a LVM_GETITEMRECT result of 0x0000000D 0x00000000 0x0000003D 0x00000035.
Notice how the RECT X and Y results are, quite unexpected to me, *smaller* than the POSITONs X and Y results.
Does anyone knows whats going on ? What is LVM_GETITEMPOSITION actually returning ?
Regards,
Rudy Wieser
Have you checked it against the item's icon RECT?
JJ,
Have you checked it against the item's icon RECT?
I thought about that being a possible reason, and just checking it it looks like you hit the nail on the head. :-)
Its just that I didn't expect a LVM_GET*ITEM*POSITION call to return the position of something (the icon) inside of it. :-|
Any idea how I can get the top-left of the item itself ? (I'm trying to
draw a more visible focus indicator).
Regards,
Rudy Wieser
...Any idea how I can get the top-left of the item itself ? (I'm
trying to draw a more visible focus indicator).
Just give LVM_GETITEMRECT which information you want. Or did you
overlooked it in the documentation?
JJ,
....Any idea how I can get the top-left of the item itself ? (I'm
trying to draw a more visible focus indicator).
Just give LVM_GETITEMRECT which information you want. Or did you
overlooked it in the documentation?
Did you overlook that I also mentioned that one in my inital message (and included results of both), and that its documentation says it returns the *boundary* of the item (which turns out to be the smallest box which encompass all in it) ? :-p
Yeah, I tested (and drawn) both.
Regards,
Rudy Wieser
...Just give LVM_GETITEMRECT which information you want. Or did you
overlooked it in the documentation?
Did you overlook that I also mentioned that one in my inital message (and
included results of both), and that its documentation says it returns the
*boundary* of the item (which turns out to be the smallest box which
encompass all in it) ? :-p
Yeah, I tested (and drawn) both.
I'm not referring to the result.
Without any knowledge I would think that the 3 words "in view coordinates" make the difference, <=> "in the current view". And "The position of
list-
view items is specified in view coordinates, which are client coordinates offset by the scroll position."