Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Syntax Edit
  New Posts New Posts RSS Feed - Efficient coloring for "log window"
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Efficient coloring for "log window"

 Post Reply Post Reply
Author
Message
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Topic: Efficient coloring for "log window"
    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
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2007 at 6:35pm
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
Back to Top
znakeeye View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 July 2006
Status: Offline
Points: 1672
Post Options Post Options   Thanks (0) Thanks(0)   Quote znakeeye Quote  Post ReplyReply Direct Link To This Post Posted: 24 March 2007 at 5:16pm

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!
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.