Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj =================================================================== diff -u -r6cdf02ac497b3bab4f7f955efac588545f5b8986 -ra09a8d55dd24812784b22dd4a0f64e605ebc390a --- Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision 6cdf02ac497b3bab4f7f955efac588545f5b8986) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Ringtoets.Common.Forms.csproj (.../Ringtoets.Common.Forms.csproj) (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -136,6 +136,12 @@ IllustrationPointsChartControl.cs + + UserControl + + + IllustrationPointsControl.cs + UserControl @@ -197,6 +203,9 @@ IllustrationPointsChartControl.cs + + IllustrationPointsControl.cs + LocationsView.cs Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.Designer.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.Designer.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.Designer.cs (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -0,0 +1,101 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +namespace Ringtoets.Common.Forms.Views +{ + partial class IllustrationPointsControl + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.illustrationPointsChartControl = new Ringtoets.Common.Forms.Views.IllustrationPointsChartControl(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer + // + this.splitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; + this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + // + // splitContainer.Panel1 + // + this.splitContainer.Panel1.Controls.Add(this.illustrationPointsChartControl); + this.splitContainer.Size = new System.Drawing.Size(150, 150); + this.splitContainer.SplitterDistance = 72; + this.splitContainer.TabIndex = 0; + // + // illustrationPointsChartControl + // + this.illustrationPointsChartControl.Data = null; + this.illustrationPointsChartControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.illustrationPointsChartControl.Location = new System.Drawing.Point(0, 0); + this.illustrationPointsChartControl.Name = "illustrationPointsChartControl"; + this.illustrationPointsChartControl.Size = new System.Drawing.Size(148, 70); + this.illustrationPointsChartControl.TabIndex = 0; + // + // IllustrationPointsControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.splitContainer); + this.Name = "IllustrationPointsControl"; + this.splitContainer.Panel1.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer; + private IllustrationPointsChartControl illustrationPointsChartControl; + } +} Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.cs (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -0,0 +1,58 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Windows.Forms; +using Ringtoets.Common.Data.Hydraulics.IllustrationPoints; + +namespace Ringtoets.Common.Forms.Views +{ + /// + /// Control to show illustration points. + /// + public partial class IllustrationPointsControl : UserControl + { + private GeneralResult data; + + /// + /// Creates a new instance of .s + /// + public IllustrationPointsControl() + { + InitializeComponent(); + } + + /// + /// Gets or sets the data of the control. + /// + public GeneralResult Data + { + get + { + return data; + } + set + { + data = value; + illustrationPointsChartControl.Data = data; + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.resx =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.resx (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/IllustrationPointsControl.resx (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.Designer.cs =================================================================== diff -u -r095b567e3a7a0e61dd92b0e68fc6f5db883ebcdd -ra09a8d55dd24812784b22dd4a0f64e605ebc390a --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.Designer.cs (.../LocationsView.Designer.cs) (revision 095b567e3a7a0e61dd92b0e68fc6f5db883ebcdd) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.Designer.cs (.../LocationsView.Designer.cs) (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -45,18 +45,14 @@ this.SelectAllButton = new System.Windows.Forms.Button(); this.ButtonGroupBox = new System.Windows.Forms.GroupBox(); this.CalculateForSelectedButtonErrorProvider = new System.Windows.Forms.ErrorProvider(this.components); - this.verticalSplitContainer = new System.Windows.Forms.SplitContainer(); - this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer(); - this.illustrationPointsChartControl = new Ringtoets.Common.Forms.Views.IllustrationPointsChartControl(); + this.splitContainer = new System.Windows.Forms.SplitContainer(); + this.illustrationPointsControl = new Ringtoets.Common.Forms.Views.IllustrationPointsControl(); this.ButtonGroupBox.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.CalculateForSelectedButtonErrorProvider)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.verticalSplitContainer)).BeginInit(); - this.verticalSplitContainer.Panel1.SuspendLayout(); - this.verticalSplitContainer.Panel2.SuspendLayout(); - this.verticalSplitContainer.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.horizontalSplitContainer)).BeginInit(); - this.horizontalSplitContainer.Panel1.SuspendLayout(); - this.horizontalSplitContainer.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit(); + this.splitContainer.Panel1.SuspendLayout(); + this.splitContainer.Panel2.SuspendLayout(); + this.splitContainer.SuspendLayout(); this.SuspendLayout(); // // dataGridViewControl @@ -118,69 +114,50 @@ this.CalculateForSelectedButtonErrorProvider.ContainerControl = this; this.CalculateForSelectedButtonErrorProvider.Icon = global::Ringtoets.Common.Forms.Properties.Resources.warning; // - // verticalSplitContainer + // splitContainer // - this.verticalSplitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.verticalSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.verticalSplitContainer.Location = new System.Drawing.Point(0, 0); - this.verticalSplitContainer.Name = "verticalSplitContainer"; + this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer.Location = new System.Drawing.Point(0, 0); + this.splitContainer.Name = "splitContainer"; // - // verticalSplitContainer.Panel1 + // splitContainer.Panel1 // - this.verticalSplitContainer.Panel1.AutoScroll = true; - this.verticalSplitContainer.Panel1.AutoScrollMinSize = new System.Drawing.Size(440, 0); - this.verticalSplitContainer.Panel1.Controls.Add(this.dataGridViewControl); - this.verticalSplitContainer.Panel1.Controls.Add(this.ButtonGroupBox); + this.splitContainer.Panel1.AutoScroll = true; + this.splitContainer.Panel1.AutoScrollMinSize = new System.Drawing.Size(440, 0); + this.splitContainer.Panel1.Controls.Add(this.dataGridViewControl); + this.splitContainer.Panel1.Controls.Add(this.ButtonGroupBox); // - // verticalSplitContainer.Panel2 + // splitContainer.Panel2 // - this.verticalSplitContainer.Panel2.Controls.Add(this.horizontalSplitContainer); - this.verticalSplitContainer.Size = new System.Drawing.Size(822, 543); - this.verticalSplitContainer.SplitterDistance = 445; - this.verticalSplitContainer.TabIndex = 1; + this.splitContainer.Panel2.Controls.Add(this.illustrationPointsControl); + this.splitContainer.Size = new System.Drawing.Size(822, 543); + this.splitContainer.SplitterDistance = 445; + this.splitContainer.TabIndex = 1; // - // horizontalSplitContainer + // illustrationPointsControl // - this.horizontalSplitContainer.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.horizontalSplitContainer.Dock = System.Windows.Forms.DockStyle.Fill; - this.horizontalSplitContainer.Location = new System.Drawing.Point(0, 0); - this.horizontalSplitContainer.Name = "horizontalSplitContainer"; - this.horizontalSplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; + this.illustrationPointsControl.Data = null; + this.illustrationPointsControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.illustrationPointsControl.Location = new System.Drawing.Point(0, 0); + this.illustrationPointsControl.Name = "illustrationPointsControl"; + this.illustrationPointsControl.Size = new System.Drawing.Size(371, 541); + this.illustrationPointsControl.TabIndex = 0; // - // horizontalSplitContainer.Panel1 - // - this.horizontalSplitContainer.Panel1.Controls.Add(this.illustrationPointsChartControl); - this.horizontalSplitContainer.Size = new System.Drawing.Size(373, 543); - this.horizontalSplitContainer.SplitterDistance = 261; - this.horizontalSplitContainer.TabIndex = 0; - // - // illustrationPointsChartControl - // - this.illustrationPointsChartControl.Data = null; - this.illustrationPointsChartControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.illustrationPointsChartControl.Location = new System.Drawing.Point(0, 0); - this.illustrationPointsChartControl.Name = "illustrationPointsChartControl"; - this.illustrationPointsChartControl.Size = new System.Drawing.Size(371, 259); - this.illustrationPointsChartControl.TabIndex = 0; - // // LocationsView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScroll = true; this.AutoScrollMinSize = new System.Drawing.Size(526, 85); - this.Controls.Add(this.verticalSplitContainer); + this.Controls.Add(this.splitContainer); this.Name = "LocationsView"; this.Size = new System.Drawing.Size(822, 543); this.ButtonGroupBox.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.CalculateForSelectedButtonErrorProvider)).EndInit(); - this.verticalSplitContainer.Panel1.ResumeLayout(false); - this.verticalSplitContainer.Panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.verticalSplitContainer)).EndInit(); - this.verticalSplitContainer.ResumeLayout(false); - this.horizontalSplitContainer.Panel1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.horizontalSplitContainer)).EndInit(); - this.horizontalSplitContainer.ResumeLayout(false); + this.splitContainer.Panel1.ResumeLayout(false); + this.splitContainer.Panel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit(); + this.splitContainer.ResumeLayout(false); this.ResumeLayout(false); } @@ -193,8 +170,7 @@ private System.Windows.Forms.Button SelectAllButton; protected System.Windows.Forms.GroupBox ButtonGroupBox; private System.Windows.Forms.ErrorProvider CalculateForSelectedButtonErrorProvider; - private System.Windows.Forms.SplitContainer verticalSplitContainer; - private System.Windows.Forms.SplitContainer horizontalSplitContainer; - private IllustrationPointsChartControl illustrationPointsChartControl; + private System.Windows.Forms.SplitContainer splitContainer; + private IllustrationPointsControl illustrationPointsControl; } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs =================================================================== diff -u -r13d9407c89466e20fe912bb64d078358f8d03afc -ra09a8d55dd24812784b22dd4a0f64e605ebc390a --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs (.../LocationsView.cs) (revision 13d9407c89466e20fe912bb64d078358f8d03afc) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/LocationsView.cs (.../LocationsView.cs) (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -182,7 +182,7 @@ { SelectionChanged?.Invoke(this, new EventArgs()); - illustrationPointsChartControl.Data = GetGeneralIllustrationPointsResult(); + illustrationPointsControl.Data = GetGeneralIllustrationPointsResult(); } #region Event handling Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj =================================================================== diff -u -r095b567e3a7a0e61dd92b0e68fc6f5db883ebcdd -ra09a8d55dd24812784b22dd4a0f64e605ebc390a --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision 095b567e3a7a0e61dd92b0e68fc6f5db883ebcdd) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Ringtoets.Common.Forms.Test.csproj (.../Ringtoets.Common.Forms.Test.csproj) (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -118,6 +118,7 @@ + Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsControlTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsControlTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/IllustrationPointsControlTest.cs (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -0,0 +1,71 @@ +// Copyright (C) Stichting Deltares 2017. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Linq; +using NUnit.Framework; +using Ringtoets.Common.Forms.Views; +using System.Windows.Forms; +using Ringtoets.Common.Data.TestUtil.IllustrationPoints; + +namespace Ringtoets.Common.Forms.Test.Views +{ + [TestFixture] + public class IllustrationPointsControlTest + { + [Test] + public void Constructor_ExpectedValues() + { + // Call + var control = new IllustrationPointsControl(); + + // Assert + Assert.IsInstanceOf(control); + Assert.IsNull(control.Data); + + Assert.AreEqual(1, control.Controls.Count); + + var splitContainer = control.Controls[0] as SplitContainer; + Assert.IsNotNull(splitContainer); + Control.ControlCollection splitContainerPanel1Controls = splitContainer.Panel1.Controls; + Assert.AreEqual(1, splitContainerPanel1Controls.Count); + Assert.IsInstanceOf(splitContainerPanel1Controls[0]); + + CollectionAssert.IsEmpty(splitContainer .Panel2.Controls); + } + + [Test] + public void Data_ValueSet_DataSetToIllustrationPointsChartControl() + { + // Setup + var data = new TestGeneralResult(); + var control = new IllustrationPointsControl(); + + var chartControl = (IllustrationPointsChartControl) control.Controls.Find("IllustrationPointsChartControl", true).Single(); + + // Call + control.Data = data; + + // Assert + Assert.AreSame(data, control.Data); + Assert.AreSame(data, chartControl.Data); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/LocationsViewTest.cs =================================================================== diff -u -r13d9407c89466e20fe912bb64d078358f8d03afc -ra09a8d55dd24812784b22dd4a0f64e605ebc390a --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/LocationsViewTest.cs (.../LocationsViewTest.cs) (revision 13d9407c89466e20fe912bb64d078358f8d03afc) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/LocationsViewTest.cs (.../LocationsViewTest.cs) (revision a09a8d55dd24812784b22dd4a0f64e605ebc390a) @@ -64,23 +64,16 @@ Assert.AreEqual(1, view.Controls.Count); - var verticalSplitContainer = view.Controls[0] as SplitContainer; - Assert.IsNotNull(verticalSplitContainer); - Control.ControlCollection verticalSplitContainerPanel1Controls = verticalSplitContainer.Panel1.Controls; + var splitContainer = view.Controls[0] as SplitContainer; + Assert.IsNotNull(splitContainer); + Control.ControlCollection verticalSplitContainerPanel1Controls = splitContainer.Panel1.Controls; Assert.AreEqual(2, verticalSplitContainerPanel1Controls.Count); Assert.IsInstanceOf(verticalSplitContainerPanel1Controls[0]); Assert.IsInstanceOf(verticalSplitContainerPanel1Controls[1]); - Control.ControlCollection verticalSplitContainerPanel2Controls = verticalSplitContainer.Panel2.Controls; + Control.ControlCollection verticalSplitContainerPanel2Controls = splitContainer.Panel2.Controls; Assert.AreEqual(1, verticalSplitContainerPanel2Controls.Count); - var horizontalSplitContainer = verticalSplitContainerPanel2Controls[0] as SplitContainer; - Assert.IsNotNull(horizontalSplitContainer); - - Control.ControlCollection horizontalSplitContainerPanel1Controls = horizontalSplitContainer.Panel1.Controls; - Assert.AreEqual(1, horizontalSplitContainerPanel1Controls.Count); - Assert.IsInstanceOf(horizontalSplitContainerPanel1Controls[0]); - - CollectionAssert.IsEmpty(horizontalSplitContainer.Panel2.Controls); + Assert.IsInstanceOf(verticalSplitContainerPanel2Controls[0]); } }