Browse Source

Use "+" in serialized shortcut strings. Fix python binding tests

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@4149 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts^2
Sergej Andrejev 16 years ago
parent
commit
a0454e65b8
  1. 42
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 2
      src/AddIns/BackendBindings/Python/PythonBinding/Test/AddInFileTestFixture.cs
  3. 2
      src/AddIns/DisplayBindings/HexEditor/Project/HexEditor.addin
  4. 20
      src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin
  5. 2
      src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin
  6. 39
      src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.addin
  7. 2
      src/Main/Base/Project/Src/Internal/Doozers/PadDoozer.cs
  8. 2
      src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/MenuItemDoozer.cs
  9. 8
      src/Main/ICSharpCode.Core.WinForms/Menu/MenuCommand.cs

42
AddIns/ICSharpCode.SharpDevelop.addin

@ -1231,7 +1231,7 @@ @@ -1231,7 +1231,7 @@
<MenuItem id = "File"
label = "${res:XML.MainMenu.FileMenu.New.File}"
icon = "Icons.16x16.NewDocumentIcon"
shortcut = "Control|N"
shortcut = "Ctrl+N"
class = "ICSharpCode.SharpDevelop.Commands.CreateNewFile"/>
<MenuItem id = "Project"
@ -1246,7 +1246,7 @@ @@ -1246,7 +1246,7 @@
<MenuItem id = "File"
label = "${res:XML.MainMenu.FileMenu.Open.File}"
icon = "Icons.16x16.OpenFileIcon"
shortcut = "Control|O"
shortcut = "Ctrl+O"
class = "ICSharpCode.SharpDevelop.Commands.OpenFile"/>
<MenuItem id = "Project"
@ -1261,7 +1261,7 @@ @@ -1261,7 +1261,7 @@
<MenuItem id = "CloseFile"
label = "${res:XML.MainMenu.FileMenu.Close.File}"
icon = "Icons.16x16.CloseFileIcon"
shortcut = "Control|F4"
shortcut = "Ctrl+F4"
class ="ICSharpCode.SharpDevelop.Commands.CloseFile"/>
</Condition>
<Condition name = "SolutionOpen" action="Disable">
@ -1286,7 +1286,7 @@ @@ -1286,7 +1286,7 @@
<MenuItem id = "Save"
label = "${res:XML.MainMenu.FileMenu.Save}"
icon = "Icons.16x16.SaveIcon"
shortcut = "Control|S"
shortcut = "Ctrl+S"
class = "ICSharpCode.SharpDevelop.Commands.SaveFile"/>
</Condition>
@ -1309,7 +1309,7 @@ @@ -1309,7 +1309,7 @@
<MenuItem id = "Print"
label = "${res:XML.MainMenu.FileMenu.Print}"
icon = "Icons.16x16.Print"
shortcut = "Control|P"
shortcut = "Ctrl+P"
class = "ICSharpCode.SharpDevelop.Commands.Print"/>
<MenuItem id = "PrintPreview"
label = "${res:XML.MainMenu.FileMenu.PrintPreview}"
@ -1346,32 +1346,32 @@ @@ -1346,32 +1346,32 @@
label = "${res:XML.MainMenu.EditMenu.Undo}"
icon = "Icons.16x16.UndoIcon"
type = "Item"
shortcut = "Control|Z"
shortcut = "Ctrl+Z"
command = "ApplicationCommands.Undo"/>
<MenuItem id = "Redo"
label = "${res:XML.MainMenu.EditMenu.Redo}"
icon = "Icons.16x16.RedoIcon"
type = "Item"
shortcut = "Control|Y"
shortcut = "Ctrl+Y"
command = "ApplicationCommands.Redo"/>
<MenuItem id = "Separator1" type = "Separator" />
<MenuItem id = "Cut"
label = "${res:XML.MainMenu.EditMenu.Cut}"
icon = "Icons.16x16.CutIcon"
type = "Item"
shortcut = "Control|X"
shortcut = "Ctrl+X"
command = "ApplicationCommands.Cut"/>
<MenuItem id = "Copy"
label = "${res:XML.MainMenu.EditMenu.Copy}"
icon = "Icons.16x16.CopyIcon"
type = "Item"
shortcut = "Control|C"
shortcut = "Ctrl+C"
command = "ApplicationCommands.Copy"/>
<MenuItem id = "Paste"
label = "${res:XML.MainMenu.EditMenu.Paste}"
icon = "Icons.16x16.PasteIcon"
type = "Item"
shortcut = "Control|V"
shortcut = "Ctrl+V"
command = "ApplicationCommands.Paste"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"
@ -1402,7 +1402,7 @@ @@ -1402,7 +1402,7 @@
<MenuItem id = "SelectAll"
label = "${res:XML.MainMenu.EditMenu.SelectAll}"
type = "Item"
shortcut = "Control|A"
shortcut = "Ctrl+A"
command = "ApplicationCommands.SelectAll"/>
<MenuItem id = "Separator4" type = "Separator" />
<ComplexCondition action="Disable">
@ -1567,7 +1567,7 @@ @@ -1567,7 +1567,7 @@
<MenuItem id = "RunWithoutDebugger"
label = "${res:XML.MainMenu.DebugMenu.RunWithoutDebug}"
icon = "Icons.16x16.Debug.StartWithoutDebugging"
shortcut = "Control|F5"
shortcut = "Ctrl+F5"
class = "ICSharpCode.SharpDevelop.Project.Commands.ExecuteWithoutDebugger"
command = "SDDebugCommands.ExecuteWithoutDebugger" />
</Condition>
@ -1693,7 +1693,7 @@ @@ -1693,7 +1693,7 @@
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.GenerateCodeAction"/>
<MenuItem id = "ShowQuickHelp"
label = "${res:XML.MainMenu.ToolMenu.QuickXmlDoc}"
shortcut = "Control|Q"
shortcut = "Ctrl+Q"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.QuickDocumentation"/>
</Condition>
@ -1710,7 +1710,7 @@ @@ -1710,7 +1710,7 @@
<MenuItem id = "NextWindow"
label = "${res:XML.MainMenu.WindowMenu.NxtWindow}"
icon = "Icons.16x16.NextWindowIcon"
shortcut = "Control|Tab"
shortcut = "Ctrl+Tab"
class = "ICSharpCode.SharpDevelop.Commands.SelectNextWindow" />
<MenuItem id = "PrevWindow"
label = "${res:XML.MainMenu.WindowMenu.PrvWindow}"
@ -1857,7 +1857,7 @@ @@ -1857,7 +1857,7 @@
<MenuItem id = "Save"
label = "${res:XML.MainMenu.FileMenu.Save}"
icon = "Icons.16x16.SaveIcon"
shortcut = "Control|S"
shortcut = "Ctrl+S"
class = "ICSharpCode.SharpDevelop.Commands.SaveFile"/>
<MenuItem id = "SaveAs"
label = "${res:XML.MainMenu.FileMenu.SaveAs}"
@ -1878,7 +1878,7 @@ @@ -1878,7 +1878,7 @@
class= "ICSharpCode.SharpDevelop.DefaultEditor.Commands.CommentRegion"/>
<MenuItem id = "Indent"
label = "${res:XML.TextAreaContextMenu.Indent}"
shortcut = "Control|I"
shortcut = "Ctrl+I"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.IndentSelection" />
<MenuItem id = "FileMode" label = "${res:XML.TextAreaContextMenu.FileMode}" type="Menu">
@ -1933,7 +1933,7 @@ @@ -1933,7 +1933,7 @@
<MenuItem id = "Search" insertafter ="View" insertbefore ="Tools" label = "${res:XML.MainMenu.SearchMenu}" type="Menu">
<MenuItem id = "SearchIncremental"
label = "${res:XML.MainMenu.SearchMenu.IncrementalSearch}"
shortcut = "Control|E"
shortcut = "Ctrl+E"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.RunIncrementalSearch"/>
<MenuItem id = "SearchReverseIncremental"
label = "${res:XML.MainMenu.SearchMenu.ReverseIncrementalSearch}"
@ -1943,7 +1943,7 @@ @@ -1943,7 +1943,7 @@
<!-- <Condition name = "WindowActive" activewindow="ICSharpCode.SharpDevelop.DefaultEditor.Gui.Editor.ITextEditorControlProvider" action="Disable"> -->
<MenuItem id = "ToggleBookmark"
label = "${res:XML.MainMenu.SearchMenu.ToggleBookmark}"
shortcut = "Control|F2"
shortcut = "Ctrl+F2"
icon = "Bookmarks.ToggleMark"
class = "ICSharpCode.SharpDevelop.Bookmarks.ToggleBookmark"/>
<MenuItem id = "PrevBookmark"
@ -1963,12 +1963,12 @@ @@ -1963,12 +1963,12 @@
<MenuItem id = "Separator2" type = "Separator" />
<MenuItem id = "GotoLineNr"
label = "${res:XML.MainMenu.SearchMenu.GotoLineNr}"
shortcut = "Control|G"
shortcut = "Ctrl+G"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.GotoLineNumber"/>
<MenuItem id = "Separator3" type = "Separator" />
<MenuItem id = "GotoBrace"
label = "${res:XML.MainMenu.SearchMenu.GotoBrace}"
shortcut = "Control|B"
shortcut = "Ctrl+B"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.GotoMatchingBrace"/>
<!-- </Condition> -->
</MenuItem>
@ -2024,7 +2024,7 @@ @@ -2024,7 +2024,7 @@
class= "ICSharpCode.SharpDevelop.DefaultEditor.Commands.CommentRegion"/>
<MenuItem id = "Indent"
label = "${res:XML.TextAreaContextMenu.Indent}"
shortcut = "Control|I"
shortcut = "Ctrl+I"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.IndentSelection" />
</Condition>
</MenuItem>

2
src/AddIns/BackendBindings/Python/PythonBinding/Test/AddInFileTestFixture.cs

@ -274,7 +274,7 @@ namespace PythonBinding.Tests @@ -274,7 +274,7 @@ namespace PythonBinding.Tests
[Test]
public void PythonRunMenuItemShortcut()
{
Assert.AreEqual("Control|Shift|R", pythonRunMenuItemCodon["shortcut"]);
Assert.AreEqual("Ctrl+Shift+R", pythonRunMenuItemCodon["shortcut"]);
}
[Test]

2
src/AddIns/DisplayBindings/HexEditor/Project/HexEditor.addin

@ -40,7 +40,7 @@ @@ -40,7 +40,7 @@
<MenuItem id = "Save"
label = "${res:XML.MainMenu.FileMenu.Save}"
icon = "Icons.16x16.SaveIcon"
shortcut = "Control|S"
shortcut = "Ctrl+S"
class = "ICSharpCode.SharpDevelop.Commands.SaveFile"/>
<MenuItem id = "SaveAs"
label = "${res:XML.MainMenu.FileMenu.SaveAs}"

20
src/AddIns/DisplayBindings/XmlEditor/Project/XmlEditor.addin

@ -96,17 +96,17 @@ @@ -96,17 +96,17 @@
<MenuItem id = "Cut"
label = "${res:XML.TextAreaContextMenu.Cut}"
icon = "Icons.16x16.CutIcon"
shortcut = "Control|X"
shortcut = "Ctrl+X"
class = "ICSharpCode.SharpDevelop.Commands.Cut"/>
<MenuItem id = "Copy"
label = "${res:XML.TextAreaContextMenu.Copy}"
icon = "Icons.16x16.CopyIcon"
shortcut = "Control|C"
shortcut = "Ctrl+C"
class = "ICSharpCode.SharpDevelop.Commands.Copy"/>
<MenuItem id = "Paste"
label = "${res:XML.TextAreaContextMenu.Paste}"
icon = "Icons.16x16.PasteIcon"
shortcut = "Control|V"
shortcut = "Ctrl+V"
class = "ICSharpCode.SharpDevelop.Commands.Paste"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"
@ -116,7 +116,7 @@ @@ -116,7 +116,7 @@
<MenuItem id = "Save"
label = "${res:XML.MainMenu.FileMenu.Save}"
icon = "Icons.16x16.SaveIcon"
shortcut = "Control|S"
shortcut = "Ctrl+S"
class = "ICSharpCode.SharpDevelop.Commands.SaveFile"/>
<MenuItem id = "SaveAs"
label = "${res:XML.MainMenu.FileMenu.SaveAs}"
@ -127,7 +127,7 @@ @@ -127,7 +127,7 @@
<MenuItem id = "Separator2" type = "Separator"/>
<MenuItem id = "Indent"
label = "${res:XML.TextAreaContextMenu.Indent}"
shortcut = "Control|I"
shortcut = "Ctrl+I"
class = "ICSharpCode.SharpDevelop.DefaultEditor.Commands.IndentSelection" />
<MenuItem id = "HideXPathResults"
label = "${res:ICSharpCode.XmlEditor.HideXPathResults}"
@ -159,8 +159,8 @@ @@ -159,8 +159,8 @@
</Path>
<Path path = "/AddIns/XmlEditor/EditActions">
<EditAction id = "XmlCompletionPopup" class = "ICSharpCode.XmlEditor.CodeCompletionPopupCommand" keys = "Control|Space"/>
<EditAction id = "GoToDefinition" class = "ICSharpCode.XmlEditor.GoToSchemaDefinitionEditAction" keys = "Control|Enter"/>
<EditAction id = "XmlCompletionPopup" class = "ICSharpCode.XmlEditor.CodeCompletionPopupCommand" keys = "Ctrl+Space"/>
<EditAction id = "GoToDefinition" class = "ICSharpCode.XmlEditor.GoToSchemaDefinitionEditAction" keys = "Ctrl+Enter"/>
</Path>
<!-- XPath Query pad -->
@ -203,17 +203,17 @@ @@ -203,17 +203,17 @@
<MenuItem id = "Cut"
label = "${res:XML.TextAreaContextMenu.Cut}"
icon = "Icons.16x16.CutIcon"
shortcut = "Control|X"
shortcut = "Ctrl+X"
class = "ICSharpCode.SharpDevelop.Commands.Cut"/>
<MenuItem id = "Copy"
label = "${res:XML.TextAreaContextMenu.Copy}"
icon = "Icons.16x16.CopyIcon"
shortcut = "Control|C"
shortcut = "Ctrl+C"
class = "ICSharpCode.SharpDevelop.Commands.Copy"/>
<MenuItem id = "Paste"
label = "${res:XML.TextAreaContextMenu.Paste}"
icon = "Icons.16x16.PasteIcon"
shortcut = "Control|V"
shortcut = "Ctrl+V"
class = "ICSharpCode.SharpDevelop.Commands.Paste"/>
<MenuItem id = "Delete"
label = "${res:XML.MainMenu.EditMenu.Delete}"

2
src/AddIns/Misc/HtmlHelp2/Project/HtmlHelp2.addin

@ -92,7 +92,7 @@ @@ -92,7 +92,7 @@
insertbefore = "TocPadCommand"
label = "${res:AddIns.HtmlHelp2.DynamicHelp}"
icon = "HtmlHelp2.16x16.DynamicHelp"
shortcut = "Control|F1"
shortcut = "Ctrl+F1"
class = "HtmlHelp2.ShowDynamicHelpMenuCommand"/>
</Path>

39
src/AddIns/Misc/SearchAndReplace/Project/SearchAndReplace.addin

@ -11,30 +11,55 @@ @@ -11,30 +11,55 @@
<Import assembly = "SearchAndReplace.dll"/>
</Runtime>
<!-- Commands registry test -->
<Path name="/SharpDevelop/Workbench/RoutedUICommands">
<RoutedUICommand name="SDSearchAndReplace.Find" text="${res:XML.MainMenu.SearchMenu.Find}" />
<RoutedUICommand name="SDSearchAndReplace.FindNext" text="${res:XML.MainMenu.SearchMenu.FindNext}" />
<RoutedUICommand name="SDSearchAndReplace.FindNextSelected" text="${res:XML.MainMenu.SearchMenu.FindNextSelected}" />
<RoutedUICommand name="SDSearchAndReplace.Replace" text="${res:XML.MainMenu.SearchMenu.Replace}" />
</Path>
<Path name="/SharpDevelop/Workbench/CommandBindings">
<CommandBinding command="SDSearchAndReplace.Find" class="SearchAndReplace.Find" />
<CommandBinding command="SDSearchAndReplace.FindNext" class="SearchAndReplace.FindNext" />
<CommandBinding command="SDSearchAndReplace.FindNextSelected" class="SearchAndReplace.FindNextSelected" />
<CommandBinding command="SDSearchAndReplace.Replace" class="SearchAndReplace.Replace" />
</Path>
<Path name="/SharpDevelop/Workbench/InputBindings">
<InputBinding command="SDSearchAndReplace.Find" gesture="Ctrl+F" />
<InputBinding command="SDSearchAndReplace.FindNext" gesture="F3" />
<InputBinding command="SDSearchAndReplace.FindNextSelected" gesture="Ctrl+F3" />
<InputBinding command="SDSearchAndReplace.Replace" gesture="Ctrl+R" />
</Path>
<!-- Commands registry test -->
<Path name = "/SharpDevelop/Workbench/MainMenu/Search">
<MenuItem id = "Find"
label = "${res:XML.MainMenu.SearchMenu.Find}"
icon = "Icons.16x16.FindIcon"
shortcut = "Control|F"
class = "SearchAndReplace.Find"/>
shortcut = "Ctrl+F"
class = "SearchAndReplace.Find" />
<MenuItem id = "FindNext"
insertafter = "Find"
label = "${res:XML.MainMenu.SearchMenu.FindNext}"
icon = "Icons.16x16.FindNextIcon"
shortcut = "F3"
class = "SearchAndReplace.FindNext"/>
class = "SearchAndReplace.FindNext" />
<MenuItem id = "FindNextSelected"
insertafter = "FindNext"
label = "${res:XML.MainMenu.SearchMenu.FindNextSelected}"
shortcut = "Control|F3"
class = "SearchAndReplace.FindNextSelected"/>
shortcut = "Ctrl+F3"
class = "SearchAndReplace.FindNextSelected" />
<MenuItem id = "Replace"
insertbefore = "SearchIncremental"
insertafter = "FindNextSelected"
label = "${res:XML.MainMenu.SearchMenu.Replace}"
icon = "Icons.16x16.ReplaceIcon"
shortcut = "Control|R"
class = "SearchAndReplace.Replace"/>
shortcut = "Ctrl+R"
class = "SearchAndReplace.Replace" />
</Path>
<Path name = "/SharpDevelop/DefaultEditor/SearchAndReplace/WildcardHelpPath">

2
src/Main/Base/Project/Src/Internal/Doozers/PadDoozer.cs

@ -34,7 +34,7 @@ namespace ICSharpCode.SharpDevelop @@ -34,7 +34,7 @@ namespace ICSharpCode.SharpDevelop
/// "View -&gt; Debugger" menu.
/// </attribute>
/// <attribute name="shortcut" use="optional">
/// Shortcut that activates the 'Show pad' command (e.g. "Control|Alt|T").
/// Shortcut that activates the 'Show pad' command (e.g. "Ctrl+Alt+T").
/// </attribute>
/// <usage>Only in /Workspace/Parser</usage>
/// <returns>

2
src/Main/Core/Project/Src/AddInTree/AddIn/DefaultDoozers/MenuItem/MenuItemDoozer.cs

@ -43,7 +43,7 @@ namespace ICSharpCode.Core @@ -43,7 +43,7 @@ namespace ICSharpCode.Core
/// clicking the item.
/// </attribute>
/// <attribute name="shortcut" use="optional">
/// Shortcut that activates the command (e.g. "Control|S").
/// Shortcut that activates the command (e.g. "Ctrl+S").
/// </attribute>
/// <children childTypes="MenuItem">
/// If "type" is "Menu", the item can have sub-menuitems.

8
src/Main/ICSharpCode.Core.WinForms/Menu/MenuCommand.cs

@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using System.Text.RegularExpressions;
namespace ICSharpCode.Core.WinForms
{
@ -68,8 +69,11 @@ namespace ICSharpCode.Core.WinForms @@ -68,8 +69,11 @@ namespace ICSharpCode.Core.WinForms
Keys shortCut = Keys.None;
if (shortcutString.Length > 0) {
try {
foreach (string key in shortcutString.Split('|')) {
shortCut |= (System.Windows.Forms.Keys)Enum.Parse(typeof(System.Windows.Forms.Keys), key);
foreach (string key in Regex.Split(shortcutString, @"\s*\+\s*")) {
string winKey = key;
if(key.ToLower() == "ctrl") winKey = "Control";
shortCut |= (System.Windows.Forms.Keys)Enum.Parse(typeof(System.Windows.Forms.Keys), winKey);
}
} catch (Exception ex) {
MessageService.ShowError(ex);

Loading…
Cancel
Save