DebugCodeEdit with SyntaxEdit functionality

Hi,
All scripter examples use DebugCodeEdit (that derive from SyntaxEdit) as the code editor and all editor examples are using SyntaxEdit.
Using DebugCodeEdit, how do I enable the CodeSnippet functionality for example?
Thanks
Hi,
Yes, some of Scripter examples (that have Script debugging functionality) are using DebugCodeEdit, which is derived from SyntaxEdit and provides additional features like displaying the current execution line or evaluating the symbol under the mouse cursor when debugging. Being derived from SyntaxEdit it has all the functionality of SyntaxEdit control.
CodeSnippets are available by executing Ctrl + K + X or by calling edit.CodeSnippets method.
Please let me know if it answers your question.
Regards,
Andrew
Thanks. When running the debugger examples, CTRL+K+X don't do anything, what I need to do to make it work?

Thanks
Hi,
Ctrl + K + X key sequence is suppressed by Cut popup menu, which we will resolve
The easiest workaround is to remove InputBinding from the DebugCodeEdit like this:
InputBinding toRemove = null;
foreach (KeyBinding binding in ((DebugCodeEdit)edit).InputBindings)
{
if (binding.Key == Key.X)
{
toRemove = binding;
break;
}
}
if (toRemove != null)
((DebugCodeEdit)edit).InputBindings.Remove(toRemove);
Regards,
Andrew
Thanks! I'll try your suggestion.
Hi,
((DebugCodeEdit)edit).InputBindings)
InputBindings is not a member of DebugCodeEdit
Any idea?
Hi,
Problem with CTRL+K+X related only for the WPF version of the DebugCodeEdit. In the WinForms version it works without any problem.
So my solution also belongs to the WPF version.
InputBindings property defined in the UIElement class.
As DebugCodeEdit class in the WPF version derived from the UIElement, ((DebugCodeEdit)edit).InputBindings should work.as expected
Regards,
Andrew
It is not working for the AlterNet Studio example, it is working with the Scrip Debugger demo AND it is not working when I host the DebugCodeEdit control.
I can't figure out why!
I am running Windows 10 Professional.
Thanks
Hi,
you should comment the code in the AlterNet Studio demo, that suppresses Code snippet like this:
//this.miCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
Could you please describe in details scenario with hohst DebugCodeEdit?
Kind regards,
Andrew
Hi,
removing miCut.ShortcutKeys fixed the issue. I wish that I could re-assign the code snippet keys to a different set of keys.

Thanks for the help.
Hi,
There is a sample code to re-assign new key combination for the Code Snippets:
private Alternet.Editor.KeyEvent CodeSnippetsEvent;
public void DoCodeSnippets()
{
syntaxEdit1.CodeSnippets();
}
private void Form1_Load(object sender, EventArgs e)
{
CodeSnippetsEvent = new Alternet.Editor.KeyEvent(DoCodeSnippets);
syntaxEdit1.KeyList.Remove(Keys.X | Keys.Control, 1);
syntaxEdit1.KeyList.Add(Keys.A | Keys.Control, CodeSnippetsEvent, 1, 0);
}
Kind regards,
Andrew Medvedev
Thanks. I'll give a try