Rich Text edit window

Issue #1141 new
Marvin Gülker
created an issue


I know this is a very complex feature request and is not going to be implemented anytime soon, but I thought I add it to the tracker so it is at least there.

What I would like to request is a Rich Text Edit window, i.e. a textbox that allows the user to input text and allows that text to be colourised. That is, it should be like CEGUI::MultiLineEditbox, but allow to colourise the user's input inside it.

Background: In TSC, we have integrated a scripting engine based on mruby which allows level designers to enhance their levels using some scripting. For that, we provide a script editor window in the level editor, which is currently implemented by means of a CEGUI::MultiLineEditbox and thus looks fairly mono-coloured. We quickly received a feature request to implement syntax highlighting, but this is currently not possible.

Here's a forum thread where I asked about this topic earlier.

Greetings Marvin

Comments (5)

  1. Marvin Gülker reporter

    I'm pretty indifferent to the format used, as long as it can be used to create syntax highlighting while the user is typing. I don't quite get how this should be possible with HTML, but maybe I'm simply misunderstanding. Maybe another approach is to have a callback/event that allows the programmer to tokenize the input himself, that way the window would be agnostic towards the way things are highlighted, and no fixed list of languages supported would be required.

    Just my two cents. Marvin

  2. Yaron Cohen-Tal

    @Marvin Gülker: Let's divide the problem to 2:

    1. Support rich text.
    2. Support syntax highlighting.

    Obviously, it's better to support rich text also regardless of syntax highlighting. For that, I suggest html. Obviously only a subset of it - for syntax highlighting all we need to support is to change the foreground color.

    As for syntax highlighting, there r existing libraries that can turn [ruby] code to html, which u can indeed use with events. Note, however, that the whole text will have to b parsed each time a single character is inserted. Implementing dynamic syntax highlighting is something much more complex, I think, which we prolly won't implement and I doubt you'll need. Even Emacs doesn't do it properly e.g. with C++.

  3. Log in to comment