You've already forked lazarus-ccr
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
This commit is contained in:
@ -221,6 +221,7 @@ var
|
|||||||
Index, I, NewIndex: Integer;
|
Index, I, NewIndex: Integer;
|
||||||
begin
|
begin
|
||||||
Index := BoxGetFirstSelection(SrcList);
|
Index := BoxGetFirstSelection(SrcList);
|
||||||
|
NewIndex:=-1;
|
||||||
if Index <> LB_ERR then
|
if Index <> LB_ERR then
|
||||||
begin
|
begin
|
||||||
BoxItems(SrcList).BeginUpdate;
|
BoxItems(SrcList).BeginUpdate;
|
||||||
@ -232,14 +233,18 @@ begin
|
|||||||
if BoxGetSelected(SrcList, I) then
|
if BoxGetSelected(SrcList, I) then
|
||||||
begin
|
begin
|
||||||
NewIndex := BoxItems(DstList).AddObject(BoxItems(SrcList).Strings[I], BoxItems(SrcList).Objects[I]);
|
NewIndex := BoxItems(DstList).AddObject(BoxItems(SrcList).Strings[I], BoxItems(SrcList).Objects[I]);
|
||||||
|
|
||||||
if (SrcList is TCheckListBox) and (DstList is TCheckListBox) then
|
if (SrcList is TCheckListBox) and (DstList is TCheckListBox) then
|
||||||
TCheckListBox(DstList).State[NewIndex] := TCheckListBox(SrcList).State[I];
|
TCheckListBox(DstList).State[NewIndex] := TCheckListBox(SrcList).State[I];
|
||||||
|
|
||||||
BoxItems(SrcList).Delete(I);
|
BoxItems(SrcList).Delete(I);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
Inc(I);
|
Inc(I);
|
||||||
end;
|
end;
|
||||||
BoxSetItem(SrcList, Index);
|
BoxSetItem(SrcList, Index);
|
||||||
|
if NewIndex>-1 then
|
||||||
|
BoxSetItem(DstList, NewIndex);
|
||||||
finally
|
finally
|
||||||
BoxItems(SrcList).EndUpdate;
|
BoxItems(SrcList).EndUpdate;
|
||||||
BoxItems(DstList).EndUpdate;
|
BoxItems(DstList).EndUpdate;
|
||||||
|
Reference in New Issue
Block a user