mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-26 22:23:49 +02:00
LCL/Listview: Fix listview jumping to first item when a key is pressed in virtual mode, issue #39715.
This commit is contained in:
parent
8c556536c1
commit
d3396e9fa0
@ -233,6 +233,26 @@ var
|
||||
end;
|
||||
end;
|
||||
|
||||
{ Workaround for issue #39715 to prevent the selection jumping to the first
|
||||
item in virtual mode when a normal key is pressed (the listview probably
|
||||
tries to perform an incremental search in this case which has not been
|
||||
implemented, yet (handler for OnDataFind). }
|
||||
procedure HandleListViewFindItem(ALV: TCustomlistViewAccess);
|
||||
var
|
||||
FindInfo: PNMLVFindItem;
|
||||
listitem: TListItem;
|
||||
begin
|
||||
if ALV.OwnerData then
|
||||
begin
|
||||
FindInfo := PNMLVFindItem(NMHdr);
|
||||
if Assigned(FindInfo) then
|
||||
begin
|
||||
MsgResult := -1;
|
||||
WinProcess := false;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
Result := False;
|
||||
case Msg of
|
||||
@ -247,6 +267,8 @@ begin
|
||||
if ListViewWindProcInfo.ActiveListView = AWinControl then
|
||||
ListViewWindProcInfo.NoMouseUp := True;
|
||||
end;
|
||||
LVN_ODFINDITEM:
|
||||
HandleListViewFindItem(TCustomListViewAccess(AWinControl));
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user