mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
- epgplus: add clock and context button to header
This commit is contained in:
@@ -87,10 +87,16 @@ EpgPlus::Header::Header(CFrameBuffer * pframeBuffer, int px, int py, int pwidth)
|
|||||||
this->x = px;
|
this->x = px;
|
||||||
this->y = py;
|
this->y = py;
|
||||||
this->width = pwidth;
|
this->width = pwidth;
|
||||||
|
this->header = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
EpgPlus::Header::~Header()
|
EpgPlus::Header::~Header()
|
||||||
{
|
{
|
||||||
|
if (this->header)
|
||||||
|
{
|
||||||
|
delete this->header;
|
||||||
|
this->header = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EpgPlus::Header::init()
|
void EpgPlus::Header::init()
|
||||||
@@ -100,10 +106,19 @@ void EpgPlus::Header::init()
|
|||||||
|
|
||||||
void EpgPlus::Header::paint(const char * Name)
|
void EpgPlus::Header::paint(const char * Name)
|
||||||
{
|
{
|
||||||
std::string head = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD);
|
std::string headerCaption = Name ? Name : g_Locale->getText(LOCALE_EPGPLUS_HEAD);
|
||||||
|
|
||||||
CComponentsHeader _header(this->x, this->y, this->width, this->font->getHeight(), head);
|
if (this->header == NULL)
|
||||||
_header.paint(CC_SAVE_SCREEN_NO);
|
this->header = new CComponentsHeader();
|
||||||
|
|
||||||
|
if (this->header)
|
||||||
|
{
|
||||||
|
this->header->setDimensionsAll(this->x, this->y, this->width, this->font->getHeight());
|
||||||
|
this->header->setCaption(headerCaption, CTextBox::NO_AUTO_LINEBREAK);
|
||||||
|
this->header->setContextButton(CComponentsHeader::CC_BTN_HELP);
|
||||||
|
this->header->enableClock(true, "%H:%M", "%H %M", true);
|
||||||
|
this->header->paint(CC_SAVE_SCREEN_NO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int EpgPlus::Header::getUsedHeight()
|
int EpgPlus::Header::getUsedHeight()
|
||||||
|
@@ -95,6 +95,7 @@ class EpgPlus
|
|||||||
int width;
|
int width;
|
||||||
|
|
||||||
static Font* font;
|
static Font* font;
|
||||||
|
CComponentsHeader *header;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user