mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
CComponentsItemBox: split addElement()
This commit is contained in:
@@ -349,6 +349,7 @@ class CComponentsItemBox : public CComponentsContainer
|
|||||||
void calPositionOfElements();
|
void calPositionOfElements();
|
||||||
void paintItemBox(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
void paintItemBox(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||||
void calculateElements();
|
void calculateElements();
|
||||||
|
bool addElement(int align, int type, const std::string& element="", size_t *index=NULL);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CComponentsItemBox();
|
CComponentsItemBox();
|
||||||
@@ -356,13 +357,15 @@ class CComponentsItemBox : public CComponentsContainer
|
|||||||
|
|
||||||
inline virtual void setTextFont(Font* font){font_text = font;};
|
inline virtual void setTextFont(Font* font){font_text = font;};
|
||||||
inline virtual void setTextColor(fb_pixel_t color_text){ it_col_text = color_text;};
|
inline virtual void setTextColor(fb_pixel_t color_text){ it_col_text = color_text;};
|
||||||
|
|
||||||
virtual bool addElement(int align, int type, const std::string& element="", size_t *index=NULL);
|
|
||||||
virtual void refreshElement(size_t index, const std::string& element);
|
virtual void refreshElement(size_t index, const std::string& element);
|
||||||
virtual void paintElement(size_t index, bool newElement= false);
|
virtual void paintElement(size_t index, bool newElement= false);
|
||||||
virtual bool addLogoOrText(int align, const std::string& logo, const std::string& text, size_t *index=NULL);
|
virtual bool addLogoOrText(int align, const std::string& logo, const std::string& text, size_t *index=NULL);
|
||||||
virtual void clearTitlebar();
|
virtual void clearTitlebar();
|
||||||
|
virtual void addText(const std::string& s_text, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
|
||||||
|
virtual void addIcon(const std::string& s_icon_name, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
|
||||||
|
virtual void addPicture(const std::string& s_picture_path, const int align=CC_ALIGN_LEFT, size_t *index=NULL);
|
||||||
|
virtual void addClock(const int align=CC_ALIGN_RIGHT, size_t *index=NULL);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CComponentsTitleBar : public CComponentsItemBox
|
class CComponentsTitleBar : public CComponentsItemBox
|
||||||
|
@@ -913,6 +913,26 @@ bool CComponentsItemBox::addLogoOrText(int align, const std::string& logo, const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CComponentsItemBox::addText(const std::string& s_text, const int align, size_t *index)
|
||||||
|
{
|
||||||
|
addElement(align, CC_ITEMBOX_TEXT, s_text, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CComponentsItemBox::addIcon(const std::string& s_icon_name, const int align, size_t *index)
|
||||||
|
{
|
||||||
|
addElement(align, CC_ITEMBOX_ICON, s_icon_name, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CComponentsItemBox::addPicture(const std::string& s_picture_path, const int align, size_t *index)
|
||||||
|
{
|
||||||
|
addElement(align, CC_ITEMBOX_PICTURE, s_picture_path, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CComponentsItemBox::addClock(const int align, size_t *index)
|
||||||
|
{
|
||||||
|
addElement(align, CC_ITEMBOX_CLOCK, "", index);
|
||||||
|
}
|
||||||
|
|
||||||
bool CComponentsItemBox::addElement(int align, int type, const std::string& element, size_t *index)
|
bool CComponentsItemBox::addElement(int align, int type, const std::string& element, size_t *index)
|
||||||
{
|
{
|
||||||
comp_element_data_t data;
|
comp_element_data_t data;
|
||||||
@@ -1196,6 +1216,8 @@ void CComponentsItemBox::clearTitlebar()
|
|||||||
paintElements = true;
|
paintElements = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------
|
||||||
//sub class CComponentsTitleBar from CComponentsItemBox
|
//sub class CComponentsTitleBar from CComponentsItemBox
|
||||||
CComponentsTitleBar::CComponentsTitleBar()
|
CComponentsTitleBar::CComponentsTitleBar()
|
||||||
|
Reference in New Issue
Block a user