Page 1 of 1

Autotext Functionality

Posted: Tue Nov 13, 2012 10:51 am
by Camphausen
I would like to add Autotext functionality. Every time I press a key the editor will read the current word (no matter whether in a table or normal text area) and look it up in a database. When I press F6 (or similar) the text found in the database will replace my current word in the editor.
I hope my description is easy to understand.
Thanks for your help.
Christoph

Posted: Tue Nov 13, 2012 11:47 am
by Sergey Tkachenko
You can call GetCurrentWord from RVGetTextW unit (or from RVGetText unit, if you use non-Unicode version of Delphi and non-Unicode documents).
Then, to replace a word, call SelectCurrentWord and InsertText.

(all these methods must be called for SRichViewEdit.ActiveEditor).

An example can be found in Demos\RVDemos\Assorted\AutoComplete\