Index: src/Deltares.DSoilModel.Forms/CPTLookup2DControl.Designer.cs =================================================================== diff -u -r252 -r523 --- src/Deltares.DSoilModel.Forms/CPTLookup2DControl.Designer.cs (.../CPTLookup2DControl.Designer.cs) (revision 252) +++ src/Deltares.DSoilModel.Forms/CPTLookup2DControl.Designer.cs (.../CPTLookup2DControl.Designer.cs) (revision 523) @@ -30,67 +30,32 @@ { this.OffsetGroupControl = new DevExpress.XtraEditors.GroupControl(); this.XLabel = new DevExpress.XtraEditors.LabelControl(); - this.ZEdit = new DevExpress.XtraEditors.SpinEdit(); this.XEdit = new DevExpress.XtraEditors.SpinEdit(); - this.ZLabel = new DevExpress.XtraEditors.LabelControl(); - this.CPTNameLabelControl = new DevExpress.XtraEditors.LabelControl(); - this.ProfileNameLabelControl = new DevExpress.XtraEditors.LabelControl(); - this.CPTNameTextEdit = new DevExpress.XtraEditors.TextEdit(); - this.ProfileNameTextEdit = new DevExpress.XtraEditors.TextEdit(); + this.CptControl = new Deltares.DSoilModel.Forms.CPTControl(); ((System.ComponentModel.ISupportInitialize)(this.OffsetGroupControl)).BeginInit(); this.OffsetGroupControl.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ZEdit.Properties)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.XEdit.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.CPTNameTextEdit.Properties)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.ProfileNameTextEdit.Properties)).BeginInit(); this.SuspendLayout(); // // OffsetGroupControl // - this.OffsetGroupControl.Controls.Add(this.ProfileNameTextEdit); - this.OffsetGroupControl.Controls.Add(this.CPTNameTextEdit); - this.OffsetGroupControl.Controls.Add(this.ProfileNameLabelControl); - this.OffsetGroupControl.Controls.Add(this.CPTNameLabelControl); this.OffsetGroupControl.Controls.Add(this.XLabel); - this.OffsetGroupControl.Controls.Add(this.ZEdit); this.OffsetGroupControl.Controls.Add(this.XEdit); - this.OffsetGroupControl.Controls.Add(this.ZLabel); this.OffsetGroupControl.Dock = System.Windows.Forms.DockStyle.Top; this.OffsetGroupControl.Location = new System.Drawing.Point(0, 0); - this.OffsetGroupControl.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.OffsetGroupControl.Name = "OffsetGroupControl"; - this.OffsetGroupControl.Size = new System.Drawing.Size(347, 174); + this.OffsetGroupControl.Size = new System.Drawing.Size(260, 68); this.OffsetGroupControl.TabIndex = 8; this.OffsetGroupControl.Text = "CPT Lookup"; // // XLabel // - this.XLabel.Location = new System.Drawing.Point(21, 41); - this.XLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.XLabel.Location = new System.Drawing.Point(16, 33); this.XLabel.Name = "XLabel"; - this.XLabel.Size = new System.Drawing.Size(50, 16); + this.XLabel.Size = new System.Drawing.Size(43, 13); this.XLabel.TabIndex = 6; this.XLabel.Text = "X Offset "; // - // ZEdit - // - this.ZEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ZEdit.EditValue = new decimal(new int[] { - 0, - 0, - 0, - 0}); - this.ZEdit.EnterMoveNextControl = true; - this.ZEdit.Location = new System.Drawing.Point(200, 69); - this.ZEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.ZEdit.Name = "ZEdit"; - this.ZEdit.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; - this.ZEdit.Properties.EditFormat.FormatString = "F3"; - this.ZEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; - this.ZEdit.Properties.HideSelection = false; - this.ZEdit.Size = new System.Drawing.Size(133, 22); - this.ZEdit.TabIndex = 9; - // // XEdit // this.XEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -100,74 +65,36 @@ 0, 0}); this.XEdit.EnterMoveNextControl = true; - this.XEdit.Location = new System.Drawing.Point(200, 37); - this.XEdit.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.XEdit.Location = new System.Drawing.Point(150, 30); this.XEdit.Name = "XEdit"; this.XEdit.Properties.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.XEdit.Properties.EditFormat.FormatString = "F3"; this.XEdit.Properties.EditFormat.FormatType = DevExpress.Utils.FormatType.Numeric; this.XEdit.Properties.HideSelection = false; - this.XEdit.Size = new System.Drawing.Size(133, 22); + this.XEdit.Size = new System.Drawing.Size(100, 20); this.XEdit.TabIndex = 7; // - // ZLabel + // CptControl // - this.ZLabel.Location = new System.Drawing.Point(21, 73); - this.ZLabel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.ZLabel.Name = "ZLabel"; - this.ZLabel.Size = new System.Drawing.Size(43, 16); - this.ZLabel.TabIndex = 8; - this.ZLabel.Text = "Z offset"; + this.CptControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.CptControl.Location = new System.Drawing.Point(0, 68); + this.CptControl.Name = "CptControl"; + this.CptControl.SelectedObject = null; + this.CptControl.Size = new System.Drawing.Size(260, 531); + this.CptControl.TabIndex = 9; // - // CPTNameLabelControl + // CPTLookup2DControl // - this.CPTNameLabelControl.Location = new System.Drawing.Point(21, 110); - this.CPTNameLabelControl.Margin = new System.Windows.Forms.Padding(4); - this.CPTNameLabelControl.Name = "CPTNameLabelControl"; - this.CPTNameLabelControl.Size = new System.Drawing.Size(23, 16); - this.CPTNameLabelControl.TabIndex = 10; - this.CPTNameLabelControl.Text = "CPT"; - // - // ProfileNameLabelControl - // - this.ProfileNameLabelControl.Location = new System.Drawing.Point(21, 143); - this.ProfileNameLabelControl.Margin = new System.Windows.Forms.Padding(4); - this.ProfileNameLabelControl.Name = "ProfileNameLabelControl"; - this.ProfileNameLabelControl.Size = new System.Drawing.Size(36, 16); - this.ProfileNameLabelControl.TabIndex = 11; - this.ProfileNameLabelControl.Text = "Profile"; - // - // CPTNameTextEdit - // - this.CPTNameTextEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.CPTNameTextEdit.Location = new System.Drawing.Point(200, 107); - this.CPTNameTextEdit.Name = "CPTNameTextEdit"; - this.CPTNameTextEdit.Size = new System.Drawing.Size(133, 22); - this.CPTNameTextEdit.TabIndex = 12; - // - // ProfileNameTextEdit - // - this.ProfileNameTextEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.ProfileNameTextEdit.Location = new System.Drawing.Point(200, 140); - this.ProfileNameTextEdit.Name = "ProfileNameTextEdit"; - this.ProfileNameTextEdit.Size = new System.Drawing.Size(133, 22); - this.ProfileNameTextEdit.TabIndex = 13; - // - // CPTLookupControl - // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.CptControl); this.Controls.Add(this.OffsetGroupControl); - this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); - this.Name = "CPTLookupControl"; - this.Size = new System.Drawing.Size(347, 737); + this.Name = "CPTLookup2DControl"; + this.Size = new System.Drawing.Size(260, 599); ((System.ComponentModel.ISupportInitialize)(this.OffsetGroupControl)).EndInit(); this.OffsetGroupControl.ResumeLayout(false); this.OffsetGroupControl.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.ZEdit.Properties)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.XEdit.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.CPTNameTextEdit.Properties)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.ProfileNameTextEdit.Properties)).EndInit(); this.ResumeLayout(false); } @@ -176,13 +103,8 @@ private DevExpress.XtraEditors.GroupControl OffsetGroupControl; private DevExpress.XtraEditors.LabelControl XLabel; - private DevExpress.XtraEditors.SpinEdit ZEdit; private DevExpress.XtraEditors.SpinEdit XEdit; - private DevExpress.XtraEditors.LabelControl ZLabel; - private DevExpress.XtraEditors.TextEdit ProfileNameTextEdit; - private DevExpress.XtraEditors.TextEdit CPTNameTextEdit; - private DevExpress.XtraEditors.LabelControl ProfileNameLabelControl; - private DevExpress.XtraEditors.LabelControl CPTNameLabelControl; + private CPTControl CptControl; } } Index: src/Deltares.DSoilModel.Forms.Tests/CptLookup2DControlTests.cs =================================================================== diff -u -r379 -r523 --- src/Deltares.DSoilModel.Forms.Tests/CptLookup2DControlTests.cs (.../CptLookup2DControlTests.cs) (revision 379) +++ src/Deltares.DSoilModel.Forms.Tests/CptLookup2DControlTests.cs (.../CptLookup2DControlTests.cs) (revision 523) @@ -28,12 +28,10 @@ TestSpinEditVisibleEnabledValue(PropertyControl, "XEdit", true, true, lookup, x => x.Xlocal, 5.0); TestLabelControlVisibleValue(PropertyControl, "XLabel", true, "Lokale x [-]"); - TestSpinEditVisibleEnabledValue(PropertyControl, "ZEdit", true, false, lookup, x => x.Zlocal, 6.0); - TestLabelControlVisibleValue(PropertyControl, "ZLabel", true, "Lokale z [-]"); - TestTextEditVisibleEnabledValue(PropertyControl, "CPTNameTextEdit", true, false, lookup, x => x.CPTName, "Cpt 1"); - TestLabelControlVisibleValue(PropertyControl, "CPTNameLabelControl", true, "Naam sondering [-]"); - TestTextEditVisibleEnabledValue(PropertyControl, "ProfileNameTextEdit", true, false, lookup, x => x.SoilProfileName, "Profile A"); - TestLabelControlVisibleValue(PropertyControl, "ProfileNameLabelControl", true, "Naam 2D profiel [-]"); + + var subcontrol = GetPrivateField(PropertyControl, "CptControl"); + Assert.NotNull(subcontrol); + Assert.AreSame(lookup.ConePenetrationTestData, subcontrol.SelectedObject); } [Test] Index: src/Deltares.DSoilModel.Forms/CPTLookup2DControl.cs =================================================================== diff -u -r363 -r523 --- src/Deltares.DSoilModel.Forms/CPTLookup2DControl.cs (.../CPTLookup2DControl.cs) (revision 363) +++ src/Deltares.DSoilModel.Forms/CPTLookup2DControl.cs (.../CPTLookup2DControl.cs) (revision 523) @@ -19,9 +19,6 @@ ((IPropertyControl)this).Name = LocalizationManager.GetTranslatedText(this, caption); BindSupport.BindTextValueAndUnit(this, XLabel, XEdit, typeof(ConePenetrationTestLookup2D), "Xlocal"); - BindSupport.BindTextValueAndUnit(this, ZLabel, ZEdit, typeof(ConePenetrationTestLookup2D), "Zlocal"); - BindSupport.BindTextValueAndUnit(this, CPTNameLabelControl, CPTNameTextEdit, typeof(ConePenetrationTestLookup2D), "CPTName"); - BindSupport.BindTextValueAndUnit(this, ProfileNameLabelControl, ProfileNameTextEdit, typeof(ConePenetrationTestLookup2D), "SoilProfileName"); OffsetGroupControl.Text = caption; LocalizationSupport.RegisterAndTranslate(typeof(CPTLookup2DControl), OffsetGroupControl); @@ -44,6 +41,7 @@ conePenetrationTestLookup = lookup; } BindSupport.Assign(this, conePenetrationTestLookup); + CptControl.SelectedObject = lookup.ConePenetrationTestData; } }