TextFormatting Codes = BackPen

Discuss GUI programming with the MUI Royale plugin here
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

TextFormatting Codes = BackPen

Post 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.

Image

Image
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TextFormatting Codes = BackPen

Post by airsoftsoftwair »

No, it's not possible because MUI doesn't support this. Complain to the MUI developers :)
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: TextFormatting Codes = BackPen

Post by djrikki »

Ok will do!
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TextFormatting Codes = BackPen

Post 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!
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: TextFormatting Codes = BackPen

Post by djrikki »

Excellent news thx guys
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: TextFormatting Codes = BackPen

Post 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?

Image
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: TextFormatting Codes = BackPen

Post 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.

Image

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.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: TextFormatting Codes = BackPen

Post 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.
djrikki
Posts: 682
Joined: Wed Apr 06, 2011 12:26 am

Re: TextFormatting Codes = BackPen

Post 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.
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com
ArtBlink
Posts: 484
Joined: Mon Nov 01, 2010 10:37 am
Location: Albert - France
Contact:

Re: TextFormatting Codes = BackPen

Post by ArtBlink »

Hello,

Your editor is look like very good ;-)
Post Reply