From b7dc8e17118ec2dc239d4eef1ad2b948e168aac3 Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Wed, 10 Oct 2018 09:49:01 -0700 Subject: [PATCH] Improve behavior under Mono Worked around two crashes in Mono 5.16's WinForms implementation. (See mono/mono#11070 for the details.) Still very unstable, but it no longer crashes on startup. Also, tweaked the "about" box title. --- SourceGen/AppForms/AboutBox.Designer.cs | 4 ++-- SourceGen/AppForms/ProjectView.Designer.cs | 19 ++++++++++--------- SourceGen/AppForms/ProjectView.cs | 4 ++-- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/SourceGen/AppForms/AboutBox.Designer.cs b/SourceGen/AppForms/AboutBox.Designer.cs index ff759ff..1305655 100644 --- a/SourceGen/AppForms/AboutBox.Designer.cs +++ b/SourceGen/AppForms/AboutBox.Designer.cs @@ -65,7 +65,7 @@ namespace SourceGen.AppForms { this.sourceGenLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.sourceGenLabel.Location = new System.Drawing.Point(340, 13); this.sourceGenLabel.Name = "sourceGenLabel"; - this.sourceGenLabel.Size = new System.Drawing.Size(349, 37); + this.sourceGenLabel.Size = new System.Drawing.Size(346, 37); this.sourceGenLabel.TabIndex = 1; this.sourceGenLabel.Text = "6502bench SourceGen"; // @@ -164,7 +164,7 @@ namespace SourceGen.AppForms { this.Name = "AboutBox"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "AboutBox"; + this.Text = "About SourceGen"; this.Load += new System.EventHandler(this.AboutBox_Load); ((System.ComponentModel.ISupportInitialize)(this.boardPictureBox)).EndInit(); this.ResumeLayout(false); diff --git a/SourceGen/AppForms/ProjectView.Designer.cs b/SourceGen/AppForms/ProjectView.Designer.cs index 4a66fd0..4416b4c 100644 --- a/SourceGen/AppForms/ProjectView.Designer.cs +++ b/SourceGen/AppForms/ProjectView.Designer.cs @@ -1211,6 +1211,7 @@ namespace SourceGen.AppForms this.codeListView.Size = new System.Drawing.Size(446, 543); this.codeListView.TabIndex = 0; this.codeListView.UseCompatibleStateImageBehavior = false; + this.codeListView.View = System.Windows.Forms.View.Details; this.codeListView.VirtualMode = true; this.codeListView.CacheVirtualItems += new System.Windows.Forms.CacheVirtualItemsEventHandler(this.codeListView_CacheVirtualItems); this.codeListView.ColumnWidthChanged += new System.Windows.Forms.ColumnWidthChangedEventHandler(this.codeListView_ColumnWidthChanged); @@ -1227,47 +1228,47 @@ namespace SourceGen.AppForms // columnOffset // this.columnOffset.Text = "offset"; - this.columnOffset.Width = -2; + this.columnOffset.Width = 0; // // columnAddr // this.columnAddr.Text = "addr"; - this.columnAddr.Width = -2; + this.columnAddr.Width = 0; // // columnBytes // this.columnBytes.Text = "bytes"; - this.columnBytes.Width = -2; + this.columnBytes.Width = 0; // // columnFlags // this.columnFlags.Text = "flags"; - this.columnFlags.Width = -2; + this.columnFlags.Width = 0; // // columnAttr // this.columnAttr.Text = "attr"; - this.columnAttr.Width = -2; + this.columnAttr.Width = 0; // // columnLabel // this.columnLabel.Text = "label"; - this.columnLabel.Width = -2; + this.columnLabel.Width = 0; // // columnOpcode // this.columnOpcode.Text = "opcode"; - this.columnOpcode.Width = -2; + this.columnOpcode.Width = 0; // // columnOperand // this.columnOperand.Text = "operand"; - this.columnOperand.Width = -2; + this.columnOperand.Width = 0; // // columnComment // this.columnComment.Text = "comment"; - this.columnComment.Width = -2; + this.columnComment.Width = 0; // // rightPanelSplitter // diff --git a/SourceGen/AppForms/ProjectView.cs b/SourceGen/AppForms/ProjectView.cs index a3650b0..cd9abcc 100644 --- a/SourceGen/AppForms/ProjectView.cs +++ b/SourceGen/AppForms/ProjectView.cs @@ -276,7 +276,7 @@ namespace SourceGen.AppForms { private void InitCodeListView() { ListView cv = codeListView; - cv.View = View.Details; + //cv.View = View.Details; // Create an empty place-holder for the context menu. codeListView.ContextMenuStrip = new ContextMenuStrip(); @@ -1613,7 +1613,7 @@ namespace SourceGen.AppForms { mCodeViewSelection = new VirtualListViewSelection(); mDisplayList = null; codeListView.VirtualListSize = 0; - codeListView.Items.Clear(); + //codeListView.Items.Clear(); ShowNoProject(); InvalidateControls(null);