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 » Mon Aug 31, 2015 10:13 pm

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: 2477
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: TextFormatting Codes = BackPen

Post by airsoftsoftwair » Wed Sep 02, 2015 12:19 am

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 » Wed Sep 02, 2015 2:54 pm

Ok will do!
Evolve - Rapid GUI Development tool for MUI Royale and RapaGUI
http://myevolve.wordpress.com

User avatar
airsoftsoftwair
Posts: 2477
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: TextFormatting Codes = BackPen

Post by airsoftsoftwair » Wed Sep 02, 2015 6:27 pm

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 » Wed Sep 02, 2015 8:55 pm

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 » Thu Sep 03, 2015 8:10 am

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 » Thu Sep 03, 2015 8:44 am

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: 2477
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: TextFormatting Codes = BackPen

Post by airsoftsoftwair » Thu Sep 03, 2015 10:07 pm

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 » Sat Jan 23, 2016 11:41 am

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: 435
Joined: Mon Nov 01, 2010 11:37 am
Location: Albert - France
Contact:

Re: TextFormatting Codes = BackPen

Post by ArtBlink » Sat Jan 23, 2016 12:06 pm

Hello,

Your editor is look like very good ;-)

Post Reply