Textboxes or Tooltips on specific text patterns???

SyntaxEditor for Windows Forms Forum

Posted 15 years ago by Nassim Farhat
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! Also, tracking these in document changes could be hell for me, since i need to constantly update the variables and if the data is not bound correctly, this would cause me to create timers in my code and obtain the tokens again and refresh the information constantly.... Soooo to avoid all this mess, I was wondering instead, 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 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 the 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 variables.
Now I know that this might only be attainable with WPF version of Syntax Editor so my question is: Can you suggest me something else i can do to monitor these variable on screen using my non WPF version of Syntax Editor? IF WPF version of syntax Editor is absolutely necessary, will it be reverse compatible with the code I have already created in my non-WPF version of Symtax Editor (intelliprompt, same events, dynamic language definition is the same etc...)?

Regards
Nassim

[Modified at 02/19/2010 03:47 PM]

[Modified at 02/22/2010 08:21 AM]

[Modified at 02/22/2010 08:21 AM]

[Modified at 02/22/2010 08:22 AM]

Comments (6)

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

Sorry but you can't currently render custom content in the text area very easily in the WinForms version, and it doesn't support inserting content inline. That is a feature we have in our newer WPF version though.

I would normally recommend that you use our IntelliPrompt quick info features, which allow you to show a tooltip in response to mouse hovers over tokens. Just handle the ViewMouseHover event and update e.ToolTipText. Note that it uses the HTML-like markup syntax described in our documentation for quick info content, so you can colorize text etc. But you had indicated you needed them always showing.

Perhaps you could alternatively use the smart tags feature? That would at least mark the areas where info is available and the user could click on it to pop up a menu or dialog.

The WPF SyntaxEditor's object model is similar in many areas but some others are drastically different. We can import dynamic language definition files to it with its Language Designer. The member list in WPF (called completion list there) is completely different though, but much better.


Actipro Software Support

Posted 15 years ago by Nassim Farhat
Avatar
Thank you for your time.
I liked your proposition about smart tagging my variables

Concidering the limited resources we have with the normal version of SyntaxEditor, I was wondering the following two things:

1-
So I tried to play around with the feature in the sample code you provided and i'm having small issues in trying to keep the smart tags constantly displayed:

I set the following prop to true.
this.editor.IntelliPrompt.SmartTag.MultipleSmartTagsEnabled = true;

but still after i press enter or start editing, the smart tag disapears.
How can I dynamically display many little red smart tag bars for some selected on screen visible tokens in my document and keep them displayed all the time?


2-
When hovering over the little red bar that represents smarttag, can the smart tag icon be replaced with a textbox control? I really need a databound control to be displayed when the smart tag is hovered over. In that way i could bind the value of my underlying data to the text box and have it refresh automaticaly? If not, do you have any proposition of a control i can use in the editor that could bind to a datasource and be displayed to the user?

If what I am asking for is not possible... then, would there be a way to bind the tooltip message to a datasource?

Regards
Nassim

[Modified at 02/22/2010 02:55 PM]
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Nassim,

Make sure you have the editor.IntelliPrompt.SmartTag.ClearOnDocumentModification property set to false. If it is true then smart tags will clear when typing.

If you handle the editor.IntelliPromptSmartTagClicked event you can show whatever you want. In our samples we show a ContextMenu but you could show other things instead and it's all dynamic so you can update it however you need.


Actipro Software Support

Posted 15 years ago by Nassim Farhat
Avatar
Thank you for your reply...

When I was talking about showing anything i wanted when the smart tag is hovered over, what I meant to say is:
Can the default action of poping up an image/icon when hovering over the smarttag be overriden for something else ... like a custom control popup, textbox, grid....whatever?

I'm just one step before what you mentioned.... I'm not looking for editor.IntelliPromptSmartTagClicked event.... but instead for editor.IntelliPromptSmartTagMouseHover event or something like that.

Is that available?

Regards
Nassim
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you are wanting to do something like that then you would be better off not using smart tags and just making a span indicator instead. Then handle the ViewMouseHover event and see if you are over any of your span indicators. If so, show the appropriate popup you want.


Actipro Software Support

Posted 15 years ago by Nassim Farhat
Avatar
thank you so much for that information....

That is a great idea.... I might go ahead and implement that

Regards
NF
The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.