Thank you for the suggestion, we will write it down.
Re: FSharp (F#) language type checking as tooltips
Unable to use shortcuts (F3) when recording a MacroCommand
My previous editor allowed us to use shortcuts in keyboard macros.
SyntaxEditor seems to ignore keys such as F3 when recording the macro.
I am receiving complaints from my customers that they are unable to create macros like the ones they previously created since many of these require the use of a 'Find' command.
The 'Find' structure will previously have been 'primed' so that
resultSet = SelectedView.FindReplace.Find(FindOptions)
can be called.
This is called whenever F3 is pressed.
Is there a workaround for this limitation?
Thanks
Mike
Re: Unable to use shortcuts (F3) when recording a MacroCommand
Hi Mike,
When a key is typed, SyntaxEditor will scan its CommandLinks collection to determine if there is a CommandLink that has a matching KeyBinding. If one is found and macro recording is active, it will record the action. There is no edit command for F3 at this time by default in our editor. That's why F3 isn't picked up.
That being said, you could make your own EditCommand for F3 and add it to the CommandLinks collection. I would think that if you did that, it would start to get picked up in macro recording.
Re: Unable to use shortcuts (F3) when recording a MacroCommand
I verified that creating my own FindNextCommand (which simply calls my FindNext function in the control derived from SyntaxEditor) causes the macro recorder to record the use of a FindNextCommand, and play it back as intended.
However I dont think that's a real solution to the problem since my applications define many shortcuts and provide a command subsystem (similar to Visual Studio) which allows the user to change or add any shortcuts they want.
This means that F3 might not mean FindNext for another user, for example.
I also need to talk to the vendor of the tool that provides the command subsystem since by default it intercepts all shortcut keys defined to it and does not pass them on to the Syntax editor control, so I need to change that functionality while recording a macro.
(Unless there is a way to tell SyntaxEditor that it should get first crack at keystrokes)
The old editor I used simply recorded all keystrokes verbatim and replayed them back the same way. I think Visual Studio does the same.
So it makes no difference if there is a command bound to a function key or shortcut combination - it simply records and plays back exactly what the user did on the keyboard ... and if there is a shortcut defined (within either SyntaxEditor or the command system) then it will be processed as such when it is replayed.
Were you trying to improve performance or something when you decided to record 'commands' rather than keystrokes?
Is there an option I can switch on to tell it to record keystrokes instead?
Thanks
Re: Unable to use shortcuts (F3) when recording a MacroCommand
I have also found that Macro Playback generates errors when some of your commands are used.
For example
<EditCommand TypeName="ActiproSoftware.SyntaxEditor.Commands.ChangeCharacterCasingCommand" AssemblyName="ActiproSoftware.SyntaxEditor.WinForms"/>
generates the following exception:
System.MissingMethodException: No parameterless constructor defined for this object.
at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
at System.Activator.CreateInstance(Type type)
at ActiproSoftware.SyntaxEditor.Commands.MacroCommand.ReadFromXml(XmlReader reader)
at Teradata.SQLA.Query.PlayMacro() in E:\AppSourceCurrent\SQLA\Query.vb:line 425
It looks like you make the assumption that commands do not require parameters but the CharacterCasing command requires Upper/Lower so it causes macro playback to fail if it is used within a macro.
(I would expect that changing character casing would be a common use for macros so this is a major problem.)
Once again, simply recording and playing back the Ctrl+L or Ctrl+U that I bind to these commands would not have these issues.
Mike
Re: Unable to use shortcuts (F3) when recording a MacroCommand
Hi Mike,
Thanks for the bug report on the character casing command in macros. It was an oversight and we will fix that for the next build.
The way we did macros serializes the edit-related commands that were recorded exactly. This allows you to serialize off a macro sequence and reply it later on another machine (or even the same) that might have different hotkey settings, knowing that the same command sequence will execute. Sorry but we don't have a way to record and replay keystrokes instead. We also are recording commands that might not necessarily come from keys and might come from menus/toolbars, etc.
If you are trying to make system wide macros with access to commands that are unrelated to SyntaxEditor, then I would recommend you use your command subsystem to possibly track everything at that level instead and reply things via that. If you want, you could also remove all the command links we define and then map custom commands from your command subsystem to call related methods on our editor. That way, our key handler wouldn't potentially be trapping related commands that your command subsystem was watching for.
Can i alter the default logic to make 'Tab' a separate Undo action
Currently all typing is classed as a single Undo 'event', with the exception of Enter, Backspace and Arrow keys.
Enter and Backspace are classed as separate undoable events, while the arrow keys act as 'hidden' breaks in typing.
Is there any way to treat the Tab key [and maybe the Space bar] as a separate Undo event.
(i.e. can we control which keys are handled separately?)
Thanks
Mike
Can AutoReplaceTriggerActivator be set to the down arrow key?
Currently you have no way to specify automatic case setting for tokens that are matched to a regular expression. (A feature I'm hoping you will add at some point) so I am making use of AutoReplaceTriggers to uppercase the most commonly used such tokens.
These work fine for Space, Tab and Enter but if the user simply presses the down arrow after one of these keywords then the trigger does not fire.
When setting AutoReplaceTriggerActivator I have to specify a 'character' rather than a 'key' so is there any way to specify a key that does not generate a character?
Thanks
Mike
Re: Can i alter the default logic to make 'Tab' a separate Undo action
Hi Mike,
It will combine any sequential occurrances of "Typing" document modifications. Thus the only way to prevent the combination would be to use a different document modification type for spaces, etc. But changing that for default typing isn't very easy since you would probably need to handle the KeyTyping event and then swap in a new e.Command in place of the default TypingCommand. And have your custom EditCommand do a view.ReplaceSelectedText but with a different document modification type than Typing.
Re: Can AutoReplaceTriggerActivator be set to the down arrow key?
Hi Mike,
Sorry but auto-replace triggers only work with typable characters. There isn't a way to get them working with non-character producing keys like arrow keys.
Re: Can i alter the default logic to make 'Tab' a separate Undo action
OK. Thanks. I thought it probably wasn't a recommended option.
Re: Can AutoReplaceTriggerActivator be set to the down arrow key?
Is there a feature request open to add an 'AutoCase' option for Tokens defined using RegEx patterns?
If not, could you please open one.
The idea is to be able to specify AutoCase=Upper, Lower, and maybe Proper.
Re: Can AutoReplaceTriggerActivator be set to the down arrow key?
Hi Mike,
Ok we will add it to the TODO list if it's not already on it.
a small horizontal bar located above the scroll bar
In the syntax editor, I see a small horizontal bar located above the scroll bar.
This horizontal bar can be expanded and the same text is visible in two separate windows.
You can reproduce the problem in the published syntaxeditor Sample.
Re: a small horizontal bar located above the scroll bar
I don't know how to upload a picture. Could any expert tell me how?
Re: a small horizontal bar located above the scroll bar
I think what you are refering to is the split view feature. It is not a bug. You have to set SyntaxEditor.SplitType property to SyntaxEditorSplitType.None to disable the option. After that the splitter will be hidden and the scrollbar looks as usual.
Btw.: You cannot upload pictures here. You can contact the support per e-Mail and add the files there or upload the files somewhere else and link them here.
Excel functions editor
Hi,
I'm new to Actipro SyntaxEditor; I need to develop an Excel-like app, with an editor that displays Excel functions in color, and with intellisense (for macros, and named cells defined in the Excel file).
Where should I start? Should I define my own xml language file? (one drawback I see now is that the list of macros and named cells is dynamic; each Excel file will have a different list. So, should I create the xml language file dynamically?)
Thanks in advance
Re: Excel functions editor
Hello, yes you could make a core XML definition that has all the keywords, etc. that will be constant. Then maybe have an empty lexical pattern group that you will intend on dynamically modifying at run-time.
For each document, you'd load up a new instance of your language definition and update the lexical pattern group as appropriate. Then that would get you customized document-specific syntax highlighting.
Bug in RegEx replace function
One of my customers just reported a strange problem with the RegEx replace function.
A simplified version of the problem is:
Search String: (.*)
Replace expression: $1xxx$1
Replace All
Input Expected Result Actual Result
c1 c1xxxc1 c1xxxc1xxx
c2 c2xxxc2 c2xxxc2xxx
c3 c3xxxc3 c3xxxc3
If we change the Search string to (.+) it works as expected.
Or we can use (\w+) also... but not (\w*).
Is the '*' somehow matching the LineEnd characters also?
But if so, that should cause it to add additional line end characters, so that can't be it.
Note that this is a very simplified version of what the customer is actually trying to do.
Re: Bug in RegEx replace function
Hi Mike,
I believe what's happening is that your regex pattern allows effectively "nothing" to get consumed in some cases where there is no match. For instance if you have the text "c1 c2" and you search on "(\w*)", you will get three results:
- 0-2 ("c1")
- 2-2 ("" - empty string)
- 3-5 ("c2")
It's those empty string matches that end up adding those extra "xxx". VS seems to do the same thing. I would recommend using a better search pattern that requires at least one character to be consumed.