Forum > LCL

SOLVED! Virtual listview; validity of "Item" in "Edited" when Selection changed

(1/10) > >>

d7_2_laz:
Windows (10 x64), virtual listview, nultiselect.   Lazarrus 2.2, but probably earlier too.
First side note: i found the observation a bit curios until i found a workaround. So i only would like to ask if it is normal. Wouldn't like to make an issue of it.
Second: imo it has absolutely nothing to do with the bunch of issues around virtual listview / multiselect as recently discussed. If i remember right it had already been with 2.0.12.
If appears more to be related to the order of message processing (set focus, kill foucs).

Scenario: the inplace editor is open for a selected iten. Now, by click, select another item.
"Item" within "Edited" now will point to the newly selected item, and not to the item just being edited.
"Item" appears to be hijacked (with strange results if one relies on it.

Test project attached.
My question is only for understanding: is it known and is it by design?

wp:
I tested the issue with Delphi, and there the edited text always goes into the previously selected, edited item. I cannot imagine that this behaviour is intentional. You should report it as a bug (not sure if someone will pick it up, though).

d7_2_laz:
Yes, it was not with Delphi (7 in my case).  With Laz. i noticed since a longer time sporadically, strange phenomena when editing and change selection, so i did a closer look now and found it at least worthy to communicate.

Happy enough that the really urgent thing(s) had been recently addressed i wouldn't like to annoy again with other issues near by (if desired i could to it of course).
A workaround does exist (using a remembered item index).

wp:
It's not annoying. But if you don't report it, the risk that a bug reported in a forum post will be forgotten is quite high.

d7_2_laz:
Probably you are right wp, and it's better to register it for to make it known.
Btw it differs from the behaviour of a regular listview, as:
without any further code (as default action), when the editor is open and another item is clicked,
- the regular listview commits the changed contents,  and selects the clicked item. The "edited" Item still points to the previous one -- ok.
- the virtual listview discards the changed contents, and selects the clicked item (but the "edited" Item  points to the clicked one too  -- wrong).
That may appear to be very unspectular and to be only a matter of personal flavour (which is better..).
Until one starts (withiin "Edited") to do something meaningful with "Item" and has to notice that he's working with a wrong object ...

So:
https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/39708

Navigation

[0] Message Index

[#] Next page

Go to full version