Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r600 -r602 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 600) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 602) @@ -135,9 +135,9 @@ FObjType: string; FObjRef: string; FCutOrder: Integer; - FDeelVan: TProductVerpakking; FDeelVanCaption: string; - FDeelVanID: string; { TODO : Setter die ID en caption instelt + notify } + FDeelVanID: string; + FDeelVan: TProductVerpakking; FVolumeVanCaption: string; FVolumeVanID: string; FMetaCaption: string; @@ -160,6 +160,7 @@ FMaxCombinAantal: string; FParameters: TList; + function GetDeelVanDisplay(): string; function GetMetaCaptionDisplay(): string; function GetBreedteDisplay: string; function GetDiepteDisplay: string; @@ -176,6 +177,7 @@ property DeelVanID: string read FDeelVanID write FDeelVanID; property DeelVanCaption: string read FDeelVanCaption write FDeelVanCaption; property DeelVan: TProductVerpakking read FDeelVan write FDeelVan; + property DeelVanDisplay: string read GetDeelVanDisplay; property VolumeVanCaption: string read FVolumeVanCaption write FVolumeVanCaption; property VolumeVanID: string read FVolumeVanID write FVolumeVanID; @@ -238,7 +240,7 @@ procedure SetProductVerpakkingen(Collection: TEnumerable); procedure AddProductVerpakking(ProductVerpakking: TProductVerpakking); procedure VerwijderProductVerpakking(ProductVerpakking: TProductVerpakking); - function GetDeelVanOpties(ProductVerpakking: TProductVerpakking): TList; + function GetDeelVanOpties(ProductVerpakking: TProductVerpakking): TReadOnlyList; property GeselecteerdeVerpakking: TProductVerpakking read FGeselecteerdeVerpakking write SetGeselecteerdeVerpakking; property IsOK: Boolean read FIsOK write FIsOK; @@ -438,19 +440,17 @@ self.NotifyChanged(); end; -function TProductVerpakkingenContext.GetDeelVanOpties(ProductVerpakking: TProductVerpakking): TList; +function TProductVerpakkingenContext.GetDeelVanOpties(ProductVerpakking: TProductVerpakking): TReadOnlyList; var ProductVerpakkingTeZoeken: TProductVerpakking; - Namen: TList; + ProductVerpakkingen: TList; begin - Namen := TList.Create(); + ProductVerpakkingen := TList.Create(); for ProductVerpakkingTeZoeken in FProductVerpakkingen do - begin if not ProductVerpakkingTeZoeken.Equals(ProductVerpakking) then - Namen.Add(intToStr(ProductVerpakkingTeZoeken.CutOrder) + ': ' + ProductVerpakkingTeZoeken.MetaCaptionDisplay) - end; + ProductVerpakkingen.Add(ProductVerpakkingTeZoeken); - Result := Namen; + Result := TReadOnlyList.Create(ProductVerpakkingen); end; // Product verpakking @@ -478,6 +478,11 @@ Result := False; end; +function TProductVerpakking.GetDeelVanDisplay(): string; +begin + Result := intToStr(CutOrder) + ': ' + GetMetaCaptionDisplay(); +end; + function TProductVerpakking.GetMetaCaptionDisplay(): string; begin if FMetaCaption <> '' then