Opkman: Fix editing a ListBox item in a sorted list.

git-svn-id: trunk@53797 -
This commit is contained in:
juha 2016-12-29 12:15:53 +00:00
parent ccc4cf64a7
commit 0330cf85c9

View File

@ -268,7 +268,13 @@ begin
Index := -1;
Value := InputBox(rsOptions_InputBox_Caption, MsgTxt, GetSelectedText(ListBox, Index));
if (Value <> '') and (Index <> -1) then
begin
ListBox.Sorted := False;
ListBox.Items[Index] := Value;
ListBox.Sorted := True;
Index := ListBox.Items.IndexOf(Value);
ListBox.Selected[Index] := True;
end;
end;
@ -301,10 +307,8 @@ begin
Index := -1;
Value := GetSelectedText(ListBox, Index);
if (Value <> '') and (Index <> -1) then
begin
if MessageDlgEx(Format(MsgConf, [Value]), mtConfirmation, [mbYes, mbNo], Self) = mrYes then
ListBox.Items.Delete(Index);
end;
end;
procedure TOptionsFrm.bRestoreClick(Sender: TObject);