Index: VerpakkingsDefinitie/UI/ProductDetailScherm.pas =================================================================== diff -u -r571 -r577 --- VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 571) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.pas (.../ProductDetailScherm.pas) (revision 577) @@ -66,6 +66,7 @@ CheckComboBoxRichting: TCheckedComboBox; procedure UpdateGui(Sender: TObject); + procedure UpdateControlsEnableStatus(); procedure UpdateGuiDataAanwezigheid(Aanwezig: boolean); public Constructor Create(AOwner: TComponent; Navigator: INavigator; ApplicationContext: TApplicationContext; @@ -141,10 +142,23 @@ SubItems.Add(ProductDetailInformatie.Aantal); SubItems.Add(ProductDetailInformatie.MaxCombinAantal); SubItems.Add(ProductDetailInformatie.DeelVanCaption); + // Linkerhelft + EditMeta.Text := ProductDetailInformatie.MetaCaption; EditVolumeVan.Text := ProductDetailInformatie.VolumeVanCaption; - ComboBoxDeelVan.Items.Add(ProductDetailInformatie.DeelVanCaption); + // 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 @@ -194,10 +208,31 @@ 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 + 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; 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); var I: Integer;