From 7640a86947a520e94cad6b33b61e44849cfc4983 Mon Sep 17 00:00:00 2001 From: juha Date: Mon, 9 Apr 2012 12:59:08 +0000 Subject: [PATCH] LCL: Implement TListItem.EditCaption, issue #20295 git-svn-id: trunk@36676 - --- lcl/comctrls.pp | 1 + lcl/include/listitem.inc | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lcl/comctrls.pp b/lcl/comctrls.pp index 2f88a73d49..6fdd443632 100644 --- a/lcl/comctrls.pp +++ b/lcl/comctrls.pp @@ -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; diff --git a/lcl/include/listitem.inc b/lcl/include/listitem.inc index 8727a8ff35..c349835fc5 100644 --- a/lcl/include/listitem.inc +++ b/lcl/include/listitem.inc @@ -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 } {------------------------------------------------------------------------------}