|
Rank: Newbie Groups: Member
Joined: 12/20/2008 Posts: 3
|
I am looking at several editor controls for a specific project. I do not need most of the fancy stuff that tends to be the main selling point of many such tools, but there is one thing I do need. I have looked through some of the documentation but given that I am looking at three different toolkits it ultimately seems simpler just to ask if it is possible.
Basically, imagine a set of both individual tokens highlighted anywhere within a line, plus one or more lines that are highlighted as a whole (with regex eg. "^KEY/s.*$" or some such). Is there a straightforward way in either case to obtain a collection of all entries of a specific token or line type along with their line offsets (character position is irrelevant), which can be kept up to date, possibly via a timer or event, so that at any time a user can select and jump to any occurence? Sort of like a Visual Studio class browser?
Many thanks, Mr C
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
Unfortunately the syntax editor currently does not expose any interface for you to read its collection of tokens. We are working on the next version which will allow you to read all tokens and also build AST, but that will be a while. Sorry about it!
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 12/20/2008 Posts: 3
|
Thanks for the quick reply. The lack of the facility has made me question how I was going to make use of it which in fact has helped tremendously. The option to do such things in other edit controls had steered me in a direction that was over-complicated for my needs - I was designing my interface around the edit controls facilities rather than just picking something that sufficed for my original plans. There is a way around this with EO which actually seems to work better in my interface design so that is not an issue.
Before I purchase though there were just two further questions which I hope you may be able to answer. The first is whether a purchaser gets the source code. It may be stated very obviously somewhere but I did not see it. The second is regarding files in memory. When a large document (tens of thousands of lines) is placed in the editor, either by pasting or by loading, there is a brief period (a half second or so) where typing is extremely slow as, presumably, it is analysing the text. Is there any event I can hook into or a property I can monitor to know when the edit control is up to speed as it would work better in my case for a momentary pause rather than a user to start typing and the keys not appear instantly?
Many thanks again, Mr C.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi,
I am glad you found a workaround. Unfortunately we do not provide source code with our Editor. Currently our Editor is priced very low comparing with our competitors. Generally option with source code would be much more expensive and we currently do not have such an option. We do understand that having the source code makes sense for a lot of people, so we will be looking into it to see if we can provide the source code in the future.
The editor has done a lot of optimizations. So it's actually very fast comparing with other products on the market. If you use a built-in parser, then there is not direct way for you to tell whether the parser is running. However if you use a CustomParser, because your code does the parsing, you can set a flag when your code is entered and clear that flag when your code exits. That way you have a flag to see whether the parser is running.
Another way to do this is to post a user message to the editor window and then overrides the editor's WndProc to check for that message. You would measure the time delay between these two actions. If the time delay is very little, then the editor is idle, otherwise it's busy. Be careful with threading when you use this option.
Hope this helps.
Thanks!
|
|