Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r585 -r586 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 585) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 586) @@ -35,19 +35,26 @@ // - UI instellingen TUiInstellingenContext = class(TSubject) private - FPositie: TDictionary; - FPlaatsing: TDictionary; - FRichting: TDictionary; + FPositieByKey: TDictionary; + FPositieByValue: TDictionary; + FPlaatsingByKey: TDictionary; + FPlaatsingByValue: TDictionary; + FRichtingByKey: TDictionary; + FRichtingByValue: TDictionary; FIsOK: Boolean; FErrorMessage: string; FInternalErrorMessage: string; public constructor Create(); procedure NotifyChanged(); - property Positie: TDictionary read FPositie write FPositie; - property Plaatsing: TDictionary read FPlaatsing write FPlaatsing; - property Richting: TDictionary read FRichting write FRichting; + property Posities: TDictionary read FPositieByKey; + property PositiesByValue: TDictionary read FPositieByValue; + property Plaatsing: TDictionary read FPlaatsingByKey; + property PlaatsingByValue: TDictionary read FPlaatsingByValue; + property Richtingen: TDictionary read FRichtingByKey; + property RichtingenByValue: TDictionary read FRichtingByValue; + property IsOK: Boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; @@ -100,44 +107,65 @@ FRawData: TObject; FID: string; - FMetaCaption: string; FCutOrder: Integer; + FBreedte: string; FDefaultBreedte: string; FDiepte: string; FDefaultDiepte: string; FHoogte: string; FDefaultHoogte: string; FAantal: string; + FDefaultAantal: string; FMaxCombinAantal: string; + FDefaultMaxCombinAantal: string; FPlaatsing: string; - FPositie: string; - FRichting: string; + FDefaultPlaatsing: string; + FPosities: TList; + FDefaultPosities: TList; + FRichtingen: TList; + FDefaultRichtingen: TList; + FDeelVanID: string; + FDeelVanCaption: string; FDeelVan: TProductVerpakking; + + FMetaCaption: string; + + function GetMetaCaptionDisplay(): string; public property RawData: TObject read FRawData write FRawData; property ID: string read FID write FID; - property MetaCaption: string read FMetaCaption write FMetaCaption; property CutOrder: Integer read FCutOrder write FCutOrder; + property Breedte: string read FBreedte write FBreedte; property DefaultBreedte: string read FDefaultBreedte write FDefaultBreedte; property Diepte: string read FDiepte write FDiepte; property DefaultDiepte: string read FDefaultDiepte write FDefaultDiepte; property Hoogte: string read FHoogte write FHoogte; property DefaultHoogte: string read FDefaultHoogte write FDefaultHoogte; property Aantal: string read FAantal write FAantal; + property DefaultAantal: string read FDefaultAantal write FDefaultAantal; property MaxCombinAantal: string read FMaxCombinAantal write FMaxCombinAantal; + property DefaultMaxCombinAantal: string read FDefaultMaxCombinAantal write FDefaultMaxCombinAantal; property Plaatsing: string read FPlaatsing write FPlaatsing; - property Positie: string read FPositie write FPositie; - property Richting: string read FRichting write FRichting; + property DefaultPlaatsing: string read FDefaultPlaatsing write FDefaultPlaatsing; + property Posities: TList read FPosities; + property DefaultPosities: TList read FDefaultPosities; + property Richtingen: TList read FRichtingen; + property DefaultRichtingen: TList read FDefaultRichtingen; property DeelVanID: string read FDeelVanID write FDeelVanID; + property DeelVanCaption: string read FDeelVanCaption write FDeelVanCaption; property DeelVan: TProductVerpakking read FDeelVan write FDeelVan; + property MetaCaption: string write FMetaCaption; + property MetaCaptionDisplay: string read GetMetaCaptionDisplay; + function Equals(Obj: TObject): Boolean; override; + constructor Create(); end; TProductDetailContext = class(TSubject) @@ -189,9 +217,12 @@ constructor TUiInstellingenContext.Create(); begin inherited Create(); - FPositie := TDictionary.Create(); - FPlaatsing := TDictionary.Create(); - FRichting := TDictionary.Create(); + FPositieByKey := TDictionary.Create(); + FPositieByValue := TDictionary.Create(); + FPlaatsingByKey := TDictionary.Create(); + FPlaatsingByValue := TDictionary.Create(); + FRichtingByKey := TDictionary.Create(); + FRichtingByValue := TDictionary.Create(); end; procedure TUiInstellingenContext.NotifyChanged(); @@ -288,13 +319,23 @@ for ProductVerpakkingTeZoeken in FProductVerpakkingen do begin if not ProductVerpakkingTeZoeken.Equals(ProductVerpakking) then - Namen.Add(intToStr(ProductVerpakkingTeZoeken.CutOrder) + ': ' + ProductVerpakkingTeZoeken.MetaCaption) + Namen.Add(intToStr(ProductVerpakkingTeZoeken.CutOrder) + ': ' + ProductVerpakkingTeZoeken.MetaCaptionDisplay) end; Result := Namen; end; // Product verpakking +constructor TProductVerpakking.Create(); +begin + inherited Create(); + + FPosities := TList.Create(); + FDefaultPosities := TList.Create(); + FRichtingen := TList.Create(); + FDefaultRichtingen := TList.Create(); +end; + function TProductVerpakking.Equals(Obj: TObject): Boolean; begin if Obj = nil then @@ -307,6 +348,14 @@ Result := false; end; +function TProductVerpakking.GetMetaCaptionDisplay(): string; +begin + if FMetaCaption <> '' then + Result := copy(FMetaCaption, Pos(':', FMetaCaption) + 2) + else + Result := ''; +end; + // APPLICATION CONTEXT constructor TApplicationContext.Create(); begin Index: VerpakkingsDefinitie/UI/ProductDetailScherm.dfm =================================================================== diff -u -r585 -r586 --- VerpakkingsDefinitie/UI/ProductDetailScherm.dfm (.../ProductDetailScherm.dfm) (revision 585) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.dfm (.../ProductDetailScherm.dfm) (revision 586) @@ -21,16 +21,28 @@ object LabelOmschrijving1: TLabel Left = 8 Top = 8 - Width = 92 - Height = 13 + Width = 103 + Height = 14 Caption = 'LabelOmschrijving1' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False end object LabelOmschrijving2: TLabel Left = 8 Top = 35 - Width = 92 - Height = 13 + Width = 103 + Height = 14 Caption = 'LabelOmschrijving2' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -12 + Font.Name = 'Tahoma' + Font.Style = [] + ParentFont = False end object Label1: TLabel Left = 8 @@ -52,6 +64,30 @@ Font.Style = [fsBold] ParentFont = False end + object LabelProductNummer: TLabel + Left = 736 + Top = 64 + Width = 64 + Height = 13 + Anchors = [akTop, akRight] + BiDiMode = bdLeftToRight + Caption = 'LabelProductNummer' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'Tahoma' + Font.Style = [fsBold] + ParentBiDiMode = False + ParentFont = False + end + object Label17: TLabel + Left = 676 + Top = 64 + Width = 54 + Height = 13 + Anchors = [akTop, akRight] + Caption = 'Product nr.' + end object PanelVerpakkingControls: TPanel Left = 8 Top = 257 @@ -72,31 +108,28 @@ ExplicitTop = 275 end object Label11: TLabel - Left = 400 + Left = 368 Top = 15 Width = 43 Height = 13 Anchors = [akLeft, akBottom] Caption = 'Plaatsing' - ExplicitTop = 11 end object Label12: TLabel - Left = 400 + Left = 368 Top = 47 Width = 31 Height = 13 Anchors = [akLeft, akBottom] Caption = 'Positie' - ExplicitTop = 43 end object Label13: TLabel - Left = 400 + Left = 368 Top = 79 Width = 38 Height = 13 Anchors = [akLeft, akBottom] Caption = 'Richting' - ExplicitTop = 75 end object Label2: TLabel Left = 8 @@ -161,6 +194,30 @@ Caption = 'Aantal' ExplicitTop = 248 end + object Label3: TLabel + Left = 8 + Top = 47 + Width = 55 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Volume van' + end + object Label14: TLabel + Left = 368 + Top = 143 + Width = 44 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'OptiType' + end + object Label15: TLabel + Left = 368 + Top = 173 + Width = 47 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'BoxSelect' + end object ButtonMeta: TButton Left = 272 Top = 12 @@ -180,7 +237,7 @@ TabOrder = 1 end object ComboBoxPlaatsing: TComboBox - Left = 518 + Left = 446 Top = 12 Width = 162 Height = 21 @@ -189,7 +246,7 @@ TabOrder = 2 end object ComboBoxPositie: TComboBox - Left = 518 + Left = 446 Top = 44 Width = 162 Height = 21 @@ -198,7 +255,7 @@ TabOrder = 3 end object ComboBoxRichting: TComboBox - Left = 518 + Left = 446 Top = 76 Width = 162 Height = 21 @@ -265,6 +322,42 @@ '') TabOrder = 11 end + object Button1: TButton + Left = 272 + Top = 44 + Width = 40 + Height = 21 + Anchors = [akLeft, akBottom] + Caption = '...' + TabOrder = 12 + end + object EditVolumeVan: TEdit + Left = 112 + Top = 44 + Width = 154 + Height = 21 + Anchors = [akLeft, akBottom] + Enabled = False + TabOrder = 13 + end + object ComboBoxOptiType: TComboBox + Left = 446 + Top = 140 + Width = 162 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akBottom] + TabOrder = 14 + end + object ComboBoxBoxSelect: TComboBox + Left = 446 + Top = 172 + Width = 162 + Height = 21 + Style = csDropDownList + Anchors = [akLeft, akBottom] + TabOrder = 15 + end end object GroupBox1: TGroupBox Left = 8 @@ -285,28 +378,44 @@ Anchors = [akLeft, akTop, akRight, akBottom] Columns = < item - AutoSize = True Caption = 'Nr' + Width = -1 + WidthType = ( + -1) end item - AutoSize = True Caption = 'BoxSelect' + Width = -1 + WidthType = ( + -1) end item - AutoSize = True Caption = 'Dim' + Width = -1 + WidthType = ( + -1) end item - AutoSize = True Caption = 'Aantal' + Width = -1 + WidthType = ( + -1) end item - AutoSize = True Caption = 'Max.Comb.Aantal' + Width = 100 end item - AutoSize = True Caption = 'Deel van' + Width = -1 + WidthType = ( + -1) + end + item + Caption = 'ID' + Width = -1 + WidthType = ( + -1) end> TabOrder = 0 ViewStyle = vsReport Index: VerpakkingsDefinitie/WS/ProductsAgent.pas =================================================================== diff -u -r585 -r586 --- VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 585) +++ VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 586) @@ -85,9 +85,9 @@ pxStatusObj: OptiServerService.pxStatus); begin // Andere velden leegmaken - UiInstellingenContext.Positie.Clear(); + UiInstellingenContext.Posities.Clear(); UiInstellingenContext.Plaatsing.Clear(); - UiInstellingenContext.Richting.Clear(); + UiInstellingenContext.Richtingen.Clear(); UiInstellingenContext.IsOK := pxStatusObj.IsOK; UiInstellingenContext.ErrorMessage := pxStatusObj.Message_; @@ -116,39 +116,46 @@ var Node: IXMLNode; I: Integer; + KeyStr: string; begin // Ander velden leegmaken UiInstellingenContext.IsOK := True; UiInstellingenContext.ErrorMessage := ''; UiInstellingenContext.InternalErrorMessage := ''; - UiInstellingenContext.Positie.Clear(); + UiInstellingenContext.Posities.Clear(); if Instellingen.Positie <> nil then begin for I := 0 to Instellingen.Positie.Count - 1 do begin Node := Instellingen.Positie[I]; - UiInstellingenContext.Positie.Add(Node.GetAttributeNS('Key', ''), Node.Text); + KeyStr := Node.GetAttributeNS('Key', ''); + UiInstellingenContext.Posities.Add(KeyStr, Node.Text); + UiInstellingenContext.PositiesByValue.Add(Node.Text, KeyStr); end; end; UiInstellingenContext.Plaatsing.Clear(); - if Instellingen.Positie <> nil then + if Instellingen.Plaatsing <> nil then begin for I := 0 to Instellingen.Plaatsing.Count - 1 do begin Node := Instellingen.Plaatsing[I]; - UiInstellingenContext.Plaatsing.Add(Node.GetAttributeNS('Key', ''), Node.Text); + KeyStr := Node.GetAttributeNS('Key', ''); + UiInstellingenContext.Plaatsing.Add(KeyStr, Node.Text); + UiInstellingenContext.PlaatsingByValue.Add(Node.Text, KeyStr); end; end; - UiInstellingenContext.Richting.Clear(); - if Instellingen.Positie <> nil then + UiInstellingenContext.Richtingen.Clear(); + if Instellingen.Richting <> nil then begin for I := 0 to Instellingen.Richting.Count - 1 do begin Node := Instellingen.Richting[I]; - UiInstellingenContext.Richting.Add(Node.GetAttributeNS('Key', ''), Node.Text); + KeyStr := Node.GetAttributeNS('Key', ''); + UiInstellingenContext.Richtingen.Add(KeyStr, Node.Text); + UiInstellingenContext.RichtingenByValue.Add(Node.Text, KeyStr); end; end; @@ -460,7 +467,6 @@ begin RawData := pxBoxDataObj; ID := pxBoxDataObj.ID; - MetaCaption := pxBoxDataObj.MetaCaption; CutOrder := pxBoxDataObj.CutOrder; Breedte := pxBoxDataObj.Breedte; DefaultBreedte := pxBoxDataObj.DefaultData.Breedte; @@ -471,10 +477,16 @@ Aantal := pxBoxDataObj.Aantal; MaxCombinAantal := pxBoxDataObj.MaxCombinAantal; Plaatsing := pxBoxDataObj.Plaatsing; - Positie := pxBoxDataObj.Positie; - Richting := pxBoxDataObj.Rotatie; + Posities.AddRange(SplitString(pxBoxDataObj.Positie, '')); + DefaultPosities.AddRange(SplitString(pxBoxDataObj.DefaultData.Positie, ';')); + Richtingen.AddRange(SplitString(pxBoxDataObj.Rotatie, '')); + DefaultRichtingen.AddRange(SplitString(pxBoxDataObj.DefaultData.Rotatie, ';')); + DeelVanID := pxBoxDataObj.DeelVanID; + DeelVanCaption := pxBoxDataObj.DeelVanCaption; + + MetaCaption := pxBoxDataObj.MetaCaption; end; ProductDetailContext.ProductVerpakkingen.Add(Verpakking); Index: VerpakkingsDefinitie/UI/ProductDetailScherm.pas =================================================================== diff -u -r585 -r586 --- VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 585) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 586) @@ -47,6 +47,15 @@ ButtonMeta: TButton; MemoParameters: TMemo; PanelVerpakkingControls: TPanel; + Label3: TLabel; + Button1: TButton; + EditVolumeVan: TEdit; + Label14: TLabel; + Label15: TLabel; + ComboBoxOptiType: TComboBox; + ComboBoxBoxSelect: TComboBox; + LabelProductNummer: TLabel; + Label17: TLabel; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); @@ -128,31 +137,39 @@ LabelOmschrijving1.Caption := ApplicationContext.ProductDetailContext.GeselecteerdProduct.Omschrijving1; LabelOmschrijving2.Caption := ApplicationContext.ProductDetailContext.GeselecteerdProduct.Omschrijving2; LabelProductNaam.Caption := ApplicationContext.ProductDetailContext.GeselecteerdProduct.Kol1; + LabelProductNummer.Caption := intToStr(ApplicationContext.ProductDetailContext.GeselecteerdProduct.ProductNr); VorigeIndexInList := ListViewVerpakkingen.ItemIndex; // List view (grid) + ListViewVerpakkingen.Items.BeginUpdate; ListViewVerpakkingen.Clear(); for ProductVerpakking in ApplicationContext.ProductDetailContext.ProductVerpakkingen do begin With ListViewVerpakkingen.Items.Add Do begin + Data := ProductVerpakking; // Caption := IntToStr(Product.ProductNr); // Deze casting geeft geen access violation - Caption := IntToStr(ProductVerpakking.CutOrder); - SubItems.Add(ProductVerpakking.MetaCaption); + Caption := intToStr(ProductVerpakking.CutOrder); + SubItems.Add(ProductVerpakking.MetaCaptionDisplay); SubItems.Add(ProductVerpakking.Breedte + ' x ' + ProductVerpakking.Diepte + ' x ' + ProductVerpakking.Hoogte); SubItems.Add(ProductVerpakking.Aantal); SubItems.Add(ProductVerpakking.MaxCombinAantal); - SubItems.Add(ifthen(ProductVerpakking.DeelVan <> nil, ProductVerpakking.DeelVan.MetaCaption, '')); - Data := ProductVerpakking; + if ProductVerpakking.DeelVan <> nil then + SubItems.Add(ProductVerpakking.DeelVanCaption) + else + SubItems.Add(''); + SubItems.Add(ProductVerpakking.ID); end; end; + ListViewVerpakkingen.Items.EndUpdate; // Kijk of dezelfde verpakking als voor de update opnieuw geselecteerd kan worden if (VorigeIndexInList >= 0) and (VorigeIndexInList < ApplicationContext.ProductDetailContext.ProductVerpakkingen.Count) then ProductVerpakking := ApplicationContext.ProductDetailContext.ProductVerpakkingen[VorigeIndexInList] else if ApplicationContext.ProductDetailContext.ProductVerpakkingen.Count > 0 then - ProductVerpakking := ApplicationContext.ProductDetailContext.ProductVerpakkingen[0] // Default eerste verpakking selecteren + ProductVerpakking := ApplicationContext.ProductDetailContext.ProductVerpakkingen[0] + // Default eerste verpakking selecteren else ProductVerpakking := nil; // Geen verpakking aanwezig @@ -170,7 +187,7 @@ begin // Linkerhelft - EditMeta.Text := ProductVerpakking.MetaCaption; + EditMeta.Text := ProductVerpakking.MetaCaptionDisplay; // DeelVan ComboBoxDeelVan.Items.Clear(); // ComboBox vullen en item selecteren. @@ -184,21 +201,24 @@ // Index zoeken in lijst van producten ComboBoxDeelVan.ItemIndex := ApplicationContext.ProductDetailContext.ProductVerpakkingen.IndexOf(ProductVerpakking.DeelVan) else + // Default waarde: 'niks' optie selecteren ComboBoxDeelVan.ItemIndex := ComboBoxDeelVan.Items.Count - 1; - // Default waarde: 'niks' optie selecteren + // Breedte, Diepte, Hoogte. + // Default waarde altijd als placeholder instellen + EditBreedte.TextHint := ProductVerpakking.DefaultBreedte; // Default if ProductVerpakking.Breedte <> '' then - EditBreedte.Text := ProductVerpakking.Breedte - else - EditBreedte.Text := ProductVerpakking.DefaultBreedte; // Default + EditBreedte.Text := ProductVerpakking.Breedte; + + EditDiepte.TextHint := ProductVerpakking.DefaultDiepte; // Default if ProductVerpakking.Diepte <> '' then - EditDiepte.Text := ProductVerpakking.Diepte - else - EditDiepte.Text := ProductVerpakking.DefaultDiepte; // Default + EditDiepte.Text := ProductVerpakking.Diepte; + + EditHoogte.TextHint := ProductVerpakking.DefaultHoogte; // Default if ProductVerpakking.Hoogte <> '' then - EditHoogte.Text := ProductVerpakking.Hoogte - else - EditHoogte.Text := ProductVerpakking.DefaultHoogte; + EditHoogte.Text := ProductVerpakking.Hoogte; + + // Max.Comb.Aantal, Aantal EditMaxCombAantal.Text := ProductVerpakking.MaxCombinAantal; EditAantal.Text := ProductVerpakking.Aantal; @@ -207,46 +227,62 @@ // Plaatsing ComboBoxPlaatsing.Items.Clear(); // Combobox vullen en item selecteren. Indien item niet aanwezig is, eerste item selecteren. - for Item in ApplicationContext.UiInstellingenContext.Plaatsing.Values do - begin - ComboBoxPlaatsing.Items.Add(Item); - end; - if (ApplicationContext.UiInstellingenContext.Plaatsing.TryGetValue(ProductVerpakking.Plaatsing, Item) = True) then + for Item in ApplicationContext.UiInstellingenContext.Plaatsing.keys do + ComboBoxPlaatsing.Items.AddObject(ApplicationContext.UiInstellingenContext.Plaatsing[Item], TObject(Item)); + if (ProductVerpakking.Plaatsing <> '') and + (ApplicationContext.UiInstellingenContext.Plaatsing.TryGetValue(ProductVerpakking.Plaatsing, Item) = True) then ComboBoxPlaatsing.ItemIndex := ComboBoxPlaatsing.Items.IndexOf(Item) + else if (ProductVerpakking.DefaultPlaatsing <> '') and + (ApplicationContext.UiInstellingenContext.Plaatsing.TryGetValue(ProductVerpakking.DefaultPlaatsing, Item) = True) then + ComboBoxPlaatsing.ItemIndex := ComboBoxPlaatsing.Items.IndexOf(Item) // Default else if ComboBoxPlaatsing.Items.Count > 0 then - ComboBoxPlaatsing.ItemIndex := 0; + ComboBoxPlaatsing.ItemIndex := 0; // Geen waarde, geen default, eerste item selecteren. // Positie CheckComboBoxPositie.Items.Clear(); - // CheckComboBox vullen en items selecteren. - { TODO : Vertaling naar gewone string waarden uit Context halen en tonen in checked combobox } - for Item in ApplicationContext.UiInstellingenContext.Positie.Keys do + // CheckComboBox vullen en items selecteren. Als waarde niet aanwezig is, uit default halen. + for Item in ApplicationContext.UiInstellingenContext.Posities.keys do + CheckComboBoxPositie.Items.AddObject(ApplicationContext.UiInstellingenContext.Posities[Item], TObject(Item)); + if ProductVerpakking.Posities.Count > 0 then begin - CheckComboBoxPositie.Items.Add(Item); - end; - if ProductVerpakking.Positie = '' then - // Lege positie betekent alles aangeduid - for I := 0 to CheckComboBoxPositie.Items.Count - 1 do - CheckComboBoxPositie.Checked[I] := True + for Item in ProductVerpakking.Posities do + begin + TempStr := ApplicationContext.UiInstellingenContext.Posities[Item]; + if CheckComboBoxPositie.Items.IndexOf(TempStr) >= 0 then + CheckComboBoxPositie.Checked[CheckComboBoxPositie.Items.IndexOf(TempStr)] := True; + end; + end else - for TempStr in SplitString(ProductVerpakking.Positie, '') do + // Default waarden + for Item in ProductVerpakking.DefaultPosities do + begin + TempStr := ApplicationContext.UiInstellingenContext.Posities[Item]; if CheckComboBoxPositie.Items.IndexOf(TempStr) >= 0 then CheckComboBoxPositie.Checked[CheckComboBoxPositie.Items.IndexOf(TempStr)] := True; + end; // Richting CheckComboBoxRichting.Items.Clear(); - // CheckComboBox vullen en item selecteren. Als waarde niet aanwezig is, uit default halen. - { TODO : Vertaling naar gewone string waarden uit Context halen en tonen in checked combobox } - for Item in ApplicationContext.UiInstellingenContext.Richting.Keys do + // CheckComboBox vullen en items selecteren. Als waarde niet aanwezig is, uit default halen. + for Item in ApplicationContext.UiInstellingenContext.Richtingen.keys do + CheckComboBoxRichting.Items.AddObject(ApplicationContext.UiInstellingenContext.Richtingen[Item], TObject(Item)); + if ProductVerpakking.Richtingen.Count > 0 then begin - CheckComboBoxRichting.Items.Add(Item); - end; - if ProductVerpakking.Richting <> '' then - begin - for TempStr in SplitString(ProductVerpakking.Richting, '') do + for Item in ProductVerpakking.Richtingen do + begin + TempStr := ApplicationContext.UiInstellingenContext.Richtingen[Item]; if CheckComboBoxRichting.Items.IndexOf(TempStr) >= 0 then CheckComboBoxRichting.Checked[CheckComboBoxRichting.Items.IndexOf(TempStr)] := True; - end; + end; + end + else + // Default waarden + for Item in ProductVerpakking.DefaultRichtingen do + begin + TempStr := ApplicationContext.UiInstellingenContext.Richtingen[Item]; + if CheckComboBoxRichting.Items.IndexOf(TempStr) >= 0 then + CheckComboBoxRichting.Checked[CheckComboBoxRichting.Items.IndexOf(TempStr)] := True; + end; end; procedure TFormProductDetail.UpdateControlsEnableStatus(); @@ -263,6 +299,8 @@ ButtonVerwijder.Enabled := VerpakkingAanwezigEnGeselecteerd; // Linkerdeel + EditMeta.Enabled := False; + EditVolumeVan.Enabled := False; ComboBoxDeelVan.Enabled := (ComboBoxDeelVan.Items.Count > 0) and VerpakkingAanwezigEnGeselecteerd; end;