Danke das könnte mir helfen
Nur was ich nicht verstehe habe schon einen Typ von TPicture
über den ich PngImage einladen kann.
Delphi-Quellcode:
TJvCustomInspectorData.ItemRegister.
Add(TJvInspectorTypeInfoRegItem.Create(TJvInspectorPictureItem ,
TypeInfo(TPicture)));
Habe es jetzt so gemacht wird aber kein bild eingeladen..
Delphi-Quellcode:
TJvInspectorPngImage = class(TJvInspectorClassItem)
protected
procedure Edit; override;
function GetDisplayValue: string; override;
public
constructor Create(const AParent: TJvCustomInspectorItem; const AData: TJvCustomInspectorData); override;
end;
Delphi-Quellcode:
constructor TJvInspectorPngImage.Create(const AParent: TJvCustomInspectorItem;
const AData: TJvCustomInspectorData);
begin
inherited Create(AParent, AData);
Flags := Flags + [iifEditButton, iifEditFixed];
end;
procedure TJvInspectorPngImage.Edit;
begin
MainForm.dlgPicture.InitialDir := ExtractFilePath(Application.ExeName);
if MainForm.dlgPicture.Execute then
begin
PngImageFile := MainForm.dlgPicture.Filename;
tmpPngImage.Picture.LoadFromFile(PngImageFile);
SkinManagerInterface.Modified := True;
end;
// ReInitialisiere Inspector Display Edit Button
InitEdit;
Inspector.Invalidate;
end;
function TJvInspectorPngImage.GetDisplayValue: string;
begin
if TPngObject(Pointer(Data.AsOrdinal)).Empty then
Result := 'click to edit'
else
begin
Result := ExtractFileName(MainForm.dlgPicture.Filename);
MainForm.JvDesignPanel.Invalidate;
end;
end;
und bei 'margins' gibt es immer noch einen abstract error.
Das image 'tmpPngImage' wird erstellt in ShowSelProperties
Delphi-Quellcode:
procedure TCAVEUIObject.ShowSelProperties(Inspector: TJvInspector;
aObj: TObject; Props: array of string; NodeText: string);
var
i : integer;
Category: TJvInspectorCustomCategoryItem;
begin
Inspector.Root.Clear;
Category := TJvInspectorCustomCategoryItem.Create(Inspector.Root, nil);
Category.DisplayName := NodeText;
Inspector.Root.SortKind := iskNone;
for i:=Low(Props) to High(Props) do
TJvInspectorPropData.New(Category, aObj, GetPropInfo(aObj, Props[i]));
if aObj.classname = 'TImage' then
begin
tmpImage := TImage(aObj);
end else
if aObj.classname = 'TcAVeButton' then
begin
tmpPngImage := TImage(aObj);
end;
Category.Expanded := True;
end;
Gruss Emil