Page 1 of 2
TextFormatting Codes = BackPen
Posted: Mon Aug 31, 2015 10:13 pm
by djrikki
Perhaps its because MUI doesn't support it however without asking I don't know (!), so Andreas perhaps you can tell me - can it be possible to be able to set a BackPen within FloatText?
Using CodeBench layout/colours as an example (see below) I want to be able to present the Line Number as a distinct visual vertical band of colour e.g. Light Blue with the Line Numbers in White Text.
Re: TextFormatting Codes = BackPen
Posted: Wed Sep 02, 2015 12:19 am
by airsoftsoftwair
No, it's not possible because MUI doesn't support this. Complain to the MUI developers
Re: TextFormatting Codes = BackPen
Posted: Wed Sep 02, 2015 2:54 pm
by djrikki
Ok will do!
Re: TextFormatting Codes = BackPen
Posted: Wed Sep 02, 2015 6:27 pm
by airsoftsoftwair
Good news for you! According to Thore Böckelmann of OS4 MUI fame it is indeed already supported but just not documented. You need to use \33B to enable background colour mode and then use \33p[RRGGBB] to set the background colour. To turn off background colour mode, you have to use \33F.
Here is an example:
Code: Select all
<text>Hello! \33B\33p[000000]\33P[ff0000]MUI\33F\33P[000000] is magic</text>
This will print MUI in red letters on black background.
HTH!
Re: TextFormatting Codes = BackPen
Posted: Wed Sep 02, 2015 8:55 pm
by djrikki
Excellent news thx guys
Re: TextFormatting Codes = BackPen
Posted: Thu Sep 03, 2015 8:10 am
by djrikki
Thanks, desired effect achieved, however it would be neat if I could work out how to change the background of the textblock from 'Amiga Grey' to White? Any ideas?
Re: TextFormatting Codes = BackPen
Posted: Thu Sep 03, 2015 8:44 am
by djrikki
Okay so I've moved on to looking at the TextEditor class instead as possible way to get a White background with formatted text in Back/Foreground colours that I choose.
Fail...
Okay clearly text formatting codes aren't accepted here, fine, I'll look at what Attributes the Class has. Ah, so I can use .Color to change the colour of the font, but seemingly no Attribute for BackColor with this particular Class.
Re: TextFormatting Codes = BackPen
Posted: Thu Sep 03, 2015 10:07 pm
by airsoftsoftwair
djrikki wrote:Thanks, desired effect achieved, however it would be neat if I could work out how to change the background of the textblock from 'Amiga Grey' to White? Any ideas?
What about
Area.BackgroundRGB?
Okay clearly text formatting codes aren't accepted here, fine, I'll look at what Attributes the Class has. Ah, so I can use .Color to change the colour of the font, but seemingly no Attribute for BackColor with this particular Class.
TextEditor.mcc is a different kind of beast. It doesn't use MUI's text engine at all so things will always be different with TextEditor.mcc. Better stick with Floattext.
Re: TextFormatting Codes = BackPen
Posted: Sat Jan 23, 2016 10:41 am
by djrikki
Hi Andreas,
Code: Select all
Function base:AddCodeLineNumber(plain,text$)
base:DebugPrint("base:AddCodeLineNumber() " .. IIf(plain = True, "OFF", "ON") )
Local textfile, count = SplitStr(text$, "\n")
text$ = ""
If plain = False
For Local l = 0 to count-1 Do text$ = text$ .. "\27B\27p[99B6D9]\27P[FFFFFF]" .. PadNum(l+1,4) .. "\t\27P[000000]\27F " .. textfile[l] .. IIf(l <> count-1,"\n","")
Else
For Local l = 0 to count-1 Do text$ = text$ .. PadNum(l+1,4) .. "\t " .. textfile[l] .. "\n"
EndIf
Return(text$)
EndFunction
Are you able to do a some extensive tests your end mixing BackPens and Regular pens with text blocks and push them into a floattext object? I am getting unbreakable program freezes which I have been unable to pinpoint as a problem in my code - potential floattext.mcc issue but Thore may require more detail.
PS: BackgroundRGB not accepted on a floattext.
Re: TextFormatting Codes = BackPen
Posted: Sat Jan 23, 2016 11:06 am
by ArtBlink
Hello,
Your editor is look like very good