From 357a3728c6fb3002bf42815773ea63bec62af407 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Mon, 18 Sep 2017 17:55:22 -0700 Subject: [PATCH] Invalidate widget on property grid change --- InspectForm.Designer.cs | 18 ++++++++++++------ InspectForm.cs | 5 +++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/InspectForm.Designer.cs b/InspectForm.Designer.cs index 191b03347..306284279 100644 --- a/InspectForm.Designer.cs +++ b/InspectForm.Designer.cs @@ -41,6 +41,7 @@ // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.splitContainer1.Name = "splitContainer1"; // // splitContainer1.Panel1 @@ -50,8 +51,9 @@ // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.propertyGrid1); - this.splitContainer1.Size = new System.Drawing.Size(1426, 972); - this.splitContainer1.SplitterDistance = 886; + this.splitContainer1.Size = new System.Drawing.Size(951, 632); + this.splitContainer1.SplitterDistance = 590; + this.splitContainer1.SplitterWidth = 3; this.splitContainer1.TabIndex = 0; // // treeView1 @@ -60,8 +62,9 @@ this.treeView1.FullRowSelect = true; this.treeView1.HideSelection = false; this.treeView1.Location = new System.Drawing.Point(0, 0); + this.treeView1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.treeView1.Name = "treeView1"; - this.treeView1.Size = new System.Drawing.Size(886, 972); + this.treeView1.Size = new System.Drawing.Size(590, 632); this.treeView1.TabIndex = 0; this.treeView1.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.treeView1_AfterSelect); // @@ -70,16 +73,19 @@ this.propertyGrid1.Dock = System.Windows.Forms.DockStyle.Fill; this.propertyGrid1.LineColor = System.Drawing.SystemColors.ControlDark; this.propertyGrid1.Location = new System.Drawing.Point(0, 0); + this.propertyGrid1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.propertyGrid1.Name = "propertyGrid1"; - this.propertyGrid1.Size = new System.Drawing.Size(536, 972); + this.propertyGrid1.Size = new System.Drawing.Size(358, 632); this.propertyGrid1.TabIndex = 0; + this.propertyGrid1.PropertyValueChanged += new System.Windows.Forms.PropertyValueChangedEventHandler(this.propertyGrid1_PropertyValueChanged); // // InspectForm // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1426, 972); + this.ClientSize = new System.Drawing.Size(951, 632); this.Controls.Add(this.splitContainer1); + this.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2); this.Name = "InspectForm"; this.Text = "InspectForm"; this.splitContainer1.Panel1.ResumeLayout(false); diff --git a/InspectForm.cs b/InspectForm.cs index 3a094444e..45636f07d 100644 --- a/InspectForm.cs +++ b/InspectForm.cs @@ -175,5 +175,10 @@ namespace MatterHackers.MatterControl { this.InspectedWidget = e.Node.Tag as GuiWidget; } + + private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e) + { + this.InspectedWidget.Invalidate(); + } } }