Layering a control on top of certain tokens.

SyntaxEditor for WPF Forum

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

I am using Dynamic language definition in order to create my own "BASIC" like language.

In my language, my variable text patterns fall under the Identifier Tokens and I am able to obtain all of them by parsing my document.

MY application requires that I monitor variables in the code. Monitoring requires me to display the value of the underlying variable (let's say for convenience that it is an "int" type) next to the TOKEN of the variable.

Now, initialy i was thinking of inserting text that represent the value of the variable right next to the variable itself ( ex: Variable1(-123123) ).... but then I realized that this could really be difficult to manage given that the value (-123123) is constantly being updated when i am monitoring, which would cause the document to contantly be moving due to text changes!
I was wondering can I apply tooltips or textboxes right next to my variable tokens? These tooltips/textboxes would be either on another layor or the same layor but they should not affect the formatting of the underlying document.

To be more specific, 1 document could have many tooltip/texboxes appearing at the same time, they are not triggered by a mouseover event, but rather, they are displayed and iserted dynamically for each variables shown on screen when my application goes into monitoring mode!

If I cannot not apply a tooltip to specific tokens, I would like to be able to insert a textbox next to my variables which would give me a container for my monitoring my variables.

Is this easily attainable? If so, can you help me out by guiding me a little in the first steps?

Regards
Nassim

[Modified at 12/19/2011 02:38 PM]

Comments (1)

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

The WPF SyntaxEditor has a really nice features for doing this sort of thing called intra-text adornments. It harnesses the tagging features so that you can "tag" regions of text (like your variables) and reserve space for adornments to render in that space, inline with the text. The adornments can be any sort of UIElement. The Adornments 6 (Code Reviewing) QuickStart shows a great example of how to do this.


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.