How to struck out text in a TextArea? There is .SelUnderline but no .SelStruckOut
Love the user name… One of my favourite game series…
There is no feature to do strike out… You could always take a look to see if there are declares to get it done on the target platform(s)…
for macos you can use the splendid TextArea experiments from Axel Schneider
For x-Plat you could use http://www.bkeeney.com/formatted-text-control/
Because http://developer.xojo.com/styledtext says:
For which platforms?
I may be able to add it for Mac + Win via plugin.
I need it for Mac only.
Thanks, Christian, but I only got a very old MBS version for a very old Xojo
You could update plugins and use current plugin version with old Xojo.
I found two ways to do this:
[code]dim t as NSTextViewMBS = TextArea1.NSTextViewMBS
dim s as NSTextStorageMBS = t.textStorage
const NSUnderlineStyleSingle = 1
dim d as Dictionary = t.selectedTextAttributes
d.Value(NSAttributedStringMBS.NSStrikethroughStyleAttributeName) = NSUnderlineStyleSingle
t.selectedTextAttributes = d[/code]
or
[code]dim t as NSTextViewMBS = TextArea1.NSTextViewMBS
dim s as NSTextStorageMBS = t.textStorage
const NSUnderlineStyleSingle = 1
dim r as NSRangeMBS = t.selectedRange
s.addAttribute NSAttributedStringMBS.NSStrikethroughStyleAttributeName, NSUnderlineStyleSingle, r[/code]
Great, thanks
If you convert to an HTMLViewer, it supports StrikeOut , and cross-platform.
And I’ll add WinSelStrikeOutMBS for my win plugin to do it on Windows.
Just FYI, its usually StrikeThrough not StrikeOut.
I can change the name later.
Thanks Greg.