LCL: Implement TListItem.EditCaption, issue #20295

git-svn-id: trunk@36676 -
This commit is contained in:
juha 2012-04-09 12:59:08 +00:00
parent d9ca0b833d
commit 7640a86947
2 changed files with 12 additions and 0 deletions

View File

@ -945,6 +945,7 @@ type
procedure MakeVisible(PartialOK: Boolean);
function DisplayRect(Code: TDisplayCode): TRect;
function DisplayRectSubItem(subItem: integer;Code: TDisplayCode): TRect;
function EditCaption: Boolean;
property Caption : String read GetCaption write SetCaption;
property Checked : Boolean read GetChecked write SetChecked;

View File

@ -373,6 +373,17 @@ begin
LV, GetIndex, subItem, code);
end;
function TListItem.EditCaption: Boolean;
var
LV: TCustomListView;
begin
LV := FOwner.FOwner;
LV.Selected := Nil; // First clear all selections,
LV.Selected := Self; // then set this item as the only selected.
if not LV.ReadOnly and Assigned(LV.FEditor) then
LV.ShowEditor;
end;
{------------------------------------------------------------------------------}
{ TListItem IntfUpdateText }
{------------------------------------------------------------------------------}