B4J Question Check for selection in RichTextFX [SOLVED]

ThRuST

Well-Known Member
Licensed User
Longtime User
As the title says, is there an easy way to do that? my mind is blank after a long day with code so..

Anyway, it's based on this

when a button is clicked..

B4X:
fx.Clipboard.SetString(CodeArea1.GetSelectedText) ' GetText selects all
 
Last edited:

ThRuST

Well-Known Member
Licensed User
Longtime User
a new day, another solution enjoy

 
Last edited:
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
And here is the final preffered behavior. Depending on which TabPane is selected (Doc/Code as in Athena) , here's the logic.

If nothing is selected in the RichTextFX, then ALL the contents is copied to the clipboard.
If something is selected, that portion is copied to the clipboard.
This means, if the view is empty the clipboard becomes empty as well.

Info about project Athena can be found in B4J/Share my creations. Go here

 
Last edited:
Upvote 0

ThRuST

Well-Known Member
Licensed User
Longtime User
@Mashiane Thanks I had to search Google to find out about length. It's indeed very powerful and most useful. The FXnotify is useful but will probably not be needed because sound themes has proven to be much more convenient. The RichTextFX was wrapped by Stevel05 and can be found in the forum, so you can use the classes he implemented right outa the box. There's also the option to print. It depends on Java 8 as there were no Java 11 support at the time he wrapped it. Actually he called it RichViewFX and it's available here
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…