Advertisement

Syntax coloring in my MFC app

Started by October 10, 2000 11:39 AM
0 comments, last by Yanroy 24 years, 3 months ago
Just in case the title is misleading, I want to know how to add syntax coloring to a rich edit field in my dialog, not turn it on in MSVC++. I have a little program for writing PBASIC for my robot and the local FIRST team, and it would be nice to add syntax coloring for it. I know I worded this vaguely, but I do know that to change the color I need to use SetCharFormat() for something like that with a struct. My question is how to detect and use the colors for words AS THE USER TYPES THEM! For some reason the rich edit box won''t send the NM_CHANGE (?) or NM_UPDATE (?) messages, so I was thinking that maybe OnIdle is the way to go. If someone could supply an idea on how to do this, I think I can handle the rest (I hope... I am new to rich edit controls) --------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming

You are unique. Just like everybody else.

Yanroy@usa.com

Visit the ROAD Programming Website for more programming help.

--------------------

You are not a real programmer until you end all your sentences with semicolons; (c) 2000 ROAD Programming
You are unique. Just like everybody else.
"Mechanical engineers design weapons; civil engineers design targets."
"Sensitivity is adjustable, so you can set it to detect elephants and other small creatures." -- Product Description for a vibration sensor

Yanroy@usa.com

You''re going to have to do a customized control with CRichEditCtrl as your base class. I''d go into detail and all that junk but I''m feeling lazy so I''ll just send you over here, where one is already written for you with complete source code available... use it or figure out how to do it from this one. I think his demo is set up to edit VBScript or something like that. Your stuff can''t be much different.

-fel
~ The opinions stated by this individual are the opinions of this individual and not the opinions of her company, any organization she might be part of, her parrot, or anyone else. ~

This topic is closed to new replies.

Advertisement