vdr-plugin-tvguide/recmenu.h

63 lines
2.0 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);
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;
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);
void SetHeader(cRecMenuItem *header);
void SetFooter(cRecMenuItem *footer);
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; };
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);
virtual eRecMenuState ProcessKey(eKeys Key);
2013-07-09 00:17:42 +02:00
};
#endif //__TVGUIDE_RECMENU_H