Platforms to show: All Mac Windows Linux Cross-Platform
/MacCocoa/Spellcheck/NSSpellChecker Grammar
Required plugins for this example: MBS MacBase Plugin, MBS MacCocoa Plugin, MBS Main Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCocoa/Spellcheck/NSSpellChecker Grammar
This example is the version from Sun, 17th Mar 2012.
Project "NSSpellChecker Grammar.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Löschen"
Const kFileQuit = "Beenden"
Const kFileQuitShortcut = ""
End Class
Class Window1 Inherits Window
EventHandler Sub Open()
dim s as new NSSpellCheckerMBS
dim r as NSRangeMBS
dim details(-1) as Dictionary
dim text as string = "This is just an example example text with a grammar error."
r=s.checkGrammarOfString(text, 0, "en", false, details)
dim lines(-1) as string
lines.Append "Result: "+r.String
lines.Append ""
lines.Append ""
if UBound(details)>=0 then
for each dic as Dictionary in details
for each k as variant in dic.keys
dim v as Variant = dic.value(k)
lines.Append k
lines.Append v
next
next
end if
MsgBox join(lines,EndOfLine)
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&Ablage"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Bearbeiten"
MenuItem EditUndo = "&Rückgängig"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "&Ausschneiden"
MenuItem EditCopy = "&Kopieren"
MenuItem EditPaste = "&Einfügen"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "&Alles auswählen"
End MenuBar
End Project
The items on this page are in the following plugins: MBS MacCocoa Plugin.