page scrolling with keys left and right in detail view

This commit is contained in:
louis 2013-07-17 16:43:57 +02:00
parent 4082580444
commit 780e17395f
4 changed files with 36 additions and 3 deletions

View File

@ -51,3 +51,4 @@ VDR Plugin 'tvguide' Revision History
- added possibility to replace original VDR schedules menu - added possibility to replace original VDR schedules menu
- changed channel jump logic - changed channel jump logic
- red button also available in detail view - red button also available in detail view
- page scrolling with keys left and right in detail view

View File

@ -1,4 +1,3 @@
#include "services/epgsearch.h"
#include <sstream> #include <sstream>
#include "detailview.h" #include "detailview.h"
@ -154,6 +153,28 @@ void cDetailView::scrollDown() {
} }
} }
void cDetailView::pageUp() {
if (contentScrollable) {
int aktHeight = (-1)*content->DrawPort().Point().Y();
int totalHeight = content->DrawPort().Height();
int screenHeight = content->ViewPort().Height();
int newHeight = max(aktHeight - screenHeight, 0);
content->SetDrawPortPoint(cPoint(0, (-1)*newHeight));
drawScrollbar();
}
}
void cDetailView::pageDown() {
if (contentScrollable) {
int aktHeight = (-1)*content->DrawPort().Point().Y();
int totalHeight = content->DrawPort().Height();
int screenHeight = content->ViewPort().Height();
int newHeight = min(aktHeight + screenHeight, totalHeight - screenHeight);
content->SetDrawPortPoint(cPoint(0, (-1)*newHeight));
drawScrollbar();
}
}
cImage *cDetailView::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) { cImage *cDetailView::createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend) {
cImage *image = new cImage(cSize(width, height)); cImage *image = new cImage(cSize(width, height));
image->Fill(clrBgr); image->Fill(clrBgr);
@ -296,6 +317,14 @@ eOSState cDetailView::ProcessKey(eKeys Key) {
scrollDown(); scrollDown();
osdManager.flush(); osdManager.flush();
break; break;
case kLeft:
pageUp();
osdManager.flush();
break;
case kRight:
pageDown();
osdManager.flush();
break;
case kOk: case kOk:
case kBack: case kBack:
state = osEnd; state = osEnd;

View File

@ -29,6 +29,10 @@ private:
int heightEPGPics(void); int heightEPGPics(void);
void drawEPGPictures(int height); void drawEPGPictures(int height);
cImage *createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend); cImage *createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend);
void scrollUp();
void scrollDown();
void pageUp();
void pageDown();
public: public:
cDetailView(const cEvent *event); cDetailView(const cEvent *event);
virtual ~cDetailView(void); virtual ~cDetailView(void);
@ -36,8 +40,6 @@ public:
void drawHeader(); void drawHeader();
void drawContent(); void drawContent();
void drawScrollbar(); void drawScrollbar();
void scrollUp();
void scrollDown();
eOSState ProcessKey(eKeys Key); eOSState ProcessKey(eKeys Key);
}; };

View File

@ -59,6 +59,7 @@ cTvguideConfig tvguideConfig;
#include "osdmanager.c" #include "osdmanager.c"
cOsdManager osdManager; cOsdManager osdManager;
#include "services/epgsearch.h"
#include "tools.c" #include "tools.c"
#include "switchtimer.c" #include "switchtimer.c"
#include "setup.c" #include "setup.c"