Input Roll - add a method that generates built in context menu items (for now just a separator and a rotate menu item), add rotate as a hotkey Ctrl+Shift+F, note: this is built into input roll, it can conflict with mapped hotkeys since tastudio sends input to the mainform! Need to deal with that at some point, in the meantime that's an unlikely key combo. Still todo: a tastudio menu item for rotate, and fix the context menu in horizontal orientation

This commit is contained in:
adelikat 2014-10-15 16:50:51 +00:00
parent b87177a0b5
commit c14028d6c8
2 changed files with 33 additions and 2 deletions

View File

@ -405,7 +405,8 @@ namespace BizHawk.Client.EmuHawk
/// Sets the width of data cells when in Horizontal orientation. /// Sets the width of data cells when in Horizontal orientation.
/// </summary> /// </summary>
/// <param name="maxLength">The maximum number of characters the column will support in Horizontal orientation.</param> /// <param name="maxLength">The maximum number of characters the column will support in Horizontal orientation.</param>
public int MaxCharactersInHorizontal{ public int MaxCharactersInHorizontal
{
get get
{ {
return _maxCharactersInHorizontal; return _maxCharactersInHorizontal;
@ -537,6 +538,25 @@ namespace BizHawk.Client.EmuHawk
} }
} }
public IEnumerable<ToolStripItem> GenerateContextMenuItems()
{
yield return new ToolStripSeparator();
var rotate = new ToolStripMenuItem
{
Name = "RotateMenuItem",
Text = "Rotate",
ShortcutKeyDisplayString = "Ctrl+Shift+F",
};
rotate.Click += (o, ev) =>
{
this.HorizontalOrientation ^= true;
};
yield return rotate;
}
#endregion #endregion
#region Paint #region Paint
@ -1227,6 +1247,16 @@ namespace BizHawk.Client.EmuHawk
} }
} }
protected override void OnKeyDown(KeyEventArgs e)
{
if (e.Control && !e.Alt && e.Shift && e.KeyCode == Keys.F) // Ctrl+Shift+F
{
HorizontalOrientation ^= true;
}
base.OnKeyDown(e);
}
#endregion #endregion
#region Change Events #region Change Events

View File

@ -1132,6 +1132,7 @@ namespace BizHawk.Client.EmuHawk
LoadConfigSettings(); LoadConfigSettings();
SetColumnsFromCurrentStickies(); SetColumnsFromCurrentStickies();
RightClickMenu.Items.AddRange(TasView.GenerateContextMenuItems().ToArray());
RefreshDialog(); RefreshDialog();
} }
@ -1166,7 +1167,7 @@ namespace BizHawk.Client.EmuHawk
private void RightClickMenu_Opened(object sender, EventArgs e) private void RightClickMenu_Opened(object sender, EventArgs e)
{ {
RemoveMarkersContextMenuItem.Enabled = _currentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCUEX does this). RemoveMarkersContextMenuItem.Enabled = _currentTasMovie.Markers.Any(m => TasView.SelectedRows.Contains(m.Frame)); // Disable the option to remove markers if no markers are selected (FCEUX does this).
} }
#endregion #endregion