Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs =================================================================== diff -u -r530541f36c86a4dce7c73c075ac2a41a9bd9f730 -r971bf6a5b105ff3f1d1a1106eb4a82682697fb47 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 530541f36c86a4dce7c73c075ac2a41a9bd9f730) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 971bf6a5b105ff3f1d1a1106eb4a82682697fb47) @@ -1580,6 +1580,23 @@ } /// + /// Looks up a localized string similar to NVT - Niet Van Toepassing + ///WVT - Wel Van Toepassing + ///FV - Faalkans Verwaarloosbaar + ///VB - Verder Beoordelen + /// + ///V - Voldoet + ///VN - Voldoet Niet + ///NGO - Nog Geen Oordeel + ///Faalkans - Faalkans gespecificeerd of uitgerekend. + /// + public static string FailureMechanismResultView_InfoToolTip { + get { + return ResourceManager.GetString("FailureMechanismResultView_InfoToolTip", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Assemblageresultaat ///handmatig. /// Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx =================================================================== diff -u -r530541f36c86a4dce7c73c075ac2a41a9bd9f730 -r971bf6a5b105ff3f1d1a1106eb4a82682697fb47 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 530541f36c86a4dce7c73c075ac2a41a9bd9f730) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Properties/Resources.resx (.../Resources.resx) (revision 971bf6a5b105ff3f1d1a1106eb4a82682697fb47) @@ -1375,4 +1375,15 @@ Normen + + NVT - Niet Van Toepassing +WVT - Wel Van Toepassing +FV - Faalkans Verwaarloosbaar +VB - Verder Beoordelen + +V - Voldoet +VN - Voldoet Niet +NGO - Nog Geen Oordeel +Faalkans - Faalkans gespecificeerd of uitgerekend + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.Designer.cs =================================================================== diff -u -r44420c717ac32101ba0da4739d259c622f47976e -r971bf6a5b105ff3f1d1a1106eb4a82682697fb47 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.Designer.cs (.../FailureMechanismResultView.Designer.cs) (revision 44420c717ac32101ba0da4739d259c622f47976e) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.Designer.cs (.../FailureMechanismResultView.Designer.cs) (revision 971bf6a5b105ff3f1d1a1106eb4a82682697fb47) @@ -36,27 +36,75 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.DataGridViewControl = new Core.Common.Controls.DataGrid.DataGridViewControl(); + this.tableLayoutPanel = new System.Windows.Forms.TableLayoutPanel(); + this.infoIcon = new System.Windows.Forms.PictureBox(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.tableLayoutPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.infoIcon)).BeginInit(); this.SuspendLayout(); // - // dataGridViewControl + // DataGridViewControl // this.DataGridViewControl.Dock = System.Windows.Forms.DockStyle.Fill; - this.DataGridViewControl.Location = new System.Drawing.Point(0, 0); + this.DataGridViewControl.Location = new System.Drawing.Point(0, 30); + this.DataGridViewControl.MultiSelect = true; this.DataGridViewControl.Name = "DataGridViewControl"; - this.DataGridViewControl.Size = new System.Drawing.Size(150, 150); + this.DataGridViewControl.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.RowHeaderSelect; + this.DataGridViewControl.Size = new System.Drawing.Size(522, 120); this.DataGridViewControl.TabIndex = 0; // + // tableLayoutPanel + // + this.tableLayoutPanel.ColumnCount = 2; + this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel.Controls.Add(this.infoIcon, 1, 0); + this.tableLayoutPanel.Dock = System.Windows.Forms.DockStyle.Top; + this.tableLayoutPanel.Location = new System.Drawing.Point(0, 0); + this.tableLayoutPanel.Name = "tableLayoutPanel"; + this.tableLayoutPanel.RowCount = 1; + this.tableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel.Size = new System.Drawing.Size(522, 30); + this.tableLayoutPanel.TabIndex = 1; + // + // infoIcon + // + this.infoIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center; + this.infoIcon.Dock = System.Windows.Forms.DockStyle.Fill; + this.infoIcon.Location = new System.Drawing.Point(505, 3); + this.infoIcon.Name = "infoIcon"; + this.infoIcon.Size = new System.Drawing.Size(14, 24); + this.infoIcon.TabIndex = 0; + this.infoIcon.TabStop = false; + // + // toolTip + // + this.toolTip.AutoPopDelay = 5000; + this.toolTip.InitialDelay = 100; + this.toolTip.IsBalloon = true; + this.toolTip.ReshowDelay = 100; + // // FailureMechanismResultView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.DataGridViewControl); + this.Controls.Add(this.tableLayoutPanel); this.Name = "FailureMechanismResultView"; + this.Size = new System.Drawing.Size(522, 150); + this.tableLayoutPanel.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.infoIcon)).EndInit(); this.ResumeLayout(false); } #endregion + + protected Core.Common.Controls.DataGrid.DataGridViewControl DataGridViewControl; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel; + private System.Windows.Forms.PictureBox infoIcon; + private System.Windows.Forms.ToolTip toolTip; } } Index: Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs =================================================================== diff -u -r3ae40918f906ffd4907f5d7ff328d6fdeeec5228 -r971bf6a5b105ff3f1d1a1106eb4a82682697fb47 --- Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 3ae40918f906ffd4907f5d7ff328d6fdeeec5228) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/Views/FailureMechanismResultView.cs (.../FailureMechanismResultView.cs) (revision 971bf6a5b105ff3f1d1a1106eb4a82682697fb47) @@ -26,8 +26,10 @@ using Core.Common.Base; using Core.Common.Controls.DataGrid; using Core.Common.Controls.Views; +using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; using Core.Common.Util.Extensions; using Ringtoets.Common.Data.FailureMechanism; +using Ringtoets.Common.Forms.Properties; namespace Ringtoets.Common.Forms.Views { @@ -73,6 +75,8 @@ InitializeComponent(); + InitializeToolTip(); + FailureMechanism = failureMechanism; this.failureMechanismSectionResults = failureMechanismSectionResults; @@ -94,15 +98,19 @@ }; } + private void InitializeToolTip() + { + infoIcon.BackgroundImage = CoreCommonGuiResources.information; + toolTip.SetToolTip(infoIcon, Resources.FailureMechanismResultView_InfoToolTip); + } + /// /// Gets the failure mechanism. /// public TFailureMechanism FailureMechanism { get; } public object Data { get; set; } - protected DataGridViewControl DataGridViewControl { get; private set; } - protected override void OnLoad(EventArgs e) { base.OnLoad(e); Index: Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs =================================================================== diff -u -r845bc0316bfb8173d53a1d002686fc9a6a631ee1 -r971bf6a5b105ff3f1d1a1106eb4a82682697fb47 --- Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 845bc0316bfb8173d53a1d002686fc9a6a631ee1) +++ Ringtoets/Common/test/Ringtoets.Common.Forms.Test/Views/FailureMechanismResultViewTest.cs (.../FailureMechanismResultViewTest.cs) (revision 971bf6a5b105ff3f1d1a1106eb4a82682697fb47) @@ -21,15 +21,19 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Windows.Forms; using Core.Common.Base; using Core.Common.Controls.DataGrid; using Core.Common.Controls.Views; +using Core.Common.TestUtil; +using Core.Common.Util.Reflection; using NUnit.Extensions.Forms; using NUnit.Framework; using Ringtoets.Common.Data.FailureMechanism; using Ringtoets.Common.Data.TestUtil; using Ringtoets.Common.Forms.Views; +using CoreCommonGuiResources = Core.Common.Gui.Properties.Resources; namespace Ringtoets.Common.Forms.Test.Views { @@ -68,7 +72,39 @@ // Call using (var view = new TestFailureMechanismResultView(failureMechanism.SectionResults, failureMechanism)) { + testForm.Controls.Add(view); + testForm.Show(); + // Assert + var dataGridView = (DataGridViewControl) new ControlTester("DataGridViewControl").TheObject; + Assert.AreEqual(DockStyle.Fill, dataGridView.Dock); + Assert.AreEqual(DataGridViewSelectionMode.RowHeaderSelect, dataGridView.SelectionMode); + + var tableLayoutPanel = (TableLayoutPanel) new ControlTester("tableLayoutPanel").TheObject; + Assert.AreEqual(DockStyle.Top, tableLayoutPanel.Dock); + Assert.AreEqual(2, tableLayoutPanel.ColumnCount); + Assert.AreEqual(SizeType.Percent, tableLayoutPanel.ColumnStyles[0].SizeType); + Assert.AreEqual(100F, tableLayoutPanel.ColumnStyles[0].Width); + Assert.AreEqual(SizeType.Absolute, tableLayoutPanel.ColumnStyles[1].SizeType); + Assert.AreEqual(20F, tableLayoutPanel.ColumnStyles[1].Width); + Assert.AreEqual(1, tableLayoutPanel.RowCount); + Assert.AreEqual(SizeType.Percent, tableLayoutPanel.RowStyles[0].SizeType); + Assert.AreEqual(100F, tableLayoutPanel.RowStyles[0].Height); + + var infoIcon = (PictureBox) new ControlTester("infoIcon").TheObject; + TestHelper.AssertImagesAreEqual(CoreCommonGuiResources.information, infoIcon.BackgroundImage); + Assert.AreEqual(ImageLayout.Center, infoIcon.BackgroundImageLayout); + + var toolTip = TypeUtils.GetField(view, "toolTip"); + Assert.AreEqual("NVT - Niet Van Toepassing\r\n" + + "WVT - Wel Van Toepassing\r\n" + + "FV - Faalkans Verwaarloosbaar\r\n"+ + "VB - Verder Beoordelen\r\n\r\n" + + "V - Voldoet\r\n" + + "VN - Voldoet Niet\r\n" + + "NGO - Nog Geen Oordeel\r\n" + + "Faalkans - Faalkans gespecificeerd of uitgerekend", toolTip.GetToolTip(infoIcon)); + Assert.IsInstanceOf(view); Assert.IsInstanceOf(view); Assert.IsNull(view.Data);