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:
parent
0b8c9f3db1
commit
c0dcf99656
|
@ -270,11 +270,10 @@ namespace BizHawk.Client.EmuHawk
|
||||||
[Category("Behavior")]
|
[Category("Behavior")]
|
||||||
public event RightMouseScrollEventHandler RightMouseScrolled;
|
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>
|
/// <summary>
|
||||||
/// Retrieve the text for a cell
|
/// Retrieve the text for a cell
|
||||||
/// </summary>
|
/// </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
|
// TODO: change this to pass in a column object instead of an index (which forces the caller to look up the column
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -619,7 +618,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
for (int j = 0; j < columns.Count; j++)
|
for (int j = 0; j < columns.Count; j++)
|
||||||
{
|
{
|
||||||
string text;
|
string text;
|
||||||
QueryItemText(i + startIndex, j, out text);
|
QueryItemText(i + startIndex, columns[j], out text);
|
||||||
|
|
||||||
//Center Text
|
//Center Text
|
||||||
int x = RowsToPixels(i) + (CellWidth - text.Length * _charSize.Width) / 2;
|
int x = RowsToPixels(i) + (CellWidth - text.Length * _charSize.Width) / 2;
|
||||||
|
@ -663,7 +662,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
QueryItemText(i + startRow, j, out text);
|
QueryItemText(i + startRow, columns[j], out text);
|
||||||
if (!string.IsNullOrWhiteSpace(text))
|
if (!string.IsNullOrWhiteSpace(text))
|
||||||
{
|
{
|
||||||
Gdi.DrawString(text, point);
|
Gdi.DrawString(text, point);
|
||||||
|
|
|
@ -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 = "";
|
text = "";
|
||||||
|
|
||||||
if (column == 0)
|
if (column.Name == "FrameColumn")
|
||||||
{
|
{
|
||||||
text = Tastudio.CurrentMovie.Markers[index].Frame.ToString();
|
text = Tastudio.CurrentMovie.Markers[index].Frame.ToString();
|
||||||
}
|
}
|
||||||
else if (column == 1)
|
else if (column.Name == "LabelColumn")
|
||||||
{
|
{
|
||||||
text = Tastudio.CurrentMovie.Markers[index].Message;
|
text = Tastudio.CurrentMovie.Markers[index].Message;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
try
|
||||||
{
|
{
|
||||||
text = string.Empty;
|
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)
|
if (columnName == MarkerColumnName)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue