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
- changed channel jump logic
- 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 "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 *image = new cImage(cSize(width, height));
image->Fill(clrBgr);
@ -296,6 +317,14 @@ eOSState cDetailView::ProcessKey(eKeys Key) {
scrollDown();
osdManager.flush();
break;
case kLeft:
pageUp();
osdManager.flush();
break;
case kRight:
pageDown();
osdManager.flush();
break;
case kOk:
case kBack:
state = osEnd;

View File

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

View File

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