StyledText in TextPainter [message #1744066] |
Thu, 22 September 2016 03:13  |
Eclipse User |
|
|
|
Hello,
we wondered, why there is a Text in the TextPainter and not a StyledText. Are there any reasons for that?
Thanks
Nico Linder
|
|
|
|
|
|
Re: StyledText in TextPainter [message #1751631 is a reply to message #1744101] |
Thu, 12 January 2017 00:58   |
Eclipse User |
|
|
|
Hi,
I have the need for an editor and painter which support links (which the RichTextEditor/Painter does not). So I thought of a StyledText-like editor/painter, which is however also not yet supported.
When digging a bit deeper into the implementation to see what it would need to make links working, I think I understood the following:
to implement linking, somehow I have to remember the area that should be responsive to the mouse, and a link target ('href') associated with this area
during the painting process, I could compute these areas
I cannot store them in the painter, however, since painters are not associated with the cell
the cell is created on the fly, so I cannot store it there, eiter
I currently have two ideas how to do it:
store it somehow in the data associated with the cell, and therefore I would make the users via the data providers responsible for storing the data. For example, I could create a new interface ICellPainterData which gives access both to the 'real' data and to the painter data. It doesn't feel like the best way to do it (because it requires the users of the NatTable to store internal data), but that's the best (easiest) idea I had so far.
Probably however it is best to store the data in the painter itself, somehow in a data type which stores objects based on cell row/colum indices...
Would you have alternative suggestions?
Thank you!
Joachim
[Updated on: Thu, 12 January 2017 01:50] by Moderator
|
|
|
|
Re: StyledText in TextPainter [message #1751709 is a reply to message #1751642] |
Thu, 12 January 2017 13:26  |
Eclipse User |
|
|
|
Hi,
thank you for the Papyrus hint. The link should be part of a longer text, the text should be able to contain more than one hint, and potentially also support other features (e.g. mouse over/tooltips) based on the location of the mouse pointer over the cell. Therefore, the 'active regions' of the cell need to be stored to be accessible for the UI bindings.
I'll have a look at what Papyrus is doing and how the RichText feature could be extended.
Regards!
|
|
|
Powered by
FUDForum. Page generated in 0.03276 seconds