Highlighting in realtime (guitar chords)

General TRichView support forum. Please post your questions here
Post Reply
Garfunkel
Posts: 1
Joined: Tue Jan 17, 2006 6:26 am

Highlighting in realtime (guitar chords)

Post by Garfunkel »

Using TRichViewEdit :
I need to highlight all the keywords I specify in an array (say, 'Hm', 'Am', 'C7', 'D#','Em','C'...). Something you provided in your MultiDemo (7.Search & Mark). BUT...

1) I need it to be done in real time (as one writes or paste, that is changes the
document) and not after one clicks a button (I think onchange event could do?)
2) I would like to un-highlight a word if it doesn't match any of my keywords anymore. For example:

One writes:

C Hm Em Am
Yesterday all my troubles seemed so far away...

as he types the above words which are actually chords (c, Hm, Em, Am) are highlighted because they are in my array of keywords. But then he make a change...

AC Hma Em Am
Yesterday all my troubles seemed so far away...

Then 'AC' and 'Hma' should be unhighlighted immediately in real time as they are not in
my array.
And besides, I have troubles with returning the caret to the position it had been before
one started to enter words. The caret seems to be prone to 'run' to the beginning or to
the end of the document. The caret should stay on the same position the user put it or at the end of the document if a text was pasted in RichView.
I hope I made myself clear? Please, help me!
Sergey Tkachenko
Site Admin
Posts: 17310
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

May be you can use http://www.trichview.com/resources/synt ... ewedit.zip - a simple highlighter based on TRichViewEdit.
Post Reply