[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Syntax Coloring Editor - How???

Posted on 1997-08-12
4
Medium Priority
?
292 Views
Last Modified: 2013-11-19
I tried implementing syntax coloring in a CRichEditView based App.  It works but can be tedious and slow because of the message based way the text color is changed.  How can I implement syntax coloring in say a CEditView class?  I notice that Microsoft's Visual C++ IDE editor does not use CRichEditView because it supports splitters.  The way Microsoft implemented syntax coloring is realy cool and fast.  How the heck did they do it?  
0
Comment
Question by:WillieSwart
4 Comments
 

Expert Comment

by:craven080297
ID: 1303561
Yes you can use a CEditView, just call GetEditCtrl() method which informs you about the currently used CEdit. This should allow you to make use of standard notification on character stroke, thus modify any attribute (fi: color) on the fly.
0
 

Author Comment

by:WillieSwart
ID: 1303562
As far as I know, CEdit does not allow the display of more than one font at a time, thus not allowing more than one color in a CEdit control.  Am I missing something craven?  If so, please clarify your answer.  thanx
0
 
LVL 8

Accepted Solution

by:
gelbert earned 300 total points
ID: 1303563
You can use user interface thread to do coloring. In this case if will not affect perfomance of main thread which will do the rest of functionality.
You can look at sample in mfc\advanced\mtgdi
0
 

Expert Comment

by:bola053097
ID: 1303564
try SourceView at www.tetradyne.com. Its pretty cool! I did
use the RichEditControl for highlighting but its too slow
at Serialization time



0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses
Course of the Month18 days, 5 hours left to enroll

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question