Start a TasListView object that inherits VirtualListView, make TAStudio use it, have it have properties for which Column and Row is currently being pointed to by the mouse. Row isn't calculated yet, but column is

This commit is contained in:
adelikat 2013-12-07 23:20:44 +00:00
parent 1bc9a5eb7a
commit ac56fb0883
3 changed files with 54 additions and 2 deletions

View File

@ -326,6 +326,9 @@
<Compile Include="CustomControls\SmartTextBoxControl.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\TasListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="CustomControls\TextDebugView.cs">
<SubType>Component</SubType>
</Compile>

View File

@ -0,0 +1,49 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace BizHawk.Client.EmuHawk
{
public class TasListView : VirtualListView
{
public string PointedColumnName = String.Empty;
public int? PointedRowIndex = null;
private void CalculatePointedCell(int x, int y)
{
string columnName = String.Empty;
var accumulator = 0;
foreach (ColumnHeader column in Columns)
{
accumulator += column.Width;
if (accumulator < x)
{
continue;
}
else
{
PointedColumnName = column.Name;
break;
}
}
// TODO: Get row
}
protected override void OnMouseLeave(EventArgs e)
{
PointedColumnName = String.Empty;
PointedRowIndex = null;
base.OnMouseLeave(e);
}
protected override void OnMouseMove(MouseEventArgs e)
{
CalculatePointedCell(e.X, e.Y);
base.OnMouseMove(e);
}
}
}

View File

@ -101,7 +101,7 @@ namespace BizHawk.Client.EmuHawk
this.EnableTooltipsMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator();
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TASView = new BizHawk.Client.EmuHawk.VirtualListView();
this.TASView = new BizHawk.Client.EmuHawk.TasListView();
this.Frame = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.Log = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.MarkerLabel = new System.Windows.Forms.Label();
@ -752,7 +752,7 @@ namespace BizHawk.Client.EmuHawk
private System.Windows.Forms.ToolStripMenuItem ExitMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem ConfigSubMenu;
private VirtualListView TASView;
private TasListView TASView;
private System.Windows.Forms.ColumnHeader Log;
private System.Windows.Forms.ToolStripMenuItem RecentSubMenu;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;