MarkOttoSmith
asked on
Syntax Highlighting for CRichEditView
I am trying to create a program in VC6.0. SDI App on Win98. Trying to create a simple syntax highligher for the perl scripting I do.
I can't see to find how to make it call my function when the text is changed. That way I would do that syntax highlight again.
BOOL CPerlScripterView::PreTran slateMessa ge(MSG* pMsg)
{
if (n == 258){ // found the number by monitoring the messages and this one seamed to be passed when ever a key was pressed
...
}
return CRichEditView::PreTranslat eMessage(p Msg);
}
void CPerlScripterView::OnEditP aste()
{
GetRichEditCtrl().Paste();
...
}
void CPerlScripterView::OnEditC ut()
{
GetRichEditCtrl().Cut();
...
}
this seams to work but it doesn't take care of everything that can happen, for example someone uses the replace text option.
Is there a window message like EM_CHANGE.. I belive that works for CEditView.
I can't see to find how to make it call my function when the text is changed. That way I would do that syntax highlight again.
BOOL CPerlScripterView::PreTran
{
if (n == 258){ // found the number by monitoring the messages and this one seamed to be passed when ever a key was pressed
...
}
return CRichEditView::PreTranslat
}
void CPerlScripterView::OnEditP
{
GetRichEditCtrl().Paste();
...
}
void CPerlScripterView::OnEditC
{
GetRichEditCtrl().Cut();
...
}
this seams to work but it doesn't take care of everything that can happen, for example someone uses the replace text option.
Is there a window message like EM_CHANGE.. I belive that works for CEditView.
Please remain active in your questions here and provide feedback to the Experts who help you. If more is needed, let them know.
Thank you,
Moondancer - EE Moderator
Thank you,
Moondancer - EE Moderator
MarkOttoSmith has not responded to my request of 4/27/02, nor to help posted by Experts. It looks like this is left in my hands to finalize.
Expert input is appreciated here so I can be fair in the finalization of this question.
Thanks,
Moondancer - EE Moderator
Expert input is appreciated here so I can be fair in the finalization of this question.
Thanks,
Moondancer - EE Moderator
Hmm
Can be point to the existing solition accepted as answer?
Can be point to the existing solition accepted as answer?
ASKER
no solution was suggested. But i managed to find out using the msdn that by doing something like
long eventmask = GetRichEditCtrl().GetEvent Mask() | ENM_CHANGE;
GetRichEditCtrl().SetEvent Mask( eventmask );
then the ON_CONTROL_REFLECT(EN_CHAN GE, OnChanged)
would call OnChange when the doc changed
long eventmask = GetRichEditCtrl().GetEvent
GetRichEditCtrl().SetEvent
then the ON_CONTROL_REFLECT(EN_CHAN
would call OnChange when the doc changed
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Can you check www.codeguru.com and www.codeproject com? there are several syntax highlighers at this sites you can choose from RichEdit based and Pure CWnd derived ones.