PV's Cassiopeia SDK Moving between Screens #include #include #include "define.h" #include "libc.h" #include "l_libc.h" /**************************************/ /*Three touch buttons are defined here. */ /**************************************/ #define TouchAreaName1 0x9000 #define TouchAreaName2 0x9001 #define TouchAreaName3 0x9002 /**************************************/ /*Three function prototypes*/ /**************************************/ void Screen1text (); void OutputText(); void OutputText1Screen2(); /**************************************/ /*TCHTBL for screen 1 with two buttons*/ /**************************************/ TCHTBL far TouchAreaScreen1Name[] = { 30, 9, 130, 25, ACT_MAKE | ACT_MOVE_IN | ACT_MOVE_OUT | ACT_BREAK_IN, TouchAreaName1, 0x0000, 30,90,130,106, ACT_MAKE | ACT_MOVE_IN | ACT_MOVE_OUT | ACT_BREAK_IN, TouchAreaName2, 0x0000, }; /**************************************/ /*TCHTBL for screen 2 with one button */ /**************************************/ TCHTBL far TouchAreaScreen2Name[] = { 30, 9, 130, 25, ACT_MAKE | ACT_MOVE_IN | ACT_MOVE_OUT | ACT_BREAK_IN, TouchAreaName3, 0x0000, }; void Screen1text () { LibInitDisp(); LibClrDisp(); LibGdsBox(30, 9, 130, 25); LibPutProStr(IB_PFONT3,43,13,"CLICK HERE!",75); LibGdsBox(30,90,130,106); LibPutProStr(IB_PFONT2,50,96,"Click Here!",60); LibPutDisp(); } /**************************************/ /*This function contains some the Congratulation text and the text for the third button*/ /**************************************/ void OutputText1Screen2() { TCHSTS tsts; LibTchStackClr(); LibTchStackPush(NULL); LibTchStackPush(TchHardIcon); LibTchStackPush(TouchAreaScreen2Name); LibTchInit(); LibRepOff(); /*Your code goes here*/ LibClrDisp(); LibPutProStr(IB_PFONT1,41,66,"Congratulations!!",78); LibPutProStr(IB_PFONT1,37,75,"You have created",85); LibPutProStr(IB_PFONT1,21,84,"Your Third Pv program",117); LibGdsBox(30, 9, 130, 25); LibPutProStr(IB_PFONT3,43,13,"CLICK HERE!",75); LibPutDisp(); /* Puts the text on screen */ LibTchWait(&tsts); switch(tsts.obj) { case TouchAreaName3: Screen1text (); OutputText(); } } void OutputText() { TCHSTS tsts; LibTchStackClr(); LibTchStackPush(NULL); LibTchStackPush(TchHardIcon); LibTchStackPush(TouchAreaScreen1Name); LibTchInit(); LibRepOff(); LibTchWait(&tsts); switch(tsts.obj) { case TouchAreaName1: /*Your code goes here*/ OutputText1Screen2(); case TouchAreaName2: /*Your code goes here*/ { LibClrDisp(); LibPutProStr(IB_PFONT1,14,66,"Congratulations Once Again!!",132); LibPutProStr(IB_PFONT1,37,75,"You have created",85); LibPutProStr(IB_PFONT1,21,84,"Your Third Pv program",117); LibPutDisp(); /* Puts the text on screen */ LibWait (IB_1SWAIT); /* The following six lines, each wait for 1 second*/ LibWait (IB_1SWAIT); /* wait for 1 second*/ LibWait (IB_1SWAIT); /* wait for 1 second*/ LibWait (IB_1SWAIT); /* wait for 1 second*/ LibWait (IB_1SWAIT); /* wait for 1 second*/ LibWait (IB_1SWAIT); /* wait for 1 second*/ LibJumpMenu(); } } } void main() { Screen1text (); OutputText(); }