Seite 1 von 1

TXControl und Spell checking

Verfasst: Di, 12. Apr 2016 14:38
von Dietmar
Hallo,

ich benutze das TXControl für die Eingabe von formatierten Texten und würde nun gerne auch das vorhandene spell checking (bzw. die Anzeige der falsch geschriebenen Worte) benutzen.
Dazu bekommt man als ersten Parameter eines Callbacks den geänderten Text übergeben und soll mittels einem zweiten Parameter ein Array von long-Werten (die die Position der falschen Worte beschreiben) an das Control zurückgeben.

Code: Alles auswählen

::oTXControl:SpellCheckText := {|cText, aWrong|::spellCheck(cText, @aWrong)}

Hat hier jemand schon Erfahrung, wie diese Rückgabe aufgebaut sein muss?

Code: Alles auswählen

Method _txcontrol:spellCheck( cText, aWrong )
// cText auswerten und Werte ermitteln
// diese sollen dann in einem Array von long-Werten zurückgegeben werden
aWrong := ??
Return self
Auszug aus der TXControl-Hilfe:

TXTextControl.SpellCheckText Event
Occurs, if the document's text has been altered and the spelling of the new text must be checked. This event occurs only, if the EnableSpellChecking property has been set to true.

Syntax
SpellCheckText(Text, MisspelledWordPositions)

Text
Is the text to check.

MisspelledWordPositions
Is an array of Long values which can be used to inform the TextControl about misspelled words.
This array must be created in the event handler after the specified text has been examined.
The array must contain two entries for each misspelled word: a start position and an end position.
Both values must be one-based indices in the specified text.
The example text 'This iss an exxample' contains two misspelled words: 'iss' and 'exxample'.
For this example an array of four Long values must be created containing the values 6, 8, 13, 20.
TextControl uses these positions to underline the misspelled words with a red zigzag line.

Data Types
Text: String
MisspelledWordPositions: Array of Long

Vielen Dank und viele Grüße

Dietmar

Re: TXControl und Spell checking

Verfasst: Fr, 20. Jan 2017 6:35
von AUGE_OHR
hat jemand das Rätsel gelöst ?

Re: TXControl und Spell checking

Verfasst: Fr, 20. Jan 2017 9:11
von Tom
Das Control hat zwar die Schnittstelle, aber keine eigene Rechtschreibprüfung. Ich habe eine dazugekauft. Die Darstellung in der Doku und auf der Site ist äußerst irritierend.