I won't add any bug reports if i am not sure. My topic's title did end with a question mark.
In fact it turns out to be more complicated than i assumed at the beginning.
** I tried to build an easy testcase from the scratch (simple listview / custom listview / Shell listview as picked up from within the IDE), but that did NOT show up the issue.
** My own app (not using the shell controls) as well as a shell control demo from within this forum (i tried it for cross check), are showing up the issue.
So there is some layer between, and i still could not identify which specific change destroys the correct value of "Selected" when using both apps with RC1. - The impact is: one won't be able to call the right context menu.
Instead of more many words, for everyone who is interested in and wants to see a test case)
Pickup the zip file from Reply #32 within:
https://forum.lazarus.freepascal.org/index.php/topic,31625.msg397071.html#msg397071and do:
- Set ShellListView ("SLV") to multiselect true, and add a event for OnContextPopup.
- Within this event, place a simple check like:
if SLV.Selected = nil then
ShowMessage(' Not Ok!!! Selected is NIL, SelCount is: ' + inttostr(SLV.SelCount))
else ShowMessage('OK, Selected is not NIL; SelCount is: ' + inttostr(SLV.SelCount));;
- Compile and test (Windows) with 2.012. And then compile and test with 2.2 RC1
- For testing, select at least two items in the Listview; then do right mouse click
---> See what the message box is telling you
___OR SIMPLY___ pickup the zip file herein attached, which already contains those steps described.
(Remark: with new ShellCtrls.pas, sthe event "STVGetImageIndex" is no longer needed)