CComponentsTitleBar: add blanc constructor

This commit is contained in:
2012-08-27 22:32:10 +02:00
parent 8cabe408cf
commit edbbfbef8f
2 changed files with 39 additions and 7 deletions

View File

@@ -363,8 +363,12 @@ class CComponentsItemBox : public CComponentsContainer
class CComponentsTitleBar : public CComponentsItemBox
{
private:
void initVarTitleBar();
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);
void calculateElements();

View File

@@ -1121,12 +1121,17 @@ void CComponentsItemBox::paintPic(CComponentsPicture* pic)
//-------------------------------------------------------------------------------------------------------
//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)
{
//CComponentsItemBox
initVarItemBox();
onlyOneTextElement = true;
initVarTitleBar();
//CComponents
x = x_pos;
@@ -1134,12 +1139,35 @@ CComponentsTitleBar::CComponentsTitleBar(const int x_pos, const int y_pos, const
height = h;
width = w;
col_body = color_body;
corner_type = CORNER_TOP;
corner_rad = RADIUS_LARGE;
//CComponentsTitleBar
font_text = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE];
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;
}