2013-07-09 00:17:42 +02:00
|
|
|
#ifndef __TVGUIDE_RECMENU_H
|
|
|
|
#define __TVGUIDE_RECMENU_H
|
|
|
|
|
2013-12-07 15:51:50 +01:00
|
|
|
#include "recmenuitem.h"
|
|
|
|
|
2013-07-09 00:17:42 +02:00
|
|
|
// --- cRecMenu -------------------------------------------------------------
|
|
|
|
|
|
|
|
class cRecMenu : public cStyledPixmap {
|
2014-01-10 12:44:01 +01:00
|
|
|
private:
|
|
|
|
std::list<cRecMenuItem*> menuItems;
|
|
|
|
int scrollbarWidth;
|
|
|
|
int numItems;
|
|
|
|
int startIndex, stopIndex;
|
|
|
|
void Activate(cRecMenuItem *itemOld, cRecMenuItem *item);
|
|
|
|
bool ActivateNext(void);
|
|
|
|
bool ActivatePrev(void);
|
2014-01-12 16:27:59 +01:00
|
|
|
bool ScrollUp(void);
|
|
|
|
bool ScrollDown(void);
|
2014-01-18 14:10:42 +01:00
|
|
|
void PageUp(void);
|
|
|
|
void PageDown(void);
|
2014-01-10 12:44:01 +01:00
|
|
|
void JumpBegin(void);
|
|
|
|
void JumpEnd(void);
|
2013-07-09 00:17:42 +02:00
|
|
|
protected:
|
|
|
|
int x, y;
|
|
|
|
int width, height;
|
|
|
|
int headerHeight, footerHeight;
|
2014-01-10 12:44:01 +01:00
|
|
|
int currentHeight;
|
|
|
|
bool deleteMenuItems;
|
2013-07-09 00:17:42 +02:00
|
|
|
cPixmap *pixmapScrollBar;
|
|
|
|
cImage *imgScrollBar;
|
|
|
|
int border;
|
|
|
|
bool scrollable;
|
|
|
|
cRecMenuItem *header;
|
|
|
|
cRecMenuItem *footer;
|
|
|
|
void SetWidthPercent(int percentOSDWidth);
|
|
|
|
void SetWidthPixel(int pixel);
|
|
|
|
int CalculateOptimalWidth(void);
|
2014-01-10 12:44:01 +01:00
|
|
|
bool CalculateHeight(bool reDraw = false);
|
2013-07-09 00:17:42 +02:00
|
|
|
void CreatePixmap(void);
|
2019-11-09 11:22:02 +01:00
|
|
|
void AddHeader(cRecMenuItem *header);
|
|
|
|
void AddFooter(cRecMenuItem *footer);
|
2014-01-12 16:27:59 +01:00
|
|
|
void ClearMenuItems(bool destructor = false);
|
2014-01-10 12:44:01 +01:00
|
|
|
void InitMenu(bool complete);
|
2014-01-18 14:10:42 +01:00
|
|
|
bool AddMenuItemInitial(cRecMenuItem *item, bool inFront = false);
|
2014-01-10 12:44:01 +01:00
|
|
|
void AddMenuItem(cRecMenuItem *item, bool inFront = false);
|
2013-07-09 00:17:42 +02:00
|
|
|
void DrawScrollBar(void);
|
|
|
|
cImage *createScrollbar(int width, int height, tColor clrBgr, tColor clrBlend);
|
|
|
|
void Arrange(bool scroll = false);
|
|
|
|
virtual cRecMenuItem *GetMenuItem(int number) { return NULL; };
|
2014-01-10 12:44:01 +01:00
|
|
|
cRecMenuItem *GetActiveMenuItem(void);
|
|
|
|
cRecMenuItem *GetMenuItemAt(int num);
|
|
|
|
int GetCurrentNumMenuItems(void) { return menuItems.size(); };
|
2013-07-09 00:17:42 +02:00
|
|
|
virtual int GetTotalNumMenuItems(void) { return 0; };
|
|
|
|
virtual void CreateMenuItems(void) {};
|
2014-01-10 12:44:01 +01:00
|
|
|
int GetStartIndex(void) { return startIndex; };
|
2019-11-10 13:24:22 +01:00
|
|
|
int GetNumActive(void);
|
2013-07-09 00:17:42 +02:00
|
|
|
public:
|
|
|
|
cRecMenu(void);
|
|
|
|
virtual ~cRecMenu(void);
|
|
|
|
void Display(bool scroll = false);
|
|
|
|
void Hide(void);
|
|
|
|
void Show(void);
|
2014-02-07 17:57:14 +01:00
|
|
|
void UpdateActiveMenuItem(void);
|
2014-01-02 11:25:58 +01:00
|
|
|
virtual eRecMenuState ProcessKey(eKeys Key);
|
2013-07-09 00:17:42 +02:00
|
|
|
};
|
2019-11-09 11:22:02 +01:00
|
|
|
#endif //__TVGUIDE_RECMENU_H
|