InputRoll - ColunReorder event handler, Tastudio - subscribe to this event handler and flag changes to the movie (since this information is saved into the tasproj file)
This commit is contained in:
parent
bcb8a00c77
commit
3593588d5f
|
@ -109,6 +109,11 @@ namespace BizHawk.Client.Common
|
|||
Changes = false;
|
||||
}
|
||||
|
||||
public void FlagChanges() // TODO: it is pointless to have these two methods rather than a public setter
|
||||
{
|
||||
Changes = true;
|
||||
}
|
||||
|
||||
public override void StartNewRecording()
|
||||
{
|
||||
LagLog.Clear();
|
||||
|
|
|
@ -273,6 +273,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
[Category("Behavior")]
|
||||
public event RightMouseScrollEventHandler RightMouseScrolled;
|
||||
|
||||
[Category("Property Changed")]
|
||||
[Description("Occurs when the column header has been reordered")]
|
||||
public event ColumnReorderedEventHandler ColumnReordered;
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve the text for a cell
|
||||
/// </summary>
|
||||
|
@ -294,6 +298,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public delegate void ColumnClickEventHandler(object sender, ColumnClickEventArgs e);
|
||||
|
||||
public delegate void ColumnReorderedEventHandler(object sender, ColumnReorderedEventArgs e);
|
||||
|
||||
public class CellEventArgs
|
||||
{
|
||||
public CellEventArgs(Cell oldCell, Cell newCell)
|
||||
|
@ -316,6 +322,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
public RollColumn Column { get; private set; }
|
||||
}
|
||||
|
||||
public class ColumnReorderedEventArgs
|
||||
{
|
||||
public ColumnReorderedEventArgs(int oldDisplayIndex, int newDisplayIndex, RollColumn column)
|
||||
{
|
||||
Column = column;
|
||||
OldDisplayIndex = oldDisplayIndex;
|
||||
NewDisplayIndex = NewDisplayIndex;
|
||||
}
|
||||
|
||||
public RollColumn Column { get; private set; }
|
||||
public int OldDisplayIndex { get; private set; }
|
||||
public int NewDisplayIndex { get; private set; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Api
|
||||
|
@ -1478,7 +1498,14 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
if (_columnDown != CurrentCell.Column)
|
||||
{
|
||||
var oldIndex = _columns.IndexOf(_columnDown);
|
||||
var newIndex = _columns.IndexOf(CurrentCell.Column);
|
||||
|
||||
if (ColumnReordered != null)
|
||||
{
|
||||
ColumnReordered(this, new ColumnReorderedEventArgs(oldIndex, newIndex, _columnDown));
|
||||
}
|
||||
|
||||
_columns.Remove(_columnDown);
|
||||
_columns.Insert(newIndex, _columnDown);
|
||||
}
|
||||
|
|
|
@ -779,6 +779,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
this.TasView.ColumnRightClick += new BizHawk.Client.EmuHawk.InputRoll.ColumnClickEventHandler(this.TasView_ColumnRightClick);
|
||||
this.TasView.SelectedIndexChanged += new System.EventHandler(this.TasView_SelectedIndexChanged);
|
||||
this.TasView.RightMouseScrolled += new BizHawk.Client.EmuHawk.InputRoll.RightMouseScrollEventHandler(this.TasView_MouseWheel);
|
||||
this.TasView.ColumnReordered += new BizHawk.Client.EmuHawk.InputRoll.ColumnReorderedEventHandler(this.TasView_ColumnReordered);
|
||||
this.TasView.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TasView_KeyDown);
|
||||
this.TasView.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDoubleClick);
|
||||
this.TasView.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TasView_MouseDown);
|
||||
|
|
|
@ -198,6 +198,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
TasView.Refresh();
|
||||
}
|
||||
|
||||
private void TasView_ColumnReordered(object sender, InputRoll.ColumnReorderedEventArgs e)
|
||||
{
|
||||
_currentTasMovie.FlagChanges();
|
||||
}
|
||||
|
||||
private void TasView_MouseEnter(object sender, EventArgs e)
|
||||
{
|
||||
TasView.Focus();
|
||||
|
|
Loading…
Reference in New Issue