diff --git a/GCSViews/ConfigurationView/ConfigRawParams.Designer.cs b/GCSViews/ConfigurationView/ConfigRawParams.Designer.cs index 8007d46944..5d723b5ab4 100644 --- a/GCSViews/ConfigurationView/ConfigRawParams.Designer.cs +++ b/GCSViews/ConfigurationView/ConfigRawParams.Designer.cs @@ -241,7 +241,6 @@ private void InitializeComponent() // this.Params.AllowUserToAddRows = false; this.Params.AllowUserToDeleteRows = false; - this.Params.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle1.BackColor = System.Drawing.Color.Maroon; dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -295,14 +294,12 @@ private void InitializeComponent() // // Value // - this.Value.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.Value.FillWeight = 11F; resources.ApplyResources(this.Value, "Value"); this.Value.Name = "Value"; // // Default_value // - this.Default_value.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.Default_value.FillWeight = 11F; resources.ApplyResources(this.Default_value, "Default_value"); this.Default_value.Name = "Default_value"; @@ -317,7 +314,6 @@ private void InitializeComponent() // // Options // - this.Options.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; this.Options.FillWeight = 28F; resources.ApplyResources(this.Options, "Options"); this.Options.Name = "Options"; @@ -339,7 +335,7 @@ private void InitializeComponent() this.Fav.FillWeight = 4F; resources.ApplyResources(this.Fav, "Fav"); this.Fav.Name = "Fav"; - this.Fav.Resizable = System.Windows.Forms.DataGridViewTriState.False; + this.Fav.Resizable = System.Windows.Forms.DataGridViewTriState.True; // // ConfigRawParams // diff --git a/GCSViews/ConfigurationView/ConfigRawParams.cs b/GCSViews/ConfigurationView/ConfigRawParams.cs index 2e834a9d58..e006f34138 100644 --- a/GCSViews/ConfigurationView/ConfigRawParams.cs +++ b/GCSViews/ConfigurationView/ConfigRawParams.cs @@ -66,9 +66,15 @@ public void Activate() foreach (DataGridViewColumn col in Params.Columns) { - if (!String.IsNullOrEmpty(Settings.Instance["rawparam_" + col.Name + "_widthpercent"])) + // Don't need to size a fill column + if (col.AutoSizeMode == DataGridViewAutoSizeColumnMode.Fill) continue; + + // Don't need to size a column that can't be resized + if (col.Resizable == DataGridViewTriState.False) continue; + + if (!String.IsNullOrEmpty(Settings.Instance["rawparam_" + col.Name + "_width"])) { - col.Width = (int)((Math.Max(5, Settings.Instance.GetInt32("rawparam_" + col.Name + "_widthpercent")) / 100.0) * Params.Width); + col.Width = (int)Math.Max(5, Settings.Instance.GetInt32("rawparam_" + col.Name + "_width")); log.InfoFormat("{0} to {1}", col.Name, col.Width); } } @@ -91,7 +97,13 @@ public void Deactivate() { foreach (DataGridViewColumn col in Params.Columns) { - Settings.Instance["rawparam_" + col.Name + "_widthpercent"] = ((col.Width / (double)Params.Width) * 100.0).ToString("0", CultureInfo.InvariantCulture); + // Don't need to save the width of a fill column + if (col.AutoSizeMode == DataGridViewAutoSizeColumnMode.Fill) continue; + + // Don't need to save the width of a column that can't be resized + if (col.Resizable == DataGridViewTriState.False) continue; + + Settings.Instance["rawparam_" + col.Name + "_width"] = col.Width.ToString("0", CultureInfo.InvariantCulture); } Settings.Instance["rawparam_splitterdistance"] = splitContainer1.SplitterDistance.ToString(); @@ -588,7 +600,6 @@ internal void processToScreen() log.Info("about to add all"); - SuspendParamGridView(); Params.Visible = false; Params.Rows.AddRange(rowlist.ToArray()); @@ -600,7 +611,6 @@ internal void processToScreen() Params.Sort(Params.Columns[Command.Index], ListSortDirection.Ascending); Params.Visible = true; - ResumeParamGridView(); if (splitContainer1.Panel1Collapsed == false) { @@ -710,7 +720,7 @@ private void updatedefaultlist(object crap) void filterList(string searchfor) { DateTime start = DateTime.Now; - SuspendParamGridView(); + Params.Visible = false; if (searchfor.Length >= 2 || searchfor.Length == 0) { Regex filter = new Regex(searchfor.Replace("*", ".*").Replace("..*", ".*"), RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline); @@ -759,7 +769,7 @@ void filterList(string searchfor) } } - ResumeParamGridView(); + Params.Visible = true; log.InfoFormat("Filter: {0}ms", (DateTime.Now - start).TotalMilliseconds); } @@ -1167,18 +1177,6 @@ private void Params_ColumnWidthChanged(object sender, DataGridViewColumnEventArg optionsControlUpateBounds(); } } - - void SuspendParamGridView() - { - Params.Visible = false; - Params.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.None; - } - - void ResumeParamGridView() - { - Params.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.DisplayedCells; - Params.Visible = true; - } } } diff --git a/GCSViews/ConfigurationView/ConfigRawParams.resx b/GCSViews/ConfigurationView/ConfigRawParams.resx index 3ddc477026..8104d0eb8d 100644 --- a/GCSViews/ConfigurationView/ConfigRawParams.resx +++ b/GCSViews/ConfigurationView/ConfigRawParams.resx @@ -638,7 +638,7 @@ format with no scaling 50 - 126 + 130 True @@ -650,7 +650,7 @@ format with no scaling 50 - 69 + 70 True @@ -665,7 +665,7 @@ format with no scaling False - 69 + 70 True @@ -677,7 +677,7 @@ format with no scaling 50 - 56 + 60 True @@ -689,7 +689,7 @@ format with no scaling 50 - 175 + 150 True @@ -728,7 +728,7 @@ format with no scaling Params - MissionPlanner.Controls.MyDataGridView, MissionPlanner, Version=1.3.8474.23142, Culture=neutral, PublicKeyToken=null + MissionPlanner.Controls.MyDataGridView, MissionPlanner, Version=1.3.8674.15835, Culture=neutral, PublicKeyToken=null splitContainer1.Panel2