Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Syntax Coloring Editor - How???

Posted on 1997-08-12
4
256 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 150 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Replacement selected text 2 63
maxBlock challenge 30 142
lucky13 challenge 11 154
EvenOdd challenge 10 126
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

856 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