vdr-plugin-tvguide/recmenu.h

69 lines
2.2 KiB
C
Raw Normal View History

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 {
private:
std::list<cRecMenuItem*> menuItems;
int scrollbarWidth;
int numItems;
int startIndex, stopIndex;
void Activate(cRecMenuItem *itemOld, cRecMenuItem *item);
bool ActivateNext(void);
bool ActivatePrev(void);
bool ScrollUp(void);
bool ScrollDown(void);
void PageUp(void);
void PageDown(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;
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);
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);
2013-07-09 00:17:42 +02:00
void SetHeader(cRecMenuItem *header);
void SetFooter(cRecMenuItem *footer);
void ClearMenuItems(bool destructor = false);
void InitMenu(bool complete);
bool AddMenuItemInitial(cRecMenuItem *item, bool inFront = false);
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; };
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) {};
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);
void UpdateActiveMenuItem(void);
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