Das hier habe ich mal schnell zusammengeschrieben (=zusammenkopiert)
Delphi-Quellcode:
type
TJvInspectorPictureItem = class(TJvCustomInspectorItem)
protected
function GetDisplayValue: string; override;
procedure Edit; override;
public
constructor Create(const AParent: TJvCustomInspectorItem; const AData: TJvCustomInspectorData); override;
end;
constructor TJvInspectorPictureItem .Create(const AParent: TJvCustomInspectorItem;
const AData: TJvCustomInspectorData);
begin
inherited Create(AParent, AData);
Flags := Flags + [iifEditButton, iifEditFixed];
end;
function TJvInspectorPictureItem.GetDisplayValue: string;
begin
if TPicture(Data.AsOrdinal).IsEmpty then
Result := '(kein Bild)'
else
Result := '(Bild)';
end;
procedure TJvInspectorMacroItem.Edit;
var
Pic: TPicture;
begin
Pic := TPicture(Data.AsOrdinal);
ShowPictureEditor(Pic);
end;
initialization
TJvCustomInspectorData.ItemRegister.Add(TJvInspectorTypeInfoRegItem.Create(TJvInspectorPictureItem , TypeInfo(TPicture)));
end.