gui/widget/textbox.cpp: add flag to control screen save, default is false;

disable hide in desctructor


Origin commit data
------------------
Branch: ni/coolstream
Commit: 72997591a0
Author: [CST] Focus <focus.cst@gmail.com>
Date: 2015-03-06 (Fri, 06 Mar 2015)



------------------
This commit was generated by Migit
This commit is contained in:
[CST] Focus
2015-03-06 13:21:08 +03:00
parent e8e5651b0c
commit b51fecc3eb
2 changed files with 9 additions and 6 deletions

View File

@@ -73,7 +73,7 @@
CTextBox::CTextBox(const char * text, Font* font_text, const int pmode, CTextBox::CTextBox(const char * text, Font* font_text, const int pmode,
const CBox* position, CFBWindow::color_t textBackgroundColor) const CBox* position, CFBWindow::color_t textBackgroundColor)
{ {
//TRACE("[CTextBox] new\r\n"); //TRACE("[CTextBox] new %d\n", __LINE__);
initVar(); initVar();
if(text != NULL) if(text != NULL)
@@ -109,7 +109,7 @@ CTextBox::CTextBox(const char * text, Font* font_text, const int pmode,
CTextBox::CTextBox(const char * text) CTextBox::CTextBox(const char * text)
{ {
//TRACE("[CTextBox] new\r\n"); //TRACE("[CTextBox] new %d\r", __LINE__);
initVar(); initVar();
if(text != NULL) if(text != NULL)
@@ -123,7 +123,7 @@ CTextBox::CTextBox(const char * text)
CTextBox::CTextBox() CTextBox::CTextBox()
{ {
//TRACE("[CTextBox] new\r\n"); //TRACE("[CTextBox] new %d\n", __LINE__);
initVar(); initVar();
//Initialise the window frames first and than refresh text line array //Initialise the window frames first and than refresh text line array
@@ -134,7 +134,7 @@ CTextBox::~CTextBox()
{ {
//TRACE("[CTextBox] del\r\n"); //TRACE("[CTextBox] del\r\n");
m_cLineArray.clear(); m_cLineArray.clear();
hide(); //hide();
delete[] m_bgpixbuf; delete[] m_bgpixbuf;
} }
@@ -179,6 +179,7 @@ void CTextBox::initVar(void)
m_textColor = COL_MENUCONTENT_TEXT; m_textColor = COL_MENUCONTENT_TEXT;
m_old_textColor = 0; m_old_textColor = 0;
m_nPaintBackground = true; m_nPaintBackground = true;
m_SaveScreen = false;
m_nBgRadius = m_old_nBgRadius = 0; m_nBgRadius = m_old_nBgRadius = 0;
m_nBgRadiusType = m_old_nBgRadiusType = CORNER_ALL; m_nBgRadiusType = m_old_nBgRadiusType = CORNER_ALL;
@@ -569,7 +570,7 @@ void CTextBox::refreshText(void)
} }
//save screen only if no paint of background required //save screen only if no paint of background required
if (!m_nPaintBackground){ if (!m_nPaintBackground && m_SaveScreen) {
if (m_bgpixbuf == NULL){ if (m_bgpixbuf == NULL){
//TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__); //TRACE("[CTextBox] %s save bg %d\r\n", __FUNCTION__, __LINE__);
m_bgpixbuf= new fb_pixel_t[dx * dy]; m_bgpixbuf= new fb_pixel_t[dx * dy];

View File

@@ -147,6 +147,7 @@ class CTextBox
int m_nBgRadius; int m_nBgRadius;
int m_nBgRadiusType; int m_nBgRadiusType;
bool m_nPaintBackground; bool m_nPaintBackground;
bool m_SaveScreen;
Font* m_pcFontText; Font* m_pcFontText;
int m_nFontTextHeight; int m_nFontTextHeight;
@@ -178,6 +179,7 @@ class CTextBox
void scrollPageDown(const int pages); void scrollPageDown(const int pages);
void scrollPageUp(const int pages); void scrollPageUp(const int pages);
void enableBackgroundPaint(bool mode = true){m_nPaintBackground = mode;}; void enableBackgroundPaint(bool mode = true){m_nPaintBackground = mode;};
void enableSaveScreen(bool mode = true){m_SaveScreen = mode;};
bool setText(const std::string* newText, int max_width = 0, bool force_repaint = true); bool setText(const std::string* newText, int max_width = 0, bool force_repaint = true);
void setTextColor(fb_pixel_t color_text){ m_textColor = color_text;}; void setTextColor(fb_pixel_t color_text){ m_textColor = color_text;};
void setBackGroundRadius(const int radius, const int type = CORNER_ALL){m_nBgRadius = radius; m_nBgRadiusType = type;}; void setBackGroundRadius(const int radius, const int type = CORNER_ALL){m_nBgRadius = radius; m_nBgRadiusType = type;};