diff --git a/SourceGen/AppForms/ProjectView.Designer.cs b/SourceGen/AppForms/ProjectView.Designer.cs index 49aca22..52b43e8 100644 --- a/SourceGen/AppForms/ProjectView.Designer.cs +++ b/SourceGen/AppForms/ProjectView.Designer.cs @@ -170,8 +170,8 @@ namespace SourceGen.AppForms this.symbolPlatformCheckBox = new System.Windows.Forms.CheckBox(); this.symbolListView = new System.Windows.Forms.ListView(); this.symbolTypeColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); - this.symbolNameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.symbolValueColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.symbolNameColumnHeader = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); this.infoGroupBox = new System.Windows.Forms.GroupBox(); this.infoTextBox = new System.Windows.Forms.TextBox(); this.mainMenuStrip.SuspendLayout(); @@ -1374,8 +1374,8 @@ namespace SourceGen.AppForms | System.Windows.Forms.AnchorStyles.Right))); this.symbolListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.symbolTypeColumnHeader, - this.symbolNameColumnHeader, - this.symbolValueColumnHeader}); + this.symbolValueColumnHeader, + this.symbolNameColumnHeader}); this.symbolListView.Font = new System.Drawing.Font("Consolas", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.symbolListView.FullRowSelect = true; this.symbolListView.GridLines = true; @@ -1399,15 +1399,15 @@ namespace SourceGen.AppForms this.symbolTypeColumnHeader.Text = "Type"; this.symbolTypeColumnHeader.Width = 44; // - // symbolNameColumnHeader - // - this.symbolNameColumnHeader.Text = "Name"; - this.symbolNameColumnHeader.Width = 84; - // // symbolValueColumnHeader // this.symbolValueColumnHeader.Text = "Value"; - this.symbolValueColumnHeader.Width = 68; + this.symbolValueColumnHeader.Width = 54; + // + // symbolNameColumnHeader + // + this.symbolNameColumnHeader.Text = "Name"; + this.symbolNameColumnHeader.Width = 100; // // infoGroupBox // @@ -1527,8 +1527,8 @@ namespace SourceGen.AppForms private System.Windows.Forms.CheckBox symbolAutoCheckBox; private System.Windows.Forms.GroupBox symbolsGroupBox; private System.Windows.Forms.ListView symbolListView; - private System.Windows.Forms.ColumnHeader symbolNameColumnHeader; private System.Windows.Forms.ColumnHeader symbolValueColumnHeader; + private System.Windows.Forms.ColumnHeader symbolNameColumnHeader; private System.Windows.Forms.ColumnHeader symbolTypeColumnHeader; private System.Windows.Forms.ColumnHeader offsetColumnHeader; private System.Windows.Forms.ColumnHeader addressColumnHeader; diff --git a/SourceGen/AppForms/ProjectView.cs b/SourceGen/AppForms/ProjectView.cs index c8bf28c..ecc646b 100644 --- a/SourceGen/AppForms/ProjectView.cs +++ b/SourceGen/AppForms/ProjectView.cs @@ -51,7 +51,7 @@ namespace SourceGen.AppForms { /// Symbol subset, used to supply data to the symbol ListView. Initialized with /// an empty symbol table. /// - private SymbolTableSubset mSymbolSubset = new SymbolTableSubset(new SymbolTable()); + private SymbolTableSubset mSymbolSubset; /// /// Current code list view selection. The length will match the DisplayList Count. @@ -233,20 +233,26 @@ namespace SourceGen.AppForms { mActionsMenuItems[i] = actionsToolStripMenuItem.DropDownItems[i]; } + // Load the settings from the file. Some things (like the symbol subset) need + // these. The general "apply settings" doesn't happen until a bit later, after + // the sub-windows have been initialized. + LoadAppSettings(); + // Init primary ListView (virtual, ownerdraw) InitCodeListView(); // Init Symbols ListView (virtual, non-ownerdraw) + mSymbolSubset = new SymbolTableSubset(new SymbolTable()); symbolListView.SetDoubleBuffered(true); InitSymbolListView(); - LoadAppSettings(); - SetAppWindowLocation(); - ApplyAppSettings(); - // Init References ListView (non-virtual, non-ownerdraw) referencesListView.SetDoubleBuffered(true); + // Place the main window and apply the various settings. + SetAppWindowLocation(); + ApplyAppSettings(); + UpdateActionMenu(); UpdateMenuItemsAndTitle(); UpdateRecentLinks(); @@ -3490,8 +3496,8 @@ namespace SourceGen.AppForms { // Save a copy of the column header names as entered in the designer. mSymbolColumnHeaderNames = new string[3]; mSymbolColumnHeaderNames[0] = symbolTypeColumnHeader.Text; - mSymbolColumnHeaderNames[1] = symbolNameColumnHeader.Text; - mSymbolColumnHeaderNames[2] = symbolValueColumnHeader.Text; + mSymbolColumnHeaderNames[1] = symbolValueColumnHeader.Text; + mSymbolColumnHeaderNames[2] = symbolNameColumnHeader.Text; SetSymbolColumnHeaders(); } @@ -3540,9 +3546,9 @@ namespace SourceGen.AppForms { ListViewItem lvi = new ListViewItem(); lvi.Text = sym.SourceTypeString; - mSymbolSubArray[0] = new ListViewItem.ListViewSubItem(lvi, sym.Label); - mSymbolSubArray[1] = new ListViewItem.ListViewSubItem(lvi, + mSymbolSubArray[0] = new ListViewItem.ListViewSubItem(lvi, mOutputFormatter.FormatHexValue(sym.Value, 0)); + mSymbolSubArray[1] = new ListViewItem.ListViewSubItem(lvi, sym.Label); lvi.SubItems.AddRange(mSymbolSubArray); return lvi; } @@ -3607,11 +3613,11 @@ namespace SourceGen.AppForms { symbolTypeColumnHeader.Text = (sortCol == SymbolTableSubset.SortCol.Type ? sortStr : "") + mSymbolColumnHeaderNames[0]; - symbolNameColumnHeader.Text = - (sortCol == SymbolTableSubset.SortCol.Name ? sortStr : "") + - mSymbolColumnHeaderNames[1]; symbolValueColumnHeader.Text = (sortCol == SymbolTableSubset.SortCol.Value ? sortStr : "") + + mSymbolColumnHeaderNames[1]; + symbolNameColumnHeader.Text = + (sortCol == SymbolTableSubset.SortCol.Name ? sortStr : "") + mSymbolColumnHeaderNames[2]; } diff --git a/SourceGen/SymbolTableSubset.cs b/SourceGen/SymbolTableSubset.cs index c1a2f7c..ef1b5e5 100644 --- a/SourceGen/SymbolTableSubset.cs +++ b/SourceGen/SymbolTableSubset.cs @@ -21,6 +21,9 @@ using System.Text; namespace SourceGen { public class SymbolTableSubset { + // Sort: which column? Note we store the int value in the app settings. + public enum SortCol { Type = 0, Value = 1, Name = 2 }; + private SymbolTable mSymbolTable; // Internal dirty flag. @@ -155,8 +158,6 @@ namespace SourceGen { } } } - // Sort: which column? Note we store the int value in the app settings. - public enum SortCol { Type = 0, Name = 1, Value = 2 }; private SortCol mSortColumn = SortCol.Name; public SortCol SortColumn { get {