Index: VerpakkingsDefinitie/UI/ProductDetailScherm.pas =================================================================== diff -u -r577 -r581 --- VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 577) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 581) @@ -10,7 +10,6 @@ CheckCombo; resourceString - RICHTING_DEFAULT_VALUES = 'X;Y;Z;F'; GEEN_DATA_CAPTION = 'Geen data om te tonen'; type @@ -23,9 +22,7 @@ GroupBox1: TGroupBox; ButtonNieuw: TButton; ButtonVerwijder: TButton; - ButtonMaakDozen: TButton; Label2: TLabel; - Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; @@ -36,10 +33,7 @@ Label11: TLabel; Label12: TLabel; Label13: TLabel; - Label14: TLabel; - Label15: TLabel; EditMeta: TEdit; - EditVolumeVan: TEdit; ComboBoxDeelVan: TComboBox; EditBreedte: TEdit; EditDiepte: TEdit; @@ -49,10 +43,7 @@ ComboBoxPlaatsing: TComboBox; ComboBoxPositie: TComboBox; ComboBoxRichting: TComboBox; - ComboBoxOptiType: TComboBox; - ComboBoxBoxSelect: TComboBox; ButtonMeta: TButton; - ButtonDeelVan: TButton; MemoParameters: TMemo; procedure FormCreate(Sender: TObject); @@ -113,6 +104,8 @@ ProductDetailInformatie: OptiServerService.pxBoxData; PPSPrioriteitEl: OptiServerService.pxemPPSPrioriteit; TempStr: string; + Item: string; + I: Integer; begin if (ApplicationContext.ProductDetailContext.GeselecteerdProduct = nil) or (ApplicationContext.ProductDetailContext.ProductDetailInformatie = nil) then @@ -142,95 +135,98 @@ SubItems.Add(ProductDetailInformatie.Aantal); SubItems.Add(ProductDetailInformatie.MaxCombinAantal); SubItems.Add(ProductDetailInformatie.DeelVanCaption); + end; - // Linkerhelft + // Linkerhelft - EditMeta.Text := ProductDetailInformatie.MetaCaption; - EditVolumeVan.Text := ProductDetailInformatie.VolumeVanCaption; - // DeelVan - ComboBoxDeelVan.Items.Clear(); - // ComboBox vullen en item selecteren. - for TempStr in SplitString(ProductDetailInformatie.DefaultData.DeelVanCaption, ';') do - begin - ComboBoxDeelVan.Items.Add(TempStr); - end; - if ComboBoxDeelVan.Items.IndexOf(ProductDetailInformatie.DeelVanCaption) >= 0 then - ComboBoxDeelVan.ItemIndex := ComboBoxDeelVan.Items.IndexOf(ProductDetailInformatie.DeelVanCaption) - else if ComboBoxDeelVan.Items.Count > 0 then - ComboBoxDeelVan.ItemIndex := 0; + EditMeta.Text := ProductDetailInformatie.MetaCaption; + // DeelVan + ComboBoxDeelVan.Items.Clear(); + // ComboBox vullen en item selecteren. + for TempStr in SplitString(ProductDetailInformatie.DefaultData.DeelVanCaption, ';') do + begin + ComboBoxDeelVan.Items.Add(TempStr); + end; + if ComboBoxDeelVan.Items.IndexOf(ProductDetailInformatie.DeelVanCaption) >= 0 then + ComboBoxDeelVan.ItemIndex := ComboBoxDeelVan.Items.IndexOf(ProductDetailInformatie.DeelVanCaption) + else if ComboBoxDeelVan.Items.Count > 0 then + ComboBoxDeelVan.ItemIndex := 0; - if ProductDetailInformatie.Breedte <> '' then - EditBreedte.Text := ProductDetailInformatie.Breedte - else - EditBreedte.Text := ProductDetailInformatie.DefaultData.Breedte; // Default - if ProductDetailInformatie.Diepte <> '' then - EditDiepte.Text := ProductDetailInformatie.Diepte - else - EditDiepte.Text := ProductDetailInformatie.DefaultData.Diepte; // Default - if ProductDetailInformatie.Hoogte <> '' then - EditHoogte.Text := ProductDetailInformatie.Hoogte - else - EditHoogte.Text := ProductDetailInformatie.DefaultData.Hoogte; - EditMaxCombAantal.Text := ProductDetailInformatie.MaxCombinAantal; - EditAantal.Text := ProductDetailInformatie.Aantal; + if ProductDetailInformatie.Breedte <> '' then + EditBreedte.Text := ProductDetailInformatie.Breedte + else + EditBreedte.Text := ProductDetailInformatie.DefaultData.Breedte; // Default + if ProductDetailInformatie.Diepte <> '' then + EditDiepte.Text := ProductDetailInformatie.Diepte + else + EditDiepte.Text := ProductDetailInformatie.DefaultData.Diepte; // Default + if ProductDetailInformatie.Hoogte <> '' then + EditHoogte.Text := ProductDetailInformatie.Hoogte + else + EditHoogte.Text := ProductDetailInformatie.DefaultData.Hoogte; + EditMaxCombAantal.Text := ProductDetailInformatie.MaxCombinAantal; + EditAantal.Text := ProductDetailInformatie.Aantal; - // Rechterhelft + // Rechterhelft - // Plaatsing - ComboBoxPlaatsing.Items.Clear(); - // Combobox vullen en item selecteren. Indien item niet aanwezig is, eerste item selecteren. - for PPSPrioriteitEl in ProductDetailInformatie.PPSPrioriteit do - begin - ComboBoxPlaatsing.Items.Add(PPSPrioriteitEl.Key); - end; - if ComboBoxPlaatsing.Items.IndexOf(ProductDetailInformatie.OptiType) >= 0 then - ComboBoxPlaatsing.ItemIndex := ComboBoxPlaatsing.Items.IndexOf(ProductDetailInformatie.OptiType) - else if ComboBoxPlaatsing.Items.Count > 0 then - ComboBoxPlaatsing.ItemIndex := 0; + // 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(ProductDetailInformatie.Plaatsing, Item) = True) then + ComboBoxPlaatsing.ItemIndex := ComboBoxPlaatsing.Items.IndexOf(Item) + else if ComboBoxPlaatsing.Items.Count > 0 then + ComboBoxPlaatsing.ItemIndex := 0; - // Positie - CheckComboBoxPositie.Items.Clear(); - // CheckComboBoxPositie vullen en item selecteren. - for TempStr in SplitString(ProductDetailInformatie.DefaultData.Positie, ';') do - begin - CheckComboBoxPositie.Items.Add(TempStr); - end; - if CheckComboBoxPositie.Items.IndexOf(ProductDetailInformatie.Positie) >= 0 then - CheckComboBoxPositie.Checked[CheckComboBoxPositie.Items.IndexOf(ProductDetailInformatie.Positie)] := True; + // 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 + begin + CheckComboBoxPositie.Items.Add(Item); + end; + if ProductDetailInformatie.Positie = '' then + // Lege positie betekent alles aangeduid + for I := 0 to CheckComboBoxPositie.Items.Count - 1 do + CheckComboBoxPositie.Checked[I] := True + else + for TempStr in SplitString(ProductDetailInformatie.Positie, '') do + if CheckComboBoxPositie.Items.IndexOf(TempStr) >= 0 then + CheckComboBoxPositie.Checked[CheckComboBoxPositie.Items.IndexOf(TempStr)] := True; - // Richting - CheckComboBoxRichting.Items.Clear(); - // CheckComboBoxPositie vullen en item selecteren. Als waarde niet aanwezig is, uit default halen. - for TempStr in SplitString(RICHTING_DEFAULT_VALUES, ';') do - begin - CheckComboBoxRichting.Items.Add(TempStr); - end; - if CheckComboBoxRichting.Items.IndexOf(ProductDetailInformatie.Rotatie) >= 0 then - CheckComboBoxRichting.Checked[CheckComboBoxRichting.Items.IndexOf(ProductDetailInformatie.Rotatie)] := True - else if CheckComboBoxRichting.Items.IndexOf(ProductDetailInformatie.DefaultData.Rotatie) >= 0 then - CheckComboBoxRichting.Checked[CheckComboBoxRichting.Items.IndexOf(ProductDetailInformatie.DefaultData.Rotatie)] := True; - - // BoxSelect - ComboBoxBoxSelect.Items.Clear(); - // ComboBoxBoxSelect vullen en item selecteren. - for TempStr in SplitString(ProductDetailInformatie.DefaultData.BoxSelect, ';') do - begin - ComboBoxBoxSelect.Items.Add(TempStr); - end; - if ComboBoxBoxSelect.Items.IndexOf(ProductDetailInformatie.BoxSelect) >= 0 then - ComboBoxBoxSelect.ItemIndex := ComboBoxBoxSelect.Items.IndexOf(ProductDetailInformatie.BoxSelect) - else if ComboBoxBoxSelect.Items.Count > 0 then - ComboBoxBoxSelect.ItemIndex := 0; + // 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 + begin + CheckComboBoxRichting.Items.Add(Item); end; + if ProductDetailInformatie.Rotatie <> '' then + begin + for TempStr in SplitString(ProductDetailInformatie.Rotatie, '') do + if CheckComboBoxRichting.Items.IndexOf(TempStr) >= 0 then + CheckComboBoxRichting.Checked[CheckComboBoxRichting.Items.IndexOf(TempStr)] := True; + end + else + begin + // Leeg, kies default waarden + for TempStr in SplitString(ProductDetailInformatie.DefaultData.Rotatie, ';') do + if CheckComboBoxRichting.Items.IndexOf(TempStr) >= 0 then + CheckComboBoxRichting.Checked[CheckComboBoxRichting.Items.IndexOf(TempStr)] := True; + end; + UpdateControlsEnableStatus() end; procedure TFormProductDetail.UpdateControlsEnableStatus(); begin // Linkerdeel ComboBoxDeelVan.Enabled := ComboBoxDeelVan.Items.Count > 0; - // Rechterdeel - ComboBoxBoxSelect.Enabled := ComboBoxBoxSelect.Items.Count > 0; end; procedure TFormProductDetail.UpdateGuiDataAanwezigheid(Aanwezig: boolean);