TXControl und Spell checking

Moderator: Moderatoren

Antworten
Dietmar
Rookie
Rookie
Beiträge: 4
Registriert: Mi, 17. Okt 2012 7:34

TXControl und Spell checking

Beitrag 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
Benutzeravatar
AUGE_OHR
Marvin
Marvin
Beiträge: 12903
Registriert: Do, 16. Mär 2006 7:55
Wohnort: Hamburg
Hat sich bedankt: 19 Mal
Danksagung erhalten: 44 Mal

Re: TXControl und Spell checking

Beitrag von AUGE_OHR »

hat jemand das Rätsel gelöst ?
gruss by OHR
Jimmy
Benutzeravatar
Tom
Der Entwickler von "Deep Thought"
Der Entwickler von "Deep Thought"
Beiträge: 9345
Registriert: Do, 22. Sep 2005 23:11
Wohnort: Berlin
Hat sich bedankt: 100 Mal
Danksagung erhalten: 359 Mal
Kontaktdaten:

Re: TXControl und Spell checking

Beitrag 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.
Herzlich,
Tom
Antworten