Command Style
 
Description Styles enable you to maintain a common theme throughout your application and reduce the number of parameters required to be passed in the Page, text, draw, image and key commands. A style is only used during the creation of an entity. When updating a text or an image, the style is omitted from the command.
 
Options Updating
Style parameters can be updated using the dot operator except sizes and watchdog values.
LOAD(ADC1.calib1,0.75);
changes the calibration value for the analogue input ADC1.

Inherited Styles - 47.24
Style inheritance using previously defined style
  > style(styleA,text){...}
  > style(styleB,styleA){...} <- firstly copy style from styleA then apply new style parameters

Style with Floats - v49.02
Style parameters now except floats (rather than throwing an error).
Floats are rounded to ints where applicable.

Centre/Center - v49.16
Added support for accepting both "centre" and "center" in parameters.

STYLE Handling Improvements - v49.37
* Maximum style parameter value length now 128 chars (was 64).
* Maximum number of settable params in one STYLE() command is now 17 (was 16).
* Improved style creation algorithm.

Colours of "none" or "transparent" - v49.37
* The value of "none" or "transparent" can now be used for all colours in the styles.

Image Rotation (90 degree steps) in STYLE - v49.42
* Images can now be rotated using the style parameter:
STYLE(stImg,IMAGE){rotate=90;} and
LOAD(stImg.rotate,90);
* Supported angles: 0, 90, 180, 270. Image is rotated clockwise.
* Transparency is set with the back=colour property.

Image Scaling in STYLE - v49.42
* Images can now be scaled using the style parameter:
STYLE(stImg,IMAGE){scale=75;} and
LOAD(stImg.scale,75);
* Supported scaling in 1% steps.
* PNG Alpha Transparency is only supported with 100% scaled images.
* Transparency is set with the back=colour property.


Style switching LOAD(text.style,newstyle); - v49.46
* 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.

Built-In TEXT, PAGE, DRAW, and IMAGE Styles - v49.51
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.

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");

The rules/examples for each can be found in the appropriate sections below

Built-In KEY Style - v49.52
Added built-in touch key style:
DSK_act_deb_del_rep_cur
Where
act = 'action'
deb = 'debounce' in milliseconds
del = 'delay' in milliseconds
rep = 'repeat' in milliseconds
cur = 'curRel'
Examples
KEY(key1,func,100,20,DSK_D_9_500_200_CC); // Create Key, action = down; debounce = 9; delay = 500; repeat = 200; curRel = CC
KEY(key2,func,100,100,DSK_C____TL); // Create Key, action = change; curRel = TL
 Built-In Styles - Parameters Are Optional - v49.52
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 specifying some parameters
KEY(key2,func,100,100,DSK_C____TL); // Create Key, action = change; curRel = TL
 
Command VAR Data Styles - VAR(Name,Value,Style)
 
Description Specify your own style for integer, float, pointer or text or use a built in style name.
 
Syntax/Parameters STYLE(stVar, Data)
 {
 type = U8;     // U8, U16, U32 - unsigned 8, 16 and 32 bit integer
                     // S8, S16, S32 - signed 8, 16, 32 bit integer
                     // TEXT for text strings
                     // FLOAT for higher resolution calculation
                     // POINTER for use with images
 length=64;    // For text, specify the length from 1 to 8192, default =32
 decimal=3;    // Specify the number of decimal places when type is float. Range 0 to 7, default=2
 format="dd mm YY";   //Specify RTC format. see RTC page for format character types
 location=SDRAM;        //Specify the data location as SDRAM (default) or EEPROM
 }
 
Options Built In Styles (Add E for EEPROM types Example FLT4E)
The following pre defined 'built in' style names are available
U8/U8E - type = U8, U16/U16E - type = U16, U32/U32E - type = U32
S8/S8E - type = S8, S16/S16E - type = S16, S32/S32E - type = S32
PTR/PTRE - type = pointer, TXT/TXTE - type = TEXT, length=32
FLT1/FLT1E - type = float, decimal = 1, FLT2/FLT2E - type = float, decimal = 2
FLT3/FLT3E - type = float, decimal = 3, FLT4/FLT4E - type = float, decimal = 4

Read-Only VARs (Constants) - v49.32
Variables can be designated read-only (constants) by specifying readonly=y; in the data style:
> STYLE(U8C,data){type=u8;readonly=y;}
A system error will occur if modification to a read-only variable is requested.
Checking is performed in LOAD(), VAR() and CALC() commands only. 

Built-in "Constant" styles created:
U8C, U16C, U32C, S8C, S16C, S32C, PTRC, FLT1C, FLT2C, FLT3C, FLT4C, TXT4C, TXT16C, TXTC, TXT64C, TXT128C.


Extra Built-In Data Styles TXT and FLT - v49.51
* Added TXTn, TXTnE and TXTnC data styles of type text where n is the maxLen value allocated for the data between 1 and 8192. If the name ends in an 'E' then it stored in EEPROM. If the name ends in 'C' then it is a constant (ie read-only). Examples TXT42, TXT27E, TXT32C.
* Added FLTn, FLTnE and FLTnC data styles of type float where n is the number of displayed decimal places between 0 and 17. If the name ends in an 'E' then it stored in EEPROM. If the name ends in 'C' then it is a constant (ie read-only). Examples FLT5, FLT7E, FLT4C.

VAR(v1,"",TXT1);
STYLE(TXT1,DATA){type=text;maxLen=1;}  
VAR(v2,"",TXT8192);
STYLE(TXT8192,DATA){type=text;maxLen=8192;}

VAR(v4,"",TXT128C);
STYLE(TXT128C,DATA){type=text;maxLen=128;readonly=y;}

VAR(v5,"",TXT48E);
STYLE(TXT48E,DATA){type=text;maxLen=48;locate=eeprom;}

VAR(v6,3.141,FLT7);
STYLE(FLT7,DATA){type=float;decimal=7;}

VAR(v7,1.23,FLT8C);
STYLE(FLT8C,DATA){type=float;decimal=8;readonly=y;}

VAR(v8,2.34,FLT12E);
STYLE(FLT12E,DATA){type=float;decimal=12;locate=eeprom;}
 
 
Command Page Styles - PAGE(Name,Style) {…….}
 
Description The style defines the page size, position and background.
 
Syntax/Parameters STYLE(stPage,Page) //create a style name and define as type Page
 {
 sizeX=480;        //specify width of page 1 to 3* LCD width
 sizeY=272;        //specify height of page 1 to 3* LCD height
 posX=0;            //specify the absolute X position of page on screen. -4 * LCD width to 4 * LCD width
 posY=0;            //specify the absolute Y position of page on screen. -4 * LCD height to 4 * LCD height
 back=black;       //specify background colour of page as hex \\000000 to \\FFFFFF or colour name
 image=pageimg; //specify background image of page as SDHC path or entity name using LIB.
 }
 
Options Pop-Up Pages - v49.03
Page style parameter "type=popUp;" or "type=p;" added to define a page as a pop-up.
Default is "type=normal;" or "type=n;" for non-pop-up page.
This allows pages the same size as the screen to be defined as a pop-up.
Pages smaller than the screen size will still always be declared as pop-ups; the "type" parameter is ignored in this case.

Built-In PAGE Styles - v49.51
Add a default PAGE style
DSP_
DSP_col
DSP_col_img
DSP_col_img_cur
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;
 
Command Text Styles - TEXT(Name,Text,Style)
 
Description 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.
 
Syntax/Parameters 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.
 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
 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 Unique Font Overlay
It is possible to overlay one font over another to enable single byte operation with ASCII from 20H to 7FH and Cyrillic, Greek, Hebrew, Bengali, Tamil, Thai or Katakana from 80H to FFH. The LIB command is used to load the extended font at 0080H 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 80H to FFH.

Text Alignment - v49.00
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;

Opacity - v49.00
Added opacity to text.
   STYLE( st, text )
   {   ...
   opacity = n; // n = 0..100 where 0=transparent..100=opaque (default=100)
   ...   }
   LOAD( st.opacity, num ); // Dot operator also supported.

Text justification - v49.14
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 );

Built-In TEXT styles- v49.51
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
 
Command Draw Styles - DRAW(Name,X,Y,Style)
 
Description Draw or update a Line, Box or Circle of size X,Y or Pixel at X,Y. The entities can be an outline or filled.
 
Syntax/Parameters STYLE(stCircleRed,DRAW)
 {
 type=B;           //Specify the type of shape to draw. type = B or Box , C or Circle, L or Line, G or Graph
 col=red;           //Specify the border colour of the shape. Use hex, colour name + alpha
 back=\\00FF66; //Specify the fill colour of the shape. Use hex, colour name + alpha
 maxX=160;      //Declare the maximum width allowing for rotation
 maxY=40;        //Declare the maximum height allowing for rotation
 rotate=0;         //Specify the rotation of the shape with respect to the screen. 0,90,180,270
 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 Alpha blending
It is possible to specify transparency values with colours if the colour is entered as a 32-bit hex number the top 8 bits specify the alpha blending level.
col = \\aarrggbb; back = \\aarrggbb; where aa = alpha level.
For example, col = \\80FFFF00; gives 50% transparent yellow.

Graphs - 47.00
A number of graph styles now exist as draw types:
type=p; type=pixel; // Pixel Scatter - places a point at x,y
type=t; type=trace; // Trace/Line - joins the dots between current point and previous point.
type=y; type=yBar; // Bar Y - draws vertical line from 0 to y and clears from y+1 to ymax
type=x; type=xBar; // Bar X - draws horizontal line from 0 to x and clears from x+1 to xmax
The origin on the graph can be changed
xOrigin=val; // (default=0)
yOrigin=val; // (default=0)
The scaling of pixels can be set:
xScale=val; // (default=100.0) [val can be float and is a percentage]
yScale=val; // (default=100.0) [val can be float and is a percentage]
Note to draw graph with 0,0 at top and n,n at bottom, use yScale=-100;

The graph can be made to scroll (currently right-to-left only supported)
xScroll=val; // where val=0 (default - no scroll); val=n (scroll left n pixels before each plot
   STYLE(gstyle,DRAW) {
   type=trace;
   maxX=100;
   maxY=100;
   col=green;
   back=black;
   width=3;
   curRel=cc;
   xOrigin=50;
   yOrigin=50;
   xScale=200;
   yScale=200;
   xScroll=1;
   }

Opacity - v49.00
Added opacity to drawing objects.
   STYLE( st, draw)
   {   ...
   opacity = n; // n = 0..100 where 0=transparent..100=opaque (default=100)
   ...   }
   LOAD( st.opacity, num ); // Dot operator also supported.


Built-In DRAW styles- v49.51
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;
 
Command Image Styles - IMG(Name,Source,Style)
 
Description The image may be larger than the size specified so it is necessary to define how it will be scaled.
 
Syntax/Parameters STYLE(MyImage,Image)
 {
 scale=100;     //The image is scaled down or up by a percentage.
                      //Supports 5% steps below 100 and 100% steps above 100.
 maxX=160;    //Declare the maximum width allowing for rotation
 maxY=40;      //Declare the maximum height allowing for rotation
 rotate=0;       //Specify the rotation of the shape with respect to the screen. 0,90,180,270
 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 Image Action - 47.12
The way in which an image is displayed can be changed for slideshows.
   STYLE(imgSt,Image){ action=type; step=pixels; }
> action type options are:
- i or instant = Instant (default);
- u or up = Move Up;
- d or down = Move Down;
- l or left = Move Left;
- r or right = Move Right;
- ur or ru or upright = Move Diagonal Up-Right
- dr or rd or downright = Move Diagonal Down-Right
- ul or lu or upleft = Move Diagonal Up-Left
- dl or ld or downleft = Move Diagonal Down-Left
- a or all = Sequence through all (except instant);
> step pixels defaults to 20 pixels (value 1 to minimum of lcd width or lcd height)

Opacity - v49.00
Added opacity to images.
   STYLE( st, image)
   {
   ...
   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.

Built-In IMG styles- v49.51
DSI_
DSI_cur
Where
cur = 'curRel'
Examples
IMG(img1,libImg1,DSI_TL); // Create Image, curRel = TL;
 
Command Key Styles - KEY(Name,Function,X,Y,Style)
 
Description Specify the source of key data. Touch keys are dependent on certain SYSTEM parameters.
If you require a dual action, specify 2 keys at the same location, one with action D and one with U.
 
Syntax/Parameters STYLE(myTouch,key)
 {
 type=touch;      //specify 'touch' screen or external 'keyio'
 debounce=250; //Specify the time delay to allow a key press to stabilise. Value in milliseconds.
 delay=1000;     //Specify the time delay before auto repeat occurs. Value in milliseconds. 0=off.
 repeat=500;     //Specify the repeat period if the key is held down. Value in milliseconds
 action = D;       // Specify D or Down and U or Up. Specify the up or down action for the key.
 curRel=CC;      //specify touch key placement relative to cursor. CC Centre Centre,
 }                     //BC Bottom Centre, LC Left Centre, RC Right Centre, TL Top Left,
                        // BL Bottom Left, TR Top Right, BR Bottom Right, TC Top Centre.
 
Options KEY style event handler - v49.27
Added an additional parameter to the key style. evfunc allows a function to be called when any key using that style is pressed.
This function is run before the function specified in the KEY entity.
A typical use for this would be to provide a method to add a key beep.

   STYLE(myTouch,key)
   {
   .
   evfunc = fncBeep;
   .
   }

   FUNC(fncBeep)
   {
   LOAD(BUZZ, 100);
   }

Built-In KEY Style - v49.52
Added built-in touch key style:
DSK_act_deb_del_rep_cur
Where
act = 'action'
deb = 'debounce' in milliseconds
del = 'delay' in milliseconds
rep = 'repeat' in milliseconds
cur = 'curRel'
Examples
KEY(key1,func,100,20,DSK_D_9_500_200_CC); // Create Key, action = down; debounce = 9; delay = 500; repeat = 200; curRel = CC
KEY(key2,func,100,100,DSK_C____TL); // Create Key, action = change; curRel = TL

 
Update Information

 Version

 Title

Date  

 Details

49.52

 Built-In KEY Style

25 Feb 14 

Show

Added built-in touch key style:
DSK_act_deb_del_rep_cur
Where
act = 'action'
deb = 'debounce' in milliseconds
del = 'delay' in milliseconds
rep = 'repeat' in milliseconds
cur = 'curRel'
Examples
KEY(key1,func,100,20,DSK_D_9_500_200_CC); // Create Key, action = down; debounce = 9; delay = 500; repeat = 200; curRel = CC
KEY(key2,func,100,100,DSK_C____TL); // Create Key, action = change; curRel = TL

49.52

 Built-In Styles - Parameters Are Optional

25 Feb 14 

Show

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 

Show

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

 Extra Built-In Data Styles TXT and FLT

10 Feb 14 

Show

* Added TXTn, TXTnE and TXTnC data styles of type text where n is the maxLen value allocated for the data between 1 and 8192. If the name ends in an 'E' then it stored in EEPROM. If the name ends in 'C' then it is a constant (ie read-only). Examples TXT42, TXT27E, TXT32C.
* Added FLTn, FLTnE and FLTnC data styles of type float where n is the number of displayed decimal places between 0 and 17. If the name ends in an 'E' then it stored in EEPROM. If the name ends in 'C' then it is a constant (ie read-only). Examples FLT5, FLT7E, FLT4C.

Examples of styles created:

VAR(v1,"",TXT1);
STYLE(TXT1,DATA){type=text;maxLen=1;}

VAR(v2,"",TXT99);
STYLE(TXT99,DATA){type=text;maxLen=99;}

VAR(v2,"",TXT8192);
STYLE(TXT8192,DATA){type=text;maxLen=8192;}

VAR(v3,"",TXT2048);
STYLE(TXT2048,DATA){type=text;maxLen=2048;}

VAR(v4,"",TXT128C);
STYLE(TXT128C,DATA){type=text;maxLen=128;readonly=y;}

VAR(v5,"",TXT48E);
STYLE(TXT48E,DATA){type=text;maxLen=48;locate=eeprom;}


VAR(v6,3.141,FLT7);
STYLE(FLT7,DATA){type=float;decimal=7;}

VAR(v7,1.23,FLT8C);
STYLE(FLT8C,DATA){type=float;decimal=8;readonly=y;}

VAR(v8,2.34,FLT12E);
STYLE(FLT12E,DATA){type=float;decimal=12;locate=eeprom;}

49.48

 New Line Draw ''curRel'' Options Plus Offset

29 Nov 13 

Show

* Additional parameter can now be passed to DRAW() command for Line and Vector drawing which allow for the line to be offset relative to the cursor:
DRAW( name, length, angle, offset, stVect );
DRAW( name, length, angle, offset );
DRAW( name, length, angle, offset, stVect, xPos, yPos );
DRAW( name, width, height, offset, stLine );
DRAW( name, width, height, offset );
DRAW( name, width, height, offset, stLine, xPos, yPos );
* The offset parameter is ideal for the pointer on gauges and clocks where the point of rotation is a certain distance along the line
* New curRel options allow for better line placement.
SA, SB, SC // Start of line. SA = Edge A; SB = Edge B; SC = Centre
EA, EB, EC // End of line. EA = Edge A; EB = Edge B; EC = Centre
MA, MB, MC // Mid-point of line. MA = Edge A; MB = Edge B; MC = Centre
OA, OB, OC // Offset along line. OA = Edge A; OB = Edge Bl OC = Centre

* Example: Vector length = 100, angle = 125 deg, width = 5 (not to scale)


49.46

 Style switching LOAD(text.style,newstyle);

21 Oct 13 

Show

* 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.43

 Text Alignment not correct with rotated text

12 Sep 13 

Show

* 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.43

 Support for Pages Larger Than Screen Size

12 Sep 13 

Show

* Added functionality to support pages defined greater than page size. The posX and posY in the page style can be used to scroll the page around.
STYLE(stPg,PAGE){sizeX=960;}
LOAD(stPg.posX,-480);; // Show right half of page
* Modified page style so that only sizeX or sizeY needs to be defined (the other size defaults to the screen size). Previously both sizeX and sizeY needed to be defined to override the default page size.

49.42

 Image Rotation (90 degree steps) in STYLE

06 Sep 13 

Show

* Images can now be rotated using the style parameter:
STYLE(stImg,IMAGE){rotate=90;} and
LOAD(stImg.rotate,90);
* Supported angles: 0, 90, 180, 270. Image is rotated clockwise.
* Transparency is set with the back=colour property.

49.42

 Image Scaling in STYLE

06 Sep 13 

Show

* Images can now be scaled using the style parameter:
STYLE(stImg,IMAGE){scale=75;} and
LOAD(stImg.scale,75);
* Supported scaling in 1% steps.
* PNG Alpha Transparency is only supported with 100% scaled images.
* Transparency is set with the back=colour property.

49.38

 TEXT Alignment Problem with ''update=changed''

11 Jun 13 

Show

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

 New Text Parameters - width, bcol, padding, xSpace, ySpace [work in progress]

10 Jun 13 

Show

* 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

 Colours of ''none'' or ''transparent''

10 Jun 13 

Show

* The value of "none" or "transparent" can now be used for all colours in the styles.

49.37

 STYLE Handling Improvements

10 Jun 13 

Show

* Maximum style parameter value length now 128 chars (was 64).
* Maximum number of settable params in one STYLE() command is now 17 (was 16).
* Improved style creation algorithm.

49.32

 Read-Only VARs - Variables can be designated read-only (constants).

14 Feb 13 

Show

* Variables can be designated read-only (constants) by specifying readonly=y; in the data style:
STYLE(U8C,data){type=u8;readonly=y;}
* A system error will occur if modification to a read-only variable is requested.
* Checking is performed in LOAD(), VAR() and CALC() commands only.
* Built-in "Constant" styles created:
U8C, U16C, U32C, S8C, S16C, S32C, PTRC, FLT1C, FLT2C, FLT3C, FLT4C, TXT4C, TXT16C, TXTC, TXT64C, TXT128C

49.27

 KEY style event handler - Added an additional parameter to the key style - evfunc.

11 Dec 12 

Show

Added an additional parameter to the key style. evfunc allows a function to be called when any key using that style is pressed. This function is run before the function specified in the KEY entity. A typical use for this would be to provide a method to add a key beep.

STYLE(myTouch,key)
{
.
.
evfunc = fncBeep;
.
.
}

FUNC(fncBeep)
{
LOAD(BUZZ, 100);
}

49.16

 Centre/Center - Added support for accepting both ''centre'' and ''center'' in parameters.

14 Sep 12 

Show

* Added support for accepting both "centre" and "center" in parameters.
style image action
style text justify

49.14

 Text - Added text justification style property for displaying multiple lines in text box.

27 Jul 12 

Show

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

 Pop-Up Pages - Page style parameter ''type=popUp;'' or ''type=p;'' added to define a page as a pop-up.

01 Jun 12 

Show

Page style parameter "type=popUp;" or "type=p;" added to define a page as a pop-up.
Default is "type=normal;" or "type=n;" for non-pop-up page.
* This allows pages the same size as the screen to be defined as a pop-up.
* Pages smaller than the screen size will still always be declared as pop-ups; the "type" parameter is ignored in this case.

49.02

 Style with Floats - Style parameters now except floats.

15 May 12 

Show

Style parameters now except floats (rather than throwing an error).
Floats are rounded to ints where applicable.

49.00

 Opacity - Added opacity to images, drawing objects and text.

22 Mar 12 

Show

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.

49.00

 Text Alignment - To support ''monospaced'' fonts, the text style parameter xtrim=Y|N has been added.

22 Mar 12 

Show

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.

47.24

 Inherited Styles - Style storage simplified reducing memory usage and increasing performance.

31 Oct 11 

Show

Style storage simplified reducing memory usage and increasing performance.
* Style inheritance using previously defined style now possible:
> style(styleA,text){...}
> style(styleB,styleA){...} <- firstly copy style from styleA then apply new style parameters
* load(style.param,var); fixed

47.12

 Image Actions - The way in which an image is displayed can be changed for slideshows.

09 Sep 11 

Show

The way in which an image is displayed can be changed for slideshows.
STYLE(imgSt,Image){ action=type; step=pixels; }
> action type options are:
- i or instant = Instant (default);
- u or up = Move Up;
- d or down = Move Down;
- l or left = Move Left;
- r or right = Move Right;
- ur or ru or upright = Move Diagonal Up-Right
- dr or rd or downright = Move Diagonal Down-Right
- ul or lu or upleft = Move Diagonal Up-Left
- dl or ld or downleft = Move Diagonal Down-Left
- a or all = Sequence through all (except instant);
> step pixels defaults to 20 pixels (value 1 to minimum of lcd width or lcd height)

47.00

 Graphs - A number of graph styles now exist as draw types.

09 Jul 11 

Show

A number of graph styles now exist as draw types:
type=p; type=pixel; // Pixel Scatter - places a point at x,y
type=t; type=trace; // Trace/Line - joins the dots between current point and previous point.
type=y; type=yBar; // Bar Y - draws vertical line from 0 to y and clears from y+1 to ymax
type=x; type=xBar; // Bar X - draws horizontal line from 0 to x and clears from x+1 to xmax

The origin on the graph can be changed
xOrigin=val; // (default=0)
yOrigin=val; // (default=0)

The scaling of pixels can be set:
xScale=val; // (default=100.0) [val can be float and is a percentage]
yScale=val; // (default=100.0) [val can be float and is a percentage]
Note to draw graph with 0,0 at top and n,n at bottom, use yScale=-100;

The graph can be made to scroll (currently right-to-left only supported)
xScroll=val; // where val=0 (default - no scroll); val=n (scroll left n pixels before each plot

STYLE(gstyle,DRAW) {
type=trace;
maxX=100;
maxY=100;
col=green;
back=black;
width=3;
curRel=cc;
xOrigin=50;
yOrigin=50;
xScale=200;
yScale=200;
xScroll=1;
}

44.00

 Images - Style for images now accepts sizeX and maxX for maximum width; sizeY and maxY for maximum height.

20 May 11 

Show

Style for images now accepts sizeX and maxX for maximum width; sizeY and
maxY for maximum height.
When an image is added to a page, if the maxX and maxY parameters are
equal to the width and height of the image and scaling is 100% and rotation
0, then a copy of the image is not made - just a pointer to it created (this
saves memory space).

· When a library image is specified as the background to a page and the image
dimensions are the same as the page size, then just a pointer to the library image is used rather than a copy.
Bit map images using 16bits are retained in memory as 16bit until refreshed on screen. This extends image storage by ~ 40%. Bit map images using 24bits are converted to 32bit on loading into the library as in previous releases.

Style Updating using Dot Operator
· Style parameters can now be updated by using the dot operator.
· Usage: LOAD(stylename.prop,val);
· Some parameters are not adjustable after the initial style setup as they require a change in memory allocation.
· The following style properties can be modified:
DATA: decimal
PAGE: posX, posY, back, image
TEXT: font, size, col, rotate, curRel
DRAW(box): col, width, back, rotate, curRel
DRAW(circle): col, width, back, curRel
DRAW(line): col, width, rotate, curRel
DRAW(graph): col, width, back, curRel
IMAGE: curRel
KEY: curRel

· When setting a non-adjustable parameter an error is no longer generated if the new value is the same as the current value.

42.00

 Draw Graph - Graph drawing added.

09 Mar 11 

Show

Graph drawing added, creating dot colour, background colour, max width, max height and dot size using draw style
draw(name,sizeX,sizeY,style); creates graph area
draw(name,posX,posY); puts dot in graph area at posX, posY (0,0 is top left
reset(name); clears graph
To be done - graph scrolling / redrawing, dot overlay / replace column

38.00

 Images - Image rotation of 0, 90, 180 and 270 degrees now supported.

13 Jan 11 

Show

Image rotation of 0, 90, 180 and 270 degrees now supported.
When loading file into library use LIB( img, "SDHC/filename.bmp?back=black&rotate=180" );
When using an image from the library use STYLE( imgStyle, image ) { rotate=180; }

Image scaling now supported on image files loaded into library (with restrictions)
Scaling value is a percentage.
For rotate=0,90,180,270, scale=100,200,300,400,500 etc..
For rotate=0, scale=5 to 100 in 5% steps also supported. (eg scale=75)
Example: LIB( img, "SDHC/filename.bmp?back=black&rotate=180&scale=200" )
Example: LIB( img, "SDHC/filename.bmp?back=blue&scale=60" );
(Still need to add scale to style for IMG and support for other rotations for LIB.)

38.00

 Draw - Box rotation of 0, 90, 180 and 270 degrees now supported.

13 Jan 11 

Show

Box rotation of 0, 90, 180 and 270 degrees now supported.
Example: STYLE( boxStyle, draw ) { rotate=180; }
Line drawing added.
Example: DRAW( line1, 10, 10, lineStyle ); Draws line 45 degrees top left to bottom right
Example: DRAW( line2, 10, -10, lineStyle ); Draws line 45 degrees bottom left to top right
Line rotation 0, 90, 180 and 270 degrees added.
· Pixel drawing added.

34.00

 EEPROM Storage - The user software can store values (text and numbers) in EEPROM.

19 Oct 10 

Show

The user software can store values (text and numbers) in EEPROM
About 1500 bytes are available. This would hold about 50 variable names and their values.
Example command VAR(MyEENum, 123, U8E); stores 123 in MyEENum the first time as a default. When you use LOAD(MyEENum, 244); the value is updated in RAM and in EEPROM. When power is removed and reapplied, VAR(MyEENum, 123, U8E); will not load 123 but the previously saved value.
To clean up the EEPROM during development, use RESET(EEPROM); which cleans the EEPROM and loads back only the currently defined variables.

STYLE( EEstyle, data) { type=U8; location=eeprom; } if location is specified as eeprom, data is stored otherwise just RAM is used and data lost at power off.

Built in data types have been created to simplify EEPROM storage: U8E, S8E, U16E, S16E, U32E, S32E, PTRE, FLT1E, FLT2E, FLT3E, FLT4E, TXTE

The ‘aircon.mnu’ now uses two U8E variables for the minimum and maximum temperatures. Error messages will be generated if a variable stored in EEPROM is redefined in SDRAM or a different VAR type is specified.

32.00

 VAR - VAR(Name,Style); changes to VAR(Name, default Value, Style);.

14 Oct 10 

Show

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

 Entity Pointers - Entity pointers have been added.

10 Sep 10 

Show

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.

25.00

 EXTERNAL FONTS - All font/text functions rewritten to support 8-bit dithered fonts.

03 Sep 10 

Show

All font/text functions rewritten to support 8-bit dithered fonts.
External font files (.fnt extension) can now be loaded using the LIB() command.
'?start' parameter added to library font load to allow specifying of font start address. If this is not specified, the Unicode value is used

Multiple fonts can be added to the text style, allowing character replacement and extending font tables: It is actually possible to mix a 16x16 and 32x32 font in the same text string…looks a bit crazy

STYLE( TextStyle1, TEXT )
{ font = FontName1; } // A single font does not need quotes

STYLE( TextStyle2, TEXT )
{ font = "FontName1, FontName2, ... FontName16"; } // Up to 16 fonts (multiple fonts must be enclosed in quotes)

Where multiple fonts are used, the last font is searched (FontName16 if present), then FontName15 (if present) is checked, etc. If the character is not present in any of the specified fonts, then no character drawn.

Except the special characters
\\0D (carriage return) which sets the cursor back to the start of the line
\\0A (line feed) which increments the line and sets the cursor to the start.

NOTE: only single characters in the range \\00 to \\FF are currently supported until the 2 byte Unicode is active. The demo includes 16x16, 24x24 and 32x32 ASCII fonts. The other fonts will be loaded on the website when 2byte Unicode is active.

21.00

 STYLE - Fixed error with default style initialization.

30 Jul 10 

Show

Fixed error with default style initialization. Style parameter names for POSN, PAGE, TEXT, DRAW, IMAGE, KEY set up

20.00

 STYLE - The parameter styles for interfaces RS2, I2C, USB, RTC.

22 Jul 10 

Show

The parameter styles for interfaces RS2, I2C, USB, RTC, etc use
SETUP(RS2) {....}

19.00

 RS2 - Added setting of RS232 port with STYLE.

14 Jul 10 

Show

Added setting of RS232 port with STYLE

19.00

 STYLE - Fixed passing strings in the STYLE parameters.

14 Jul 10 

Show

Fixed passing strings in the STYLE parameters.