From 47c3fea545a1b4607deda1e7d2fa51cbcf89a656 Mon Sep 17 00:00:00 2001 From: louis Date: Thu, 17 Jan 2013 13:16:44 +0100 Subject: Initial push tvguide 0.0.1 --- footer.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 footer.c (limited to 'footer.c') diff --git a/footer.c b/footer.c new file mode 100644 index 0000000..19ee958 --- /dev/null +++ b/footer.c @@ -0,0 +1,59 @@ +#include "footer.h" + +cFooter::cFooter() { + int buttonHeight= tvguideConfig.footerHeight - 20; + textY = (buttonHeight - tvguideConfig.FontButton->Height())/2; + int distanceX = 20; + buttonWidth = (tvguideConfig.osdWidth - tvguideConfig.timeColWidth-5*distanceX)/4; + int startX = tvguideConfig.timeColWidth + distanceX; + int Y = tvguideConfig.osdHeight - tvguideConfig.footerHeight + (tvguideConfig.footerHeight - buttonHeight)/2; + + buttonRed = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX, Y, buttonWidth, buttonHeight), cRect::Null, "btnRed"), "btnRed"); + buttonGreen = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX + buttonWidth + distanceX, Y, buttonWidth, buttonHeight), cRect::Null, "btnGreen"), "btnGreen"); + buttonYellow = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX + 2*(buttonWidth + distanceX), Y, buttonWidth, buttonHeight), cRect::Null, "btnYellow"), "btnYellow"); + buttonBlue = new cStyledPixmap(osdManager.requestPixmap(3, cRect(startX + 3*(buttonWidth + distanceX), Y, buttonWidth, buttonHeight), cRect::Null, "btnBlue"), "btnBlue"); +} + +cFooter::~cFooter(void) { + delete buttonRed; + delete buttonGreen; + delete buttonYellow; + delete buttonBlue; +} + +void cFooter::drawRedButton() { + buttonRed->setColor(theme.Color(clrButtonRed), theme.Color(clrButtonRedBlending)); + buttonRed->drawBackground(); + buttonRed->drawBorder(); + cString text(tr("Set Timer")); + int width = tvguideConfig.FontButton->Width(*(text)); + buttonRed->DrawText(cPoint((buttonWidth-width)/2, textY), *(text), theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton); + +} + +void cFooter::drawGreenButton() { + buttonGreen->setColor(theme.Color(clrButtonGreen), theme.Color(clrButtonGreenBlending)); + buttonGreen->drawBackground(); + buttonGreen->drawBorder(); + cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels back")); + int width = tvguideConfig.FontButton->Width(*text); + buttonGreen->DrawText(cPoint((buttonWidth-width)/2, textY), *text, theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton); +} + +void cFooter::drawYellowButton() { + buttonYellow->setColor(theme.Color(clrButtonYellow), theme.Color(clrButtonYellowBlending)); + buttonYellow->drawBackground(); + buttonYellow->drawBorder(); + cString text = cString::sprintf("%d %s", tvguideConfig.jumpChannels, tr("Channels forward")); + int width = tvguideConfig.FontButton->Width(*text); + buttonYellow->DrawText(cPoint((buttonWidth-width)/2, textY), *text, theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton); +} + +void cFooter::drawBlueButton() { + buttonBlue->setColor(theme.Color(clrButtonBlue), theme.Color(clrButtonBlueBlending)); + buttonBlue->drawBackground(); + buttonBlue->drawBorder(); + cString text(tr("Switch to Channel")); + int width = tvguideConfig.FontButton->Width(*(text)); + buttonBlue->DrawText(cPoint((buttonWidth-width)/2, textY), *(text), theme.Color(clrFontButtons), clrTransparent, tvguideConfig.FontButton); +} -- cgit v1.2.3