ImageEn, unit iexMetaHelpers

TIEMetaListView.ItemValue

TIEMetaListView.ItemValue


Declaration

property ItemValue[Item: TListItem]: string;


Description

Returns the meta value for the specified list item.
If this value is set and iemoDirectEdit is specified in Options, the params of the attached control will also be updated.

Note: This method does not check that the specified meta-type supports editing


Examples

// Specify a new meta value for the selected item
IEMetaListView1.ItemValue[ IEMetaListView1.Selected ] := 'My String';

// Output info on the selected meta item
procedure TMainForm.IEMetaListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean);
var
  cap, value, rec: string;
  metaInfo: TIEMetaRecord;
begin
  if IEMetaListView1.Selected <> nil then
  begin
    cap      := IEMetaListView1.Selected.Caption;
    value    := IEMetaListView1.ItemValue[ IEMetaListView1.Selected ];
    metaInfo := IEMetaListView1.ItemInfo [ IEMetaListView1.Selected ];

    case metaInfo.MetaType of
      iemGeneral : rec := format( 'General: %d', [ metaInfo.DataIndex ]);
      iemEXIF    : rec := format( 'EXIF: %d', [ metaInfo.DataIndex ]);
      iemIPTC    : rec := format( 'IPTC: %d,%d', [ metaInfo.RecIndex, metaInfo.DataIndex ]);
      iemDicom   : rec := format( 'Dicom: %d,%d', [ metaInfo.RecIndex, metaInfo.DataIndex ]);
      iemXMP     : rec := format( 'XMP: %d', [ metaInfo.DataIndex ]);
      iemPDF     : rec := format( 'PDF: %d', [ metaInfo.DataIndex ]);
      else         rec := '';
    end;

    Caption := Format( '%s (%s): %s', [ cap, rec, value ]);
  end;
end;