Add background image to library
Add Background image to library
Add font file to library
Create style for keyboard page
Create style for lock page
Create a style for text
Create a variable for inputted password
Create a variable for the required password
Define a page named "PassPage" with style "pageStyleK"
Postion text entity
Create number keys that add the value to the pcode variable
Create password button to view password (test only)
Create backspace key which runs fncbsp
Create clear key that empties pcode variable
Create check password button
Create page loop running forever to update text string
Check if passord button has been pressed
Or wrong password entered
Backspace function removes one character except the password cursor type
Password check to see if entered password matches the set password if correct go to menupage else show incorrect
Define a page named "menupage" with style "pageStyle"
Create a key that goes to passpage
After loading show the page named "PassPage"
|
LIB(backgroundK,"SDHC/bground5.png");
LIB(backgroundL,"SDHC/bground6.png");
LIB(asc_16b,"SDHC/asc_16b.fnt");
STYLE(pageStyleK, Page) { image = backgroundK; }
STYLE(pageStyle, Page) { image = backgroundL; }
STYLE(textStyle, Text) { font=asc_16b; col=\\000d55; curRel=CC; maxrows=2; yspace=-4; }
VAR(pcode,"\\01",TXT);
VAR(passw,"\\012580",TXT);
PAGE(PassPage,pageStyleK)
{
POSN(230,70); TEXT(passtxt,"",textStyle);
POSN(150,110); KEY(key1,[LOAD(pcode,pcode,1);],35,35,TOUCH);
POSN(190,110); KEY(key2,[LOAD(pcode,pcode,2);],35,35,TOUCH);
POSN(230,110); KEY(key3,[LOAD(pcode,pcode,3);],35,35,TOUCH);
POSN(150,150); KEY(key4,[LOAD(pcode,pcode,4);],35,35,TOUCH);
POSN(190,150); KEY(key5,[LOAD(pcode,pcode,5);],35,35,TOUCH);
POSN(230,150); KEY(key6,[LOAD(pcode,pcode,6);],35,35,TOUCH);
POSN(150,190); KEY(key7,[LOAD(pcode,pcode,7);],35,35,TOUCH);
POSN(190,190); KEY(key8,[LOAD(pcode,pcode,8);],35,35,TOUCH);
POSN(230,190); KEY(key9,[LOAD(pcode,pcode,9);],35,35,TOUCH);
POSN(150,230); KEY(keyast,[LOAD(pcode,pcode,"*");],35,35,TOUCH);
POSN(190,230); KEY(key0,[LOAD(pcode,pcode,0);],35,35,TOUCH);
POSN(230,230); KEY(keyhs,[LOAD(pcode,pcode,"#");],35,35,TOUCH);
POSN(290,110); KEY(keySP,[LOAD(pcode,"2580");TEXT(passtxt,pcode);;],75,35,TOUCH);
POSN(290,150); KEY(keybs,fncbsp,75,35,TOUCH);
POSN(290,190); KEY(keydel,[LOAD(pcode,"\\01");],75,35,TOUCH);
POSN(290,230); KEY(keyOK,fncOK,75,35,TOUCH);
LOOP(lp1,forever)
{
TEXT(passtxt,pcode);
IF(pcode="2580"?[WAIT(2000);LOAD(pcode,"\\01");]);
IF(pcode="Incorrect"?[WAIT(2000);LOAD(pcode,"\\01");]);;
}
}
FUNC(fncbsp) { IF(pcode~>1?[CALC(pcode,pcode,-1,"DEL");TEXT(passtxt,pcode);;]); }
FUNC(fncOK) { IF(pcode=passw?[LOAD(pcode,"\\01");TEXT(passtxt,pcode);;SHOW(menupage);]:[LOAD(pcode,"Incorrect");TEXT(passtxt,pcode);;]); }
PAGE(menupage,pageStyle)
{
POSN(240,136); KEY(LockK,[SHOW(PassPage);],100,30,TOUCH);
}
SHOW(PassPage);
|