UI: Fixed tab order (generic code) + Small fixes to some windows

This commit is contained in:
Souryo 2016-02-07 14:42:07 -05:00
parent 7505ff1237
commit 4e9714ae51
8 changed files with 89 additions and 45 deletions

View file

@ -27,7 +27,6 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
this.lblBreakOn = new System.Windows.Forms.Label();
this.lblAddress = new System.Windows.Forms.Label();
@ -51,7 +50,6 @@
this.chkRead = new System.Windows.Forms.CheckBox();
this.chkWrite = new System.Windows.Forms.CheckBox();
this.chkExec = new System.Windows.Forms.CheckBox();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.tableLayoutPanel1.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.picHelp)).BeginInit();
@ -359,7 +357,6 @@
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Name = "frmBreakpoint";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Breakpoint";
this.Controls.SetChildIndex(this.tableLayoutPanel1, 0);

View file

@ -90,7 +90,6 @@
this.saveStrippedDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveUnusedDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuTraceLogger = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
this.statusStrip = new System.Windows.Forms.StatusStrip();
this.lblPrgAnalysis = new System.Windows.Forms.ToolStripStatusLabel();
this.lblPrgAnalysisResult = new System.Windows.Forms.ToolStripStatusLabel();
@ -638,18 +637,11 @@
//
// mnuTraceLogger
//
this.mnuTraceLogger.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem5});
this.mnuTraceLogger.Name = "mnuTraceLogger";
this.mnuTraceLogger.Size = new System.Drawing.Size(171, 22);
this.mnuTraceLogger.Text = "Trace Logger";
this.mnuTraceLogger.Click += new System.EventHandler(this.mnuTraceLogger_Click);
//
// toolStripMenuItem5
//
this.toolStripMenuItem5.Name = "toolStripMenuItem5";
this.toolStripMenuItem5.Size = new System.Drawing.Size(152, 22);
//
// statusStrip
//
this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -793,6 +785,5 @@
private System.Windows.Forms.ToolStripMenuItem mnuGoToNmiHandler;
private System.Windows.Forms.ToolStripMenuItem mnuGoToResetHandler;
private System.Windows.Forms.ToolStripMenuItem mnuTraceLogger;
private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem5;
}
}

View file

@ -117,16 +117,19 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="contextMenuCode.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>561, 17</value>
<value>215, 17</value>
</metadata>
<metadata name="menuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
<metadata name="statusStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>713, 17</value>
<value>367, 17</value>
</metadata>
<metadata name="tmrCdlRatios.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>822, 17</value>
<value>476, 17</value>
</metadata>
</root>

View file

@ -36,6 +36,7 @@
this.mnuClose = new System.Windows.Forms.ToolStripMenuItem();
this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mnuRefresh = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.mnuAutoRefresh = new System.Windows.Forms.ToolStripMenuItem();
this.tabMain = new System.Windows.Forms.TabControl();
this.tpgNametableViewer = new System.Windows.Forms.TabPage();
@ -46,7 +47,6 @@
this.ctrlSpriteViewer = new Mesen.GUI.Debugger.Controls.ctrlSpriteViewer();
this.tpgPaletteViewer = new System.Windows.Forms.TabPage();
this.ctrlPaletteViewer = new Mesen.GUI.Debugger.Controls.ctrlPaletteViewer();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.menuStrip1.SuspendLayout();
this.tabMain.SuspendLayout();
this.tpgNametableViewer.SuspendLayout();
@ -95,17 +95,22 @@
//
this.mnuRefresh.Name = "mnuRefresh";
this.mnuRefresh.ShortcutKeys = System.Windows.Forms.Keys.F5;
this.mnuRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuRefresh.Size = new System.Drawing.Size(141, 22);
this.mnuRefresh.Text = "Refresh";
this.mnuRefresh.Click += new System.EventHandler(this.mnuRefresh_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(138, 6);
//
// mnuAutoRefresh
//
this.mnuAutoRefresh.Checked = true;
this.mnuAutoRefresh.CheckOnClick = true;
this.mnuAutoRefresh.CheckState = System.Windows.Forms.CheckState.Checked;
this.mnuAutoRefresh.Name = "mnuAutoRefresh";
this.mnuAutoRefresh.Size = new System.Drawing.Size(152, 22);
this.mnuAutoRefresh.Size = new System.Drawing.Size(141, 22);
this.mnuAutoRefresh.Text = "Auto-refresh";
//
// tabMain
@ -118,7 +123,7 @@
this.tabMain.Location = new System.Drawing.Point(0, 24);
this.tabMain.Name = "tabMain";
this.tabMain.SelectedIndex = 0;
this.tabMain.Size = new System.Drawing.Size(709, 545);
this.tabMain.Size = new System.Drawing.Size(709, 554);
this.tabMain.TabIndex = 3;
//
// tpgNametableViewer
@ -127,7 +132,7 @@
this.tpgNametableViewer.Location = new System.Drawing.Point(4, 22);
this.tpgNametableViewer.Name = "tpgNametableViewer";
this.tpgNametableViewer.Padding = new System.Windows.Forms.Padding(3);
this.tpgNametableViewer.Size = new System.Drawing.Size(701, 519);
this.tpgNametableViewer.Size = new System.Drawing.Size(701, 528);
this.tpgNametableViewer.TabIndex = 0;
this.tpgNametableViewer.Text = "Nametable Viewer";
this.tpgNametableViewer.UseVisualStyleBackColor = true;
@ -137,7 +142,7 @@
this.ctrlNametableViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlNametableViewer.Location = new System.Drawing.Point(3, 3);
this.ctrlNametableViewer.Name = "ctrlNametableViewer";
this.ctrlNametableViewer.Size = new System.Drawing.Size(695, 513);
this.ctrlNametableViewer.Size = new System.Drawing.Size(695, 522);
this.ctrlNametableViewer.TabIndex = 0;
//
// tpgChrViewer
@ -146,7 +151,7 @@
this.tpgChrViewer.Location = new System.Drawing.Point(4, 22);
this.tpgChrViewer.Name = "tpgChrViewer";
this.tpgChrViewer.Padding = new System.Windows.Forms.Padding(3);
this.tpgChrViewer.Size = new System.Drawing.Size(701, 519);
this.tpgChrViewer.Size = new System.Drawing.Size(701, 528);
this.tpgChrViewer.TabIndex = 1;
this.tpgChrViewer.Text = "CHR Viewer";
this.tpgChrViewer.UseVisualStyleBackColor = true;
@ -156,7 +161,7 @@
this.ctrlChrViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlChrViewer.Location = new System.Drawing.Point(3, 3);
this.ctrlChrViewer.Name = "ctrlChrViewer";
this.ctrlChrViewer.Size = new System.Drawing.Size(695, 513);
this.ctrlChrViewer.Size = new System.Drawing.Size(695, 522);
this.ctrlChrViewer.TabIndex = 2;
//
// tpgSpriteViewer
@ -164,7 +169,7 @@
this.tpgSpriteViewer.Controls.Add(this.ctrlSpriteViewer);
this.tpgSpriteViewer.Location = new System.Drawing.Point(4, 22);
this.tpgSpriteViewer.Name = "tpgSpriteViewer";
this.tpgSpriteViewer.Size = new System.Drawing.Size(701, 519);
this.tpgSpriteViewer.Size = new System.Drawing.Size(701, 528);
this.tpgSpriteViewer.TabIndex = 2;
this.tpgSpriteViewer.Text = "Sprite Viewer";
this.tpgSpriteViewer.UseVisualStyleBackColor = true;
@ -174,7 +179,7 @@
this.ctrlSpriteViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlSpriteViewer.Location = new System.Drawing.Point(0, 0);
this.ctrlSpriteViewer.Name = "ctrlSpriteViewer";
this.ctrlSpriteViewer.Size = new System.Drawing.Size(701, 519);
this.ctrlSpriteViewer.Size = new System.Drawing.Size(701, 528);
this.ctrlSpriteViewer.TabIndex = 0;
//
// tpgPaletteViewer
@ -182,7 +187,7 @@
this.tpgPaletteViewer.Controls.Add(this.ctrlPaletteViewer);
this.tpgPaletteViewer.Location = new System.Drawing.Point(4, 22);
this.tpgPaletteViewer.Name = "tpgPaletteViewer";
this.tpgPaletteViewer.Size = new System.Drawing.Size(701, 519);
this.tpgPaletteViewer.Size = new System.Drawing.Size(701, 528);
this.tpgPaletteViewer.TabIndex = 3;
this.tpgPaletteViewer.Text = "Palette Viewer";
this.tpgPaletteViewer.UseVisualStyleBackColor = true;
@ -192,22 +197,20 @@
this.ctrlPaletteViewer.Dock = System.Windows.Forms.DockStyle.Fill;
this.ctrlPaletteViewer.Location = new System.Drawing.Point(0, 0);
this.ctrlPaletteViewer.Name = "ctrlPaletteViewer";
this.ctrlPaletteViewer.Size = new System.Drawing.Size(701, 519);
this.ctrlPaletteViewer.Size = new System.Drawing.Size(701, 528);
this.ctrlPaletteViewer.TabIndex = 0;
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(149, 6);
//
// frmPpuViewer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(709, 569);
this.ClientSize = new System.Drawing.Size(709, 578);
this.Controls.Add(this.tabMain);
this.Controls.Add(this.menuStrip1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MainMenuStrip = this.menuStrip1;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(725, 607);
this.Name = "frmPpuViewer";
this.Text = "PPU Viewer";

View file

@ -117,7 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>107, 17</value>
</metadata>
</root>

View file

@ -35,22 +35,24 @@
//
// tableLayoutPanel1
//
this.tableLayoutPanel1.ColumnCount = 2;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.btnStopLogging, 1, 0);
this.tableLayoutPanel1.ColumnCount = 1;
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel1.Controls.Add(this.btnStartLogging, 0, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(57, 46);
this.tableLayoutPanel1.Controls.Add(this.btnStopLogging, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(278, 144);
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle());
this.tableLayoutPanel1.Size = new System.Drawing.Size(133, 59);
this.tableLayoutPanel1.TabIndex = 0;
//
// btnStartLogging
//
this.btnStartLogging.Location = new System.Drawing.Point(3, 3);
this.btnStartLogging.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnStartLogging.Location = new System.Drawing.Point(19, 3);
this.btnStartLogging.Name = "btnStartLogging";
this.btnStartLogging.Size = new System.Drawing.Size(95, 23);
this.btnStartLogging.TabIndex = 0;
@ -60,7 +62,8 @@
//
// btnStopLogging
//
this.btnStopLogging.Location = new System.Drawing.Point(142, 3);
this.btnStopLogging.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.btnStopLogging.Location = new System.Drawing.Point(19, 32);
this.btnStopLogging.Name = "btnStopLogging";
this.btnStopLogging.Size = new System.Drawing.Size(95, 23);
this.btnStopLogging.TabIndex = 1;
@ -72,9 +75,13 @@
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(546, 233);
this.ClientSize = new System.Drawing.Size(133, 59);
this.Controls.Add(this.tableLayoutPanel1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmTraceLogger";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Trace Logger";
this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false);

View file

@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View file

@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Linq;
using System.Text;
@ -53,6 +54,42 @@ namespace Mesen.GUI.Forms
base.Icon = Properties.Resources.MesenIcon;
}
}
int tabIndex = 0;
InitializeTabIndexes(this, ref tabIndex);
}
private void InitializeTabIndexes(TableLayoutPanel tlp, ref int tabIndex)
{
tlp.TabIndex = tabIndex;
tabIndex++;
for(int i = 0; i < tlp.RowCount; i++) {
for(int j = 0; j < tlp.ColumnCount; j++) {
Control ctrl = tlp.GetControlFromPosition(j, i);
if(ctrl != null) {
if(ctrl is TableLayoutPanel) {
InitializeTabIndexes(((TableLayoutPanel)ctrl), ref tabIndex);
} else {
InitializeTabIndexes(ctrl, ref tabIndex);
}
}
}
}
}
private void InitializeTabIndexes(Control container, ref int tabIndex)
{
container.TabIndex = tabIndex;
tabIndex++;
foreach(Control ctrl in container.Controls) {
if(ctrl is TableLayoutPanel) {
InitializeTabIndexes(((TableLayoutPanel)ctrl), ref tabIndex);
} else {
InitializeTabIndexes(ctrl, ref tabIndex);
}
}
}
public new Image Icon