On Wed, Jul 09, 2008 at 05:41:35PM +0200, Johannes Hofmann wrote:
Hi,
as you may have noticed, there is a problem with selecting multi-byte characters. If you enlarge the selection so that e.g. '?' is at the edge of the selected text, the character changes in weird ways. This is due to the Textblock::sendSelectionEvent() code that simply uses charPos++, and charPos-- whereas it should do something like utf8fwd() or utf8back() from fltk. The problem here is that we can't simply use fltk functions in textblock.cc as it is independent of the GUI toolkit. Any ideas how to solve this? I thought about adding wrappers to fltkmisc.cc but that's also a bit ugly...
AFAIS, utf8fwd() and utf8back() can be defined in platform.hh (right after textWidth() for instance), and implemented as wrappers in fltkplatform.hh, then used from layout in the same inlined way as textWidth. -- Cheers Jorge.-