IntraText addornments

SyntaxEditor for WPF Forum

Posted 8 years ago by Nassim Farhat
Version: 11.2.0551
Avatar
Hello,

I m trying to add an intra text control following your example, but instead of being on the left of the text, I need it to be on the right. How do i accomplish this?

Thanks

Comments (7)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nassim,

The intra-text tags reserve space to the left of their start offset. So to get your adornment on the right, you'd need to have your IIntraTextSpacerTag be for the end offset.

If you started with our AdornmentsIntraTextNotes sample, you'd have to modify the tagger. Right now it tags for both IIntraTextSpacerTag and IClassificationTag. You'd need to flip things around so it uses IClassificationTag as its core and then in the interface return, it modifies the range to be the end offset and returns IIntraTextSpacerTag from there.


Actipro Software Support

Posted 8 years ago by Nassim Farhat
Avatar
I found a simpler way to accomplish this. I basically created an intratext adornment on the next neighboring token that i am targetting, this basically gives the impression that the intratext adornment is on the right of my desired Token instead of being on the left.

If i run into some issues, i'll look into your solution.

Thanks a lot.
Nassim
Posted 3 years ago by Xinen Lee
Avatar

Hi Actipro,

I am using the intratext adornment to the right of a token by using the end offset of the token as the tag range, e.g. "token[adornment]"

The adornment is always rendered to the left of the caret, i.e. I am unable to place the caret in between my token and the adornment e.g. "token|[adornment]". User can only type after the adornment as the caret can only be placed after the adornment, "token[adornment]|"

This makes typing very weird as typing 'a' after the adornment results in: "tokena[adornment]|". Typing backspace now results in "token[adornment]|". This is because our language considers 'tokena' as a token to add an adornment for.

Is there a way to render the adornment to the right of the caret instead of the left? In other words, we need to be able to put the caret between the token and the adornment "token|[adornment]". We will not need to put the caret between the adornment and the character after it, so the adornment still does not take up any offset. I do not want to add a collapsed region tag using a dummy character as it will affect our document and language. If there isn't an existing way, is it possible for Actipro to give us an option to do so? This behavior severely affects our usability during typing.

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

Hi Xinen,

Sorry but we don't have an option at this time for determining if the caret stop is on the left or right of the intra-text spacer.  Right now the caret stop is always just left of the text at the offset.  We will mark down a request to add an option for that


Actipro Software Support

Posted 2 years ago by Daisuke Nakada
Avatar

Hi,

 

I am trying to put adornments on the right of tokens but I cannot understand how to modify the tagger to achieve this.

 

My IntraTextTag class does not implement the IClassificationTag. It implements only the IIntraTextSpacerTag.

Because I do not need to highlight those tokens.

 

I would appreciate it if you could give me some sample code.

 

Thank you.

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

Hi Daisuke,

Intra-text spacers only appear to the left of the tagged range at this time.  There is a request per this thread to add an option for displaying on the right instead, but we haven't gotten to that as of yet.  

Without that option, the only way to get the spacer on the other side would be to tag the next character over.


Actipro Software Support

Posted 2 years ago by Daisuke Nakada
Avatar

I see. Thank you.

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.