Colours and styles in texteditor.gadget

7 posts / 0 new
Last post
trixie
trixie's picture
Offline
Last seen: 5 months 1 hour ago
Joined: 2011-02-03 13:58
Colours and styles in texteditor.gadget

I wonder, has anyone been successful enough to use colours and/or text styles in OS4 ReAction's texteditor.gadget? I remember there was a thread about it over at UtilityBase but the site has been down for months, unfortunately. A piece of example code would be great!

trixie
trixie's picture
Offline
Last seen: 5 months 1 hour ago
Joined: 2011-02-03 13:58
Well, anyone? :-)

Well, anyone? :-)

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

AND
AND's picture
Offline
Last seen: 6 years 10 months ago
Joined: 2011-01-20 12:22
Well, I do not have example

Well, I do not have example code, but can quote the texteditor autodoc to shed some light on your issue:


GV_TEXTEDITOR_ImportHook_Plain:

(ESC) + u Set the soft style to underline.
(ESC) + b Set the soft style to bold.
(ESC) + i Set the soft style to italic.
(ESC) + n Set the soft style back to normal.
(ESC) + h Highlight the current line.
(ESC) + p[x] Change to color x where x is taken from the colormap.
0 means normal. The color is reset for each new line.

The following sequences are only valid at the beginning of a line.

(ESC) + l Left justify current and following lines.
(ESC) + r Right justify current and following lines.
(ESC) + c Center current and following lines.
(ESC) + [s:x] Create a separator. x is a bit combination of flags:
Placement (mutually exclusive):
LNSF_Top
LNSF_Middle
LNSF_Bottom
Cosmetical:
LNSF_StrikeThru - Draw separator on top of text.
LNSF_Thick - Make separator extra thick.

In console.device autodoc you find the ASCII-Code of ESC:


... (ESC) is a character with the hex value 1B (or the decimal value 27).

Hope this helps.

trixie
trixie's picture
Offline
Last seen: 5 months 1 hour ago
Joined: 2011-02-03 13:58
This used to work on OS3.x

This used to work on OS3.x but sadly, not with the OS4 texteditor.gadget: the escape codes just seem to be ignored. Plus, being only able to set text style/colour at text import time is a bit limiting. I need to specify a portion of text and set it to a specific style/colour - ie. no import involved.

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

Rigo
Rigo's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2011-01-24 21:55
No, this is not posible with

No, this is not posible with the texteditor as it stands today.

Simon

trixie
trixie's picture
Offline
Last seen: 5 months 1 hour ago
Joined: 2011-02-03 13:58
@Rigo No, this is not posible

@Rigo

No, this is not posible with the texteditor as it stands today.

I see, good to know. Perhaps it's time to bury the whole thing and replace it with richeditor.gadget? It's really difficult to develop serious software for OS4 if the GUI components are so limited!

Could you also take a peek at my other texteditor-related question in this thread?

Thanks!

AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2

Rigo
Rigo's picture
Offline
Last seen: 1 year 10 months ago
Joined: 2011-01-24 21:55
Replied, although you won't

Replied, although you won't be any the wiser for it :)

Simon

Log in or register to post comments