summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlordjaxom <lordjaxom>2005-01-16 20:55:20 +0000
committerlordjaxom <lordjaxom>2005-01-16 20:55:20 +0000
commite79be651465bbc5eaf00d1ccf6c87a400672c2e6 (patch)
tree470c14f5a8e9a0501ce2d643499423fc9359155d
parentd94cae36d3e53814684864b3f4a8017180d643f5 (diff)
downloadvdr-plugin-text2skin-e79be651465bbc5eaf00d1ccf6c87a400672c2e6.tar.gz
vdr-plugin-text2skin-e79be651465bbc5eaf00d1ccf6c87a400672c2e6.tar.bz2
- implemented scrolling in audio tracks menu
-rw-r--r--display.c26
-rw-r--r--display.h5
2 files changed, 21 insertions, 10 deletions
diff --git a/display.c b/display.c
index 31ecbb6..1a6d2c1 100644
--- a/display.c
+++ b/display.c
@@ -1,5 +1,5 @@
/*
- * $Id: display.c,v 1.10 2005/01/15 21:00:57 lordjaxom Exp $
+ * $Id: display.c,v 1.11 2005/01/16 20:55:20 lordjaxom Exp $
*/
#include "render.h"
@@ -1016,25 +1016,33 @@ cxType cText2SkinDisplayTracks::GetTokenData(const txToken &Token)
break;
}
+ int index = Token.Index;
+ if (index >= 0 && mCurrentItem >= (uint)mMaxItems) {
+ int offset = mCurrentItem - mMaxItems + 1;
+ index += offset;
+ }
+
switch (Token.Type) {
case tMenuTitle:
return mTitle;
- case tMenuItem:
- return mItems.size() > (uint)Token.Index && mCurrentItem != (uint)Token.Index
- ? (cxType)mItems[Token.Index].text
+ case tMenuItem: {
+ return mItems.size() > (uint)index && mCurrentItem != (uint)index
+ ? (cxType)((std::string)(const char*)itoa(index) + " " + mItems[index].text)
: (cxType)false;
+ }
case tIsMenuItem:
- return mItems.size() > (uint)Token.Index && mCurrentItem != (uint)Token.Index;
+ return mItems.size() > (uint)index && mCurrentItem != (uint)index;
- case tMenuCurrent:
- return mItems.size() > (uint)Token.Index && mCurrentItem == (uint)Token.Index
- ? (cxType)mItems[Token.Index].text
+ case tMenuCurrent: {
+ return mItems.size() > (uint)index && mCurrentItem == (uint)index
+ ? (cxType)((std::string)(const char*)itoa(index) + " " + mItems[index].text)
: (cxType)false;
+ }
case tIsMenuCurrent:
- return mItems.size() > (uint)Token.Index && mCurrentItem == (uint)Token.Index;
+ return mItems.size() > (uint)index && mCurrentItem == (uint)index;
case tAudioChannel:
return ChannelName(mAudioChannel);
diff --git a/display.h b/display.h
index e97ad6d..ef3fee0 100644
--- a/display.h
+++ b/display.h
@@ -1,5 +1,5 @@
/*
- * $Id: display.h,v 1.7 2005/01/11 17:59:04 lordjaxom Exp $
+ * $Id: display.h,v 1.8 2005/01/16 20:55:20 lordjaxom Exp $
*/
#ifndef VDR_TEXT2SKIN_SKIN_H
@@ -190,6 +190,8 @@ inline bool cText2SkinDisplayMenu::HasTabText(int Index, int n)
#if VDRVERSNUM >= 10318
class cText2SkinDisplayTracks: public cSkinDisplayTracks, public cText2SkinRender {
private:
+ int mMaxItems;
+
std::string mTitle;
struct tListItem {
@@ -208,6 +210,7 @@ private:
protected:
virtual cxType GetTokenData(const txToken &Token);
virtual bool HasTabText(int Index, int n);
+ virtual void SetMaxItems(int MaxItems) { mMaxItems = MaxItems; }
public:
static const std::string &ChannelName(int AudioChannel);