Show different member list based on different tags

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by YungWei Chen - Resolvity Inc
Version: 4.0.0271
Avatar
Hi,

I would like to show different items in the member list based on different tags. For example, I want to show January, February, March, ..., and December for the following tag, $month, and show Black, Red, White, etc for $color. How can I achieve this? Thanks.

Comments (5)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi YungWei,

Can you provide more detail about your language, scenario, what you are trying to achieve, etc.?


Actipro Software Support

Posted 14 years ago by YungWei Chen - Resolvity Inc
Avatar
Basically, my app just allows users to enter some English sentences. Eash sentence may contain one or more tags, which I plan to use IntelliPromptMemberList to simplify entering the value of each tag. For different tags, I want to present different options in the member list.

For example, we have a sentence that contains a tag, XXmonthXX. When the caret runs into the tag, "XXmonthXX" will be selected. Now if the user presses CTRL+SPACE, a list with options from Jan to Dec will be presented in the popup list so the user can select one from the list. For XXdayXX, the member list is expected to show 01~31.

So here's a few things I want to achieve:
1. Select a tag when the caret runs into it.
2. Press CTRL+SPACE to display the member list, in which options are dynamically populated.

What is the best way to achieve these? Thanks.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
YungWei,

If you open the SimpleSyntaxLanguage sample in the Languages/Simple folder of the sample project, search for the text "memberlist". Basically any procedures you see in there with that text show how a language can respond to ctrl+space (by returning true to IntelliPromptMemberListSupported) via the IntelliPromptCompleteWord method. In the ShowIntelliPromptMemberList method that it calls, it gets a TextStream to get the current token's range. Then you can check to see if it's a "tag" token in your language instead of where we do the AST examination in our sample. The rest of that method populates the member list and shows it. So you'd do the same thing but customize what you put in it based on which tag you are at. Again the TextStream can tell you what token type it is and text is in the token.


Actipro Software Support

Posted 14 years ago by YungWei Chen - Resolvity Inc
Avatar
I ran into a situation where CompleteWord method doesn't filter the options in the member list based on what I type. For example, let's say the member list contains 12 months from Jan to Dec. When I type "m", "Mar" is automatically completed. But I expect it to show "Mar" and "May" in the member list. What am I missing? Thanks.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
YungWei,

Sorry filtering is not yet a feature in the WinForms version. It is something we have implemented in our next gen framework that is being prototyped in the WPF version though. See this blog post for details on it in WPF.

We eventually will be porting this sort of feature back to the WinForms version once the next gen framework is complete and we migrate WinForms to it.


Actipro Software Support

The latest build of this product (v24.1.0) 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.