Annonces Google
Serveur IRC
Serveur : irc.portlane.se
Canal : #AmigaNG
Activité du Site

Pages vues depuis 25/07/2007 : 25 185 203

  • Nb. de membres 187
  • Nb. d'articles 1 270
  • Nb. de forums 19
  • Nb. de sujets 20
  • Nb. de critiques 24

Top 10  Statistiques

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

Définir plusieurs couleurs de "pen" dans un texteditor (MUI)#2239

4Contributeur(s)
zzd10hartblinksinisrus
3 Modérateur(s)
K-LElwoodcorto
artblink artblinkicon_post
Salut,

Ca y'es, coloration syntaxique quasi ok, mais j'ai un problème

Comment définir plusieurs pen? exemple:

Pen 1 = Bleu
Pen 2 = Rouge
Etc...

et comment les utiliser dans un texteditor?

J'arrive a utiliser qu'une seule couleur différente du noir, c'est normal?

Merci


zzd10h zzd10hicon_post
Apparement il n'y a pas besoin de Pen.

Regarde la démo "Elided Text" dans MUI:Demos et le source dans ton SDK:MUI/C/Examples/ElidedText.c.

tu peux mettre directement les valeurs RGB que tu veux, plus pratique, non ?
 \033P[ff0000]BONJOUR\033P[000000]




artblink artblinkicon_post
Pratique en édition, mais le problème pépère, c'est quand tu charge le fichier, moi j'ai ça pour définir le pen :

[1]Mot coloris[0]

[1] étant le pen 1
[0] étant le pen 0, mais aucune information sur la couleur a utiliser

Donc, quand je charge le fichier dans mon texteditor:

[1] couleur par défaut de l'utilisateur
[0] idem

Donc, je ne peu définir que 2 couleurs différentes, 1 ou 0

Pas top cette histoire :-(
zzd10h zzd10hicon_post
Je ne comprends pas pourquoi tu n'aurais que 2 pens.

On en a 256 sur OS4.
artblink artblinkicon_post
Oui, mais je sais pas comment choisir le pen avec muiroyale, avoue que c'est chiant ;-)

Tu fais comment sous mui "normal" stp?

Souvent, entre muiroyale et mui, les commandes sont quasi identiques (si c'est supporté dans muiroyale)
zzd10h zzd10hicon_post

Dans mon FlipPaper, j'utilise les Pens comme ça :

1) MUIA_Frame, MUIV_Frame_ImageButton, MUIA_Colorfield_Pen ,15, pour les boutons colorés

2) \33P[15]RAM Disk" pour le texte d'exemple en dessous


artblink artblinkicon_post
Ok, donc tu utlise un code echap avec P pour choisir le numéro de pen, c'est peut être pour ça que ça déconne chez moi, je pensai qu'il fallait mettre une couleur RVB.

Bon, j'y retourne

Par contre, je vois sur un précédent post que t'avais mis \033P[ff0000]

C'est pas plutôt \33P[ff0000]?

Moi c'est du décimal, donc ce sera \27 (\33 = code en octal si je ne me goure pas ;-) )

zzd10h zzd10hicon_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" 
sinisrus sinisrusicon_post
Et y'a pas un truc "color" dans les paramètre du texteditor?

@Artblink tu veu dire que tu a un problème de couleur avec le pen ? C'est dingue ça non?

Message édité par : sinisrus / 10-01-2016 14:21
artblink artblinkicon_post
si mais c'est bizarre...

Bon j'ai une combine

A l'ouverture du texteditor :

Je choisi pen[1]
setcolor en Bleu
Je choisi Pen[2]
setcolor en rouge

Etc...

Et voilà, j'ai affecter une couleur différentes pour chaque pen

Mais c'est franchement strange cette histoire, j'ai l'impression de bidouiller... Bha, ça ne me gêne pas ;-)

Merci les gars

Voilà comment je défini les pen, fait gaffe tony, c'est space, regarde comment tu dois faire:

mui.set("editeur".. count,"pen","0")
mui.set("editeur".. count,"color",$000000)
mui.set("editeur".. count,"pen","1")
mui.set("editeur".. count,"color",$BB4400)
mui.set("editeur".. count,"pen","2")
mui.set("editeur".. count,"color",$FF0000)
mui.set("editeur".. count,"pen","0")

Bizaroïde

Message édité par : artblink / 10-01-2016 14:33
Petites Annonces

0 annonce(s) publiée(s)

Consulter

AmigaOS 4.1

Laissez-vous tenter par
AmigaOS 4.1
AmiTheme

AmiTheme