Label Text Selection
quizynox
quizynox at gmail.com
Fri Aug 16 15:40:09 UTC 2024
Hello,
Both TextFlow and Text support the HitInfo API, which makes getting
selected characters very easy. Then you just need to wrap the selected
characters in Path. The way it is implemented in GemsFX with overlay
pane is quite complicated. Here is a rough sketch of the selectable
TextFlow I plan to release in AtlantaFX. I think implementing a
selectable Label by wrapping a text node in Region isn't much harder.
But I wouldn't mind if it was the Label out-of-the-box feature, although
I think it would require implementing some sort of selection model, so
it's unlikely to happen.
source code:
https://pastebin.com/9QKWYfx1
On 16/08/2024 14.12, Dirk Lemmermann wrote:
> Hi everyone,
>
> I recently added a custom text control (called “TextView") to the GemsFX project. It supports a somewhat limited text selection. Selection is only possible on a per-word basis. I received a bit of feedback on this control and I was wondering whether it would be worth thinking about adding a general text selection capability to labels. Is this something worth looking into? Is it even feasible?
>
> I guess one of the reasons why this topic keeps popping up is the fact that users are so used to selecting any text in web pages, but they can’t do it in desktop apps.
>
> Dirk
>
More information about the openjfx-dev
mailing list