mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-16 09:48:14 +02:00
Opkman: Fix editing a ListBox item in a sorted list.
git-svn-id: trunk@53797 -
This commit is contained in:
parent
ccc4cf64a7
commit
0330cf85c9
@ -268,7 +268,13 @@ begin
|
|||||||
Index := -1;
|
Index := -1;
|
||||||
Value := InputBox(rsOptions_InputBox_Caption, MsgTxt, GetSelectedText(ListBox, Index));
|
Value := InputBox(rsOptions_InputBox_Caption, MsgTxt, GetSelectedText(ListBox, Index));
|
||||||
if (Value <> '') and (Index <> -1) then
|
if (Value <> '') and (Index <> -1) then
|
||||||
|
begin
|
||||||
|
ListBox.Sorted := False;
|
||||||
ListBox.Items[Index] := Value;
|
ListBox.Items[Index] := Value;
|
||||||
|
ListBox.Sorted := True;
|
||||||
|
Index := ListBox.Items.IndexOf(Value);
|
||||||
|
ListBox.Selected[Index] := True;
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -301,11 +307,9 @@ begin
|
|||||||
Index := -1;
|
Index := -1;
|
||||||
Value := GetSelectedText(ListBox, Index);
|
Value := GetSelectedText(ListBox, Index);
|
||||||
if (Value <> '') and (Index <> -1) then
|
if (Value <> '') and (Index <> -1) then
|
||||||
begin
|
|
||||||
if MessageDlgEx(Format(MsgConf, [Value]), mtConfirmation, [mbYes, mbNo], Self) = mrYes then
|
if MessageDlgEx(Format(MsgConf, [Value]), mtConfirmation, [mbYes, mbNo], Self) = mrYes then
|
||||||
ListBox.Items.Delete(Index);
|
ListBox.Items.Delete(Index);
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TOptionsFrm.bRestoreClick(Sender: TObject);
|
procedure TOptionsFrm.bRestoreClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user