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);
|
|
|
|
void ScrollUp(void);
|
|
|
|
void ScrollDown(void);
|
|
|
|
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);
|
|
|
|
void SetHeader(cRecMenuItem *header);
|
|
|
|
void SetFooter(cRecMenuItem *footer);
|
2014-01-10 12:44:01 +01:00
|
|
|
void ClearMenuItems(void);
|
|
|
|
void InitMenu(bool complete);
|
|
|
|
bool AddMenuItemInitial(cRecMenuItem *item);
|
|
|
|
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; };
|
|
|
|
int GetActive(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-01-02 11:25:58 +01:00
|
|
|
virtual eRecMenuState ProcessKey(eKeys Key);
|
2013-07-09 00:17:42 +02:00
|
|
|
};
|
|
|
|
#endif //__TVGUIDE_RECMENU_H
|