Command |
TEXT |
|
|
Description |
Create or update Text.
Use Carriage Return and/or Line Feed for multi line entry "\\0D\\0A".
The font and colour are defined in the style.
If the cursor relative position is 'CC' (Centre Centre) it is easy to locate text in the centre of images like buttons.
Text areas can overlap other text areas when for example a 'drop shadow'
is required. Text can include embedded hex codes to access Unicode
fonts and a cursor.
Faster display updates occur if text uses a solid background colour (ie no alpha blending). |
|
|
Syntax/Parameters |
TEXT(Name,Text,Style)
TExt(Name,Text,Style,PosX,PosY); |
|
|
Style |
STYLE(Txt32ASC16,TEXT) //assign a name for
the style like Txt32ASC16
{
font="ASC16B,16THAI"; //define fonts using
built in or preloaded .FNT files via LIB command
size=2;
//a 24x24 font is expanded to a 48x48 font. default=1
col=white;
//"\\000000" to "\\FFFFFF" or reserved words from the colour chart.
back=black;
//ONLY USE where a page has a style updated=changed;
opacity =
n;
// n = 0..100 where 0=transparent..100=opaque (default=100)
maxLen=64;
//maximum length of text. default =32, maximum=512
maxRows=4;
//maximum number of rows=32 where new line code
\\0D\\0A is used.
rotate=90;
//rotation relative to screen 0, 90, 180, 270. default=0
justify = cur; // Default. Justification is determined by curRel. (TL,CL,BL=left;
TC,CC,BC=centre; TR,CR,BR=right)
yAlign = cur; // Default. Vertical alignment is determined by curRel. (TL,TC,TR=top;
CL,CC,CR=centre; BL,BC,BR=bottom)
xtrim=y;
//trim text box to width of text. Set to N for numbers to prevent them
moving according to width.
curRel=CC;
//specify placement relative to cursor. CC Centre Centre , TC Top
Centre,
}
//BC Bottom Centre, LC Left Centre,
RC Right Centre, TL Top Left,
// BL Bottom Left, TR Top Right, BR
Bottom Right |
|
|
Options |
Editable Text and Visible Cursor - v37.00
A text can contain single byte hex of the form \\00 to \\FF
A text can contain hidden codes for use in password and editable fields.
\\01 defines the text as a PASSWORD so that only ***** are shown.
\\02 defines a hidden cursor and \\03 a hidden cursor with insert ON
\\04 defines an underline cursor and \\05 an underline cursor with insert ON
\\06 defines a block cursor and \\07 a vertical cursor with insert ON
Always place the cursor before the applicable character.
When a page or text is hidden, the cursor remains at its current
location.
The CALC() command can then be used to manipulate the text and cursor in
EditBox.
Example Editable Text:
TEXT(EditBox,"Hello\\04World",8ptTextRed); this places an underline cursor at W
Fonts
Fonts are available using single byte, 2 byte and UTF8 multi-byte
coding.
Built in ASCII fonts have the
reserved names Ascii8, Ascii16, Ascii32 (case sensitive).
Other library fonts are uploaded using the LIB() command and have file type .FNT
These are available for download from the character fonts web page at
www.itrontft.com.
Unique Font Overlay
It is possible to overlay one font over another to enable single byte
operation with ASCII from \\20 to \\7F and Cyrillic, Greek, Hebrew,
Bengali, Tamil, Thai or Katakana from \\80 to \\FF. The LIB() command is
used to load the extended font at \\0080 instead of it's normal UNICODE
location. The style for a text can then specify font="MyASCII,MyThai";
causing the Thai to overlap the ASCII from \\80 to FF.
Text Alignment - v49.00
To support "monospaced"
fonts (ie those that have the same x-advance), the text style parameter
xtrim=Y|N
is used.
The default is Y which makes text boxes fit to the width of the visible
text. However, for monospaced fonts (eg numbers) this can cause problems
with the numbers 'shifting' left and right (eg number 1 is narrower than
2). To stop this, set
xtrim=N;
Text Justification - v49.14
Text justification style property for displaying multiple lines in text box:
justify = left; (or L) // Justify left (default)
justify = right; (or R) // Justify right
justify = centre; (or C) // Justify centre
Example1: STYLE( stText, text ) { font=Ascii16; col=blue; justify=right; }
Example2: LOAD( stText.justify, centre );;
TEXT Styles
Support for accepting both "centre" and "center" in parameters
- v49.16.
Support for opacity - v49.00.
Text rotation supported - v38.00.
New Text Parameters - width, bcol, padding, xSpace, ySpace [work in
progress] - v49.37
* Added parameters to create text box to text style:
width - width of border (default = 0)
bcol - colour of border (default = white)
padding - number of pixels to add between text area and border (default = 0)
xSpace - extra spacing between chars (default = 0)
ySpace - extra spacing between lines (default = 0)
Structure support in TEXT() commands - v49.44
* Structure
variables can now be used for the source in the TEXT() command.
Support for immediate ints and floats in TEXT(); - v49.46
Changed
TEXT(name,text,...) to support text = int, flt as well as existing
var, "txt".
TEXT( txt1, "String", stTxt );
TEXT( txt2, 100, stTxt ); // Now supported
TEXT( txt3, 3.142, stTxt ); // Now supported
TEXT( txt4, varTxt, stTxt );
TEXT( txt5, varU8, stTxt );
TEXT( txt6, varFlt, stTxt );
Text Alignment not correct with rotated text - v49.43
* Default text alignment fixed for rotated text and multi-line text.
Text Wrapping & Text Boxes - v49.49
View text wrapping editor application
* Can now pass width/height in TEXT command, similar to DRAW, so
that a text box/area can be created.
* This gives the following combinations:
- Create Text:
TEXT( name, "Text", style );
TEXT( name, "Text", style, posX, posY );
TEXT( name, "Text", sizeX, sizeY, style );
TEXT( name, "Text", sizeX, sizeY, style, posX, posY );
- Update Text:
TEXT( name, "Text" );
TEXT( name, sizeX, sizeY );
TEXT( name, "Text", sizeX, sizeY );
* The text area can be one of the following types:
type=a | auto; (default)
if no solid back colour specified, text area resizes to fit text
if solid back colour is specified, text area keeps keeps maximum x
and y of text
the maxLen x maxRows properties are only used for initial allocation
of memory
type=r | resize;
text area resizes to fit current text
if sizeX and/or sizeY specified then minimum box size is sizeX/sizeY
type=m | max;
text area remains maximum text width/height of text box
if sizeX and/or sizeY specified then minimum box size is sizeX/sizeY
this is used primarily for page update=changed to wipe any previous
text
type=f | fixed;
text a rea size is fixed to sizeX x sizeY
* New Text styles available:
width = border width
bcol = border colour
xSpace = character spacing
ySpace = row spacing
padding = space between border and text
maxX = maximum box width
maxY = maximum box height
wrap = text wrap (see below)
* Text wrapping options:
wrap = n; // no wrap (default)
wrap = cc; // char cols = wrap text at character at maxLen (ie num
cols)
wrap = wc; // word cols = wrap text at word within maxLen (ie num
cols)
wrap = cb; // char box = wrap text at character at box width
wrap = wb; // word box = wrap text at word within box width
View text wrapping editor application
Using PAGE STYLE Update=Changed
To gain the faster refreshing, a few rules apply.
1/ Only the screen area where the changed entity is located is redrawn.
2/ The entity is redrawn on top of any existing pixels being displayed
in that area.
3/ Entities with transparent backgrounds will show all previous
rendering at that location in the transparent area.
4/ Hiding an entity will not produce any visible difference until a full
page refresh is performed.
To support the
"update=changed;" method.
1/ Do not use images with transparent backgrounds
2/ Specify the "back" colour in the style for text.
3/ To hide an entity, a “masking” image will need to be placed over the
entity.
4/ To refresh only the entities on a page that have been modified, use
the double semi-colon ";;" refresh method after the last entity,
e.g. TEXT( txt1, "Hello" );;.
5/ To refresh the whole page, use the SHOW( page ); method.
|
|
|
Example |
TEXT(EditBox,"Hello World",st8Red12); //creates Edit Box with user defined style st8Red12
TEXT(EditBox,"Hello People");
//modifies content of EditBox
TEXT(EditBox,TextVar);
//modifies content of EditBox with content of variable
TEXT(EditBox,"Hello\\w0020World"); // example of unicode embedded character (see fonts page)
|
|
|
Update Information |
Version |
Title |
Date |
Details |
49.54 |
Fixed Text Box Initial Size |
05 Mar 14 |
|
* When no sizeX/sizeY is specified in a TEXT(name,"",style) command and where a style type of fixed is specified, then the initial box size is defined by the style parameters as follows: IF sizeX/sizeY specified THEN box x/y is sizeX/sizeY ELSE IF maxX/maxY is specified THEN box x/y is maxX/maxY ELSE IF maxLen/maxRows is specified THEN box x/y is calculated from font size and maxLen/maxRows ELSE box x/y is display width/height
* In subsequent text updates TEXT(name,"") where no sizeX/sizeY is specified then the existing sizeX/sizeY is used.
|
|
49.52 |
Floats to Text Rounding |
27 Feb 14 |
|
Fixed issue where float rounding was unreliable
eg LOAD(RS2,%F2%3.005); returned 3.00. Now returns 3.01
|
|
49.52 |
Built-In Styles - Parameters Are Optional |
25 Feb 14 |
|
Modified "built-in" styles to make parameters optional. Simply miss out the parameter between the underscores.
TEXT(txt4,"",DST___128__CC); // Create Text with only maxLen and curRel changed from defaults PAGE(pg3,DSP__libBg){...} // Create Page with only image changed from defaults; DRAW(dr4,40,40,DSD_B__RED__BR); // Create Draw, type = box; only specifiying some parameters KEY(key2,func,100,100,DSK_C____TL); // Create Key, action = change; curRel = TL
|
|
49.51 |
Built-In TEXT, PAGE, DRAW, and IMAGE Styles |
10 Feb 14 |
|
A larger range of "default" styles has been added.
The built-in styles are prefixed by four characters as follows: * Text Styles are prefixed by "DST_" * Page Styles are prefixed by "DSP_" * Draw Styles are prefixed by "DSD_" * Image Styles are prefixed by "DSI_"
The styles are not created at start up. The style is only created the first time it is referenced from the users' project.
The style are created from the parameters within the style name itself, ie the colour black is taken from the actual name DSP_BLACK, so DSP_PINK would create a colour pink. These colours are from the colour table on the website.
Here are the rules/examples for each
Add a default TEXT style DST_ DST_col DST_col_fnt DST_col_fnt_len DST_col_fnt_len_row DST_col_fnt_len_row_cur Where col = 'col' name or 3-digit hex or 6-digit hex (see "Colours" below) fnt = 'font' 8, 16, 32 for Ascii8, Ascii16, Ascii32 or font name (see "Fonts" below) len = 'maxLen' row = 'maxRows' cur = 'curRel' Examples TEXT(txt1,"Hello",DST_BLACK_16); // Create Text, colour = black; font = built-in Ascii16; TEXT(txt2,"",DST_F30_fnt32_8_4); // Create Text, colour = \\FF3300, font = fnt32; maxLen = 8; maxRows = 4 TEXT(txt3,"",DST_RED_F32_8_4_TL); // Create Text, colour = \\FF3300, font = F32; maxLen = 12; maxRows = 4; curRel = TL
Add a default PAGE style DSP_ DSP_col DSP_col_img Where col = 'col' name or 3-digit hex or 6-digit hex (see "Colours" below) img = 'image' image name Examples PAGE(pg1,DSP_BLACK){…} // Create Page, back = black; PAGE(pg2,DSP_AB0056_libBg){…} // Create Page, back = \\AB0056, image = libBg;
Add a default DRAW style DSD_ DSD_typ DSD_typ_wid DSD_typ_wid_col DSD_typ_wid_col_fil DSD_typ_wid_col_fil_cur Where typ = 'type' of shape (best to use the single letter here) wid = 'width' of border col = 'col' colour of border (see "Colours" below) fil = 'back' colour of fill (see "Colours" below) cur = 'curRel' Examples DRAW(dr1,100,20,DSD_BOX); // Create Draw, type = box; DRAW(dr2,120,DSD_C_2_RED); // Create Draw, type = circle; width = 2; border colour = red; DRAW(dr3,60,40,DSD_B_1_RED_FD0_TL,20,40); // Create Draw, type = box; width = 1; border = red; back = \\FFDD00; curRel = TL;
Add a default IMAGE style DSI_ DSI_cur Where cur = 'curRel' Examples IMG(img1,libImg1,DSI_TL); // Create Image, curRel = TL;
The only limitations to this method is that the style name needs to fit within the 18 character entity name limit.
Colours Where the styles take a colour for a parameter, then the value can be represented in one of three ways. * The name of the colour can be specified as in the colour chart on the website, eg BLACK, BLUE, GOLD etc * A 6 digit hexadecimal number can be used, eg 123ABC which converts to \\123ABC * A 3 digit hexadecimal number can be used, eg FD0 which converts to \\FFDD00
Fonts Where the style takes a font for a parameter, then one of two options are assumed. * If the value is either 8, 16, or 32 then the built-in fonts Ascii8, Ascii16 or Ascii32 are used * Otherwise the value is assumed to be the name of a font loaded by the LIB command, eg fnt64 from LIB(fnt64,"SDHC/name.fnt");
Examples from testing:
PAGE(p1,DSP_){} STYLE(DSP_,PAGE){}
PAGE(p2,DSP_BLACK){} STYLE(DSP_BLACK,PAGE){back=BLACK;}
PAGE(p3,DSP_FD0){} STYLE(DSP_FD0,PAGE){back=\\FFDD00;}
PAGE(p4,DSP_ABC123){} STYLE(DSP_ABC123,PAGE){back=\\ABC123;}
LIB(Im1,"SDHC/page/pgMain_1.bmp"); PAGE(p5,DSP_000_Im1){} STYLE(DSP_000_Im1,PAGE){back=\\000000;image=Im1;}
PAGE(p6,DSP_blue_Im1){} STYLE(DSP_blue_Im1,PAGE){back=blue;image=Im1;}
IMG(i1,Im1,DSI_); STYLE(DSI_,IMAGE){}
TEXT(t1,"",DST_); STYLE(DST_,TEXT){}
TEXT(t2,"",DST_BLACK); STYLE(DST_BLACK,TEXT){col=BLACK;}
TEXT(t3,"",DST_blue_32); STYLE(DST_blue_32,TEXT){col=blue;font=Ascii32;}
LIB(Fnt16,"SDHC/asc_16b.fnt"); TEXT(t4,"Hello",DST_red_Fnt16); STYLE(DST_red_Fnt16,TEXT){col=red;font=Fnt16;}
TEXT(t5,"Hi",DST_fd0_Fnt16,4,5); STYLE(DST_fd0_Fnt16,TEXT){col=\\ffdd00;font=Fnt16;}
DRAW(d1,100,DSD_); STYLE(DSD_,DRAW){}
DRAW(d2,200,DSD_C); STYLE(DSD_C,DRAW){type=C;}
DRAW(d3,100,50,DSD_B); STYLE(DSD_B,DRAW){type=B;}
DRAW(d4,30,40,DSD_B_2); STYLE(DSD_B_2,DRAW){type=B;width=2;}
DRAW(d5,120,DSD_C_1_red); STYLE(DSD_C_1_red,DRAW){type=C;width=1;col=red;}
DRAW(d6,30,40,DSD_B_2_Red_Blue); STYLE(DSD_B_2_Red_Blue,DRAW){type=B;width=2;col=Red;back=Blue;}
DRAW(d7,10,30,0,140,DSD_E_20_FD0_FFF,30,30); STYLE(DSD_E_20_FD0_FFF,DRAW){type=E;width=20;col=\\FFDD00;back=\\FFFFFF;}
|
|
49.51 |
TEXT( name, text, x, y ); Giving Error |
06 Feb 14 |
|
* Fixed problem with error code being generated when using the combination TEXT( name, text, x, y );
|
|
49.49 |
Text Wrapping & Text Boxes |
09 Jan 14 |
|
* Can now pass width/height in TEXT command, similar to DRAW, so that a text box/area can be created. * This gives the following combinations: - Create Text: TEXT( name, "Text", style ); TEXT( name, "Text", style, posX, posY ); TEXT( name, "Text", sizeX, sizeY, style ); TEXT( name, "Text", sizeX, sizeY, style, posX, posY ); - Update Text: TEXT( name, "Text" ); TEXT( name, sizeX, sizeY ); TEXT( name, "Text", sizeX, sizeY );
* The text area can be one of the following types: type=a | auto; (default) if no solid back colour specified, text area resizes to fit text if solid back colour is specified, text area keeps keeps maximum x and y of text the maxLen x maxRows properties are only used for initial allocation of memory type=r | resize; text area resizes to fit current text if sizeX and/or sizeY specified then minimum box size is sizeX/sizeY type=m | max; text area remains maximum text width/height of text box if sizeX and/or sizeY specified then minimum box size is sizeX/sizeY this is used primarily for page update=changed to wipe any previous text type=f | fixed; text area size is fixed to sizeX x sizeY
* New Text styles available: width = border width bcol = border colour xSpace = character spacing ySpace = row spacing padding = space between border and text maxX = maximum box width maxY = maximum box height wrap = text wrap (see below)
* Text wrapping options: wrap = n; // no wrap (default) wrap = cc; // char cols = wrap text at character at maxLen (ie num cols) wrap = wc; // word cols = wrap text at word within maxLen (ie num cols) wrap = cb; // char box = wrap text at character at box width wrap = wb; // word box = wrap text at word within box width
An example test project: // TU800 Text Align Demo // Mike Keeble // Last Updated: 13/12/2013
SETUP( RS2 ) { set="1152ND"; encode=sr; } SETUP( SYSTEM ) { rotate=0; }
LIB( libFntAsc16, "SDHC/asc_16b.fnt" );
STYLE( stPg, PAGE ) { back=\\000055; update=all; } STYLE( stLn, DRAW ) { type=line; col=\\ff8888; } STYLE( stTxtInfo, TEXT ) { font=Ascii8; col=white; maxLen=32; maxRows=16; yspace=1; curRel=TL; }
STYLE( stBoxBtn, DRAW ) { type=box; back=\\000088; } STYLE( stTxtBtn, TEXT ) { font=libFntAsc16; } STYLE( stTxtLbl, TEXT ) { font=libFntAsc16; curRel=RC; }
STYLE( stTxtD, TEXT ) { font="libFntAsc16"; col=white; bcol=blue; maxLen=12; maxRows=4; maxX=300; maxY=300; } VAR( varTxtBack, "none", TXTE ); // none, black VAR( varTxtJustify, "cur", TXTE ); // cur, l, c, r VAR( varTxtYAlign, "cur", TXTE ); // cur, t, c, b VAR( varTxtType, "a", TXTE ); // a, r, f, m VAR( varTxtWrap, "n", TXTE ); // n, cc, wc, cb, wb VAR( varTxtBorder, 0, S8E ); // width VAR( varTxtPadding, 0, S8E ); // padding VAR( varTxtSizeX, -1, S16E ); // sizeX VAR( varTxtSizeY, -1, S16E ); // sizeY VAR( varTxtSpacingY, 0, S8E ); // line spacing VAR( varTxtSpacingX, 0, S8E ); // char spacing
LOAD( stTxtD.back, varTxtBack ); LOAD( stTxtD.justify, varTxtJustify ); LOAD( stTxtD.yalign, varTxtYAlign ); LOAD( stTxtD.type, varTxtType ); LOAD( stTxtD.wrap, varTxtWrap ); LOAD( stTxtD.width, varTxtBorder ); LOAD( stTxtD.padding, varTxtPadding ); LOAD( stTxtD.xSpace, varTxtSpacingX ); LOAD( stTxtD.ySpace, varTxtSpacingY );
// 0 degrees STYLE( stTxtTL000D, stTxtD ) { curRel=TL; rotate=0; } STYLE( stTxtTC000D, stTxtD ) { curRel=TC; rotate=0; } STYLE( stTxtTR000D, stTxtD ) { curRel=TR; rotate=0; } STYLE( stTxtCL000D, stTxtD ) { curRel=CL; rotate=0; } STYLE( stTxtCC000D, stTxtD ) { curRel=CC; rotate=0; } STYLE( stTxtCR000D, stTxtD ) { curRel=CR; rotate=0; } STYLE( stTxtBL000D, stTxtD ) { curRel=BL; rotate=0; } STYLE( stTxtBC000D, stTxtD ) { curRel=BC; rotate=0; } STYLE( stTxtBR000D, stTxtD ) { curRel=BR; rotate=0; }
// 90 degrees STYLE( stTxtTL090D, stTxtD ) { curRel=TL; rotate=90; } STYLE( stTxtTC090D, stTxtD ) { curRel=TC; rotate=90; } STYLE( stTxtTR090D, stTxtD ) { curRel=TR; rotate=90; } STYLE( stTxtCL090D, stTxtD ) { curRel=CL; rotate=90; } STYLE( stTxtCC090D, stTxtD ) { curRel=CC; rotate=90; } STYLE( stTxtCR090D, stTxtD ) { curRel=CR; rotate=90; } STYLE( stTxtBL090D, stTxtD ) { curRel=BL; rotate=90; } STYLE( stTxtBC090D, stTxtD ) { curRel=BC; rotate=90; } STYLE( stTxtBR090D, stTxtD ) { curRel=BR; rotate=90; }
// 180 degrees STYLE( stTxtTL180D, stTxtD ) { curRel=TL; rotate=180; } STYLE( stTxtTC180D, stTxtD ) { curRel=TC; rotate=180; } STYLE( stTxtTR180D, stTxtD ) { curRel=TR; rotate=180; } STYLE( stTxtCL180D, stTxtD ) { curRel=CL; rotate=180; } STYLE( stTxtCC180D, stTxtD ) { curRel=CC; rotate=180; } STYLE( stTxtCR180D, stTxtD ) { curRel=CR; rotate=180; } STYLE( stTxtBL180D, stTxtD ) { curRel=BL; rotate=180; } STYLE( stTxtBC180D, stTxtD ) { curRel=BC; rotate=180; } STYLE( stTxtBR180D, stTxtD ) { curRel=BR; rotate=180; }
// 270 degrees STYLE( stTxtTL270D, stTxtD ) { curRel=TL; rotate=270; } STYLE( stTxtTC270D, stTxtD ) { curRel=TC; rotate=270; } STYLE( stTxtTR270D, stTxtD ) { curRel=TR; rotate=270; } STYLE( stTxtCL270D, stTxtD ) { curRel=CL; rotate=270; } STYLE( stTxtCC270D, stTxtD ) { curRel=CC; rotate=270; } STYLE( stTxtCR270D, stTxtD ) { curRel=CR; rotate=270; } STYLE( stTxtBL270D, stTxtD ) { curRel=BL; rotate=270; } STYLE( stTxtBC270D, stTxtD ) { curRel=BC; rotate=270; } STYLE( stTxtBR270D, stTxtD ) { curRel=BR; rotate=270; }
PAGE( pgTest, stPg ) { POSN( 119, 119 ); DRAW( lnCx000D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC000D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR000D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL000D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx000D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx000D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC000D, "CC", varTxtSizeX, varTxtSizeY, stTxtCC000D ); POSN( -50, -50 ); TEXT( txtBR000D, "BR", varTxtSizeX, varTxtSizeY, stTxtBR000D ); POSN( +50, +0 ); TEXT( txtBC000D, "BC", varTxtSizeX, varTxtSizeY, stTxtBC000D ); POSN( +50, +0 ); TEXT( txtBL000D, "BL", varTxtSizeX, varTxtSizeY, stTxtBL000D ); POSN( +0, +50 ); TEXT( txtCL000D, "CL", varTxtSizeX, varTxtSizeY, stTxtCL000D ); POSN( +0, +50 ); TEXT( txtTL000D, "TL", varTxtSizeX, varTxtSizeY, stTxtTL000D ); POSN( -50, +0 ); TEXT( txtTC000D, "TC", varTxtSizeX, varTxtSizeY, stTxtTC000D ); POSN( -50, +0 ); TEXT( txtTR000D, "TR", varTxtSizeX, varTxtSizeY, stTxtTR000D ); POSN( +0, -50 ); TEXT( txtCR000D, "CR", varTxtSizeX, varTxtSizeY, stTxtCR000D );
POSN( 359, 119 ); DRAW( lnCx090D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC090D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR090D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL090D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx090D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx090D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC090D, "CC", varTxtSizeX, varTxtSizeY, stTxtCC090D ); POSN( -50, -50 ); TEXT( txtBR090D, "BR", varTxtSizeX, varTxtSizeY, stTxtBR090D ); POSN( +50, +0 ); TEXT( txtBC090D, "BC", varTxtSizeX, varTxtSizeY, stTxtBC090D ); POSN( +50, +0 ); TEXT( txtBL090D, "BL", varTxtSizeX, varTxtSizeY, stTxtBL090D ); POSN( +0, +50 ); TEXT( txtCL090D, "CL", varTxtSizeX, varTxtSizeY, stTxtCL090D ); POSN( +0, +50 ); TEXT( txtTL090D, "TL", varTxtSizeX, varTxtSizeY, stTxtTL090D ); POSN( -50, +0 ); TEXT( txtTC090D, "TC", varTxtSizeX, varTxtSizeY, stTxtTC090D ); POSN( -50, +0 ); TEXT( txtTR090D, "TR", varTxtSizeX, varTxtSizeY, stTxtTR090D ); POSN( +0, -50 ); TEXT( txtCR090D, "CR", varTxtSizeX, varTxtSizeY, stTxtCR090D );
POSN( 359, 359 ); DRAW( lnCx180D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC180D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR180D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL180D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx180D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx180D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC180D, "CC", varTxtSizeX, varTxtSizeY, stTxtCC180D ); POSN( -50, -50 ); TEXT( txtBR180D, "BR", varTxtSizeX, varTxtSizeY, stTxtBR180D ); POSN( +50, +0 ); TEXT( txtBC180D, "BC", varTxtSizeX, varTxtSizeY, stTxtBC180D ); POSN( +50, +0 ); TEXT( txtBL180D, "BL", varTxtSizeX, varTxtSizeY, stTxtBL180D ); POSN( +0, +50 ); TEXT( txtCL180D, "CL", varTxtSizeX, varTxtSizeY, stTxtCL180D ); POSN( +0, +50 ); TEXT( txtTL180D, "TL", varTxtSizeX, varTxtSizeY, stTxtTL180D ); POSN( -50, +0 ); TEXT( txtTC180D, "TC", varTxtSizeX, varTxtSizeY, stTxtTC180D ); POSN( -50, +0 ); TEXT( txtTR180D, "TR", varTxtSizeX, varTxtSizeY, stTxtTR180D ); POSN( +0, -50 ); TEXT( txtCR180D, "CR", varTxtSizeX, varTxtSizeY, stTxtCR180D );
POSN( 119, 359 ); DRAW( lnCx270D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC270D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR270D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL270D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx270D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx270D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC270D, "CC", varTxtSizeX, varTxtSizeY, stTxtCC270D ); POSN( -50, -50 ); TEXT( txtBR270D, "BR", varTxtSizeX, varTxtSizeY, stTxtBR270D ); POSN( +50, +0 ); TEXT( txtBC270D, "BC", varTxtSizeX, varTxtSizeY, stTxtBC270D ); POSN( +50, +0 ); TEXT( txtBL270D, "BL", varTxtSizeX, varTxtSizeY, stTxtBL270D ); POSN( +0, +50 ); TEXT( txtCL270D, "CL", varTxtSizeX, varTxtSizeY, stTxtCL270D ); POSN( +0, +50 ); TEXT( txtTL270D, "TL", varTxtSizeX, varTxtSizeY, stTxtTL270D ); POSN( -50, +0 ); TEXT( txtTC270D, "TC", varTxtSizeX, varTxtSizeY, stTxtTC270D ); POSN( -50, +0 ); TEXT( txtTR270D, "TR", varTxtSizeX, varTxtSizeY, stTxtTR270D ); POSN( +0, -50 ); TEXT( txtCR270D, "CR", varTxtSizeX, varTxtSizeY, stTxtCR270D );
POSN( 535, 20 ); TEXT( txtTypeLbl, "Type:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxType0, 44, 20, stBoxBtn ); TEXT( txtType0, "Auto", stTxtBtn ); KEY( keyType0, [ LOAD( varTxtType, "a" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxType1, 44, 20, stBoxBtn ); TEXT( txtType1, "Resz", stTxtBtn ); KEY( keyType1, [ LOAD( varTxtType, "r" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxType2, 44, 20, stBoxBtn ); TEXT( txtType2, "Fixd", stTxtBtn ); KEY( keyType2, [ LOAD( varTxtType, "f" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxType3, 44, 20, stBoxBtn ); TEXT( txtType3, "Max", stTxtBtn ); KEY( keyType3, [ LOAD( varTxtType, "m" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtSizeXLbl, "SizeX:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxSizeX0, 44, 20, stBoxBtn ); TEXT( txtSizeX0, "-1", stTxtBtn ); KEY( keySizeX0, [ LOAD( varTxtSizeX, -1 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSizeX1, 44, 20, stBoxBtn ); TEXT( txtSizeX1, "0", stTxtBtn ); KEY( keySizeX1, [ LOAD( varTxtSizeX, 0 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSizeX2, 44, 20, stBoxBtn ); TEXT( txtSizeX2, "40", stTxtBtn ); KEY( keySizeX2, [ LOAD( varTxtSizeX, 40 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSizeX3, 44, 20, stBoxBtn ); TEXT( txtSizeX3, "150", stTxtBtn ); KEY( keySizeX3, [ LOAD( varTxtSizeX, 150 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtSizeYLbl, "SizeY:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxSizeY0, 44, 20, stBoxBtn ); TEXT( txtSizeY0, "-1", stTxtBtn ); KEY( keySizeY0, [ LOAD( varTxtSizeY, -1 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSizeY1, 44, 20, stBoxBtn ); TEXT( txtSizeY1, "0", stTxtBtn ); KEY( keySizeY1, [ LOAD( varTxtSizeY, 0 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSizeY2, 44, 20, stBoxBtn ); TEXT( txtSizeY2, "40", stTxtBtn ); KEY( keySizeY2, [ LOAD( varTxtSizeY, 40 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSizeY3, 44, 20, stBoxBtn ); TEXT( txtSizeY3, "150", stTxtBtn ); KEY( keySizeY3, [ LOAD( varTxtSizeY, 150 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtBackLbl, "Back:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxBack0, 44, 20, stBoxBtn ); TEXT( txtBack0, "None", stTxtBtn ); KEY( keyBack0, [ LOAD( varTxtBack, "none" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxBack1, 44, 20, stBoxBtn ); TEXT( txtBack1, "Blck", stTxtBtn ); KEY( keyBack1, [ LOAD( varTxtBack, "black" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxBack2, 44, 20, stBoxBtn ); TEXT( txtBack2, "25%", stTxtBtn ); KEY( keyBack2, [ LOAD( varTxtBack, "\\5C\\5C44000000" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtJustLbl, "Justify:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxJust0, 44, 20, stBoxBtn ); TEXT( txtJust0, "Cur", stTxtBtn ); KEY( keyJust0, [ LOAD( varTxtJustify, "cur" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxJust1, 44, 20, stBoxBtn ); TEXT( txtJust1, "L", stTxtBtn ); KEY( keyJust1, [ LOAD( varTxtJustify, "l" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxJust2, 44, 20, stBoxBtn ); TEXT( txtJust2, "C", stTxtBtn ); KEY( keyJust2, [ LOAD( varTxtJustify, "c" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxJust3, 44, 20, stBoxBtn ); TEXT( txtJust3, "R", stTxtBtn ); KEY( keyJust3, [ LOAD( varTxtJustify, "r" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtVertLbl, "Vertical:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxVert0, 44, 20, stBoxBtn ); TEXT( txtVert0, "Cur", stTxtBtn ); KEY( keyVert0, [ LOAD( varTxtYAlign, "cur" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxVert1, 44, 20, stBoxBtn ); TEXT( txtVert1, "T", stTxtBtn ); KEY( keyVert1, [ LOAD( varTxtYAlign, "t" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxVert2, 44, 20, stBoxBtn ); TEXT( txtVert2, "C", stTxtBtn ); KEY( keyVert2, [ LOAD( varTxtYAlign, "c" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxVert3, 44, 20, stBoxBtn ); TEXT( txtVert3, "B", stTxtBtn ); KEY( keyVert3, [ LOAD( varTxtYAlign, "b" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtWrapLbl, "Wrap:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxWrap0, 44, 20, stBoxBtn ); TEXT( txtWrap0, "None", stTxtBtn ); KEY( keyWrap0, [ LOAD( varTxtWrap, "n" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxWrap1, 44, 20, stBoxBtn ); TEXT( txtWrap1, "CC", stTxtBtn ); KEY( keyWrap1, [ LOAD( varTxtWrap, "cc" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxWrap2, 44, 20, stBoxBtn ); TEXT( txtWrap2, "WC", stTxtBtn ); KEY( keyWrap2, [ LOAD( varTxtWrap, "wc" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxWrap3, 44, 20, stBoxBtn ); TEXT( txtWrap3, "CB", stTxtBtn ); KEY( keyWrap3, [ LOAD( varTxtWrap, "cb" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxWrap4, 44, 20, stBoxBtn ); TEXT( txtWrap4, "WB", stTxtBtn ); KEY( keyWrap4, [ LOAD( varTxtWrap, "wb" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtBordLbl, "Border:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxBord0, 44, 20, stBoxBtn ); TEXT( txtBord0, "0", stTxtBtn ); KEY( keyBord0, [ LOAD( varTxtBorder, 0 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxBord1, 44, 20, stBoxBtn ); TEXT( txtBord1, "1", stTxtBtn ); KEY( keyBord1, [ LOAD( varTxtBorder, 1 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxBord2, 44, 20, stBoxBtn ); TEXT( txtBord2, "4", stTxtBtn ); KEY( keyBord2, [ LOAD( varTxtBorder, 4 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtPaddLbl, "Padding:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxPadd0, 44, 20, stBoxBtn ); TEXT( txtPadd0, "0", stTxtBtn ); KEY( keyPadd0, [ LOAD( varTxtPadding, 0 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxPadd1, 44, 20, stBoxBtn ); TEXT( txtPadd1, "2", stTxtBtn ); KEY( keyPadd1, [ LOAD( varTxtPadding, 2 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxPadd2, 44, 20, stBoxBtn ); TEXT( txtPadd2, "10", stTxtBtn ); KEY( keyPadd2, [ LOAD( varTxtPadding, 10 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtSpaceXLbl, "X Space:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxSpaceX0, 44, 20, stBoxBtn ); TEXT( txtSpaceX0, "0", stTxtBtn ); KEY( keySpaceX0, [ LOAD( varTxtSpacingX, 0 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSpaceX1, 44, 20, stBoxBtn ); TEXT( txtSpaceX1, "2", stTxtBtn ); KEY( keySpaceX1, [ LOAD( varTxtSpacingX, 2 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSpaceX2, 44, 20, stBoxBtn ); TEXT( txtSpaceX2, "5", stTxtBtn ); KEY( keySpaceX2, [ LOAD( varTxtSpacingX, 5 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtSpaceYLbl, "Y Space:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxSpaceY0, 44, 20, stBoxBtn ); TEXT( txtSpaceY0, "0", stTxtBtn ); KEY( keySpaceY0, [ LOAD( varTxtSpacingY, 0 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSpaceY1, 44, 20, stBoxBtn ); TEXT( txtSpaceY1, "2", stTxtBtn ); KEY( keySpaceY1, [ LOAD( varTxtSpacingY, 2 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH ); POSN( +50, +0 ); DRAW( boxSpaceY2, 44, 20, stBoxBtn ); TEXT( txtSpaceY2, "5", stTxtBtn ); KEY( keySpaceY2, [ LOAD( varTxtSpacingY, 5 ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 44, 20, TOUCH );
POSN( 535, +30 ); TEXT( txtApplyLbl, "Apply:", stTxtLbl ); POSN( +28, +0 ); DRAW( boxApply, 44, 20, stBoxBtn ); TEXT( txtApply, "OK", stTxtBtn ); KEY( keyApply, [ WAIT( 200 ); RESET( START ); ], 46, 20, TOUCH ); HIDE( txtApplyLbl, boxApply, txtApply, keyApply );
POSN( 535, +50 ); TEXT( txtNextLbl, "Next:", stTxtLbl ); POSN( +50, +0 ); DRAW( boxNext, 90, 60, stBoxBtn ); TEXT( txtNext, "Go", stTxtBtn ); KEY( keyNext, [ RUN( fncUpdate );; ], 90, 60, TOUCHR );
POSN( +50, -50 ); TEXT( txtMsg, "", stTxtInfo );
} LOAD( txtMsg, "Current Text Style:\\0d\\0a" ); LOAD( txtMsg, txtMsg, " type = \\22", varTxtType, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " sizeX = \\22", varTxtSizeX, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " sizeY = \\22", varTxtSizeY, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " back = \\22", varTxtBack, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " justify = \\22", varTxtJustify, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " yAlign = \\22", varTxtYAlign, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " wrap = \\22", varTxtWrap, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " border = \\22", varTxtBorder, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " padding = \\22", varTxtPadding, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " xSpace = \\22", varTxtSpacingX, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, " ySpace = \\22", varTxtSpacingY, "\\22\\0d\\0a" ); LOAD( txtMsg, txtMsg, "\\0a\\0d\\0aitronOS+ ", VERS_IAPP ); SHOW( pgTest );
VAR( t, "", TXT ); VAR( c, 0, U8 );
FUNC( fncUpdate ) { IF( c == 0 ? [ LOAD( t, "Test" ); ] ); IF( c == 1 ? [ LOAD( t, "XXXXX" ); ] ); IF( c == 2 ? [ LOAD( t, "UP" ); ] ); IF( c == 3 ? [ LOAD( t, "T\\0d\\0aB" ); ] ); IF( c == 4 ? [ LOAD( t, "A\\0d\\0aBCD" ); ] ); IF( c == 5 ? [ LOAD( t, "EFG\\0d\\0aH" ); ] ); IF( c == 6 ? [ LOAD( t, "ABCDEFG\\0d\\0aHIJKL\\0d\\0aMNOPQRSTU\\0d\\0aVWXYZ" ); ] ); IF( c == 7 ? [ LOAD( t, "The Quick Brown Foxes Jumping Over The Dogs" ); ] ); CALC( c, c, 1, "+" ); IF( c > 7 ? [ LOAD( c, 0 ); ] );
TEXT( txtTL000D, t ); TEXT( txtTC000D, t ); TEXT( txtTR000D, t ); TEXT( txtCL000D, t ); TEXT( txtCC000D, t ); TEXT( txtCR000D, t ); TEXT( txtBL000D, t ); TEXT( txtBC000D, t ); TEXT( txtBR000D, t ); TEXT( txtTL090D, t ); TEXT( txtTC090D, t ); TEXT( txtTR090D, t ); TEXT( txtCL090D, t ); TEXT( txtCC090D, t ); TEXT( txtCR090D, t ); TEXT( txtBL090D, t ); TEXT( txtBC090D, t ); TEXT( txtBR090D, t ); TEXT( txtTL180D, t ); TEXT( txtTC180D, t ); TEXT( txtTR180D, t ); TEXT( txtCL180D, t ); TEXT( txtCC180D, t ); TEXT( txtCR180D, t ); TEXT( txtBL180D, t ); TEXT( txtBC180D, t ); TEXT( txtBR180D, t ); TEXT( txtTL270D, t ); TEXT( txtTC270D, t ); TEXT( txtTR270D, t ); TEXT( txtCL270D, t ); TEXT( txtCC270D, t ); TEXT( txtCR270D, t ); TEXT( txtBL270D, t ); TEXT( txtBC270D, t ); TEXT( txtBR270D, t ); }
VAR( varCal, 0, S32 ); LOAD( varCal, TCH_CAL ); IF( varCal != 1 ? [ LOAD( SYSTEM.calibrate, y ); ] );
|
|
49.46 |
Support for immediate ints and floats in TEXT(); |
25 Oct 13 |
|
Changed TEXT(name,text,...) to support text = int, flt as well as existing var, "txt".
TEXT( txt1, "String", stTxt ); TEXT( txt2, 100, stTxt ); // Now supported TEXT( txt3, 3.142, stTxt ); // Now supported TEXT( txt4, varTxt, stTxt ); TEXT( txt5, varU8, stTxt ); TEXT( txt6, varFlt, stTxt );
Example:
STYLE(stPage,PAGE){} STYLE(stTxt,TEXT){}
VAR(varTxt,"varText",TXT); VAR(varTxt2,"Text2",TXT); VAR(varU8,99,U8); VAR(varU16,2515,U16); VAR(varFlt,1.234,FLT4); VAR(varFlt2,7.9385,FLT2);
PAGE(pgMain,stPage) { POSN(99,19); TEXT(txt1,"String",stTxt); POSN(+0,+32); TEXT(txt2,100,stTxt); POSN(+0,+32); TEXT(txt3,3.142,stTxt); POSN(+0,+32); TEXT(txt4,varTxt,stTxt); POSN(+0,+32); TEXT(txt5,varU8,stTxt); POSN(+0,+32); TEXT(txt6,varFlt,stTxt);
POSN(239,135); KEY(key1,fncUpdate,480,272,TOUCH); } SHOW(pgMain);
FUNC(fncUpdate) { TEXT(txt1,"Another"); TEXT(txt2,-75); TEXT(txt3,-27.1); TEXT(txt4,varTxt2); TEXT(txt5,varU16); TEXT(txt6,varFlt2);; }
|
|
49.46 |
Style switching LOAD(text.style,newstyle); |
21 Oct 13 |
|
* Added functionality to allow the style of an entity to be changed to another. LOAD(entName.style,newStyle);
eg STYLE(stText1,TEXT){ font=Ascii16; col=blue; back=dimgrey; } STYLE(stText2,TEXT){ font=Ascii8; col=green; back=mistyrose; } ... TEXT(txtTest,"This is a test",stText1); ... LOAD(txtTest.style,stText2);;
* Works with STYLES: TEXT, DRAW, IMAGE, PAGE, KEY.
Test Example:
SETUP(RS2){set="1152ND";encode=sr;}
LIB(libImg1,"SDHC/sunflower120x122-4.png");
STYLE(stPage1,PAGE){} STYLE(stPage2,PAGE){ back=pink; } STYLE(stText1,TEXT){ font=Ascii16; col=blue; back=dimgrey; maxLen=128; padding=8; width=4; bcol=aqua; } STYLE(stText2,TEXT){ font=Ascii8; col=green; back=mistyrose; maxLen=128; padding=2; width=1; bcol=red; } STYLE(stDraw1,DRAW){ type=box; col=aqua; back=dimgrey; width=4; maxX=200; maxY=200; } STYLE(stDraw2,DRAW){ type=circle; col=red; back=mistyrose; width=1; maxX=200; maxY=200; } STYLE(stImg1,IMAGE){ curRel=TL; rotate=0; } STYLE(stImg2,IMAGE){ curRel=CC; rotate=180; } STYLE(stTouch1,KEY){type=touch; action=c; repeat=100; evfunc=fnKey1; } STYLE(stTouch2,KEY){type=touch; action=c; repeat=1000; evfunc=fnKey2; }
STYLE(stBtnTxt,TEXT){ font=Ascii16; col=white; } STYLE(stBtnBox,DRAW){ type=box; col=silver; back=grey; width=2; }
VAR(vSw,0,U8);
PAGE(pgMain,stPage1) { POSN(59, 25); DRAW(drwBtn1,100,30,stBtnBox); TEXT(txtBtn1,"Next Style",stBtnTxt); KEY(keyBtn1,[IF(vSw==0?fnSw0:fnSw1);;],100,30,TOUCH);
POSN(109,175); TEXT(txtSam1,"ABCDEFGHIJ",stText1); POSN(109,215); TEXT(txtSam2,"ABCDEFGHIJ",stText2);
POSN(239,55); DRAW(drwShp1,100,80,stDraw1); POSN(239,155); DRAW(drwShp2,100,80,stDraw2);
POSN(369,99); IMG(imgFlw1,libImg1,stImg1); POSN(369,171); IMG(imgFlw2,libImg1,stImg2);
POSN(59,125); DRAW(drwBtn2,100,30,stBtnBox); TEXT(txtBtn2,"Test",stBtnTxt); KEY(keyBtn2,[LOAD(RS2,"D");],[LOAD(RS2,"U");],[LOAD(RS2,"R");],100,30,stTouch1);
} SHOW(pgMain);
FUNC(fnSw0) { LOAD(pgMain.style,stPage2); LOAD(txtSam1.style,stText2); LOAD(txtSam2.style,stText1); LOAD(drwShp1.style,stDraw2); LOAD(drwShp2.style,stDraw1); LOAD(imgFlw1.style,stImg2); LOAD(imgFlw2.style,stImg1); LOAD(keyBtn2.style,stTouch2); LOAD(vSw,1); }
FUNC(fnSw1) { LOAD(pgMain.style,stPage1); LOAD(txtSam1.style,stText1); LOAD(txtSam2.style,stText2); LOAD(drwShp1.style,stDraw1); LOAD(drwShp2.style,stDraw2); LOAD(imgFlw1.style,stImg1); LOAD(imgFlw2.style,stImg2); LOAD(keyBtn2.style,stTouch1); LOAD(vSw,0); }
FUNC(fnKey1) { LOAD(RS2,"1"); }
FUNC(fnKey2) { LOAD(RS2,"2"); }
VAR(vCal,0,U8); LOAD(vCal,TCH_CAL); IF( vCal==0?[LOAD(SYSTEM.calibrate,y);]);
|
|
49.44 |
Structure support in FILE() and TEXT() commands |
09 Oct 13 |
|
* Structure variables can now be used in all the parameters in the FILE() commands. * Structure variables can now be used for the source in the TEXT() command.
|
|
49.43 |
Text Alignment not correct with rotated text |
12 Sep 13 |
|
* Default text alignment fixed for rotated text and multi-line text.
Example 7" Test File (tu800a.mnu requires asc_16b.fnt)
// TU800 Text Align Demo // Mike Keeble // Last Updated: 12/09/2013
SETUP( RS2 ) { set="1152ND"; encode=sr; } SETUP( SYSTEM ) { rotate=0; }
LIB( libFntAsc16, "SDHC/asc_16b.fnt" );
STYLE( stPg, PAGE ) { back=\\000055; update=all; } STYLE( stLn, DRAW ) { type=line; col=\\ff8888; } STYLE( stTxtInfo, TEXT ) { font=libFntAsc16; col=white; maxLen=32; maxRows=8; yspace=2; curRel=TL; }
STYLE( stBoxBtn, DRAW ) { type=box; back=\\000088; } STYLE( stTxtBtn, TEXT ) { font=libFntAsc16; } STYLE( stTxtLbl, TEXT ) { font=libFntAsc16; curRel=RC; }
STYLE( stTxtD, TEXT ) { font="libFntAsc16"; col=white; maxLen=20; maxRows=3; // back=none; // justify=cur; // l,c,r,cur // yalign=cur; // t,c,b,cur // type=n; // n,b } VAR( varTxtBack, "none", TXTE ); // none, black VAR( varTxtJustify, "cur", TXTE ); // cur, l, c, r VAR( varTxtYAlign, "cur", TXTE ); // cur, t, c, b VAR( varTxtType, "n", TXTE ); // n, b
LOAD( stTxtD.back, varTxtBack ); LOAD( stTxtD.justify, varTxtJustify ); LOAD( stTxtD.yalign, varTxtYAlign ); LOAD( stTxtD.type, varTxtType );
// 0 degrees STYLE( stTxtTL000D, stTxtD ) { curRel=TL; rotate=0; } STYLE( stTxtTC000D, stTxtD ) { curRel=TC; rotate=0; } STYLE( stTxtTR000D, stTxtD ) { curRel=TR; rotate=0; } STYLE( stTxtCL000D, stTxtD ) { curRel=CL; rotate=0; } STYLE( stTxtCC000D, stTxtD ) { curRel=CC; rotate=0; } STYLE( stTxtCR000D, stTxtD ) { curRel=CR; rotate=0; } STYLE( stTxtBL000D, stTxtD ) { curRel=BL; rotate=0; } STYLE( stTxtBC000D, stTxtD ) { curRel=BC; rotate=0; } STYLE( stTxtBR000D, stTxtD ) { curRel=BR; rotate=0; }
// 90 degrees STYLE( stTxtTL090D, stTxtD ) { curRel=TL; rotate=90; } STYLE( stTxtTC090D, stTxtD ) { curRel=TC; rotate=90; } STYLE( stTxtTR090D, stTxtD ) { curRel=TR; rotate=90; } STYLE( stTxtCL090D, stTxtD ) { curRel=CL; rotate=90; } STYLE( stTxtCC090D, stTxtD ) { curRel=CC; rotate=90; } STYLE( stTxtCR090D, stTxtD ) { curRel=CR; rotate=90; } STYLE( stTxtBL090D, stTxtD ) { curRel=BL; rotate=90; } STYLE( stTxtBC090D, stTxtD ) { curRel=BC; rotate=90; } STYLE( stTxtBR090D, stTxtD ) { curRel=BR; rotate=90; }
// 180 degrees STYLE( stTxtTL180D, stTxtD ) { curRel=TL; rotate=180; } STYLE( stTxtTC180D, stTxtD ) { curRel=TC; rotate=180; } STYLE( stTxtTR180D, stTxtD ) { curRel=TR; rotate=180; } STYLE( stTxtCL180D, stTxtD ) { curRel=CL; rotate=180; } STYLE( stTxtCC180D, stTxtD ) { curRel=CC; rotate=180; } STYLE( stTxtCR180D, stTxtD ) { curRel=CR; rotate=180; } STYLE( stTxtBL180D, stTxtD ) { curRel=BL; rotate=180; } STYLE( stTxtBC180D, stTxtD ) { curRel=BC; rotate=180; } STYLE( stTxtBR180D, stTxtD ) { curRel=BR; rotate=180; }
// 270 degrees STYLE( stTxtTL270D, stTxtD ) { curRel=TL; rotate=270; } STYLE( stTxtTC270D, stTxtD ) { curRel=TC; rotate=270; } STYLE( stTxtTR270D, stTxtD ) { curRel=TR; rotate=270; } STYLE( stTxtCL270D, stTxtD ) { curRel=CL; rotate=270; } STYLE( stTxtCC270D, stTxtD ) { curRel=CC; rotate=270; } STYLE( stTxtCR270D, stTxtD ) { curRel=CR; rotate=270; } STYLE( stTxtBL270D, stTxtD ) { curRel=BL; rotate=270; } STYLE( stTxtBC270D, stTxtD ) { curRel=BC; rotate=270; } STYLE( stTxtBR270D, stTxtD ) { curRel=BR; rotate=270; }
PAGE( pgTest, stPg ) { POSN( 119, 119 ); DRAW( lnCx000D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC000D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR000D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL000D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx000D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx000D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC000D, "CC", stTxtCC000D ); POSN( -50, -50 ); TEXT( txtBR000D, "BR", stTxtBR000D ); POSN( +50, +0 ); TEXT( txtBC000D, "BC", stTxtBC000D ); POSN( +50, +0 ); TEXT( txtBL000D, "BL", stTxtBL000D ); POSN( +0, +50 ); TEXT( txtCL000D, "CL", stTxtCL000D ); POSN( +0, +50 ); TEXT( txtTL000D, "TL", stTxtTL000D ); POSN( -50, +0 ); TEXT( txtTC000D, "TC", stTxtTC000D ); POSN( -50, +0 ); TEXT( txtTR000D, "TR", stTxtTR000D ); POSN( +0, -50 ); TEXT( txtCR000D, "CR", stTxtCR000D );
POSN( 359, 119 ); DRAW( lnCx090D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC090D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR090D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL090D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx090D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx090D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC090D, "CC", stTxtCC090D ); POSN( -50, -50 ); TEXT( txtBR090D, "BR", stTxtBR090D ); POSN( +50, +0 ); TEXT( txtBC090D, "BC", stTxtBC090D ); POSN( +50, +0 ); TEXT( txtBL090D, "BL", stTxtBL090D ); POSN( +0, +50 ); TEXT( txtCL090D, "CL", stTxtCL090D ); POSN( +0, +50 ); TEXT( txtTL090D, "TL", stTxtTL090D ); POSN( -50, +0 ); TEXT( txtTC090D, "TC", stTxtTC090D ); POSN( -50, +0 ); TEXT( txtTR090D, "TR", stTxtTR090D ); POSN( +0, -50 ); TEXT( txtCR090D, "CR", stTxtCR090D );
POSN( 359, 359 ); DRAW( lnCx180D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC180D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR180D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL180D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx180D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx180D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC180D, "CC", stTxtCC180D ); POSN( -50, -50 ); TEXT( txtBR180D, "BR", stTxtBR180D ); POSN( +50, +0 ); TEXT( txtBC180D, "BC", stTxtBC180D ); POSN( +50, +0 ); TEXT( txtBL180D, "BL", stTxtBL180D ); POSN( +0, +50 ); TEXT( txtCL180D, "CL", stTxtCL180D ); POSN( +0, +50 ); TEXT( txtTL180D, "TL", stTxtTL180D ); POSN( -50, +0 ); TEXT( txtTC180D, "TC", stTxtTC180D ); POSN( -50, +0 ); TEXT( txtTR180D, "TR", stTxtTR180D ); POSN( +0, -50 ); TEXT( txtCR180D, "CR", stTxtCR180D );
POSN( 119, 359 ); DRAW( lnCx270D, 200, 0, stLn ); POSN( +0, +0); DRAW( lnxC270D, 0, 200, stLn ); POSN( +50, +0 ); DRAW( lnxR270D, 0, 200, stLn ); POSN( -100, +0 ); DRAW( lnxL270D, 0, 200, stLn ); POSN( +50, -50); DRAW( lnTx270D, 200, 0, stLn ); POSN( +0, +100); DRAW( lnBx270D, 200, 0, stLn ); POSN( +0, -50 ); TEXT( txtCC270D, "CC", stTxtCC270D ); POSN( -50, -50 ); TEXT( txtBR270D, "BR", stTxtBR270D ); POSN( +50, +0 ); TEXT( txtBC270D, "BC", stTxtBC270D ); POSN( +50, +0 ); TEXT( txtBL270D, "BL", stTxtBL270D ); POSN( +0, +50 ); TEXT( txtCL270D, "CL", stTxtCL270D ); POSN( +0, +50 ); TEXT( txtTL270D, "TL", stTxtTL270D ); POSN( -50, +0 ); TEXT( txtTC270D, "TC", stTxtTC270D ); POSN( -50, +0 ); TEXT( txtTR270D, "TR", stTxtTR270D ); POSN( +0, -50 ); TEXT( txtCR270D, "CR", stTxtCR270D );
POSN( 539, 30 ); TEXT( txtTypeLbl, "Type:", stTxtLbl ); POSN( +40, +0 ); DRAW( boxType0, 50, 20, stBoxBtn ); TEXT( txtType0, "None", stTxtBtn ); KEY( keyType0, [ LOAD( varTxtType, "n" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxType1, 50, 20, stBoxBtn ); TEXT( txtType1, "Box", stTxtBtn ); KEY( keyType1, [ LOAD( varTxtType, "b" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH );
POSN( 539, +32 ); TEXT( txtBackLbl, "Back:", stTxtLbl ); POSN( +40, +0 ); DRAW( boxBack0, 50, 20, stBoxBtn ); TEXT( txtBack0, "None", stTxtBtn ); KEY( keyBack0, [ LOAD( varTxtBack, "none" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxBack1, 50, 20, stBoxBtn ); TEXT( txtBack1, "Black", stTxtBtn ); KEY( keyBack1, [ LOAD( varTxtBack, "black" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH );
POSN( 539, +32 ); TEXT( txtJustLbl, "Justify:", stTxtLbl ); POSN( +40, +0 ); DRAW( boxJust0, 50, 20, stBoxBtn ); TEXT( txtJust0, "Cur", stTxtBtn ); KEY( keyJust0, [ LOAD( varTxtJustify, "cur" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxJust1, 50, 20, stBoxBtn ); TEXT( txtJust1, "L", stTxtBtn ); KEY( keyJust1, [ LOAD( varTxtJustify, "l" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxJust2, 50, 20, stBoxBtn ); TEXT( txtJust2, "C", stTxtBtn ); KEY( keyJust2, [ LOAD( varTxtJustify, "c" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxJust3, 50, 20, stBoxBtn ); TEXT( txtJust3, "R", stTxtBtn ); KEY( keyJust3, [ LOAD( varTxtJustify, "r" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH );
POSN( 539, +32 ); TEXT( txtVertLbl, "Vertical:", stTxtLbl ); POSN( +40, +0 ); DRAW( boxVert0, 50, 20, stBoxBtn ); TEXT( txtVert0, "Cur", stTxtBtn ); KEY( keyVert0, [ LOAD( varTxtYAlign, "cur" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxVert1, 50, 20, stBoxBtn ); TEXT( txtVert1, "T", stTxtBtn ); KEY( keyVert1, [ LOAD( varTxtYAlign, "t" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxVert2, 50, 20, stBoxBtn ); TEXT( txtVert2, "C", stTxtBtn ); KEY( keyVert2, [ LOAD( varTxtYAlign, "c" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH ); POSN( +60, +0 ); DRAW( boxVert3, 50, 20, stBoxBtn ); TEXT( txtVert3, "B", stTxtBtn ); KEY( keyVert3, [ LOAD( varTxtYAlign, "b" ); SHOW( txtApplyLbl, boxApply, txtApply, keyApply );; ], 50, 20, TOUCH );
POSN( 539, +32 ); TEXT( txtApplyLbl, "Apply:", stTxtLbl ); POSN( +40, +0 ); DRAW( boxApply, 50, 20, stBoxBtn ); TEXT( txtApply, "OK", stTxtBtn ); KEY( keyApply, [ WAIT( 200 ); RESET( START ); ], 50, 20, TOUCH ); HIDE( txtApplyLbl, boxApply, txtApply, keyApply );
POSN( 539, +96 ); TEXT( txtNextLbl, "Next:", stTxtLbl ); POSN( +60, +0 ); DRAW( boxNext, 90, 60, stBoxBtn ); TEXT( txtNext, "Go", stTxtBtn ); KEY( keyNext, [ RUN( fncUpdate );; ], 90, 60, TOUCH );
POSN( 549, +64 ); TEXT( txtMsg, "", stTxtInfo );
// LOOP( lpMain, FOREVER ) // { // LOAD( txtMsg, "TFT S/W: ", VERS_IAPP, "\\0d\\0aText: type=", varTxtType, "; back=", varTxtBack, "; justify=", varTxtJustify, "; yAlign=", varTxtYAlign );; // }
} LOAD( txtMsg, "Current Text Style:\\0d\\0a type = \\22", varTxtType, "\\22\\0d\\0a back = \\22", varTxtBack, "\\22\\0d\\0a justify = \\22", varTxtJustify, "\\22\\0d\\0a yAlign = \\22", varTxtYAlign, "\\22\\0d\\0a\\0d\\0aTFT S/W: ", VERS_IAPP ); SHOW( pgTest );
VAR( t, "", TXT ); VAR( c, 0, U8 );
FUNC( fncUpdate ) { IF( c == 0 ? [ LOAD( t, "Test" ); ] ); IF( c == 1 ? [ LOAD( t, "XXXXX" ); ] ); IF( c == 2 ? [ LOAD( t, "UP" ); ] ); IF( c == 3 ? [ LOAD( t, "T\\0d\\0aB" ); ] ); IF( c == 4 ? [ LOAD( t, "A\\0d\\0aBCD" ); ] ); IF( c == 5 ? [ LOAD( t, "EFG\\0d\\0aH" ); ] ); CALC( c, c, 1, "+" ); IF( c > 5 ? [ LOAD( c, 0 ); ] );
TEXT( txtTL000D, t ); TEXT( txtTC000D, t ); TEXT( txtTR000D, t ); TEXT( txtCL000D, t ); TEXT( txtCC000D, t ); TEXT( txtCR000D, t ); TEXT( txtBL000D, t ); TEXT( txtBC000D, t ); TEXT( txtBR000D, t ); TEXT( txtTL090D, t ); TEXT( txtTC090D, t ); TEXT( txtTR090D, t ); TEXT( txtCL090D, t ); TEXT( txtCC090D, t ); TEXT( txtCR090D, t ); TEXT( txtBL090D, t ); TEXT( txtBC090D, t ); TEXT( txtBR090D, t ); TEXT( txtTL180D, t ); TEXT( txtTC180D, t ); TEXT( txtTR180D, t ); TEXT( txtCL180D, t ); TEXT( txtCC180D, t ); TEXT( txtCR180D, t ); TEXT( txtBL180D, t ); TEXT( txtBC180D, t ); TEXT( txtBR180D, t ); TEXT( txtTL270D, t ); TEXT( txtTC270D, t ); TEXT( txtTR270D, t ); TEXT( txtCL270D, t ); TEXT( txtCC270D, t ); TEXT( txtCR270D, t ); TEXT( txtBL270D, t ); TEXT( txtBC270D, t ); TEXT( txtBR270D, t ); }
VAR( varCal, 0, S32 ); LOAD( varCal, TCH_CAL ); IF( varCal != 1 ? [ LOAD( SYSTEM.calibrate, y ); ] );
|
|
49.42 |
Multi-line text when update=changed should be left justified |
06 Sep 13 |
|
* Fixed backwards compatibility problem with text positioning when displaying more than one line in update=changed pages. Text changed back to left justified.
|
|
49.38 |
TEXT Alignment Problem with ''update=changed'' |
11 Jun 13 |
|
When no justification is specified in the text style then the text justification is defaulting to left. This is not backwardly compatible with older versions of the software. The default justification is now taken from the curRel parameter.
STYLE(name,TEXT) { curRel = TL; justify = cur; // Default. Justification is determined by curRel. (TL,CL,BL=left; TC,CC,BC=centre; TR,CR,BR=right) yAlign = cur; // Default. Vertical alignment is determined by curRel. (TL,TC,TR=top; CL,CC,CR=centre; BL,BC,BR=bottom) }
|
|
49.37 |
Fonts using too much memory |
10 Jun 13 |
|
Resolved issue where too much memory was being allocated for some fonts. This was only applicable to a small number of fonts which had a negative offset.
|
|
49.37 |
Colours of ''none'' or ''transparent'' |
10 Jun 13 |
|
* The value of "none" or "transparent" can now be used for all colours in the styles.
|
|
49.37 |
New Text Parameters - width, bcol, padding, xSpace, ySpace [work in progress] |
10 Jun 13 |
|
* Added parameters to create text box to text style: width - width of border (default = 0) bcol - colour of border (default = white) padding - number of pixels to add between text area and border (default = 0) xSpace - extra spacing between chars (default = 0) ySpace - extra spacing between lines (default = 0)
|
|
49.37 |
Convert to Unicode - %w% and Convert to UTF-8 - %m% |
10 Jun 13 |
|
Convert to Unicode ------------------ * Added %w% formatting character to convert characters to Unicode Characters * For Sending on Serial Port (set with encode=sr;): LOAD( varTxDataTxt, "\\w0033\\w0034\\w0144", %w%45 ); LOAD( AS2, %w%varTxDataTxt, "\\00\\03" ); // Will send 00 33 00 34 01 44 00 45 00 03 * For receiving on serial Port (set with encode=sr;): LOAD( varRxDataTxt, AS2 ); TEXT( txtMsg1, %w%varRxDataTxt );; * For converting text // varRxData = 0000 0033 0000 0034 0001 0044 0000 0045 LOAD( varRxDataTxt, %w%varRxDataTxt ); // varRxData = 0033 0034 0144 0045 * Added additional functionality to convert characters from an U8/S8 array LOAD(txtRxData,"\\22",%w%varRxArr,"\\22"); // 5. From Array formatted into text with LOAD()
Convert to UTF-8 ---------------- * Added %m% formatting character to convert characters to UTF-8 Characters * Works with sources of serial ports, text, text variables and U8/S8 arrays TEXT(txtRxData,%m%AS2); // 1. Directly from port formatted into TEXT() TEXT(txtRxData,%m%varRxData); // 2. From text var formatted into TEXT() LOAD(varRxData,%m%AS2); // 3. From port formatted into text var LOAD(txtRxData,"\\22",%m%varRxData,"\\22");; // 4. From text var formatted into text with LOAD() LOAD(txtRxData,"\\22",%m%varRxArr,"\\22"); // 5. From Array formatted into text with LOAD() LOAD(varA,%m%varRxData); // 6. From text var to text var
|
|
49.37 |
POSN in DRAW, IMG, TEXT and KEY Commands |
10 Jun 13 |
|
* Added initial positioning to commands: a) DRAW(name,width,style,x,y); DRAW(name,width,height,style,x,y); DRAW(name,width,height,start,arc,style,x,y); b) IMG(name,src,style,x,y); c) TEXT(name,text,style,x,y); d) KEY(name,func,width,height,style,x,y); KEY(name,downFunc,upFunc,width,height,style,x,y); KEY(name,downFunc,upFunc,repFunc,width,height,style,x,y);
|
|
49.16 |
Centre/Center - Added support for accepting both ''centre'' and ''center'' in parameters. |
14 Sep 12 |
|
* Added support for accepting both "centre" and "center" in parameters. style image action style text justify
|
|
49.14 |
Opacity - Corrected problem with assigning initial opacity value to text, images, draw, pages. |
27 Jul 12 |
|
* Corrected problem with assigning initial opacity value to text, images, draw, pages.
|
|
49.14 |
Text - Added text justification style property for displaying multiple lines in text box. |
27 Jul 12 |
|
Added text justification style property for displaying multiple lines in text box: justify = left; (or L) // Justify left (default) justify = right; (or R) // Justify right justify = centre; (or C) // Justify centre Example1: STYLE( stText, text ) { font=Ascii16; col=blue; justify=right; } Example2: LOAD( stText.justify, centre );; * Fixed problem with storing text strings containing only "\". * Fixed problems with displaying of text cursor. * Fixed text box memory allocation for built-in font Ascii16.
|
|
49.03 |
Float Formatting - Increased decimal places range from %f0% to %f9%. |
01 Jun 12 |
|
Increased decimal places range from %f0% to %f9% (was %f1% to %f8%).
|
|
49.00 |
Arrays with Text - Support for loading arrays into text boxes and text variables added. |
22 Mar 12 |
|
Support for loading arrays into text boxes and text variables added. Support for loading text into arrays added. The %t% and %r% formatting characters are used when working with arrays and text. The %t% operator observes NUL characters as string terminators, the %r% operator processes all characters the same. Fixed problem with outputting full array from serial ports in ASCII raw (sr) mode.
|
|
49.00 |
Text Alignment - To support ''monospaced'' fonts, the text style parameter xtrim=Y|N has been added. |
22 Mar 12 |
|
To support "monospaced" fonts (ie those that have the same x-advance), the text style parameter xtrim=Y|N has been added. The default is Y which makes text boxes fit to the width of the visible text. However, for monospaced fonts (eg numbers) this can cause problems with the numbers 'shifting' left and right (eg number 1 is narrower than 2). To stop this, set xtrim=N; Fixed problem with width calculation of text boxes which could cause text to shift by a couple of pixels depending on last character. NUL (0) characters in text now processed correctly.
|
|
49.00 |
Opacity - Added opacity to images, drawing objects and text. |
22 Mar 12 |
|
Added opacity to images, drawing objects and text STYLE( st, image | draw | text ) { ...... opacity = n; // n = 0..100 where 0=transparent..100=opaque (default=100) ....... }
LOAD( st.opacity, num ); // Dot operator also supported. Restrictions: Not supported for library images with bits=16.
|
|
48.24 |
Formatting for U16's to Text |
10 Mar 12 |
|
Conversion from U16 for full unicode range now supported (Was previously taking U8 value).
|
|
47.24 |
Text, Draw and Image Entity Information |
31 Oct 11 |
|
More Calc commands added to obtain entity information > CALC(var,ename,"ESIZE"); -> returns allocated display size in bytes > CALC(var,ename,"EDEL"); -> returns 1 if entity has been deleted, else 0 > CALC(var,ename,"EVIS"); -> returns 1 if entity is visible, else 0 > CALC(var,ename,"EALIGN"); -> returns value representing alignment: 0 = Top Left, 1 = Top Centre, 2 = Top Right, 3 = Centre Left, 4 = Centre Centre, 5 = Centre Right, 6 = Bottom Left, 7 = Bottom Centre, 8 = Bottom Right
|
|
47.12 |
File read into buffer - A text file can be read into a text buffer |
09 Sep 11 |
|
A text file can be read into a text buffer CALC(dstTxtVar, src, "FREAD");
|
|
44.00 |
Text - Fixed problem displaying characters using the ''\\w<...>'' format. |
20 May 11 |
|
Fixed problem displaying characters using the "\\w<...>" format. SPLIT calculation now supports split character as string and immediate number. Fixed problems with text lengths exceeding maximum allowable sizes. Fixed error reporting when font scaling exceeds allocated memory.
|
|
39.00 |
Text/Strings/Parameters - Increased maximum text var length to 8192 characters throughout code. |
21 Jan 11 |
|
Increased maximum text var length to 8192 characters throughout code
|
|
38.00 |
Text - Text rotation of 0, 90, 180 and 270 degrees now supported. |
13 Jan 11 |
|
Text rotation of 0, 90, 180 and 270 degrees now supported. Example: STYLE( textStyle, text ) { rotate=180; } Cursor drawing corrected for end of line.
|
|
37.00 |
Password - The code \\01 can now be entered into a text string causing the string to be displayed with '*' instead of the character. |
13 Dec 10 |
|
The code \\01 can now be entered into a text string causing the string to be displayed with '*' instead of the character. This only affects how the string is displayed. It can be output from a serial port without the masking.
eg TEXT(t1,"The \\01password\\01 is hidden",st1); will show "The ******** is hidden".
|
|
37.00 |
Calc for Text - New calculations have been added. |
13 Dec 10 |
|
The following calculations have been added. See web page for detailed explanations:
"POS" - Move Cursor to Absolute Position
"REL" - Move Cursor to Relative Position
"INS" - Insert / Overwrite Text at Cursor
"DEL" - Delete Text at Cursor
"TRIM" - Trim Characters from Start and End of Text String
"LTRIM" - Trim Characters from Start of Text String
"RTRIM" - Trim Characters from End of Text String
"UPPER" - Convert Text to Uppercase
"LOWER" - Convert Text to Lowercase
"BEF" - Get Characters from Before Cursor
"AFT" - Get Characters from After Cursor
"CUR" - Change Cursor Type
"LEN" - Get Text Length
"LOC" - Get Cursor Location
"TYPE" - Get Cursor Type
"FIND" - Find Location of Text1 in Text2
"IFIND" - Find Location of Case Insensitive Text1 in Text2
"REM" - Remove Every Text1 in Text2
"IREM" - Remove Every Case Insensitive Text1 in Text2
"SPLIT" - Split Text at Character – allows Sscanf capability
"PIXX" - Get Width of Entity
"PIXY" - Get Height of Entity
|
|
37.00 |
Text Cursors - A text cursor can be added to a string |
13 Dec 10 |
|
A text cursor can be added to a string
\\02 Hidden - replace (shows nothing)
\\03 Hidden - insert (shows nothing)
\\04 Underline - replace (shows horizontal line under next character)
\\05 Underline - insert (shows horizontal line under next character)
\\06 Block - replace (shows next character in reverse video)
\\07 Block - insert (shows vertical cursor at start of next character)
|
|
36.00 |
Text into Nums - Text strings are now converted into Nums/Floats during LOAD(INT,TEXT); . |
23 Nov 10 |
|
Text strings are now converted into Nums/Floats during LOAD(INT,TEXT); The text string is parsed until a non-valid numeric value. If the string does not start with a number or +/- then the result is 0.
|
|
32.00 |
VAR - VAR(Name,Style); changes to VAR(Name, default Value, Style);. |
14 Oct 10 |
|
Due to customer request, including the default value reduces the lines of code and matches other command types like TEXT, IMG, DRAW. VAR(Name,Style); changes to VAR(Name, default Value, Style); Example1: VAR( MyVarU8, 0, U8 ); Example2: VAR( MyVarTxt, "Hello", TXT ); Example3: VAR( MyVarPtr > "ImgABC", PTR ); A new built in style TXT can be used for text variables with default 32 characters length
|
|
27.00 |
Text Boxes / Strings - Corrected calculation of text box size . |
10 Sep 10 |
|
Corrected calculation of text box size (ie text width was added incorrectly, making it too wide and hence not centering / right aligning correctly). Text strings now handle \\xx formatting chars, eg TEXT( TextStr, “Line 1\\0ALine 2”, Style );
|
|
27.00 |
Entity Pointers - Entity pointers have been added. |
10 Sep 10 |
|
Entity pointers have been added. STYLE( PtrData, DATA ) { type = pointer; } VAR( EntPtr1, PtrData );
To set/change which entity the entity pointer is pointing to you enclose its name in quotes. LOAD( "EntPtr1", "Var1" ); // Set EntPtr1 to point to "Var1"
To access the entity pointed to by the entity pointer, do not enclose is quotes. LOAD( EntPtr1, "ABC" ); // Load the Entity pointed to by EntPtr1 with "ABC"
The following commands now support entity pointers: > LOAD(name|ptr|"ptr",num|"txt"|var|ptr,...); > CALC(var|ptr,var|ptr,num|var|ptr,"op"); > TEXT(name|ptr,"txt"|var|ptr,...); > IF(var|ptr op num|"txt"|var|ptr ? func|func_ptr : func|func_ptr); > KEY(name,func|func_ptr,...); > INT(name,buf,func|func_ptr,...); > SHOW(name|ptr,...); > HIDE(name|ptr,...); > RUN(name|func_ptr,...); > IMG(name|img_ptr,lib|img_ptr,...);
See the tu480.mnu file for an example of using pointers to update images representing CNTSECS.
|
|
24.00 |
TEXT U32 - Fixed the displaying of a U32 variable in TEXT string. |
25 Aug 10 |
|
Fixed the displaying of a U32 variable in TEXT string (was using U16).
|
|
23.00 |
LOAD - String concatenation now possible into a text variable: |
17 Aug 10 |
|
String concatenation now possible into a text variable: eg LOAD(TextVar1,Var2,Str3,Num4,Flt5, ...);
|
|
21.00 |
TEXT - Fixed error in calculation for memory allocation for text strings. |
30 Jul 10 |
|
Fixed error in calculation for memory allocation for text strings.
|
|
21.00 |
STYLE - Fixed error with default style initialization. |
30 Jul 10 |
|
Fixed error with default style initialization. Style parameter names for POSN, PAGE, TEXT, DRAW, IMAGE, KEY set up
|
|
|
|