Input Roll - change QueryItemText event handler to pass the RollColumn object instead of a column index, still todo: background and icon callbacks

This commit is contained in:
adelikat 2014-10-13 19:10:11 +00:00
parent 0b8c9f3db1
commit c0dcf99656
3 changed files with 8 additions and 9 deletions

View File

@ -270,11 +270,10 @@ namespace BizHawk.Client.EmuHawk
[Category("Behavior")]
public event RightMouseScrollEventHandler RightMouseScrolled;
// TODO: change this to pass in a column object instead of an index (which forces the caller to look up the column
/// <summary>
/// Retrieve the text for a cell
/// </summary>
public delegate void QueryItemTextHandler(int index, int column, out string text);
public delegate void QueryItemTextHandler(int index, RollColumn column, out string text);
// TODO: change this to pass in a column object instead of an index (which forces the caller to look up the column
/// <summary>
@ -619,7 +618,7 @@ namespace BizHawk.Client.EmuHawk
for (int j = 0; j < columns.Count; j++)
{
string text;
QueryItemText(i + startIndex, j, out text);
QueryItemText(i + startIndex, columns[j], out text);
//Center Text
int x = RowsToPixels(i) + (CellWidth - text.Length * _charSize.Width) / 2;
@ -663,7 +662,7 @@ namespace BizHawk.Client.EmuHawk
}
else
{
QueryItemText(i + startRow, j, out text);
QueryItemText(i + startRow, columns[j], out text);
if (!string.IsNullOrWhiteSpace(text))
{
Gdi.DrawString(text, point);

View File

@ -74,15 +74,15 @@ namespace BizHawk.Client.EmuHawk
}
private void MarkerView_QueryItemText(int index, int column, out string text)
private void MarkerView_QueryItemText(int index, InputRoll.RollColumn column, out string text)
{
text = "";
if (column == 0)
if (column.Name == "FrameColumn")
{
text = Tastudio.CurrentMovie.Markers[index].Frame.ToString();
}
else if (column == 1)
else if (column.Name == "LabelColumn")
{
text = Tastudio.CurrentMovie.Markers[index].Message;
}

View File

@ -148,12 +148,12 @@ namespace BizHawk.Client.EmuHawk
}
}
private void TasView_QueryItemText(int index, int column, out string text)
private void TasView_QueryItemText(int index, InputRoll.RollColumn column, out string text)
{
try
{
text = string.Empty;
var columnName = TasView.VisibleColumns.ToList()[column].Name; // TODO: don't do this when a column object is passed in instead of an int
var columnName = column.Name;
if (columnName == MarkerColumnName)
{