website logo
Auteur
avatar
zzd10h

Forum » » Création-Développement » » Définir plusieurs couleurs de "pen" dans un texteditor (MUI)


Posté : 10-01-2016 13:55 icone du post

C'est comme tu veux, un n? de Pen ou le code Hexa RGB d'une couleur.

Dans FlipPaper, je suis obligé d'utiliser des n? de Pen pour changer la couleur de la police du WB.

Sinon, lis MUI/AutoDocs/MUI_Text.doc, il y a tous les caractères d'échappement.


'\n' Start a new line. With this character you can e.g. create
        multi line buttons.

'\t' Insert a TAB character. The TAB will be as wide as four
        space characters.

ESC -    Disable text engine, following characters will be rendered
        without further parsing.

ESC u    Enable the underline soft style.

ESC U    Disable the underline soft style.

ESC b    Enable the bold soft style.

ESC i    Enable the italic soft style.

ESC t    Enable the outline soft style.

ESC T    Disable the outline soft style.

ESC s    Enable the shadow soft style.

ESC S    Disable the shadow soft style.

ESC g    Enable the ghost soft style.

ESC G    Disable the ghost soft style.

ESC n    Set the soft style back to normal.

ESC B    Enable JAM2 drawing mode. This must be set to make use of the
        set background color.

ESC F    Disable JAM2 drawing mode. The following text will be rendered
        using the text color only, no matter which background
        color is set. This is active by default.

ESC V    Enable INVERSVID drawing mode.

ESC v    Disable INVERSVID drawing mode.

ESC h    Disable the rendering of !embed!ded images and objects.

ESC H    Enable the rendering of !embed!ded images and objects. This
        is active by default.

ESC M    Use MARKTEXT pen as front pen.

ESC m    Use MARK pen as front pen.

ESC <n>  Use pen number n (2..9) as front pen. n must be a valid
DrawInfo pen as specified in "intuition/screens.h".

ESC c    Center current (and following) line(s).
This sequence is only valid at the beginning of a
string or directly following a newline character.

ESC r    Right justify current (and following) line(s).
This sequence is only valid at the beginning of a
string or directly following a newline character.

ESC l    Left justify current (and following) line(s).
This sequence is only valid at the beginning of a
string or directly following a newline character.

ESC I[s] Draw MUI image with specification <s>. See autodocs
of image class for image spec definition. Appending
",STATE=1" to the image spec will draw the image in
selected state if that is possible. This requires the
image to be have multiple images. This is true for name
extensions like ".mb0/1", ".mf0/1" or ".mim".

ESC p[p] Background pen number
ESC P[p] Text pen number

ESC p[RRGGBB]
Direct RGB color value specifying background color on truecolor
displays.

ESC P[RRGGBB]
ESC P[AARRGGBB]
ESC P[AA------]
Direct (A)RGB value specifying text color on truecolor displays.
When AA------ is used, currently set color is not altered,
only its alpha value (transparency).

ESC A[x] Draw raw ARGB data taken from struct MUI_AlphaData pointed to
by <x>, i.e. "\033A[deadbeef]". The address may be prefixed with
a '$'.

ESC O[x]
ESC O[x,width]
Draw a MUI object pointed to by <x>, i.e. "\033O[deadbeef]". The
address may be prefixed with a '$'. The additional width value is
optional. If it is omitted the object will be queried for its
minimum width.

Note:    These rules apply to all MUI strings, not only to
        a text objects contents. You can e.g. format the
        columns of a listview or include images in a cycle
        gadgets entries.

    EXAMPLE
...
MUIA_Text_Contents, "\33c\33bMUI\33n\nis magic" 

Cet article provient de Le site des utilisateurs francophones actuels et futurs d'AmigaOS 4.x
https://amiga-ng.org/viewtopic.php?topic=2239&forum=14