diff options
author | mrwastl <mrwastl@users.sourceforge.net> | 2010-05-04 21:03:19 +0200 |
---|---|---|
committer | mrwastl <mrwastl@users.sourceforge.net> | 2010-05-04 21:03:19 +0200 |
commit | 8a4168bd0d2e468604755398f18be1fba9046aa0 (patch) | |
tree | 56558e0517e3b63483a2813146563eaf0371c666 /widgets.c | |
parent | 75ebec3efc4879fc8bee8a3ecfe71809d9fccefd (diff) | |
download | vdr-plugin-graphlcd-8a4168bd0d2e468604755398f18be1fba9046aa0.tar.gz vdr-plugin-graphlcd-8a4168bd0d2e468604755398f18be1fba9046aa0.tar.bz2 |
initial git upload, based on graphlcd-0.2.0-pre2
Diffstat (limited to 'widgets.c')
-rw-r--r-- | widgets.c | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/widgets.c b/widgets.c deleted file mode 100644 index 68193d5..0000000 --- a/widgets.c +++ /dev/null @@ -1,95 +0,0 @@ -#include "setup.h" -#include "widgets.h" - -#include <vdr/config.h> -#include <vdr/tools.h> - -#include "compat.h" - - -cScroller::cScroller() -{ - Reset(); -} - -void cScroller::Reset() -{ - x = 0; - y = 0; - xmax = 0; - font = NULL; - text = ""; - active = false; - update = false; - position = 0; - increment = 0; - lastUpdate = 0; -} - -bool cScroller::NeedsUpdate() -{ - if (active && - TimeMs() - lastUpdate > (uint64_t) GraphLCDSetup.ScrollTime) - { - update = true; - return true; - } - return false; -} - -void cScroller::Init(int X, int Y, int Xmax, const GLCD::cFont * Font, const std::string & Text) -{ - x = X; - y = Y; - xmax = Xmax; - font = Font; - text = Text; - increment = GraphLCDSetup.ScrollSpeed; - position = 0; - if (GraphLCDSetup.ScrollMode != 0 && - font->Width(text) > xmax - x + 1) - active = true; - else - active = false; - update = false; - lastUpdate = TimeMs() + 2000; -} - -void cScroller::Draw(GLCD::cBitmap * bitmap) -{ - if (!active) - { - bitmap->DrawText(x, y, xmax, text, font); - } - else - { - if (update) - { - if (increment > 0) - { - if (font->Width(text) - position + font->TotalWidth() * 5 < increment) - { - increment = 0; - position = 0; - } - } - else - { - if (GraphLCDSetup.ScrollMode == 2) - { - increment = GraphLCDSetup.ScrollSpeed; - } - else - { - active = false; - } - } - position += increment; - lastUpdate = TimeMs(); - update = false; - } - bitmap->DrawText(x, y, xmax, text, font, GLCD::clrBlack, true, position); - if (font->Width(text) - position <= xmax - x + 10 + font->TotalWidth() * 5) - bitmap->DrawText(x + font->Width(text) - position + font->TotalWidth() * 5, y, xmax, text, font); - } -} |