diff options
author | lordjaxom <lordjaxom> | 2005-01-16 20:55:20 +0000 |
---|---|---|
committer | lordjaxom <lordjaxom> | 2005-01-16 20:55:20 +0000 |
commit | e79be651465bbc5eaf00d1ccf6c87a400672c2e6 (patch) | |
tree | 470c14f5a8e9a0501ce2d643499423fc9359155d /display.c | |
parent | d94cae36d3e53814684864b3f4a8017180d643f5 (diff) | |
download | vdr-plugin-text2skin-e79be651465bbc5eaf00d1ccf6c87a400672c2e6.tar.gz vdr-plugin-text2skin-e79be651465bbc5eaf00d1ccf6c87a400672c2e6.tar.bz2 |
- implemented scrolling in audio tracks menu
Diffstat (limited to 'display.c')
-rw-r--r-- | display.c | 26 |
1 files changed, 17 insertions, 9 deletions
@@ -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); |