|Re: StyledText in TextPainter [message #1751631 is a reply to message #1744101]
||Thu, 12 January 2017 05:58
| Joachim Fox
Registered: January 2011
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?
[Updated on: Thu, 12 January 2017 06:50]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02375 seconds