summaryrefslogtreecommitdiff
path: root/menuitem.h
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2012-12-15 13:09:50 +0100
committerlouis <louis.braun@gmx.de>2012-12-15 13:09:50 +0100
commit9c6b259eb786439fd4d1bbfdf8bff0bb059f9edd (patch)
tree9577e50f62d678e3b33b01525756634d9c51903b /menuitem.h
parenta8a2bd61fd2931b79c0f39812ef30a0cc7292d82 (diff)
downloadskin-nopacity-9c6b259eb786439fd4d1bbfdf8bff0bb059f9edd.tar.gz
skin-nopacity-9c6b259eb786439fd4d1bbfdf8bff0bb059f9edd.tar.bz2
Introduced scrolling for menus
Diffstat (limited to 'menuitem.h')
-rw-r--r--menuitem.h77
1 files changed, 65 insertions, 12 deletions
diff --git a/menuitem.h b/menuitem.h
index 02aa057..ecf10c0 100644
--- a/menuitem.h
+++ b/menuitem.h
@@ -1,36 +1,51 @@
#ifndef __NOPACITY_MENUITEM_H
#define __NOPACITY_MENUITEM_H
-class cNopacityMenuItem : public cListObject {
+class cNopacityMenuItem : public cListObject, public cThread {
protected:
cOsd *osd;
cPixmap *pixmap;
cPixmap *pixmapIcon;
+ cPixmap *pixmapTextScroller;
bool hasIcon;
- bool iconDrawn;
int *handleBackgrounds;
const char *Text;
bool selectable;
bool current;
+ bool wasCurrent;
+ bool scrollable;
+ bool drawn;
cFont *font;
cFont *fontSmall;
int width, height;
+ int top, left;
+ int textLeft;
+ int index;
cString *itemTabs;
int *tabWidth;
int numTabs;
void DrawDelimiter(const char *del, const char *icon, int handleBgrd);
+ virtual void Action(void);
+ virtual void SetTextFull(void) {};
+ virtual void SetTextShort(void) {};
public:
- cNopacityMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
+ cNopacityMenuItem(cOsd *osd, const char *text, bool sel);
virtual ~cNopacityMenuItem(void);
- void CreatePixmap(int top, int space, int index, int width, int height);
- void CreatePixmapIcon(int top, int space, int index, int itemHeight, int iconWidth, int iconHeight);
+ void CreatePixmap();
+ void CreatePixmapIcon(int iconWidth, int iconHeight);
+ virtual void CreatePixmapTextScroller(int totalWidth);
+ void SetGeometry(int index, int top, int left, int width, int height);
void SetFont(cFont *font) {this->font = font;}
void SetFontSmall(cFont *fontSmall) {this->fontSmall = fontSmall;}
- void SetCurrent(bool cur) {current = cur;}
+ void SetCurrent(bool cur);
void SetAlpha(int alpha) {this->pixmap->SetAlpha(alpha);}
void SetAlphaIcon(int alpha) {if (hasIcon) this->pixmapIcon->SetAlpha(alpha);}
+ void SetAlphaText(int alpha) {if (pixmapTextScroller) this->pixmapTextScroller->SetAlpha(alpha);}
void SetTabs(cString *tabs, int *tabWidths, int numtabs);
void SetBackgrounds(int *handleBackgrounds);
+ virtual void CreateText(void) {};
+ virtual void SetDisplayMode(void) {};
+ virtual int CheckScrollable(bool hasIcon) {return 0;};
virtual void Render() = 0;
};
@@ -38,12 +53,18 @@ class cNopacityMainMenuItem : public cNopacityMenuItem {
private:
cString menuNumber;
cString menuEntry;
- void SplitMenuItem();
+ std::string strEntry;
+ std::string strEntryFull;
static std::string items[6];
cString GetIconName();
+ void SetTextFull(void);
+ void SetTextShort(void);
public:
- cNopacityMainMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
+ cNopacityMainMenuItem(cOsd *osd, const char *text, bool sel);
~cNopacityMainMenuItem(void);
+ void CreatePixmapTextScroller(int totalWidth);
+ void CreateText(void);
+ int CheckScrollable(bool hasIcon);
void Render();
};
@@ -63,33 +84,65 @@ enum eMenuSubCategory { mcSubUndefined = -1,
class cNopacityScheduleMenuItem : public cNopacityMenuItem {
private:
eMenuSubCategory subCategory;
+ std::string strDateTime;
+ std::string strTitle;
+ std::string strSubTitle;
+ std::string strTitleFull;
+ std::string strSubTitleFull;
+ std::string strChannelName;
+ std::string strProgressbar;
+ bool hasProgressBar;
+ eEPGModes mode;
+ bool hasLogo;
+ int titleY;
+ std::string delimiterType;
void DrawRemaining(cString remaining, int x, int y, int width);
+ void SetTextFull(void);
+ void SetTextShort(void);
public:
- cNopacityScheduleMenuItem(cOsd *osd, const char *text, bool cur, bool sel, eMenuSubCategory subCat);
+ cNopacityScheduleMenuItem(cOsd *osd, const char *text, bool sel, eMenuSubCategory subCat);
~cNopacityScheduleMenuItem(void);
+ void CreatePixmapTextScroller(int totalWidth);
+ void SetDisplayMode(void);
+ void CreateText(void);
+ int CheckScrollable(bool hasIcon);
void Render();
};
class cNopacityChannelMenuItem : public cNopacityMenuItem {
private:
+ std::string strLogo;
+ std::string strEntry;
+ std::string strEntryFull;
+ void SetTextFull(void);
+ void SetTextShort(void);
public:
- cNopacityChannelMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
+ cNopacityChannelMenuItem(cOsd *osd, const char *text, bool sel);
~cNopacityChannelMenuItem(void);
+ void CreatePixmapTextScroller(int totalWidth);
+ void CreateText(void);
+ int CheckScrollable(bool hasIcon);
void Render();
};
class cNopacityDefaultMenuItem : public cNopacityMenuItem {
private:
+ std::string strEntry;
+ std::string strEntryFull;
+ int scrollCol;
+ void SetTextFull(void);
+ void SetTextShort(void);
public:
- cNopacityDefaultMenuItem(cOsd *osd, const char *text, bool cur, bool sel);
+ cNopacityDefaultMenuItem(cOsd *osd, const char *text, bool sel);
~cNopacityDefaultMenuItem(void);
+ int CheckScrollable(bool hasIcon);
void Render();
};
class cNopacityTrackMenuItem : public cNopacityMenuItem {
private:
public:
- cNopacityTrackMenuItem(cOsd *osd, const char *text, bool cur);
+ cNopacityTrackMenuItem(cOsd *osd, const char *text);
~cNopacityTrackMenuItem(void);
void Render();
};