1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Skins can now implement cSkinDisplayMenu::MenuOrientation() to display horizontal menus

This commit is contained in:
Klaus Schmidinger 2015-09-10 11:26:15 +02:00
parent 75f28cb0cb
commit 14f97d0f2a
5 changed files with 22 additions and 7 deletions

View File

@ -3265,6 +3265,7 @@ Stefan Braun <louis.braun@gmx.de>
for suggesting to add the menu category mcRecordingEdit for marking menus that edit
recording properties
for suggesting to make cRecording::GetResume() public
for implementing the possibility for skins to display horizontal menus
Jochen Dolze <vdr@dolze.de>
for changing cThread::SetIOPriority() from "best effort class" to "idle class" in order

View File

@ -8811,3 +8811,5 @@ Video Disk Recorder Revision History
- The EPG scanner no longer moves the dish if there is a positioner.
- The 'newplugin' script now creates the 'po' subdirectory for translations (thanks
to Thomas Reufer).
- Skins can now implement cSkinDisplayMenu::MenuOrientation() to display horizontal
menus (thanks to Stefan Braun).

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osdbase.c 3.3 2015/01/15 10:11:11 kls Exp $
* $Id: osdbase.c 4.1 2015/09/10 11:23:07 kls Exp $
*/
#include "osdbase.h"
@ -87,6 +87,7 @@ cOsdMenu::cOsdMenu(const char *Title, int c0, int c1, int c2, int c3, int c4)
title = NULL;
menuCategory = mcUnknown;
menuSortMode = msmUnknown;
menuOrientation = moVertical;
SetTitle(Title);
SetCols(c0, c1, c2, c3, c4);
first = 0;
@ -231,6 +232,7 @@ void cOsdMenu::Display(void)
if (menuCategory != displayMenu->MenuCategory())
displayMenu->SetMenuCategory(menuCategory);
displayMenu->SetMenuSortMode(menuSortMode);
menuOrientation = displayMenu->MenuOrientation();
displayMenuItems = displayMenu->MaxItems();
displayMenu->SetTabs(cols[0], cols[1], cols[2], cols[3], cols[4]);//XXX
displayMenu->SetTitle(title);
@ -541,13 +543,13 @@ eOSState cOsdMenu::ProcessKey(eKeys Key)
case k0: return osUnknown;
case k1...k9: return hasHotkeys ? HotKey(Key) : osUnknown;
case kUp|k_Repeat:
case kUp: CursorUp(); break;
case kUp: if (menuOrientation == moHorizontal) PageUp(); else CursorUp(); break;
case kDown|k_Repeat:
case kDown: CursorDown(); break;
case kDown: if (menuOrientation == moHorizontal) PageDown(); else CursorDown(); break;
case kLeft|k_Repeat:
case kLeft: PageUp(); break;
case kLeft: if (menuOrientation == moHorizontal) CursorUp(); else PageUp(); break;
case kRight|k_Repeat:
case kRight: PageDown(); break;
case kRight: if (menuOrientation == moHorizontal) CursorDown(); else PageDown(); break;
case kBack: return osBack;
case kOk: if (marked >= 0) {
SetStatus(NULL);

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: osdbase.h 3.2 2015/01/15 10:09:18 kls Exp $
* $Id: osdbase.h 4.1 2015/09/10 11:17:52 kls Exp $
*/
#ifndef __OSDBASE_H
@ -93,6 +93,7 @@ private:
int first, current, marked;
eMenuCategory menuCategory;
eMenuSortMode menuSortMode;
eMenuOrientation menuOrientation;
cOsdMenu *subMenu;
const char *helpRed, *helpGreen, *helpYellow, *helpBlue;
bool helpDisplayed;

11
skins.h
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: skins.h 3.4 2015/01/15 10:45:47 kls Exp $
* $Id: skins.h 4.1 2015/09/10 11:19:48 kls Exp $
*/
#ifndef __SKINS_H
@ -129,6 +129,11 @@ enum eMenuSortMode {
msmProvider
};
enum eMenuOrientation {
moVertical = 0,
moHorizontal
};
class cSkinDisplayMenu : public cSkinDisplay {
///< This class implements the general purpose menu display, which is
///< used throughout the program to display information and let the
@ -179,6 +184,10 @@ public:
///< Sets the mode by which the items in this menu are sorted.
///< This is purely informative and may be used by a skin to display the
///< current sort mode by means of some text or symbol.
virtual eMenuOrientation MenuOrientation(void) { return moVertical; }
///< Asks the skin for the orientation of the displayed menu.
///< If menu orientation is set to horizontal, the keys left/right
///< and up/down are just toggled.
virtual void Scroll(bool Up, bool Page);
///< If this menu contains a text area that can be scrolled, this function
///< will be called to actually scroll the text. Up indicates whether the