Add background image to library
Create page style using background image
Create text style
Create draw style for box
Setup IO ports so K00 to K03 are active inputs and are triggered on falling edge
Create a text variable
Create an Interupt for wen K00 is triggered which runs EscapeFunc
Create an Interupt for wen K01 is triggered which runs LeftFunc
Create an Interupt for wen K02 is triggered which runs RightFunc
Create an Interupt for wen K03 is triggered which runs EnterFunc
Define a page named "pageName" with style "pageStyle"
Create a box to show Text entity in
Create text entity to show varaible
Create EscapeFunc function which loads "Escape Key" into variable and shows in text entity and refreshes page
Create LeftFunc function which loads "Left Key" into variable and shows in text entity and refreshes page
Create RightFunc function which loads "Right Key" into variable and shows in text entity and refreshes page
Create EnterFunc function which loads "Enter Key" into variable and shows in text entity and refreshes page
After loading show the page named "pageName"
|
LIB(background,"SDHC/bground.png");
STYLE(pageStyle, Page) {image = background;}
STYLE(textstyle,Text) {font=Ascii16; col=White; }
STYLE(drawstyle,Draw) {type=Box;back=steelblue;col=White;width=2;}
SETUP(keyio){active=\\00000F;inp=\\00000F;trig=\\00000F;edge=\\000000;}
VAR(Descr,"Press Key",TXT);
INT(EscInt,K00,EscapeFunc);
INT(LeftInt,K01,LeftFunc);
INT(RightInt,K02,RightFunc);
INT(EnterInt,K03,EnterFunc);
PAGE(pageName, pageStyle)
{
DRAW(box1,150,50,drawstyle,240,136);
TEXT(text1,Descr,textstyle,240,136);
}
FUNC(EscapeFunc) {LOAD(Descr,"Escape Key");TEXT(text1,Descr);;}
FUNC(LeftFunc) {LOAD(Descr,"Left Key");TEXT(text1,Descr);;}
FUNC(RightFunc) {LOAD(Descr,"Right Key");TEXT(text1,Descr);;}
FUNC(EnterFunc) {LOAD(Descr,"Enter Key");TEXT(text1,Descr);;}
SHOW(pageName);
|