From fcd60c19256bdf079668edbbd9a1fe85143a746a Mon Sep 17 00:00:00 2001 From: alexs75 Date: Thu, 5 Dec 2019 19:08:28 +0000 Subject: [PATCH] RxFPC:rxboxproc.BoxMoveSelectedItems - last added item also set selected git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7203 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/trunk/rxcontrols/rxboxprocs.pas | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/rx/trunk/rxcontrols/rxboxprocs.pas b/components/rx/trunk/rxcontrols/rxboxprocs.pas index 45952277e..978179bba 100644 --- a/components/rx/trunk/rxcontrols/rxboxprocs.pas +++ b/components/rx/trunk/rxcontrols/rxboxprocs.pas @@ -221,6 +221,7 @@ var Index, I, NewIndex: Integer; begin Index := BoxGetFirstSelection(SrcList); + NewIndex:=-1; if Index <> LB_ERR then begin BoxItems(SrcList).BeginUpdate; @@ -232,14 +233,18 @@ begin if BoxGetSelected(SrcList, I) then begin NewIndex := BoxItems(DstList).AddObject(BoxItems(SrcList).Strings[I], BoxItems(SrcList).Objects[I]); + if (SrcList is TCheckListBox) and (DstList is TCheckListBox) then TCheckListBox(DstList).State[NewIndex] := TCheckListBox(SrcList).State[I]; + BoxItems(SrcList).Delete(I); end else Inc(I); end; BoxSetItem(SrcList, Index); + if NewIndex>-1 then + BoxSetItem(DstList, NewIndex); finally BoxItems(SrcList).EndUpdate; BoxItems(DstList).EndUpdate;