mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-29 16:31:11 +02:00
* CComponentsInfoBox: Add removeLineBreaks()
This commit is contained in:
@@ -221,7 +221,8 @@ class CComponentsInfoBox : public CComponentsContainer
|
||||
void setTextColor(fb_pixel_t color_text){ col_text = color_text;};
|
||||
void setSpaceOffset(const int offset){x_offset = offset;};
|
||||
void setPicture(const std::string& picture_name){pic_name = picture_name;};
|
||||
|
||||
void removeLineBreaks(std::string& str);
|
||||
|
||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||
};
|
||||
|
||||
|
@@ -390,6 +390,15 @@ void CComponentsInfoBox::paint(bool do_save_bg)
|
||||
text = NULL;
|
||||
}
|
||||
|
||||
void CComponentsInfoBox::removeLineBreaks(std::string& str)
|
||||
{
|
||||
std::string::size_type spos = str.find_first_of("\r\n");
|
||||
while (spos != std::string::npos) {
|
||||
str.replace(spos, 1, " ");
|
||||
spos = str.find_first_of("\r\n");
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------------------------------
|
||||
//sub class CComponentsShapeSquare from CComponentsContainer
|
||||
CComponentsShapeSquare::CComponentsShapeSquare(const int x_pos, const int y_pos, const int w, const int h, bool has_shadow, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow)
|
||||
|
Reference in New Issue
Block a user