Import / export GraphicContainer
This commit is contained in:
parent
d3ca72b5ff
commit
231b2c42bf
@ -201,7 +201,7 @@ object GraphicsEditorForm: TGraphicsEditorForm
|
|||||||
Left = 20
|
Left = 20
|
||||||
Top = 360
|
Top = 360
|
||||||
Bitmap = {
|
Bitmap = {
|
||||||
494C010107000900040010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
|
494C010107000900080010001000FFFFFFFFFF10FFFFFFFFFFFFFFFF424D3600
|
||||||
0000000000003600000028000000400000002000000001002000000000000020
|
0000000000003600000028000000400000002000000001002000000000000020
|
||||||
0000000000000000000000000000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
0000000000000000000000000000000000000000000000000000000000000000
|
0000000000000000000000000000000000000000000000000000000000000000
|
||||||
|
@ -466,6 +466,7 @@ var
|
|||||||
index: Integer;
|
index: Integer;
|
||||||
graphic: TX2GraphicContainerItem;
|
graphic: TX2GraphicContainerItem;
|
||||||
fileName: string;
|
fileName: string;
|
||||||
|
startIndex: Integer;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if dlgImport.Execute then
|
if dlgImport.Execute then
|
||||||
@ -476,8 +477,21 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ Items inherited from the ancestor through visual inheritance can not
|
||||||
|
be deleted. Start at the first one introduced at this level. }
|
||||||
|
startIndex := 0;
|
||||||
|
while (startIndex < FComponent.GraphicCount) and (csAncestor in FComponent.Graphics[startIndex].ComponentState) do
|
||||||
|
Inc(startIndex);
|
||||||
|
|
||||||
lstGraphics.Clear;
|
lstGraphics.Clear;
|
||||||
FComponent.Clear;
|
|
||||||
|
if startIndex = 0 then
|
||||||
|
FComponent.Clear
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
for index := Pred(FComponent.GraphicCount) downto startIndex do
|
||||||
|
FComponent.Graphics[index].Free;
|
||||||
|
end;
|
||||||
|
|
||||||
importPath := ExtractFilePath(dlgImport.FileName);
|
importPath := ExtractFilePath(dlgImport.FileName);
|
||||||
importFile := TIniFile.Create(dlgImport.FileName);
|
importFile := TIniFile.Create(dlgImport.FileName);
|
||||||
@ -485,6 +499,8 @@ begin
|
|||||||
index := 0;
|
index := 0;
|
||||||
|
|
||||||
while importFile.ValueExists('PictureName', IntToStr(index)) do
|
while importFile.ValueExists('PictureName', IntToStr(index)) do
|
||||||
|
begin
|
||||||
|
if index >= startIndex then
|
||||||
begin
|
begin
|
||||||
graphic := TX2GraphicContainerItem(FComponentDesigner.CreateComponent(TX2GraphicContainerItem, nil, 0, 0, 0, 0));
|
graphic := TX2GraphicContainerItem(FComponentDesigner.CreateComponent(TX2GraphicContainerItem, nil, 0, 0, 0, 0));
|
||||||
|
|
||||||
@ -497,6 +513,7 @@ begin
|
|||||||
if (Length(fileName) > 0) and FileExists(importPath + fileName) then
|
if (Length(fileName) > 0) and FileExists(importPath + fileName) then
|
||||||
graphic.Picture.LoadFromFile(importPath + fileName);
|
graphic.Picture.LoadFromFile(importPath + fileName);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Inc(index);
|
Inc(index);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user