CComponentsTitleBar: add blanc constructor

Origin commit data
------------------
Branch: ni/coolstream
Commit: edbbfbef8f
Author: Thilo Graf <dbt@novatux.de>
Date: 2012-08-27 (Mon, 27 Aug 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2012-08-27 22:32:10 +02:00
parent 1609144138
commit c56c40a572
2 changed files with 39 additions and 7 deletions

View File

@@ -363,8 +363,12 @@ class CComponentsItemBox : public CComponentsContainer
class CComponentsTitleBar : public CComponentsItemBox class CComponentsTitleBar : public CComponentsItemBox
{ {
private:
void initVarTitleBar();
public: public:
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, CComponentsTitleBar();
CComponentsTitleBar( const int x_pos, const int y_pos, const int w, const int h, const char* text = NULL,
fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0); fb_pixel_t color_text = COL_MENUHEAD, fb_pixel_t color_body = COL_MENUHEAD_PLUS_0);
void calculateElements(); void calculateElements();

View File

@@ -1121,12 +1121,17 @@ void CComponentsItemBox::paintPic(CComponentsPicture* pic)
//------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------
//sub class CComponentsTitleBar from CComponentsItemBox //sub class CComponentsTitleBar from CComponentsItemBox
CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const int w, const int h, CComponentsTitleBar::CComponentsTitleBar()
{
//CComponentsTitleBar
initVarTitleBar();
}
CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const int w, const int h, const char* text,
fb_pixel_t color_text, fb_pixel_t color_body) fb_pixel_t color_text, fb_pixel_t color_body)
{ {
//CComponentsItemBox //CComponentsItemBox
initVarItemBox(); initVarTitleBar();
onlyOneTextElement = true;
//CComponents //CComponents
x = x_pos; x = x_pos;
@@ -1134,12 +1139,35 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const
height = h; height = h;
width = w; width = w;
col_body = color_body; col_body = color_body;
corner_type = CORNER_TOP;
corner_rad = RADIUS_LARGE;
//CComponentsTitleBar //CComponentsTitleBar
font_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; font_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
col_text = color_text; col_text = color_text;
if (text) {
addElement (CC_ALIGN_LEFT, CC_ITEMBOX_TEXT, text);
calculateElements();
}
}
void CComponentsTitleBar::initVarTitleBar()
{
//CComponentsItemBox
initVarItemBox();
onlyOneTextElement = true;
font_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
col_text = COL_MENUHEAD;
//CComponents
x = 0;
y = 0;
height = font_text->getHeight() + 2*hSpacer;
width = frameBuffer->getScreenWidth(true);;
col_body = COL_MENUHEAD_PLUS_0;
corner_type = CORNER_TOP;
corner_rad = RADIUS_LARGE;
} }