Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs =================================================================== diff -u -r87681c3390edf7a795589748aeaa84fc9fe5317e -r5ac0582c6ddb30b2403e3e1251b10ba9c98281ca --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs (.../AssemblyResultPerSectionMapView.Designer.cs) (revision 87681c3390edf7a795589748aeaa84fc9fe5317e) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.Designer.cs (.../AssemblyResultPerSectionMapView.Designer.cs) (revision 5ac0582c6ddb30b2403e3e1251b10ba9c98281ca) @@ -38,82 +38,65 @@ /// private void InitializeComponent() { - this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AssemblyResultPerSectionMapView)); this.ringtoetsMapControl = new Ringtoets.Common.Forms.Views.RingtoetsMapControl(); this.warningPanel = new System.Windows.Forms.Panel(); this.warningIcon = new System.Windows.Forms.PictureBox(); this.warningText = new System.Windows.Forms.Label(); - this.tableLayoutPanel.SuspendLayout(); this.warningPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.warningIcon)).BeginInit(); this.SuspendLayout(); // - // tableLayoutPanel - // - this.tableLayoutPanel.ColumnCount = 1; - this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel.Controls.Add(this.ringtoetsMapControl, 0, 1); - this.tableLayoutPanel.Controls.Add(this.warningPanel, 0, 0); - this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel.Name = "tableLayoutPanel"; - this.tableLayoutPanel.RowCount = 2; - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); - this.tableLayoutPanel.Size = new System.Drawing.Size(562, 150); - this.tableLayoutPanel.TabIndex = 0; - // // ringtoetsMapControl // this.ringtoetsMapControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.ringtoetsMapControl.Location = new System.Drawing.Point(3, 16); + this.ringtoetsMapControl.Location = new System.Drawing.Point(0, 0); + this.ringtoetsMapControl.Margin = new System.Windows.Forms.Padding(0); this.ringtoetsMapControl.Name = "ringtoetsMapControl"; - this.ringtoetsMapControl.Size = new System.Drawing.Size(556, 131); + this.ringtoetsMapControl.Size = new System.Drawing.Size(562, 150); this.ringtoetsMapControl.TabIndex = 0; // // warningPanel // - this.warningPanel.AutoSize = true; this.warningPanel.BackColor = System.Drawing.SystemColors.Info; - this.warningPanel.Controls.Add(this.warningIcon); this.warningPanel.Controls.Add(this.warningText); - this.warningPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.warningPanel.Location = new System.Drawing.Point(0, 0); - this.warningPanel.Margin = new System.Windows.Forms.Padding(0); + this.warningPanel.Controls.Add(this.warningIcon); + this.warningPanel.Location = new System.Drawing.Point(0, 25); this.warningPanel.Name = "warningPanel"; - this.warningPanel.Size = new System.Drawing.Size(556, 13); + this.warningPanel.Size = new System.Drawing.Size(562, 100); this.warningPanel.TabIndex = 1; + this.warningPanel.AutoSize = true; + this.warningPanel.Dock = DockStyle.Top; // // warningIcon // - this.warningIcon.Dock = System.Windows.Forms.DockStyle.Left; - this.warningIcon.Location = new System.Drawing.Point(0, 0); + this.warningIcon.Image = global::Ringtoets.Common.Forms.Properties.Resources.PencilWarning.ToBitmap(); + this.warningIcon.Location = new System.Drawing.Point(4, 4); this.warningIcon.MaximumSize = new System.Drawing.Size(16, 16); this.warningIcon.Name = "warningIcon"; this.warningIcon.Size = new System.Drawing.Size(16, 16); - this.warningIcon.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; - this.warningIcon.Image = global::Ringtoets.Common.Forms.Properties.Resources.PencilWarning.ToBitmap(); - this.warningIcon.TabIndex = 1; + this.warningIcon.TabIndex = 0; this.warningIcon.TabStop = false; + this.warningIcon.SizeMode = PictureBoxSizeMode.StretchImage; + this.warningIcon.Dock = DockStyle.Left; // // warningText // this.warningText.AutoSize = true; - this.warningText.Location = new System.Drawing.Point(22, 0); + this.warningText.Location = new System.Drawing.Point(27, 6); this.warningText.Name = "warningText"; - this.warningText.Size = new System.Drawing.Size(500, 13); + this.warningText.Size = new System.Drawing.Size(35, 13); this.warningText.TabIndex = 1; this.warningText.Text = global::Ringtoets.Common.Forms.Properties.Resources.ManualAssemblyWarning_FailureMechanismAssemblyResult_is_based_on_manual_assemblies; // // AssemblyResultPerSectionMapView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.Controls.Add(this.tableLayoutPanel); + this.Controls.Add(this.ringtoetsMapControl); + this.Controls.Add(this.warningPanel); this.Name = "AssemblyResultPerSectionMapView"; this.Size = new System.Drawing.Size(562, 150); - this.tableLayoutPanel.ResumeLayout(false); - this.tableLayoutPanel.PerformLayout(); this.warningPanel.ResumeLayout(false); this.warningPanel.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.warningIcon)).EndInit(); @@ -123,10 +106,9 @@ #endregion - private TableLayoutPanel tableLayoutPanel; private Common.Forms.Views.RingtoetsMapControl ringtoetsMapControl; private Panel warningPanel; - private Label warningText; private PictureBox warningIcon; + private Label warningText; } } Index: Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs =================================================================== diff -u -r87681c3390edf7a795589748aeaa84fc9fe5317e -r5ac0582c6ddb30b2403e3e1251b10ba9c98281ca --- Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs (.../AssemblyResultPerSectionMapView.cs) (revision 87681c3390edf7a795589748aeaa84fc9fe5317e) +++ Ringtoets/Integration/src/Ringtoets.Integration.Forms/Views/AssemblyResultPerSectionMapView.cs (.../AssemblyResultPerSectionMapView.cs) (revision 5ac0582c6ddb30b2403e3e1251b10ba9c98281ca) @@ -32,7 +32,6 @@ using Ringtoets.Integration.Forms.Factories; using Ringtoets.Integration.Forms.Observers; using Ringtoets.Integration.Forms.Properties; -using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; namespace Ringtoets.Integration.Forms.Views { Index: Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs =================================================================== diff -u -r87681c3390edf7a795589748aeaa84fc9fe5317e -r5ac0582c6ddb30b2403e3e1251b10ba9c98281ca --- Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision 87681c3390edf7a795589748aeaa84fc9fe5317e) +++ Ringtoets/Integration/test/Ringtoets.Integration.Forms.Test/Views/AssemblyResultPerSectionMapViewTest.cs (.../AssemblyResultPerSectionMapViewTest.cs) (revision 5ac0582c6ddb30b2403e3e1251b10ba9c98281ca) @@ -86,22 +86,17 @@ Assert.IsInstanceOf(view); Assert.IsNull(view.Data); - Assert.AreEqual(1, view.Controls.Count); - Assert.IsInstanceOf(view.Controls[0]); + Assert.AreEqual(2, view.Controls.Count); - var layoutPanel = (TableLayoutPanel) view.Controls[0]; - Assert.AreEqual(1, layoutPanel.ColumnCount); - Assert.AreEqual(2, layoutPanel.RowCount); - Assert.AreEqual(DockStyle.Fill, layoutPanel.Dock); + IMapControl mapControl = GetMapControl(view); + Assert.AreSame(view.Map, mapControl); + Assert.AreEqual(DockStyle.Fill, ((Control) view.Map).Dock); - var warningPanel = (Panel) layoutPanel.GetControlFromPosition(0, 0); - Assert.AreEqual(DockStyle.Fill, warningPanel.Dock); + Panel warningPanel = GetWarningPanel(view); + Assert.AreEqual(DockStyle.Top, warningPanel.Dock); Assert.IsFalse(warningPanel.Visible); + Assert.IsTrue(warningPanel.AutoSize); - var mapControl = (RingtoetsMapControl) layoutPanel.GetControlFromPosition(0, 1); - Assert.AreSame(view.Map, mapControl.MapControl); - Assert.AreEqual(DockStyle.Fill, ((Control) view.Map).Dock); - Assert.AreSame(assessmentSection, view.AssessmentSection); MapDataCollection mapDataCollection = view.Map.Data; @@ -450,8 +445,7 @@ using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) { // Then - var layoutPanel = (TableLayoutPanel) view.Controls[0]; - var warningPanel = (Panel) layoutPanel.GetControlFromPosition(0, 0); + Panel warningPanel = GetWarningPanel(view); Assert.AreEqual(hasManualAssembly, warningPanel.Visible); AssertWarningPanel(warningPanel); } @@ -465,8 +459,7 @@ using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) { - var layoutPanel = (TableLayoutPanel) view.Controls[0]; - var warningPanel = (Panel) layoutPanel.GetControlFromPosition(0, 0); + Panel warningPanel = GetWarningPanel(view); // Precondition Assert.IsFalse(warningPanel.Visible); @@ -494,8 +487,7 @@ using (var view = new AssemblyResultPerSectionMapView(assessmentSection)) { - var layoutPanel = (TableLayoutPanel) view.Controls[0]; - var warningPanel = (Panel) layoutPanel.GetControlFromPosition(0, 0); + Panel warningPanel = GetWarningPanel(view); // Precondition Assert.IsTrue(warningPanel.Visible); @@ -575,6 +567,11 @@ } } + private static Panel GetWarningPanel(AssemblyResultPerSectionMapView view) + { + return (Panel) view.Controls[1]; + } + private static void AssertWarningPanel(Panel warningPanel) { Assert.AreEqual(2, warningPanel.Controls.Count); @@ -593,9 +590,8 @@ private static IMapControl GetMapControl(AssemblyResultPerSectionMapView view) { - var layoutPanel = (TableLayoutPanel) view.Controls[0]; - var ringtoetsMapControl = (RingtoetsMapControl) layoutPanel.GetControlFromPosition(0, 1); - return ringtoetsMapControl.MapControl; + var mapControl = (RingtoetsMapControl) view.Controls[0]; + return mapControl.MapControl; } private static void AssertEqualPointCollections(ReferenceLine referenceLine,