function GetItemListStandard():Boolean;
Var
I:Integer;
ListItem : TListItem;
ItemListStandard : TStringList;
ItemListStandardGUID : TStringList;
PNGList : TImageList;
PNGImage : TPNGObject;
BMPImage : TBitmap;
Name:
String;
GUID:
String;
begin
Main.ItemView.Clear;
PNGImage := TPngObject.Create;
BMPImage := TBitmap.Create;
PNGList := TImageList.Create(Main);
PNGList.Width:=48;
PNGList.Height:=48;
PNGList.DrawingStyle:=dsTransparent;
PNGList.ColorDepth := cd32Bit;
Main.ItemView.SmallImages := PngList;
ItemListStandard:=TStringList.Create;
ItemListStandardGUID:=TStringList.Create;
// Daten holen aus XML
ItemUnits := ItemRoot.SelectNodes('
Item');
For I := 0
to ItemUnits.length-1
do
begin
If AnsiPos(ItemAllocation,ItemUnits.item[I].attributes[3].Text) > 0
then
begin
ItemListStandard.Add(ItemUnits.Item[I].attributes[1].Text);
ItemListStandardGUID.Add(ItemUnits.Item[I].attributes[0].Text);
PNGImage.LoadFromFile(MinPath + ItemUnits.Item[I].attributes[5].Text);
BMPImage.Assign(PNGImage);
PNGList.Add(BMPImage,
nil);
end;
end;
ItemList :=
Nil;
For I := 0
to ItemListStandardGUID.Count-1
do
begin
ListItem := Main.ItemView.Items.Add;
Listitem.Caption := ItemlistStandardGUID.Strings[I];
Listitem.Subitems.add(ItemlistStandard.Strings[I]);
ListItem.ImageIndex := I;
end;
Result:= True;
end;