clockRegion.w = 150;
clockRegion.h = 30;
+ indicatorsRegion.x = 6;
+ indicatorsRegion.y = 44;
+ indicatorsRegion.w = 18;
+ indicatorsRegion.h = 15 * (surface->getFontHeight() + 1);
+
+ flipflop = true;
+
create(570, 420);
if (Video::getInstance()->getFormat() == Video::PAL)
{
setTitleBarColour(Colour::TITLEBARBACKGROUND);
sl.setSurface(surface);
- sl.setSurfaceOffset(10, 30 + 5);
- sl.setDimensions(area.w - 20, area.h - 30 - 15 - 30);
+ sl.setSurfaceOffset(30, 30 + 5);
+ sl.setDimensions(area.w - 40, area.h - 30 - 15 - 30);
// Draw statics
insertData();
sl.draw();
drawShowing();
+ drawIndicators();
drawClock();
}
{
char strA[300];
char strB[300];
- char status;
struct tm* btime;
// FIXME all drawing stuff in this class and sl.clear somewhere?!
sl.addColumn(0);
- sl.addColumn(130);
+ sl.addColumn(110);
RecTimer* recTimer;
int first = 1;
for (UINT i = 0; i < recTimerList->size(); i++)
{
recTimer = (*recTimerList)[i];
- if (recTimer->recording)
- {
- status = 'R';
- }
- else if (recTimer->pending)
- {
- status = 'X';
- }
- else if (recTimer->active == 0)
- {
- status = 'N';
- }
- else
- {
- status = 'O';
- }
btime = localtime((time_t*)&recTimer->startTime);
strftime(strA, 299, "%d/%m %H:%M ", btime);
- snprintf(strB, 299, "%c %s\t%s", status, strA, recTimer->getName());
+ snprintf(strB, 299, "%s\t%s", strA, recTimer->getName());
recTimer->index = sl.addOption(strB, first);
first = 0;
}
drawText(showing, 220, 385, Colour::LIGHTTEXT);
}
+void VTimerList::drawIndicators()
+{
+ int top = sl.getTopOption();
+ int bottom = sl.getBottomOption();
+ int yinc = surface->getFontHeight() + 1;
+ RecTimer* recTimer;
+
+ rectangle(6, 44, 18, 15*yinc, Colour::VIEWBACKGROUND);
+
+ // The indexes recorded from the wselectlist into the index member of the RecTimer
+ // Is the same as the position in the vector of RecTimers
+ // Because they are in order, they don't change order and wselectlist starts from 0 up consecutively
+
+ int ypos = 44;
+ for (int current = top; current < bottom; current++)
+ {
+ recTimer = (*recTimerList)[current];
+
+ if (recTimer->recording) // Flashing red square
+ {
+ if (flipflop)
+ {
+ //rectangle(6, ypos, 18, 16, Colour::RED);
+ rectangle(6, ypos, 18, 16, Colour::RED);
+ drawText("R", 8, ypos-3, Colour::LIGHTTEXT);
+ }
+ }
+ else if (recTimer->pending)
+ {
+ rectangle(6, ypos, 18, 16, Colour::RED);
+ drawText("X", 8, ypos-3, Colour::BLACK);
+ }
+ else if (recTimer->active == 0)
+ {
+ rectangle(6, ypos, 18, 16, Colour::SELECTHIGHLIGHT);
+ drawText("X", 8, ypos-3, Colour::BLACK);
+ }
+ else
+ {
+// if (flipflop) rectangle(6, ypos, 18, 16, Colour::GREEN);
+ }
+
+ ypos += yinc;
+ }
+}
+
void VTimerList::timercall(int clientReference)
{
drawClock();
ViewMan::getInstance()->updateView(this, &clockRegion);
+
+ flipflop = !flipflop;
+ drawIndicators();
+ ViewMan::getInstance()->updateView(this, &indicatorsRegion);
}
int VTimerList::handleCommand(int command)
sl.up();
sl.draw();
drawShowing();
+ drawIndicators();
ViewMan::getInstance()->updateView(this);
return 2;
}
sl.down();
sl.draw();
drawShowing();
+ drawIndicators();
ViewMan::getInstance()->updateView(this);
return 2;
}
sl.pageUp();
sl.draw();
drawShowing();
+ drawIndicators();
ViewMan::getInstance()->updateView(this);
return 2;
}
sl.pageDown();
sl.draw();
drawShowing();
+ drawIndicators();
ViewMan::getInstance()->updateView(this);
return 2;
}