Add to images to library
Create a style for page
Define a page named "pageName" using "pageStyle"
After loading show the page
|
// Menu file for Itron TFT module
SETUP(USB) {rxi=C; txi=Y; rxb=1250000;}
LIB(Asc_16,"NAND/asc_16b.fnt");
LIB(BackG,"NAND/BackG.bmp");
STYLE(pSt3, Page) { image = BackG; }
STYLE(tSt1, Text) { currel=TR;font = Asc_16; col = White; }
STYLE(tSt0, Text) { currel=TL;font = Asc_16; col = White; }
STYLE(kSt,Key) {currel=TL;action=D;repeat=0;}
STYLE(dSt,Draw){type=b;back=\\80ffffff; curRel=TL;}
VAR(posY,10,U16); VAR(cNo,0,U8); VAR(radioList,0,U8,20,20); VAR(Num,0,U8); VAR(TextV,"",TXT);
LOAD(radioList.0,%t%"Absolute Radio"); LOAD(radioList.1,%t%"BBC Radio 1");
LOAD(radioList.2,%t%"BBC Radio 2"); LOAD(radioList.3,%t%"BBC Radio 3");
LOAD(radioList.4,%t%"BBC Radio 4"); LOAD(radioList.5,%t%"BBC 5 Live");
LOAD(radioList.6,%t%"Classic FM"); LOAD(radioList.7,%t%"Heart");
LOAD(radioList.8,%t%"Kiss FM"); LOAD(radioList.9,%t%"Planet Rock");
PAGE(fmPg, pSt3)
{
TEXT(ftext2, "", tSt1,437,9);
DRAW(fdraw,226,24,dSt,8,10);
KEY(kftop0,upF,50,50,kSt,386,80);
KEY(kftop1,downF,50,50,kSt,386,140);
KEY(ConfirmK,[LOAD(tSt1.col,red);;],50,50,kSt,386,200);
}
FUNC(MakeList)
{
LOOP(MakeL,10)
{
LOAD(TextV,"TextB",Num);CALC(posY,26,Num,"*");CALC(posY,posY,10,"+");
TEXT(TextV,%t%radioList.Num,tSt0,14,posY);
CALC(Num,Num,1,"+");
}
}
FUNC(upF)
{
LOAD(tSt1.col,white);
IF(cNo>0?[CALC(cNo,cNo,1,"-");]);
CALC(posY,26,cNo,"*"); CALC(posY,posY,10,"+");
TEXT(ftext2,%t% radioList.cNo);
POSN(8,posY,fdraw);;
}
FUNC(downF)
{
LOAD(tSt1.col,white);
IF(cNo<9?[CALC(cNo,cNo,1,"+");]);
CALC(posY,26,cNo,"*"); CALC(posY,posY,10,"+");
TEXT(ftext2,%t% radioList.cNo);
POSN(8,posY,fdraw);;
}
TEXT(ftext2,%t% radioList.0);
SHOW(fmPg);
RUN(MakeList);;
|