TCPmaker : Visual Tour Sending Messages to Screen Controls |
First, let's look at how we set up variables for navigation. We created several Integer Variables for this purpose in TCPmaker Pro's Visual Page Designer, shown in the table below:
Variable Name: |
Id: |
PageNum |
iv16 |
Back |
iv17 |
Next |
iv1 |
For each of the 5 buttons on the navigation panel on the left, we set its mode or m property to be radio, so that only one button of the group can be in the active (lit up) state at any time. We set the g property of each of these buttons to go to the corresponding page (page id pg3 for the Variables button selected in the screen shot below). Every button in this radio group should be assigned a unique value for property rb, the radio button number. We also associated the PageNum variable with each of these 5 buttons in this radio group.
What this means is that, when the user clicks on one of these radio group buttons, the following things happen:
The PageNum variable sent to the device tells the device which page of our layout is currently being shown on the browser. We added a few lines to the PageNum variable's Receive Event handler in the PIC code, to display that value on the demo board's LCD display.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |