Adornments focus

SyntaxEditor for WPF Forum

Posted 9 years ago by Rahul Ramadas
Version: 10.1.0522
Avatar
I have created a new adorment layer on the syntaxeditor, and I've added a TextBox control as an adorment on this layer. If I click on the textbox, it receives focus and I can type in it, but the caret shows up both, in the textbox as well as in the syntax editor. Also, there is no way for me to restore keyboard focus to the syntax editor and type in it. Is there some workaround for this?

Comments (5)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Rahul,

You can call view.Focus() to move focus back to the editor. I think some work was done in build 523 related to that. Although the view caret will still likely blink while focus is in your textbox. We can make a TODO item to look into improving that in the future.


Actipro Software Support

Posted 2 years ago by Xinen Lee
Avatar

Hi Actipro,

I'm facing the same issue now - the caret shows up in both the syntax editor and the textbox control while my keyboard focus is in the textbox control and I'm typing within it. What can I do to not show the caret in syntax editor?

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

When I do a test of having another SyntaxEditor control embedded in our upcoming intra-line adornments feature (not released yet as of this posting), I don't see two carets.  I only see the caret in the editor that has focus. 

Around 4/19/2017, we did a commit in the intra-line adornments branch for "Updated view focus checks to prevent caret blinking when focus is within an adornment."  I wonder if you have a preview build prior to that?

If you'd like us to check, please send a new simple project that shows it happening and we can look into it here.


Actipro Software Support

Posted 2 years ago by Xinen Lee
Avatar

Hi, 

I'm using your Adornments 6 - Code Review sample for Version 17.1.0651.

In the IntraTextNoteAdornmentManager.cs, instead of adding a button, I add a TextBox.

TextBox tb = new TextBox();
 
// Add the adornment to the layer
this.AdornmentLayer.AddAdornment(tb, location, tagRange.Tag.Key, null);

I run the program and press the button to add the TextBox instead of the original button. When I type in the textbox, the caret is still visible in the Syntax Editor. 

What should I do to not have the caret show up in Syntax Editor?

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Xinen,

Thanks, I just confirmed that the updates we did for intra-line adornments which will appear in v2017.2, have already changed how view focus is tracked and no dual carets show.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.