Переглянути джерело

Changed casing for Shortcut.

BDisp 4 роки тому
батько
коміт
6be3aab2ce

+ 26 - 26
Terminal.Gui/Core/ShortCutHelper.cs

@@ -9,30 +9,30 @@ namespace Terminal.Gui {
 	/// <summary>
 	/// Represents a helper to manipulate shortcut keys used on views.
 	/// </summary>
-	public class ShortCutHelper {
-		private Key shortCut;
+	public class ShortcutHelper {
+		private Key shortcut;
 
 		/// <summary>
 		/// This is the global setting that can be used as a global shortcut to invoke the action on the view.
 		/// </summary>
-		public virtual Key ShortCut {
-			get => shortCut;
+		public virtual Key Shortcut {
+			get => shortcut;
 			set {
-				if (shortCut != value && (PostShortCutValidation (value) || value == Key.Null)) {
-					shortCut = value;
+				if (shortcut != value && (PostShortcutValidation (value) || value == Key.Null)) {
+					shortcut = value;
 				}
 			}
 		}
 
 		/// <summary>
-		/// The keystroke combination used in the <see cref="ShortCut"/> as string.
+		/// The keystroke combination used in the <see cref="Shortcut"/> as string.
 		/// </summary>
-		public virtual ustring ShortCutTag => GetShortCutTag (shortCut);
+		public virtual ustring ShortcutTag => GetShortcutTag (shortcut);
 
 		/// <summary>
-		/// The action to run if the <see cref="ShortCut"/> is defined.
+		/// The action to run if the <see cref="Shortcut"/> is defined.
 		/// </summary>
-		public virtual Action ShortCutAction { get; set; }
+		public virtual Action ShortcutAction { get; set; }
 
 		/// <summary>
 		/// Gets the key with all the keys modifiers, especially the shift key that sometimes have to be injected later.
@@ -56,18 +56,18 @@ namespace Terminal.Gui {
 		}
 
 		/// <summary>
-		/// Get the <see cref="ShortCut"/> key as string.
+		/// Get the <see cref="Shortcut"/> key as string.
 		/// </summary>
-		/// <param name="shortCut">The shortcut key.</param>
+		/// <param name="shortcut">The shortcut key.</param>
 		/// <returns></returns>
-		public static ustring GetShortCutTag (Key shortCut)
+		public static ustring GetShortcutTag (Key shortcut)
 		{
-			if (shortCut == Key.Null) {
+			if (shortcut == Key.Null) {
 				return "";
 			}
 
-			var k = shortCut;
-			var delimiter = MenuBar.ShortCutDelimiter;
+			var k = shortcut;
+			var delimiter = MenuBar.ShortcutDelimiter;
 			ustring tag = ustring.Empty;
 			var sCut = GetKeyToString (k, out Key knm).ToString ();
 			if (knm == Key.Unknown) {
@@ -143,10 +143,10 @@ namespace Terminal.Gui {
 		}
 
 		/// <summary>
-		/// Allows to retrieve a <see cref="Key"/> from a <see cref="ShortCutTag"/>
+		/// Allows to retrieve a <see cref="Key"/> from a <see cref="ShortcutTag"/>
 		/// </summary>
 		/// <param name="tag">The key as string.</param>
-		public static Key GetShortCutFromTag (ustring tag)
+		public static Key GetShortcutFromTag (ustring tag)
 		{
 			var sCut = tag;
 			if (sCut.IsEmpty) {
@@ -155,7 +155,7 @@ namespace Terminal.Gui {
 
 			Key key = Key.Null;
 			//var hasCtrl = false;
-			var delimiter = MenuBar.ShortCutDelimiter;
+			var delimiter = MenuBar.ShortcutDelimiter;
 
 			ustring [] keys = sCut.Split (delimiter);
 			for (int i = 0; i < keys.Length; i++) {
@@ -204,7 +204,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// <param name="key">The key to validate.</param>
 		/// <returns><c>true</c> if is valid.<c>false</c>otherwise.</returns>
-		public static bool PreShortCutValidation (Key key)
+		public static bool PreShortcutValidation (Key key)
 		{
 			if ((key & (Key.CtrlMask | Key.ShiftMask | Key.AltMask)) == 0 && !CheckKeysFlagRange (key, Key.F1, Key.F12)) {
 				return false;
@@ -218,7 +218,7 @@ namespace Terminal.Gui {
 		/// </summary>
 		/// <param name="key">The key to validate.</param>
 		/// <returns><c>true</c> if is valid.<c>false</c>otherwise.</returns>
-		public static bool PostShortCutValidation (Key key)
+		public static bool PostShortcutValidation (Key key)
 		{
 			GetKeyToString (key, out Key knm);
 
@@ -230,12 +230,12 @@ namespace Terminal.Gui {
 		}
 
 		/// <summary>
-		/// Allows a view to run a <see cref="View.ShortCutAction"/> if defined.
+		/// Allows a view to run a <see cref="View.ShortcutAction"/> if defined.
 		/// </summary>
 		/// <param name="kb">The <see cref="KeyEvent"/></param>
 		/// <param name="view">The <see cref="View"/></param>
 		/// <returns><c>true</c> if defined <c>false</c>otherwise.</returns>
-		public static bool FindAndOpenByShortCut (KeyEvent kb, View view = null)
+		public static bool FindAndOpenByShortcut (KeyEvent kb, View view = null)
 		{
 			if (view == null) {
 				return false;			}
@@ -244,8 +244,8 @@ namespace Terminal.Gui {
 			var keys = GetModifiersKey (kb);
 			key |= (int)keys;
 			foreach (var v in view.Subviews) {
-				if (v.ShortCut != Key.Null && v.ShortCut == (Key)key) {
-					var action = v.ShortCutAction;
+				if (v.Shortcut != Key.Null && v.Shortcut == (Key)key) {
+					var action = v.ShortcutAction;
 					if (action != null) {
 						Application.MainLoop.AddIdle (() => {
 							action ();
@@ -254,7 +254,7 @@ namespace Terminal.Gui {
 					}
 					return true;
 				}
-				if (FindAndOpenByShortCut (kb, v)) {
+				if (FindAndOpenByShortcut (kb, v)) {
 					return true;
 				}
 			}

+ 1 - 1
Terminal.Gui/Core/Toplevel.cs

@@ -220,7 +220,7 @@ namespace Terminal.Gui {
 				return true;
 			}
 
-			if (ShortCutHelper.FindAndOpenByShortCut(keyEvent, this)) {
+			if (ShortcutHelper.FindAndOpenByShortcut(keyEvent, this)) {
 				return true;
 			}
 			return false;

+ 12 - 12
Terminal.Gui/Core/View.cs

@@ -125,7 +125,7 @@ namespace Terminal.Gui {
 
 		TextFormatter textFormatter;
 
-		ShortCutHelper shortCutHelper;
+		ShortcutHelper shortcutHelper;
 
 		/// <summary>
 		/// Event fired when a subview is being added to this view.
@@ -175,24 +175,24 @@ namespace Terminal.Gui {
 		/// <summary>
 		/// This is the global setting that can be used as a global shortcut to invoke an action if provided.
 		/// </summary>
-		public Key ShortCut {
-			get => shortCutHelper.ShortCut;
+		public Key Shortcut {
+			get => shortcutHelper.Shortcut;
 			set {
-				if (shortCutHelper.ShortCut != value && (ShortCutHelper.PostShortCutValidation (value) || value == Key.Null)) {
-					shortCutHelper.ShortCut = value;
+				if (shortcutHelper.Shortcut != value && (ShortcutHelper.PostShortcutValidation (value) || value == Key.Null)) {
+					shortcutHelper.Shortcut = value;
 				}
 			}
 		}
 
 		/// <summary>
-		/// The keystroke combination used in the <see cref="ShortCut"/> as string.
+		/// The keystroke combination used in the <see cref="Shortcut"/> as string.
 		/// </summary>
-		public ustring ShortCutTag => ShortCutHelper.GetShortCutTag (shortCutHelper.ShortCut);
+		public ustring ShortcutTag => ShortcutHelper.GetShortcutTag (shortcutHelper.Shortcut);
 
 		/// <summary>
-		/// The action to run if the <see cref="ShortCut"/> is defined.
+		/// The action to run if the <see cref="Shortcut"/> is defined.
 		/// </summary>
-		public virtual Action ShortCutAction { get; set; }
+		public virtual Action ShortcutAction { get; set; }
 
 		/// <summary>
 		/// Gets or sets arbitrary data for the view.
@@ -574,7 +574,7 @@ namespace Terminal.Gui {
 			textFormatter = new TextFormatter ();
 			this.Text = ustring.Empty;
 
-			shortCutHelper = new ShortCutHelper ();
+			shortcutHelper = new ShortcutHelper ();
 
 			this.Frame = frame;
 			LayoutStyle = LayoutStyle.Absolute;
@@ -639,7 +639,7 @@ namespace Terminal.Gui {
 			textFormatter = new TextFormatter ();
 			this.Text = text;
 
-			shortCutHelper = new ShortCutHelper ();
+			shortcutHelper = new ShortcutHelper ();
 		}
 
 		/// <summary>
@@ -661,7 +661,7 @@ namespace Terminal.Gui {
 			textFormatter = new TextFormatter ();
 			this.Text = text;
 
-			shortCutHelper = new ShortCutHelper ();
+			shortcutHelper = new ShortcutHelper ();
 
 			CanFocus = false;
 			TabIndex = -1;

+ 34 - 34
Terminal.Gui/Views/Menu.cs

@@ -5,7 +5,7 @@
 //   Miguel de Icaza ([email protected])
 //
 // TODO:
-//   Add accelerator support, but should also support chords (ShortCut in MenuItem)
+//   Add accelerator support, but should also support chords (Shortcut in MenuItem)
 //   Allow menus inside menus
 
 using System;
@@ -42,18 +42,18 @@ namespace Terminal.Gui {
 	public class MenuItem {
 		ustring title;
 
-		ShortCutHelper shortCutHelper;
+		ShortcutHelper shortcutHelper;
 
 		/// <summary>
 		/// Initializes a new instance of <see cref="MenuItem"/>
 		/// </summary>
-		public MenuItem (Key shortCut = Key.Null)
+		public MenuItem (Key shortcut = Key.Null)
 		{
 			Title = "";
 			Help = "";
-			shortCutHelper = new ShortCutHelper ();
-			if (shortCut != Key.Null) {
-				shortCutHelper.ShortCut = shortCut;
+			shortcutHelper = new ShortcutHelper ();
+			if (shortcut != Key.Null) {
+				shortcutHelper.Shortcut = shortcut;
 			}
 		}
 
@@ -65,43 +65,43 @@ namespace Terminal.Gui {
 		/// <param name="action">Action to invoke when the menu item is activated.</param>
 		/// <param name="canExecute">Function to determine if the action can currently be executed.</param>
 		/// <param name="parent">The <see cref="Parent"/> of this menu item.</param>
-		/// <param name="shortCut">The <see cref="ShortCut"/> keystroke combination.</param>
-		public MenuItem (ustring title, ustring help, Action action, Func<bool> canExecute = null, MenuItem parent = null, Key shortCut = Key.Null)
+		/// <param name="shortcut">The <see cref="Shortcut"/> keystroke combination.</param>
+		public MenuItem (ustring title, ustring help, Action action, Func<bool> canExecute = null, MenuItem parent = null, Key shortcut = Key.Null)
 		{
 			Title = title ?? "";
 			Help = help ?? "";
 			Action = action;
 			CanExecute = canExecute;
 			Parent = parent;
-			shortCutHelper = new ShortCutHelper ();
-			if (shortCut != Key.Null) {
-				shortCutHelper.ShortCut = shortCut;
+			shortcutHelper = new ShortcutHelper ();
+			if (shortcut != Key.Null) {
+				shortcutHelper.Shortcut = shortcut;
 			}
 		}
 
 		/// <summary>
 		/// The HotKey is used when the menu is active, the shortcut can be triggered when the menu is not active.
 		/// For example HotKey would be "N" when the File Menu is open (assuming there is a "_New" entry
-		/// if the ShortCut is set to "Control-N", this would be a global hotkey that would trigger as well
+		/// if the Shortcut is set to "Control-N", this would be a global hotkey that would trigger as well
 		/// </summary>
 		public Rune HotKey;
 
 		/// <summary>
-		/// This is the global setting that can be used as a global <see cref="ShortCutHelper.ShortCut"/> to invoke the action on the menu.
+		/// This is the global setting that can be used as a global <see cref="ShortcutHelper.Shortcut"/> to invoke the action on the menu.
 		/// </summary>
-		public Key ShortCut {
-			get => shortCutHelper.ShortCut;
+		public Key Shortcut {
+			get => shortcutHelper.Shortcut;
 			set {
-				if (shortCutHelper.ShortCut != value && (ShortCutHelper.PostShortCutValidation (value) || value == Key.Null)) {
-					shortCutHelper.ShortCut = value;
+				if (shortcutHelper.Shortcut != value && (ShortcutHelper.PostShortcutValidation (value) || value == Key.Null)) {
+					shortcutHelper.Shortcut = value;
 				}
 			}
 		}
 
 		/// <summary>
-		/// The keystroke combination used in the <see cref="ShortCutHelper.ShortCutTag"/> as string.
+		/// The keystroke combination used in the <see cref="ShortcutHelper.ShortcutTag"/> as string.
 		/// </summary>
-		public ustring ShortCutTag => ShortCutHelper.GetShortCutTag (shortCutHelper.ShortCut);
+		public ustring ShortcutTag => ShortcutHelper.GetShortcutTag (shortcutHelper.Shortcut);
 
 		/// <summary>
 		/// Gets or sets the title.
@@ -145,7 +145,7 @@ namespace Terminal.Gui {
 
 		internal int Width => Title.RuneCount + Help.RuneCount + 1 + 2 +
 			(Checked || CheckType.HasFlag (MenuItemCheckStyle.Checked) || CheckType.HasFlag (MenuItemCheckStyle.Radio) ? 2 : 0) +
-			(ShortCutTag.RuneCount > 0 ? ShortCutTag.RuneCount + 2 : 0);
+			(ShortcutTag.RuneCount > 0 ? ShortcutTag.RuneCount + 2 : 0);
 
 		/// <summary>
 		/// Sets or gets whether the <see cref="MenuItem"/> shows a check indicator or not. See <see cref="MenuItemCheckStyle"/>.
@@ -459,15 +459,15 @@ namespace Terminal.Gui {
 					       i == current ? ColorScheme.Focus : ColorScheme.Normal);
 
 				// The help string
-				var l = item.ShortCutTag.RuneCount == 0 ? item.Help.RuneCount : item.Help.RuneCount + item.ShortCutTag.RuneCount + 2;
+				var l = item.ShortcutTag.RuneCount == 0 ? item.Help.RuneCount : item.Help.RuneCount + item.ShortcutTag.RuneCount + 2;
 				Move (Frame.Width - l - 2, 1 + i);
 				Driver.AddStr (item.Help);
 
 				// The shortcut tag string
-				if (!item.ShortCutTag.IsEmpty) {
-					l = item.ShortCutTag.RuneCount;
+				if (!item.ShortcutTag.IsEmpty) {
+					l = item.ShortcutTag.RuneCount;
 					Move (Frame.Width - l - 2, 1 + i);
-					Driver.AddStr (item.ShortCutTag);
+					Driver.AddStr (item.ShortcutTag);
 				}
 			}
 			PositionCursor ();
@@ -754,15 +754,15 @@ namespace Terminal.Gui {
 		/// </summary>
 		public bool UseKeysUpDownAsKeysLeftRight { get; set; } = true;
 
-		static ustring shortCutDelimiter = "+";
+		static ustring shortcutDelimiter = "+";
 		/// <summary>
 		/// Used for change the shortcut delimiter separator.
 		/// </summary>
-		public static ustring ShortCutDelimiter {
-			get => shortCutDelimiter;
+		public static ustring ShortcutDelimiter {
+			get => shortcutDelimiter;
 			set {
-				if (shortCutDelimiter != value) {
-					shortCutDelimiter = value == ustring.Empty ? " " : value;
+				if (shortcutDelimiter != value) {
+					shortcutDelimiter = value == ustring.Empty ? " " : value;
 				}
 			}
 		}
@@ -1321,21 +1321,21 @@ namespace Terminal.Gui {
 			return false;
 		}
 
-		internal bool FindAndOpenMenuByShortCut (KeyEvent kb, MenuItem [] children = null)
+		internal bool FindAndOpenMenuByShortcut (KeyEvent kb, MenuItem [] children = null)
 		{
 			if (children == null) {
 				children = Menus;
 			}
 
 			var key = kb.KeyValue;
-			var keys = ShortCutHelper.GetModifiersKey (kb);
+			var keys = ShortcutHelper.GetModifiersKey (kb);
 			key |= (int)keys;
 			for (int i = 0; i < children.Length; i++) {
 				var mi = children [i];
 				if (mi == null) {
 					continue;
 				}
-				if ((!(mi is MenuBarItem mbiTopLevel) || mbiTopLevel.IsTopLevel) && mi.ShortCut != Key.Null && mi.ShortCut == (Key)key) {
+				if ((!(mi is MenuBarItem mbiTopLevel) || mbiTopLevel.IsTopLevel) && mi.Shortcut != Key.Null && mi.Shortcut == (Key)key) {
 					var action = mi.Action;
 					if (action != null) {
 						Application.MainLoop.AddIdle (() => {
@@ -1345,7 +1345,7 @@ namespace Terminal.Gui {
 					}
 					return true;
 				}
-				if (mi is MenuBarItem menuBarItem && !menuBarItem.IsTopLevel && FindAndOpenMenuByShortCut (kb, menuBarItem.Children)) {
+				if (mi is MenuBarItem menuBarItem && !menuBarItem.IsTopLevel && FindAndOpenMenuByShortcut (kb, menuBarItem.Children)) {
 					return true;
 				}
 			}
@@ -1456,7 +1456,7 @@ namespace Terminal.Gui {
 		///<inheritdoc/>
 		public override bool ProcessColdKey (KeyEvent kb)
 		{
-			return FindAndOpenMenuByShortCut (kb);
+			return FindAndOpenMenuByShortcut (kb);
 		}
 
 		///<inheritdoc/>

+ 1 - 1
Terminal.Gui/Views/TextField.cs

@@ -345,7 +345,7 @@ namespace Terminal.Gui {
 			// Needed for the Elmish Wrapper issue https://github.com/DieselMeister/Terminal.Gui.Elmish/issues/2
 			var oldCursorPos = point;
 
-			switch (ShortCutHelper.GetModifiersKey (kb)) {
+			switch (ShortcutHelper.GetModifiersKey (kb)) {
 			case Key.DeleteChar:
 			case Key.D | Key.CtrlMask:
 				if (ReadOnly)

+ 46 - 46
UICatalog/Scenarios/DynamicMenuBar.cs

@@ -41,7 +41,7 @@ namespace UICatalog {
 		public bool isTopLevel;
 		public bool hasSubMenu;
 		public MenuItemCheckStyle checkStyle;
-		public ustring shortCut;
+		public ustring shortcut;
 
 		public DynamicMenuItem () { }
 
@@ -51,7 +51,7 @@ namespace UICatalog {
 			this.hasSubMenu = hasSubMenu;
 		}
 
-		public DynamicMenuItem (ustring title, ustring help, ustring action, bool isTopLevel, bool hasSubMenu, MenuItemCheckStyle checkStyle = MenuItemCheckStyle.NoCheck, ustring shortCut = null)
+		public DynamicMenuItem (ustring title, ustring help, ustring action, bool isTopLevel, bool hasSubMenu, MenuItemCheckStyle checkStyle = MenuItemCheckStyle.NoCheck, ustring shortcut = null)
 		{
 			this.title = title;
 			this.help = help;
@@ -59,7 +59,7 @@ namespace UICatalog {
 			this.isTopLevel = isTopLevel;
 			this.hasSubMenu = hasSubMenu;
 			this.checkStyle = checkStyle;
-			this.shortCut = shortCut;
+			this.shortcut = shortcut;
 		}
 	}
 
@@ -76,18 +76,18 @@ namespace UICatalog {
 		{
 			DataContext = new DynamicMenuItemModel ();
 
-			var _frmDelimiter = new FrameView ("ShortCut Delimiter:") {
+			var _frmDelimiter = new FrameView ("Shortcut Delimiter:") {
 				X = Pos.Center (),
 				Y = 3,
 				Width = 25,
 				Height = 4
 			};
 
-			var _txtDelimiter = new TextField (MenuBar.ShortCutDelimiter.ToString ()) {
+			var _txtDelimiter = new TextField (MenuBar.ShortcutDelimiter.ToString ()) {
 				X = Pos.Center(),
 				Width = 2,
 			};
-			_txtDelimiter.TextChanged += (_) => MenuBar.ShortCutDelimiter = _txtDelimiter.Text;
+			_txtDelimiter.TextChanged += (_) => MenuBar.ShortcutDelimiter = _txtDelimiter.Text;
 			_frmDelimiter.Add (_txtDelimiter);
 
 			Add (_frmDelimiter);
@@ -315,7 +315,7 @@ namespace UICatalog {
 						_frmMenuDetails._rbChkStyle.SelectedItem == 0 ? MenuItemCheckStyle.NoCheck :
 						_frmMenuDetails._rbChkStyle.SelectedItem == 1 ? MenuItemCheckStyle.Checked :
 						MenuItemCheckStyle.Radio,
-						_frmMenuDetails._txtShortCut.Text);
+						_frmMenuDetails._txtShortcut.Text);
 					UpdateMenuItem (_currentEditMenuBarItem, menuItem, _lstMenus.SelectedItem);
 				}
 			};
@@ -563,14 +563,14 @@ namespace UICatalog {
 					newMenu = new MenuItem (item.title, item.help, null, null, parent);
 					newMenu.CheckType = item.checkStyle;
 					newMenu.Action = _frmMenuDetails.CreateAction (newMenu, item);
-					newMenu.ShortCut = ShortCutHelper.GetShortCutFromTag (item.shortCut);
+					newMenu.Shortcut = ShortcutHelper.GetShortcutFromTag (item.shortcut);
 				} else if (item.isTopLevel) {
 					newMenu = new MenuBarItem (item.title, item.help, null);
 					newMenu.Action = _frmMenuDetails.CreateAction (newMenu, item);
 				} else {
 					newMenu = new MenuBarItem (item.title, item.help, null);
 					((MenuBarItem)newMenu).Children [0].Action = _frmMenuDetails.CreateAction (newMenu, item);
-					((MenuBarItem)newMenu).Children [0].ShortCut = ShortCutHelper.GetShortCutFromTag (item.shortCut);
+					((MenuBarItem)newMenu).Children [0].Shortcut = ShortcutHelper.GetShortcutFromTag (item.shortcut);
 				}
 
 				return newMenu;
@@ -608,7 +608,7 @@ namespace UICatalog {
 						DataContext.Menus = new List<DynamicMenuItemList> ();
 					}
 					_currentEditMenuBarItem.Action = _frmMenuDetails.CreateAction (_currentEditMenuBarItem, menuItem);
-					_currentEditMenuBarItem.ShortCut = ShortCutHelper.GetShortCutFromTag (menuItem.shortCut);
+					_currentEditMenuBarItem.Shortcut = ShortcutHelper.GetShortcutFromTag (menuItem.shortcut);
 				}
 
 				if (_currentEditMenuBarItem.Parent == null) {
@@ -636,7 +636,7 @@ namespace UICatalog {
 		public CheckBox _ckbIsTopLevel;
 		public CheckBox _ckbSubMenu;
 		public RadioGroup _rbChkStyle;
-		public TextField _txtShortCut;
+		public TextField _txtShortcut;
 
 		bool hasParent;
 
@@ -708,25 +708,25 @@ namespace UICatalog {
 			};
 			Add (_rbChkStyle);
 
-			var _lblShortCut = new Label ("ShortCut:") {
+			var _lblShortcut = new Label ("Shortcut:") {
 				X = Pos.Right (_ckbSubMenu) + 10,
 				Y = Pos.Top (_ckbSubMenu)
 			};
-			Add (_lblShortCut);
+			Add (_lblShortcut);
 
-			_txtShortCut = new TextField () {
-				X = Pos.X (_lblShortCut),
-				Y = Pos.Bottom (_lblShortCut),
+			_txtShortcut = new TextField () {
+				X = Pos.X (_lblShortcut),
+				Y = Pos.Bottom (_lblShortcut),
 				Width = Dim.Fill (),
 				ReadOnly = true
 			};
-			_txtShortCut.KeyDown += (e) => {
+			_txtShortcut.KeyDown += (e) => {
 				if (!ProcessKey (e.KeyEvent)) {
 					return;
 				}
 
-				var k = ShortCutHelper.GetModifiersKey (e.KeyEvent);
-				if (CheckShortCut (k, true)) {
+				var k = ShortcutHelper.GetModifiersKey (e.KeyEvent);
+				if (CheckShortcut (k, true)) {
 					e.Handled = true;
 				}
 			};
@@ -744,41 +744,41 @@ namespace UICatalog {
 				return true;
 			}
 
-			bool CheckShortCut (Key k, bool pre)
+			bool CheckShortcut (Key k, bool pre)
 			{
 				var m = _menuItem != null ? _menuItem : new MenuItem ();
-				if (pre && !ShortCutHelper.PreShortCutValidation (k)) {
-					_txtShortCut.Text = "";
+				if (pre && !ShortcutHelper.PreShortcutValidation (k)) {
+					_txtShortcut.Text = "";
 					return false;
 				}
 				if (!pre) {
-					if (!ShortCutHelper.PostShortCutValidation (ShortCutHelper.GetShortCutFromTag (_txtShortCut.Text))) {
-						_txtShortCut.Text = "";
+					if (!ShortcutHelper.PostShortcutValidation (ShortcutHelper.GetShortcutFromTag (_txtShortcut.Text))) {
+						_txtShortcut.Text = "";
 						return false;
 					}
 					return true;
 				}
-				_txtShortCut.Text = ShortCutHelper.GetShortCutTag (k);
+				_txtShortcut.Text = ShortcutHelper.GetShortcutTag (k);
 
 				return true;
 			}
 
-			_txtShortCut.KeyUp += (e) => {
-				var k = ShortCutHelper.GetModifiersKey (e.KeyEvent);
-				if (CheckShortCut (k, false)) {
+			_txtShortcut.KeyUp += (e) => {
+				var k = ShortcutHelper.GetModifiersKey (e.KeyEvent);
+				if (CheckShortcut (k, false)) {
 					e.Handled = true;
 				}
 			};
-			Add (_txtShortCut);
+			Add (_txtShortcut);
 
-			var _btnShortCut = new Button ("Clear ShortCut") {
-				X = Pos.X (_lblShortCut),
-				Y = Pos.Bottom (_txtShortCut) + 1
+			var _btnShortcut = new Button ("Clear Shortcut") {
+				X = Pos.X (_lblShortcut),
+				Y = Pos.Bottom (_txtShortcut) + 1
 			};
-			_btnShortCut.Clicked += () => {
-				_txtShortCut.Text = "";
+			_btnShortcut.Clicked += () => {
+				_txtShortcut.Text = "";
 			};
-			Add (_btnShortCut);
+			Add (_btnShortcut);
 
 			_ckbIsTopLevel.Toggled += (e) => {
 				if ((_menuItem != null && _menuItem.Parent != null && _ckbIsTopLevel.Checked) ||
@@ -792,12 +792,12 @@ namespace UICatalog {
 					_ckbSubMenu.SetNeedsDisplay ();
 					_txtHelp.CanFocus = true;
 					_txtAction.CanFocus = true;
-					_txtShortCut.CanFocus = !_ckbIsTopLevel.Checked && !_ckbSubMenu.Checked;
+					_txtShortcut.CanFocus = !_ckbIsTopLevel.Checked && !_ckbSubMenu.Checked;
 				} else {
 					if (_menuItem == null && !hasParent || _menuItem.Parent == null) {
 						_ckbSubMenu.Checked = true;
 						_ckbSubMenu.SetNeedsDisplay ();
-						_txtShortCut.CanFocus = false;
+						_txtShortcut.CanFocus = false;
 					}
 					_txtHelp.Text = "";
 					_txtHelp.CanFocus = false;
@@ -813,17 +813,17 @@ namespace UICatalog {
 					_txtHelp.CanFocus = false;
 					_txtAction.Text = "";
 					_txtAction.CanFocus = false;
-					_txtShortCut.Text = "";
-					_txtShortCut.CanFocus = false;
+					_txtShortcut.Text = "";
+					_txtShortcut.CanFocus = false;
 				} else {
 					if (!hasParent) {
 						_ckbIsTopLevel.Checked = true;
 						_ckbIsTopLevel.SetNeedsDisplay ();
-						_txtShortCut.CanFocus = false;
+						_txtShortcut.CanFocus = false;
 					}
 					_txtHelp.CanFocus = true;
 					_txtAction.CanFocus = true;
-					_txtShortCut.CanFocus = !_ckbIsTopLevel.Checked && !_ckbSubMenu.Checked;
+					_txtShortcut.CanFocus = !_ckbIsTopLevel.Checked && !_ckbSubMenu.Checked;
 				}
 			};
 
@@ -845,7 +845,7 @@ namespace UICatalog {
 				_ckbSubMenu.Checked = !hasParent;
 				_txtHelp.CanFocus = hasParent;
 				_txtAction.CanFocus = hasParent;
-				_txtShortCut.CanFocus = hasParent;
+				_txtShortcut.CanFocus = hasParent;
 			} else {
 				EditMenuBarItem (_menuItem);
 			}
@@ -881,7 +881,7 @@ namespace UICatalog {
 					_ckbSubMenu != null ? _ckbSubMenu.Checked : false,
 					_rbChkStyle.SelectedItem == 0 ? MenuItemCheckStyle.NoCheck :
 					_rbChkStyle.SelectedItem == 1 ? MenuItemCheckStyle.Checked : MenuItemCheckStyle.Radio,
-					_txtShortCut.Text);
+					_txtShortcut.Text);
 			} else {
 				return null;
 			}
@@ -907,8 +907,8 @@ namespace UICatalog {
 			_txtHelp.CanFocus = !_ckbSubMenu.Checked;
 			_txtAction.CanFocus = !_ckbSubMenu.Checked;
 			_rbChkStyle.SelectedItem = (int)(menuItem?.CheckType ?? MenuItemCheckStyle.NoCheck);
-			_txtShortCut.Text = menuItem?.ShortCutTag ?? "";
-			_txtShortCut.CanFocus = !_ckbIsTopLevel.Checked && !_ckbSubMenu.Checked;
+			_txtShortcut.Text = menuItem?.ShortcutTag ?? "";
+			_txtShortcut.CanFocus = !_ckbIsTopLevel.Checked && !_ckbSubMenu.Checked;
 		}
 
 		void CleanEditMenuBarItem ()
@@ -919,7 +919,7 @@ namespace UICatalog {
 			_ckbIsTopLevel.Checked = false;
 			_ckbSubMenu.Checked = false;
 			_rbChkStyle.SelectedItem = (int)MenuItemCheckStyle.NoCheck;
-			_txtShortCut.Text = "";
+			_txtShortcut.Text = "";
 		}
 
 		ustring GetTargetAction (Action action)

+ 8 - 8
UICatalog/UICatalog.cs

@@ -174,10 +174,10 @@ namespace UICatalog {
 				Width = 25,
 				Height = Dim.Fill (1),
 				CanFocus = false,
-				ShortCut = Key.CtrlMask | Key.C
+				Shortcut = Key.CtrlMask | Key.C
 			};
-			_leftPane.Title = $"{_leftPane.Title} ({_leftPane.ShortCutTag})";
-			_leftPane.ShortCutAction = () => _leftPane.SetFocus ();
+			_leftPane.Title = $"{_leftPane.Title} ({_leftPane.ShortcutTag})";
+			_leftPane.ShortcutAction = () => _leftPane.SetFocus ();
 
 			_categories = Scenario.GetAllCategories ().OrderBy (c => c).ToList ();
 			_categoryListView = new ListView (_categories) {
@@ -200,10 +200,10 @@ namespace UICatalog {
 				Width = Dim.Fill (),
 				Height = Dim.Fill (1),
 				CanFocus = true,
-				ShortCut = Key.CtrlMask | Key.S
+				Shortcut = Key.CtrlMask | Key.S
 			};
-			_rightPane.Title = $"{_rightPane.Title} ({_rightPane.ShortCutTag})";
-			_rightPane.ShortCutAction = () => _rightPane.SetFocus ();
+			_rightPane.Title = $"{_rightPane.Title} ({_rightPane.ShortcutTag})";
+			_rightPane.ShortcutAction = () => _rightPane.SetFocus ();
 
 			_nameColumnWidth = Scenario.ScenarioMetadata.GetName (_scenarios.OrderByDescending (t => Scenario.ScenarioMetadata.GetName (t).Length).FirstOrDefault ()).Length;
 
@@ -276,7 +276,7 @@ namespace UICatalog {
 			{
 				var mi = new MenuItem ();
 				mi.Title = menuItem;
-				mi.ShortCut = Key.AltMask + index.ToString () [0];
+				mi.Shortcut = Key.AltMask + index.ToString () [0];
 				index++;
 				mi.CheckType |= MenuItemCheckStyle.Checked;
 				mi.Checked = checkFunction ();
@@ -323,7 +323,7 @@ namespace UICatalog {
 			foreach (var sc in Colors.ColorSchemes) {
 				var item = new MenuItem ();
 				item.Title = $"_{sc.Key}";
-				item.ShortCut = Key.AltMask | (Key)sc.Key.Substring (0, 1) [0];
+				item.Shortcut = Key.AltMask | (Key)sc.Key.Substring (0, 1) [0];
 				item.CheckType |= MenuItemCheckStyle.Radio;
 				item.Checked = sc.Value == _baseColorScheme;
 				item.Action += () => {