Efficient coloring for "log window" |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 15 March 2007 at 5:22am |
Hi, I'm just about to code a log window where a new line is appended once every second or so. Also, the user should be able to enter commands with an auto-completion dropdown list. Something like a terminal where inplace-editing is not allowed, but text can be appended.
Here, syntax coloring would be a great benefit. However, I am going to use advanced coloring rules (mainly using regex). For this reason, I only want to colorize the last line when it is being changed. The other lines have already been colored, so I do not want colorize them again. Imagine a log window with 1000+ lines and advanced regex rules for colorization...
Is this possible with your syntax edit control?
Thanks!
/Chris, Sweden |
|
sserge
Moderator Group Joined: 01 December 2004 Status: Offline Points: 1297 |
Post Options
Thanks(0)
|
Hi Chris,
Yes, I suppose that Syntax Edit control will suite your needs. Firstly, it parses all new information in the background which allows users to continue working with text. Second, it stores parsed information for the beginning of the text. And if you only append the text, it will be parsed efficiently. The only problem could be defining a color schema. Control's schemas are based on some tricky logic not directly connected with regex expressions. However, there are a number of examples (open schemas of some formats) and you can always pick some ideas from there. -- WBR, Serge |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
If that is the case, I believe your edit control lacks a must-have feature. Whenever a line/char is about to be colorized, a message should be sent to the window. If it is not handled, then you invoke the scripted colorizer. The colorization mechanism should not be dependent on files with obscure syntax. Take a look at Scintilla!
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |