case 9: // Edit Channel Timing Settings Page
{
if ((y>=55) && (y<=103)) // Range for change icons (+ and - signs)
{
for (counter=0; counter<4; counter++)
{
if (x>= (18 + (counter*95)) && (x<= (98 + (counter*95)))) // Testing which time cell has been touched
{ // 0 - Start; 1 - Ramp up; 2 - Ramp Down; 3 - Finish
_timeCell = counter;
}
}
if ((y>=55) && (y<=71)) // + Row
{
if (x>= (18 + (_timeCell * 95)) && (x<= (34 + (_timeCell * 95)))) // Ten's digit of hours
{
timeVariable[_timeCell][0]++;
if (timeVariable[_timeCell][0] == 3)
{
timeVariable[_timeCell][0] = 0;
}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
if (x>= (34 + (_timeCell * 95)) && (x<= (50 + (_timeCell * 95)))) // One's digit of hours
{
timeVariable[_timeCell][1]++;
if (timeVariable[_timeCell][1] == 4)
{
timeVariable[_timeCell][1] = 0;
}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
if (x>= (66 + (_timeCell * 95)) && (x<= (81 + (_timeCell * 95)))) // Ten's digit of minutes
{
timeVariable[_timeCell][2]++;
if (timeVariable[_timeCell][2] == 6)
{
timeVariable[_timeCell][2] = 0;
}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
if (x>= (82 + (_timeCell * 95)) && (x<= (97 + (_timeCell * 95)))) // One's digit of minutes
{
timeVariable[_timeCell][3]++;
if (timeVariable[_timeCell][3] == 10)
{
timeVariable[_timeCell][3] = 0;
}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
}
if ((y>=87) && (y<=103)) // - Row
{
if (x>= (18 + (_timeCell * 95)) && (x<= (34 + (_timeCell * 95)))) // Ten's digit of hours
{
if (timeVariable[_timeCell][0] == 0)
{timeVariable[_timeCell][0] = 2;}
else {timeVariable[_timeCell][0]--;}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
if (x>= (34 + (_timeCell * 95)) && (x<= (50 + (_timeCell * 95)))) // One's digit of hours
{
if (timeVariable[_timeCell][1] == 0)
{timeVariable[_timeCell][1] = 3;}
else {timeVariable[_timeCell][1]--;}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
if (x>= (66 + (_timeCell * 95)) && (x<= (81 + (_timeCell * 95)))) // Ten's digit of minutes
{
if (timeVariable[_timeCell][2] == 0)
{timeVariable[_timeCell][2] = 5;}
else {timeVariable[_timeCell][2]--;}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
if (x>= (82 + (_timeCell * 95)) && (x<= (97 + (_timeCell * 95)))) // One's digit of minutes
{
if (timeVariable[_timeCell][3] == 0)
{timeVariable[_timeCell][3] = 9;}
else {timeVariable[_timeCell][3]--;}
updateTimeFields(18 + (_timeCell * 95), 55, _timeCell);
channelData[_channel][_day].StartMins = (timeVariable[_timeCell][0] * 600) + (timeVariable[_timeCell][1] * 60) + (timeVariable[_timeCell][2] * 10) + (timeVariable[_timeCell][3]);
}
}
}
if ((y>=118) && (y<=148)) // Range for channel number buttons
{
for (counter=0; counter<10; counter++)
{
if (x>= (15 + (counter*35)) && (x<= (45 + (counter*35)))) // Testing the position of each existing button to determine
{ // which one, or channel, has been touched
_channel = counter;
newButton9[0] = (15 + (counter*35));
drawframe(oldButton9[0], 118, 2);
drawframe(newButton9[0], 118, 1);
oldButton9[0] = newButton9[0];
}
}
calculateDigits(_channel, _day);
updateTimeFields(18, 55, 0);
updateTimeFields(113, 55, 1);
updateTimeFields(208, 55, 2);
updateTimeFields(303, 55, 3);
}
if ((y>=155) && (y<=185)) // Range for day of week buttons
{
for (counter=0; counter<7; counter++)
{
if (x>= (15 + (counter*35)) && (x<= (45 + (counter*35)))) // Testing the position of each existing button to determine
{ // which one, or day, has been touched
_day = counter;
newButton9[1] = (15 + (counter*35));
drawframe(oldButton9[1], 155, 2);
drawframe(newButton9[1], 155, 1);
oldButton9[1] = newButton9[1];
}
}
calculateDigits(_channel, _day);
updateTimeFields(18, 55, 0);
updateTimeFields(113, 55, 1);
updateTimeFields(208, 55, 2);
updateTimeFields(303, 55, 3);
}
if ((y>=199) && (y<= 231)) // Buttons
{
if ((x>=350) && (x<=382)) // Back Button
{
controlmodeScr();
}
}
break;
}