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); Index: VerpakkingsDefinitie/WS/ProductsAgent.pas =================================================================== diff -u -r580 -r581 --- VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 580) +++ VerpakkingsDefinitie/WS/ProductsAgent.pas (.../ProductsAgent.pas) (revision 581) @@ -116,7 +116,6 @@ var Node: IXMLNode; I: Integer; - NewPair: TPair; begin // Ander velden leegmaken UiInstellingenContext.IsOK := True; @@ -129,10 +128,7 @@ for I := 0 to Instellingen.Positie.Count - 1 do begin Node := Instellingen.Positie[I]; - NewPair := TPair.Create(); - NewPair.Key := Node.GetAttributeNS('Key', ''); - NewPair.Value := Node.Text; - UiInstellingenContext.Positie.Add(NewPair); + UiInstellingenContext.Positie.Add(Node.GetAttributeNS('Key', ''), Node.Text); end; end; @@ -142,10 +138,7 @@ for I := 0 to Instellingen.Plaatsing.Count - 1 do begin Node := Instellingen.Plaatsing[I]; - NewPair := TPair.Create(); - NewPair.Key := Node.GetAttributeNS('Key', ''); - NewPair.Value := Node.Text; - UiInstellingenContext.Plaatsing.Add(NewPair); + UiInstellingenContext.Plaatsing.Add(Node.GetAttributeNS('Key', ''), Node.Text); end; end; @@ -155,10 +148,7 @@ for I := 0 to Instellingen.Richting.Count - 1 do begin Node := Instellingen.Richting[I]; - NewPair := TPair.Create(); - NewPair.Key := Node.GetAttributeNS('Key', ''); - NewPair.Value := Node.Text; - UiInstellingenContext.Richting.Add(NewPair); + UiInstellingenContext.Richting.Add(Node.GetAttributeNS('Key', ''), Node.Text); end; end; Index: VerpakkingsDefinitie/ApplicationContext.pas =================================================================== diff -u -r580 -r581 --- VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 580) +++ VerpakkingsDefinitie/ApplicationContext.pas (.../ApplicationContext.pas) (revision 581) @@ -34,30 +34,30 @@ end; // - UI instellingen - TPair = class - private - FKey: string; - FValue: string; - public - property Key: string read FKey write FKey; - property Value: string read FValue write FValue; - end; +// TPair = class +// private +// FKey: string; +// FValue: string; +// public +// property Key: string read FKey write FKey; +// property Value: string read FValue write FValue; +// end; TUiInstellingenContext = class(TSubject) private - FPositie: TList; - FPlaatsing: TList; - FRichting: TList; + FPositie: TDictionary; + FPlaatsing: TDictionary; + FRichting: TDictionary; FIsOK: Boolean; FErrorMessage: string; FInternalErrorMessage: string; public constructor Create(); procedure NotifyChanged(); - property Positie: TList read FPositie write FPositie; - property Plaatsing: TList read FPlaatsing write FPlaatsing; - property Richting: TList read FRichting write FRichting; + property Positie: TDictionary read FPositie write FPositie; + property Plaatsing: TDictionary read FPlaatsing write FPlaatsing; + property Richting: TDictionary read FRichting write FRichting; property IsOK: Boolean read FIsOK write FIsOK; property ErrorMessage: string read FErrorMessage write FErrorMessage; property InternalErrorMessage: string read FInternalErrorMessage write FInternalErrorMessage; @@ -155,9 +155,9 @@ constructor TUiInstellingenContext.Create(); begin inherited Create(); - FPositie := TList.Create(); - FPlaatsing := TList.Create(); - FRichting := TList.Create(); + FPositie := TDictionary.Create(); + FPlaatsing := TDictionary.Create(); + FRichting := TDictionary.Create(); end; procedure TUiInstellingenContext.NotifyChanged(); @@ -183,8 +183,6 @@ end; function TProductInformatie.GetOmschrijving1(): string; -var - S: string; begin if FKol4 = '' then begin Index: VerpakkingsDefinitie/UI/ProductDetailScherm.dfm =================================================================== diff -u -r576 -r581 --- VerpakkingsDefinitie/UI/ProductDetailScherm.dfm (.../ProductDetailScherm.dfm) (revision 576) +++ VerpakkingsDefinitie/UI/ProductDetailScherm.dfm (.../ProductDetailScherm.dfm) (revision 581) @@ -60,14 +60,6 @@ Anchors = [akLeft, akBottom] Caption = 'Meta' end - object Label3: TLabel - Left = 8 - Top = 312 - Width = 55 - Height = 13 - Anchors = [akLeft, akBottom] - Caption = 'Volume van' - end object Label4: TLabel Left = 8 Top = 344 @@ -148,22 +140,6 @@ Anchors = [akLeft, akBottom] Caption = 'Richting' end - object Label14: TLabel - Left = 400 - Top = 408 - Width = 44 - Height = 13 - Anchors = [akLeft, akBottom] - Caption = 'OptiType' - end - object Label15: TLabel - Left = 400 - Top = 440 - Width = 47 - Height = 13 - Anchors = [akLeft, akBottom] - Caption = 'BoxSelect' - end object GroupBox1: TGroupBox Left = 8 Top = 83 @@ -227,15 +203,6 @@ Caption = 'Verwijder' TabOrder = 2 end - object ButtonMaakDozen: TButton - Left = 688 - Top = 140 - Width = 101 - Height = 25 - Anchors = [akRight, akBottom] - Caption = 'Maak dozen' - TabOrder = 3 - end end object EditMeta: TEdit Left = 112 @@ -246,63 +213,54 @@ Enabled = False TabOrder = 1 end - object EditVolumeVan: TEdit - Left = 112 - Top = 309 - Width = 154 - Height = 21 - Anchors = [akLeft, akBottom] - Enabled = False - TabOrder = 2 - end object ComboBoxDeelVan: TComboBox Left = 112 Top = 341 Width = 200 Height = 21 Style = csDropDownList Anchors = [akLeft, akBottom] - TabOrder = 3 + TabOrder = 2 end object EditBreedte: TEdit Left = 112 Top = 373 Width = 200 Height = 21 Anchors = [akLeft, akBottom] - TabOrder = 4 + TabOrder = 3 end object EditDiepte: TEdit Left = 112 Top = 405 Width = 200 Height = 21 Anchors = [akLeft, akBottom] - TabOrder = 5 + TabOrder = 4 end object EditHoogte: TEdit Left = 112 Top = 435 Width = 200 Height = 21 Anchors = [akLeft, akBottom] - TabOrder = 6 + TabOrder = 5 end object EditMaxCombAantal: TEdit Left = 112 Top = 485 Width = 200 Height = 21 Anchors = [akLeft, akBottom] - TabOrder = 7 + TabOrder = 6 end object EditAantal: TEdit Left = 112 Top = 514 Width = 200 Height = 21 Anchors = [akLeft, akBottom] - TabOrder = 8 + TabOrder = 7 end object ComboBoxPlaatsing: TComboBox Left = 503 @@ -311,7 +269,7 @@ Height = 21 Style = csDropDownList Anchors = [akLeft, akBottom] - TabOrder = 9 + TabOrder = 8 end object ComboBoxPositie: TComboBox Left = 503 @@ -320,7 +278,7 @@ Height = 21 Style = csDropDownList Anchors = [akLeft, akBottom] - TabOrder = 10 + TabOrder = 9 end object ComboBoxRichting: TComboBox Left = 503 @@ -329,44 +287,17 @@ Height = 21 Style = csDropDownList Anchors = [akLeft, akBottom] - TabOrder = 11 + TabOrder = 10 end - object ComboBoxOptiType: TComboBox - Left = 503 - Top = 405 - Width = 162 - Height = 21 - Style = csDropDownList - Anchors = [akLeft, akBottom] - TabOrder = 12 - end - object ComboBoxBoxSelect: TComboBox - Left = 503 - Top = 437 - Width = 162 - Height = 21 - Style = csDropDownList - Anchors = [akLeft, akBottom] - TabOrder = 13 - end object ButtonMeta: TButton Left = 272 Top = 277 Width = 40 Height = 21 Anchors = [akLeft, akBottom] Caption = '...' - TabOrder = 14 + TabOrder = 11 end - object ButtonDeelVan: TButton - Left = 272 - Top = 309 - Width = 40 - Height = 21 - Anchors = [akLeft, akBottom] - Caption = '...' - TabOrder = 15 - end object MemoParameters: TMemo Left = 112 Top = 544 @@ -375,6 +306,6 @@ Anchors = [akLeft, akBottom] Lines.Strings = ( '') - TabOrder = 16 + TabOrder = 12 end end Index: VerpakkingsDefinitie/Main.pas =================================================================== diff -u -r569 -r581 --- VerpakkingsDefinitie/Main.pas (.../Main.pas) (revision 569) +++ VerpakkingsDefinitie/Main.pas (.../Main.pas) (revision 581) @@ -89,6 +89,9 @@ // Gebruikersgegevens scherm, zoekscherm, resultaten en detail scherm inladen. NavGridPanelStandard := TNavGridPanelStandard.Create(PanelMain); NieuwScherm := NavGridPanelStandard; + FProductsAgent.LaadUIInstellingen(FAppContext.UserContext, FAppContext.UiInstellingenContext); + + // Gebruikersgegevens scherm bovenaan // Zoekscherm daaronder links // Resultaten scherm daaronder links Index: VerpakkingsDefinitie/Main.dfm =================================================================== diff -u -r573 -r581 --- VerpakkingsDefinitie/Main.dfm (.../Main.dfm) (revision 573) +++ VerpakkingsDefinitie/Main.dfm (.../Main.dfm) (revision 581) @@ -29,7 +29,5 @@ ParentShowHint = False ShowHint = True TabOrder = 0 - ExplicitWidth = 944 - ExplicitHeight = 481 end end