PV's Cassiopeia SDK Two Screen program /*****************************************/ /*Most of the code is similar to the first example.*/ /*The only difference is that there are two touch buttons on the frist screen.*/ /*And so there are to output stext screens*/ /*****************************************/ #include #include "define.h" #include "libc.h" #include "l_libc.h" /*****************************************/ /*Here instead of one we have to touch buttons defined that will appear on the first screen.*/ /*As the number of touch buttons in your programmes increase you define them the following way*/ /*#define TouchButtonName 0x900X(Where X stands for 'Touch Button Number')*/ /*****************************************/ #define TouchAreaName1 0x9000 #define TouchAreaName2 0x9001 void Screen1text(); void OutputText(); TCHTBL far TouchAreaScreen1Name[] = { 30, 72, 130, 88, ACT_MAKE | ACT_MOVE_IN | ACT_MOVE_OUT | ACT_BREAK_IN, TouchAreaName1, 0x0000, /*****************************************/ /*The second button's information in the TCHTBL of the first screen*/ /*****************************************/ 30, 90, 130, 106, ACT_MAKE | ACT_MOVE_IN | ACT_MOVE_OUT | ACT_BREAK_IN, TouchAreaName2,/*Name of a second touch button on the same screen*/ 0x0000, }; /*****************************************/ /*This function contains the text for the buttons*/ /*****************************************/ void Screen1text() { LibInitDisp(); LibClrDisp(); LibGdsBox(30,72,130,88); LibPutProStr(IB_PFONT1,55,77,"Click Here!",50); /*****************************************/ /*The text for the second button is placed in the next two lines*/ /*****************************************/ LibGdsBox(30,90,130,106); LibPutProStr(IB_PFONT2,50,96,"Click Here!",60); LibPutDisp(); } /*****************************************/ /*This function contains the code that will be executed depending which touch button is touched*/ /*The two buttons are on the the screen 1(TouchAreaScreen1Name)*/ /*****************************************/ void OutputText() { TCHSTS tsts; LibTchStackClr(); LibTchStackPush(NULL); LibTchStackPush(TchHardIcon); LibTchStackPush(TouchAreaScreen1Name); LibTchInit(); LibRepOff(); LibTchWait(&tsts); switch(tsts.obj) { case TouchAreaName1 : /*****************************************/ /*The following lines contains the text that is displayed on screen 2 if the touch button 1 is touched*/ /*****************************************/ { LibClrDisp(); LibPutProStr(IB_PFONT1,14,66,"Congratulations!!",78);/*Shows text*/ LibPutProStr(IB_PFONT1,37,75,"You have created",85); LibPutProStr(IB_PFONT1,21,84,"Your second PV program",117); LibPutDisp(); /* Puts the text on screen */ LibWait (IB_1SWAIT); /* This and the following four lines, each wait for 1 second*/ LibWait (IB_1SWAIT); LibWait (IB_1SWAIT); LibWait (IB_1SWAIT); LibWait (IB_1SWAIT); LibJumpMenu(); /*Exits back to the PV Menu*/ } break; case TouchAreaName2: /*****************************************/ /*The following lines contains the text that is displayed on screen 2 if the touch button 2 is touched*/ /*****************************************/ { LibClrDisp(); LibPutProStr(IB_PFONT1,14,66,"CongratulationsOnce Again!!",132); LibPutProStr(IB_PFONT1,37,75,"You have created",85); LibPutProStr(IB_PFONT1,21,84,"Your second PV program",117); LibPutDisp(); /* Puts the text on screen */ LibWait (IB_1SWAIT); /* This and the following four lines, each wait for 1 second*/ LibWait (IB_1SWAIT); LibWait (IB_1SWAIT); LibWait (IB_1SWAIT); LibWait (IB_1SWAIT); LibJumpMenu(); /*Exits back to the PV Menu*/ } } } void main() { Screen1text(); OutputText(); }