mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:39:25 +02:00
LCL: Fix TListView selection on Windows with MultiSelect=True and OwnerData=True. Issue #34877, patch by Yuriy Sydorov.
git-svn-id: trunk@65473 -
This commit is contained in:
parent
344c1de6e9
commit
ada182fd7b
@ -332,22 +332,20 @@ begin
|
||||
DoItemChecked(Item);
|
||||
|
||||
// focus
|
||||
if (nm^.uOldState and LVIS_FOCUSED) <>
|
||||
(nm^.uNewState and LVIS_FOCUSED) then
|
||||
if (nm^.uOldState and LVIS_FOCUSED) <> (nm^.uNewState and LVIS_FOCUSED) then
|
||||
begin
|
||||
// focus state changed
|
||||
if (nm^.uNewState and LVIS_FOCUSED) = 0 then
|
||||
begin
|
||||
if FFocused = Item then
|
||||
FFocused := nil;
|
||||
end else
|
||||
begin
|
||||
end
|
||||
else
|
||||
FFocused := Item;
|
||||
end;
|
||||
end;
|
||||
// select
|
||||
if (nm^.uOldState and LVIS_SELECTED) <>
|
||||
(nm^.uNewState and LVIS_SELECTED) then
|
||||
if (((nm^.uOldState and LVIS_SELECTED) <> (nm^.uNewState and LVIS_SELECTED)))
|
||||
or (not (lffSelectedValid in FFlags) and (nm^.uNewState and LVIS_SELECTED <> 0)) then
|
||||
begin
|
||||
// select state changed
|
||||
if (nm^.uNewState and LVIS_SELECTED) = 0 then
|
||||
@ -364,9 +362,7 @@ begin
|
||||
FSelected := Item;
|
||||
Include(FFlags,lffSelectedValid);
|
||||
if OwnerData then
|
||||
begin
|
||||
FSelectedIdx:=nm^.iItem;
|
||||
end;
|
||||
//DebugLn('TCustomListView.CNNotify FSelected=',dbgs(FSelected));
|
||||
end;
|
||||
Change(Item, nm^.uChanged);
|
||||
|
Loading…
Reference in New Issue
Block a user