From dca6dfdaeb9f85b9c2b8e8a1de2a6f6c3ef0f0cf Mon Sep 17 00:00:00 2001 From: goyuken Date: Fri, 30 Nov 2012 19:57:04 +0000 Subject: [PATCH] gba gpu view: copy to clipboard implemented. also some stuff for some other stuff which i really shouldn't be doing because it's pointless when the core doesn't work for some things. --- .../BizHawk.MultiClient.csproj | 9 ++ .../GBAtools/GBAGPUView.Designer.cs | 108 +++++++++------ BizHawk.MultiClient/GBAtools/GBAGPUView.cs | 129 ++++++++++++++---- BizHawk.MultiClient/GBAtools/GBAGPUView.resx | 6 + .../GBAtools/MobileDetailView.Designer.cs | 103 ++++++++++++++ .../GBAtools/MobileDetailView.cs | 50 +++++++ .../GBAtools/MobileDetailView.resx | 120 ++++++++++++++++ 7 files changed, 454 insertions(+), 71 deletions(-) create mode 100644 BizHawk.MultiClient/GBAtools/MobileDetailView.Designer.cs create mode 100644 BizHawk.MultiClient/GBAtools/MobileDetailView.cs create mode 100644 BizHawk.MultiClient/GBAtools/MobileDetailView.resx diff --git a/BizHawk.MultiClient/BizHawk.MultiClient.csproj b/BizHawk.MultiClient/BizHawk.MultiClient.csproj index 1e02806e28..4374fe1ce0 100644 --- a/BizHawk.MultiClient/BizHawk.MultiClient.csproj +++ b/BizHawk.MultiClient/BizHawk.MultiClient.csproj @@ -232,6 +232,12 @@ MobileBmpView.cs + + Form + + + MobileDetailView.cs + Component @@ -509,6 +515,9 @@ MobileBmpView.cs + + MobileDetailView.cs + CGBColorChooserForm.cs diff --git a/BizHawk.MultiClient/GBAtools/GBAGPUView.Designer.cs b/BizHawk.MultiClient/GBAtools/GBAGPUView.Designer.cs index 2b7ab296d1..274c2ea737 100644 --- a/BizHawk.MultiClient/GBAtools/GBAGPUView.Designer.cs +++ b/BizHawk.MultiClient/GBAtools/GBAGPUView.Designer.cs @@ -28,16 +28,19 @@ /// private void InitializeComponent() { + this.components = new System.ComponentModel.Container(); this.listBoxWidgets = new System.Windows.Forms.ListBox(); this.panel1 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); this.buttonShowWidget = new System.Windows.Forms.Button(); this.groupBox1 = new System.Windows.Forms.GroupBox(); - this.radioButtonFrame = new System.Windows.Forms.RadioButton(); - this.radioButtonScanline = new System.Windows.Forms.RadioButton(); - this.radioButtonManual = new System.Windows.Forms.RadioButton(); - this.hScrollBar1 = new System.Windows.Forms.HScrollBar(); this.buttonRefresh = new System.Windows.Forms.Button(); + this.hScrollBar1 = new System.Windows.Forms.HScrollBar(); + this.radioButtonManual = new System.Windows.Forms.RadioButton(); + this.radioButtonScanline = new System.Windows.Forms.RadioButton(); + this.radioButtonFrame = new System.Windows.Forms.RadioButton(); + this.labelClipboard = new System.Windows.Forms.Label(); + this.timerMessage = new System.Windows.Forms.Timer(this.components); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // @@ -45,7 +48,7 @@ // this.listBoxWidgets.Location = new System.Drawing.Point(12, 25); this.listBoxWidgets.Name = "listBoxWidgets"; - this.listBoxWidgets.Size = new System.Drawing.Size(120, 160); + this.listBoxWidgets.Size = new System.Drawing.Size(137, 160); this.listBoxWidgets.TabIndex = 0; this.listBoxWidgets.DoubleClick += new System.EventHandler(this.listBoxWidgets_DoubleClick); // @@ -54,10 +57,11 @@ this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.AutoScroll = true; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; - this.panel1.Location = new System.Drawing.Point(138, 12); + this.panel1.Location = new System.Drawing.Point(155, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(486, 381); + this.panel1.Size = new System.Drawing.Size(481, 405); this.panel1.TabIndex = 1; // // label1 @@ -88,32 +92,30 @@ this.groupBox1.Controls.Add(this.radioButtonFrame); this.groupBox1.Location = new System.Drawing.Point(15, 220); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Size = new System.Drawing.Size(117, 173); + this.groupBox1.Size = new System.Drawing.Size(134, 133); this.groupBox1.TabIndex = 4; this.groupBox1.TabStop = false; this.groupBox1.Text = "Refresh"; // - // radioButtonFrame + // buttonRefresh // - this.radioButtonFrame.AutoSize = true; - this.radioButtonFrame.Location = new System.Drawing.Point(6, 19); - this.radioButtonFrame.Name = "radioButtonFrame"; - this.radioButtonFrame.Size = new System.Drawing.Size(54, 17); - this.radioButtonFrame.TabIndex = 0; - this.radioButtonFrame.Text = "Frame"; - this.radioButtonFrame.UseVisualStyleBackColor = true; - this.radioButtonFrame.CheckedChanged += new System.EventHandler(this.radioButtonFrame_CheckedChanged); + this.buttonRefresh.Location = new System.Drawing.Point(6, 104); + this.buttonRefresh.Name = "buttonRefresh"; + this.buttonRefresh.Size = new System.Drawing.Size(75, 23); + this.buttonRefresh.TabIndex = 4; + this.buttonRefresh.Text = "Refresh"; + this.buttonRefresh.UseVisualStyleBackColor = true; + this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click); // - // radioButtonScanline + // hScrollBar1 // - this.radioButtonScanline.AutoSize = true; - this.radioButtonScanline.Location = new System.Drawing.Point(6, 42); - this.radioButtonScanline.Name = "radioButtonScanline"; - this.radioButtonScanline.Size = new System.Drawing.Size(66, 17); - this.radioButtonScanline.TabIndex = 1; - this.radioButtonScanline.Text = "Scanline"; - this.radioButtonScanline.UseVisualStyleBackColor = true; - this.radioButtonScanline.CheckedChanged += new System.EventHandler(this.radioButtonScanline_CheckedChanged); + this.hScrollBar1.LargeChange = 20; + this.hScrollBar1.Location = new System.Drawing.Point(3, 62); + this.hScrollBar1.Maximum = 246; + this.hScrollBar1.Name = "hScrollBar1"; + this.hScrollBar1.Size = new System.Drawing.Size(128, 16); + this.hScrollBar1.TabIndex = 3; + this.hScrollBar1.ValueChanged += new System.EventHandler(this.hScrollBar1_ValueChanged); // // radioButtonManual // @@ -127,41 +129,61 @@ this.radioButtonManual.UseVisualStyleBackColor = true; this.radioButtonManual.CheckedChanged += new System.EventHandler(this.radioButtonManual_CheckedChanged); // - // hScrollBar1 + // radioButtonScanline // - this.hScrollBar1.LargeChange = 20; - this.hScrollBar1.Location = new System.Drawing.Point(3, 62); - this.hScrollBar1.Maximum = 246; - this.hScrollBar1.Name = "hScrollBar1"; - this.hScrollBar1.Size = new System.Drawing.Size(111, 16); - this.hScrollBar1.TabIndex = 3; - this.hScrollBar1.ValueChanged += new System.EventHandler(this.hScrollBar1_ValueChanged); + this.radioButtonScanline.AutoSize = true; + this.radioButtonScanline.Location = new System.Drawing.Point(6, 42); + this.radioButtonScanline.Name = "radioButtonScanline"; + this.radioButtonScanline.Size = new System.Drawing.Size(66, 17); + this.radioButtonScanline.TabIndex = 1; + this.radioButtonScanline.Text = "Scanline"; + this.radioButtonScanline.UseVisualStyleBackColor = true; + this.radioButtonScanline.CheckedChanged += new System.EventHandler(this.radioButtonScanline_CheckedChanged); // - // buttonRefresh + // radioButtonFrame // - this.buttonRefresh.Location = new System.Drawing.Point(6, 104); - this.buttonRefresh.Name = "buttonRefresh"; - this.buttonRefresh.Size = new System.Drawing.Size(75, 23); - this.buttonRefresh.TabIndex = 4; - this.buttonRefresh.Text = "Refresh"; - this.buttonRefresh.UseVisualStyleBackColor = true; - this.buttonRefresh.Click += new System.EventHandler(this.buttonRefresh_Click); + this.radioButtonFrame.AutoSize = true; + this.radioButtonFrame.Location = new System.Drawing.Point(6, 19); + this.radioButtonFrame.Name = "radioButtonFrame"; + this.radioButtonFrame.Size = new System.Drawing.Size(54, 17); + this.radioButtonFrame.TabIndex = 0; + this.radioButtonFrame.Text = "Frame"; + this.radioButtonFrame.UseVisualStyleBackColor = true; + this.radioButtonFrame.CheckedChanged += new System.EventHandler(this.radioButtonFrame_CheckedChanged); + // + // labelClipboard + // + this.labelClipboard.AutoSize = true; + this.labelClipboard.Location = new System.Drawing.Point(9, 356); + this.labelClipboard.MaximumSize = new System.Drawing.Size(145, 0); + this.labelClipboard.Name = "labelClipboard"; + this.labelClipboard.Size = new System.Drawing.Size(117, 26); + this.labelClipboard.TabIndex = 5; + this.labelClipboard.Text = "CTRL + C: Copy under mouse to clipboard."; + // + // timerMessage + // + this.timerMessage.Interval = 5000; + this.timerMessage.Tick += new System.EventHandler(this.timerMessage_Tick); // // GBAGPUView // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(636, 405); + this.Controls.Add(this.labelClipboard); this.Controls.Add(this.groupBox1); this.Controls.Add(this.buttonShowWidget); this.Controls.Add(this.label1); this.Controls.Add(this.panel1); this.Controls.Add(this.listBoxWidgets); + this.KeyPreview = true; this.Name = "GBAGPUView"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.Text = "GBA GPU Viewer"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GBAGPUView_FormClosed); this.Load += new System.EventHandler(this.GBAGPUView_Load); + this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GBAGPUView_KeyDown); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.ResumeLayout(false); @@ -181,6 +203,8 @@ private System.Windows.Forms.RadioButton radioButtonManual; private System.Windows.Forms.RadioButton radioButtonScanline; private System.Windows.Forms.RadioButton radioButtonFrame; + private System.Windows.Forms.Label labelClipboard; + private System.Windows.Forms.Timer timerMessage; } } \ No newline at end of file diff --git a/BizHawk.MultiClient/GBAtools/GBAGPUView.cs b/BizHawk.MultiClient/GBAtools/GBAGPUView.cs index ab39bf9874..6be3d3ac00 100644 --- a/BizHawk.MultiClient/GBAtools/GBAGPUView.cs +++ b/BizHawk.MultiClient/GBAtools/GBAGPUView.cs @@ -24,6 +24,8 @@ namespace BizHawk.MultiClient.GBAtools MobileBmpView bg0, bg1, bg2, bg3, bgpal, sppal, sprites, bgtiles16, bgtiles256, sptiles16, sptiles256; + MobileDetailView details, memory; + public GBAGPUView() { InitializeComponent(); @@ -76,8 +78,8 @@ namespace BizHawk.MultiClient.GBAtools } } } - - unsafe void DrawTile16(int* dest, int pitch, byte* tile, ushort *palette, bool hflip, bool vflip) + + unsafe void DrawTile16(int* dest, int pitch, byte* tile, ushort* palette, bool hflip, bool vflip) { if (vflip) { @@ -172,7 +174,7 @@ namespace BizHawk.MultiClient.GBAtools byte* tiles = (byte*)vram + ((bgcnt & 0xc) << 12); - ushort *nametable = (ushort*)vram + ((bgcnt & 0x1f00) << 2); + ushort* nametable = (ushort*)vram + ((bgcnt & 0x1f00) << 2); bool eightbit = bgcnt.Bit(7); @@ -256,8 +258,8 @@ namespace BizHawk.MultiClient.GBAtools int* pixels = (int*)lockdata.Scan0; int pitch = lockdata.Stride / sizeof(int); - - ushort *frame = (ushort*)vram; + + ushort* frame = (ushort*)vram; for (int y = 0; y < 160; y++) { @@ -266,7 +268,7 @@ namespace BizHawk.MultiClient.GBAtools pixels -= 240; pixels += pitch; } - + bmp.UnlockBits(lockdata); mbv.bmpView.Refresh(); } @@ -607,43 +609,74 @@ namespace BizHawk.MultiClient.GBAtools if (sprites.ShouldDraw) DrawSprites(sprites); } - MobileBmpView MakeWidget(string text, int w, int h) + MobileBmpView MakeMBVWidget(string text, int w, int h) { var mbv = new MobileBmpView(); mbv.Text = text; + mbv.bmpView.Text = text; mbv.TopLevel = false; mbv.ChangeViewSize(w, h); mbv.bmpView.Clear(); - mbv.FormClosing += delegate(object sender, FormClosingEventArgs e) - { - e.Cancel = true; - listBoxWidgets.Items.Add(sender); - (sender as Form).Hide(); - }; - // hackish, and why doesn't winforms handle this directly? - mbv.bmpView.Click += (o, e) => (o as Control).Parent.BringToFront(); panel1.Controls.Add(mbv); listBoxWidgets.Items.Add(mbv); return mbv; } + MobileDetailView MakeMDVWidget(string text, int w, int h) + { + var mdv = new MobileDetailView(); + mdv.Text = text; + mdv.bmpView.Text = text; + mdv.TopLevel = false; + mdv.ClientSize = new Size(w, h); + mdv.bmpView.Clear(); + panel1.Controls.Add(mdv); + listBoxWidgets.Items.Add(mdv); + return mdv; + } + void GenerateWidgets() { listBoxWidgets.BeginUpdate(); - bg0 = MakeWidget("Background 0", 256, 256); - bg1 = MakeWidget("Background 1", 256, 256); - bg2 = MakeWidget("Background 2", 256, 256); - bg3 = MakeWidget("Background 3", 256, 256); - bgpal = MakeWidget("Background Palettes", 256, 256); - sppal = MakeWidget("Sprite Palettes", 256, 256); - sprites = MakeWidget("Sprites", 1024, 512); - sptiles16 = MakeWidget("Sprite Tiles (4bpp)", 256, 256); - sptiles256 = MakeWidget("Sprite Tiles (8bpp)", 128, 256); - bgtiles16 = MakeWidget("Background Tiles (4bpp)", 512, 256); - bgtiles256 = MakeWidget("Background Tiles (8bpp)", 256, 256); + bg0 = MakeMBVWidget("Background 0", 256, 256); + bg1 = MakeMBVWidget("Background 1", 256, 256); + bg2 = MakeMBVWidget("Background 2", 256, 256); + bg3 = MakeMBVWidget("Background 3", 256, 256); + bgpal = MakeMBVWidget("Background Palettes", 256, 256); + sppal = MakeMBVWidget("Sprite Palettes", 256, 256); + sprites = MakeMBVWidget("Sprites", 1024, 512); + sptiles16 = MakeMBVWidget("Sprite Tiles (4bpp)", 256, 256); + sptiles256 = MakeMBVWidget("Sprite Tiles (8bpp)", 128, 256); + bgtiles16 = MakeMBVWidget("Background Tiles (4bpp)", 512, 256); + bgtiles256 = MakeMBVWidget("Background Tiles (8bpp)", 256, 256); + details = MakeMDVWidget("Details", 128, 192); + memory = MakeMDVWidget("Details - Memory", 128, 192); listBoxWidgets.EndUpdate(); + + foreach (var f in listBoxWidgets.Items) + { + Form form = (Form)f; + // close becomes hide + form.FormClosing += delegate(object sender, FormClosingEventArgs e) + { + e.Cancel = true; + listBoxWidgets.Items.Add(sender); + (sender as Form).Hide(); + }; + // hackish, and why doesn't winforms handle this directly? + BringToFrontHack(form, form); + } } + static void BringToFrontHack(Control c, Control top) + { + c.Click += (o, e) => top.BringToFront(); + if (c.HasChildren) + foreach (Control cc in c.Controls) + BringToFrontHack(cc, top); + } + + public void Restart() { gba = Global.Emulator as Emulation.Consoles.Nintendo.GBA.GBA; @@ -693,9 +726,9 @@ namespace BizHawk.MultiClient.GBAtools { if (listBoxWidgets.SelectedItem != null) { - var mbv = listBoxWidgets.SelectedItem as MobileBmpView; - mbv.Show(); - mbv.BringToFront(); + var form = listBoxWidgets.SelectedItem as Form; + form.Show(); + form.BringToFront(); listBoxWidgets.Items.RemoveAt(listBoxWidgets.SelectedIndex); } } @@ -710,6 +743,8 @@ namespace BizHawk.MultiClient.GBAtools ShowSelectedWidget(); } + #region refresh control + int cbscanline; int cbscanline_emu = 500; @@ -761,6 +796,8 @@ namespace BizHawk.MultiClient.GBAtools DrawEverything(); } + #endregion + private void GBAGPUView_FormClosed(object sender, FormClosedEventArgs e) { if (gba != null) @@ -769,5 +806,39 @@ namespace BizHawk.MultiClient.GBAtools gba = null; } } + + #region copy to clipboard + + private void timerMessage_Tick(object sender, EventArgs e) + { + timerMessage.Stop(); + labelClipboard.Text = "CTRL + C: Copy under mouse to clipboard."; + } + + private void GBAGPUView_KeyDown(object sender, KeyEventArgs e) + { + if (Control.ModifierKeys.HasFlag(Keys.Control) && e.KeyCode == Keys.C) + { + // find the control under the mouse + Point m = System.Windows.Forms.Cursor.Position; + Control top = this; + Control found = null; + do + { + found = top.GetChildAtPoint(top.PointToClient(m)); + top = found; + } while (found != null && found.HasChildren); + + if (found != null && found is BmpView) + { + var bv = found as BmpView; + Clipboard.SetImage(bv.bmp); + labelClipboard.Text = found.Text + " copied to clipboard."; + timerMessage.Stop(); + timerMessage.Start(); + } + } + } + #endregion } } diff --git a/BizHawk.MultiClient/GBAtools/GBAGPUView.resx b/BizHawk.MultiClient/GBAtools/GBAGPUView.resx index 29dcb1b3a3..53b3489d26 100644 --- a/BizHawk.MultiClient/GBAtools/GBAGPUView.resx +++ b/BizHawk.MultiClient/GBAtools/GBAGPUView.resx @@ -117,4 +117,10 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 63 + \ No newline at end of file diff --git a/BizHawk.MultiClient/GBAtools/MobileDetailView.Designer.cs b/BizHawk.MultiClient/GBAtools/MobileDetailView.Designer.cs new file mode 100644 index 0000000000..4c2e0b518b --- /dev/null +++ b/BizHawk.MultiClient/GBAtools/MobileDetailView.Designer.cs @@ -0,0 +1,103 @@ +namespace BizHawk.MultiClient.GBAtools +{ + partial class MobileDetailView + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.bmpView1 = new BizHawk.MultiClient.GBtools.BmpView(); + this.listView1 = new System.Windows.Forms.ListView(); + this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.tableLayoutPanel1.SuspendLayout(); + this.SuspendLayout(); + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.bmpView1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.listView1, 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.Absolute, 140F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(142, 332); + this.tableLayoutPanel1.TabIndex = 0; + // + // bmpView1 + // + this.bmpView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.bmpView1.Location = new System.Drawing.Point(3, 3); + this.bmpView1.Name = "bmpView1"; + this.bmpView1.Size = new System.Drawing.Size(136, 134); + this.bmpView1.TabIndex = 0; + this.bmpView1.Text = "bmpView1"; + // + // listView1 + // + this.listView1.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.listView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1, + this.columnHeader2}); + this.listView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.listView1.GridLines = true; + this.listView1.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None; + this.listView1.Location = new System.Drawing.Point(3, 143); + this.listView1.Name = "listView1"; + this.listView1.Size = new System.Drawing.Size(136, 186); + this.listView1.TabIndex = 1; + this.listView1.UseCompatibleStateImageBehavior = false; + this.listView1.View = System.Windows.Forms.View.Details; + this.listView1.SizeChanged += new System.EventHandler(this.listView1_SizeChanged); + // + // MobileDetailView + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(142, 332); + this.Controls.Add(this.tableLayoutPanel1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow; + this.Name = "MobileDetailView"; + this.Text = "MobileDetailView"; + this.SizeChanged += new System.EventHandler(this.MobileDetailView_SizeChanged); + this.tableLayoutPanel1.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private GBtools.BmpView bmpView1; + private System.Windows.Forms.ListView listView1; + private System.Windows.Forms.ColumnHeader columnHeader1; + private System.Windows.Forms.ColumnHeader columnHeader2; + } +} \ No newline at end of file diff --git a/BizHawk.MultiClient/GBAtools/MobileDetailView.cs b/BizHawk.MultiClient/GBAtools/MobileDetailView.cs new file mode 100644 index 0000000000..5f9b46312d --- /dev/null +++ b/BizHawk.MultiClient/GBAtools/MobileDetailView.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace BizHawk.MultiClient.GBAtools +{ + public partial class MobileDetailView : Form + { + public MobileDetailView() + { + InitializeComponent(); + } + + public GBtools.BmpView bmpView { get { return bmpView1; } } + + [Browsable(false)] + public bool ShouldDraw { get { return this.Visible; } } + + public override string ToString() + { + return Text; + } + + public void SetDetails(IList> details) + { + listView1.Items.Clear(); + foreach (var t in details) + { + listView1.Items.Add(new ListViewItem(new string[] { t.Item1, t.Item2 })); + } + } + + private void MobileDetailView_SizeChanged(object sender, EventArgs e) + { + // bmp view is always square + tableLayoutPanel1.RowStyles[0].Height = ClientSize.Width; + } + + private void listView1_SizeChanged(object sender, EventArgs e) + { + listView1.Columns[0].Width = listView1.Width / 2; + listView1.Columns[1].Width = listView1.Width / 2; + } + } +} diff --git a/BizHawk.MultiClient/GBAtools/MobileDetailView.resx b/BizHawk.MultiClient/GBAtools/MobileDetailView.resx new file mode 100644 index 0000000000..29dcb1b3a3 --- /dev/null +++ b/BizHawk.MultiClient/GBAtools/MobileDetailView.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file