Set Markers and Remove Markers ContextMenuItems are now working. If multiple rows are selected, the new marker dialog will come up for each row. The option to remove markers is disabled if selected rows do not contain at least one marker.
This commit is contained in:
parent
6fa3cf4d28
commit
5ed74d0188
|
@ -799,17 +799,17 @@ namespace BizHawk.Client.EmuHawk
|
|||
//
|
||||
// SetMarkersContextMenuItem
|
||||
//
|
||||
this.SetMarkersContextMenuItem.Enabled = false;
|
||||
this.SetMarkersContextMenuItem.Name = "SetMarkersContextMenuItem";
|
||||
this.SetMarkersContextMenuItem.Size = new System.Drawing.Size(272, 22);
|
||||
this.SetMarkersContextMenuItem.Text = "Set Markers";
|
||||
this.SetMarkersContextMenuItem.Click += new System.EventHandler(this.SetMarkersMenuItem_Click);
|
||||
//
|
||||
// RemoveMarkersContextMenuItem
|
||||
//
|
||||
this.RemoveMarkersContextMenuItem.Enabled = false;
|
||||
this.RemoveMarkersContextMenuItem.Name = "RemoveMarkersContextMenuItem";
|
||||
this.RemoveMarkersContextMenuItem.Size = new System.Drawing.Size(272, 22);
|
||||
this.RemoveMarkersContextMenuItem.Text = "Remove Markers";
|
||||
this.RemoveMarkersContextMenuItem.Click += new System.EventHandler(this.RemoveMarkersMenuItem_Click);
|
||||
//
|
||||
// toolStripSeparator15
|
||||
//
|
||||
|
|
|
@ -238,6 +238,8 @@ namespace BizHawk.Client.EmuHawk
|
|||
var buttonName = TasView.PointedCell.Column;
|
||||
if (TasView.SelectedIndices.IndexOf(frame) != -1 && (buttonName == MarkerColumnName || buttonName == FrameColumnName))
|
||||
{
|
||||
//Disable the option to remove markers if no markers are selected (FCUEX does this).
|
||||
RemoveMarkersContextMenuItem.Enabled = _currentTasMovie.Markers.Any(m => TasView.SelectedIndices().Contains(m.Frame));
|
||||
RightClickMenu.Show(TasView, e.X, e.Y);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -800,6 +800,21 @@ namespace BizHawk.Client.EmuHawk
|
|||
}
|
||||
}
|
||||
|
||||
private void SetMarkersMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach(int index in TasView.SelectedIndices())
|
||||
{
|
||||
CallAddMarkerPopUp(index);
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveMarkersMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
_currentTasMovie.Markers.RemoveAll(m => TasView.SelectedIndices().Contains(m.Frame));
|
||||
RefreshDialog();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Config
|
||||
|
|
Loading…
Reference in New Issue