From 1ddc65e25df03a1e645a1613e5d5c5fdba8e1258 Mon Sep 17 00:00:00 2001 From: Michael Liebmann Date: Mon, 20 Aug 2012 06:14:40 +0200 Subject: [PATCH] CComponentsInfoBox: Add setTextBorderWidth() to paintText() - Add delete textbox to paint() - remove CTextBox::AUTO_HIGH Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1ac03645ccec7dd28132f0f92e06af7114879e75 Author: Michael Liebmann Date: 2012-08-20 (Mon, 20 Aug 2012) Origin message was: ------------------ * CComponentsInfoBox: Add setTextBorderWidth() to paintText() - Add delete textbox to paint() - remove CTextBox::AUTO_HIGH ------------------ This commit was generated by Migit --- src/gui/components/cc.h | 8 ++++---- src/gui/components/components.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc.h b/src/gui/components/cc.h index 01b84298c..c450635ff 100644 --- a/src/gui/components/cc.h +++ b/src/gui/components/cc.h @@ -207,15 +207,15 @@ class CComponentsInfoBox : public CComponentsContainer fb_pixel_t col_text; public: CComponentsInfoBox( const int x_pos, const int y_pos, const int w, const int h, - const char* info_text = NULL, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL, + const char* info_text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL, bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_text = COL_MENUCONTENT, fb_pixel_t color_frame = COL_MENUCONTENT_PLUS_6, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); ~CComponentsInfoBox(); - void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL){text = info_text; text_mode = mode, font = font_text;}; - void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL){text = info_text.c_str(); text_mode = mode, font = font_text;}; - void setText(neutrino_locale_t locale_text, const int mode = CTextBox::AUTO_WIDTH | CTextBox::AUTO_HIGH, Font* font_text = NULL); + void setText(const char* info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text; text_mode = mode, font = font_text;}; + void setText(const std::string& info_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL){text = info_text.c_str(); text_mode = mode, font = font_text;}; + void setText(neutrino_locale_t locale_text, const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL); void setTextMode(const int mode){text_mode = mode;};//see textbox.h for possible modes void setTextFont(Font* font_text){font = font_text;}; void setTextColor(fb_pixel_t color_text){ col_text = color_text;}; diff --git a/src/gui/components/components.cpp b/src/gui/components/components.cpp index 73996a151..a0e4bacf8 100644 --- a/src/gui/components/components.cpp +++ b/src/gui/components/components.cpp @@ -368,18 +368,23 @@ void CComponentsInfoBox::paintText() textbox = new CTextBox(text, font, text_mode, box, col_body); //set properties + textbox->setTextBorderWidth(0); textbox->movePosition(box->iX, box->iY); textbox->setTextColor(col_text); textbox->enableBackgroundPaint(false); //set text - string new_text = static_cast (text); - if (textbox->setText(&new_text)) +// string new_text = static_cast (text); +// if (textbox->setText(&text)) textbox->paint(); } void CComponentsInfoBox::paint(bool do_save_bg) { + if (textbox) { + delete textbox; + textbox = NULL; + } paintInit(do_save_bg); paintPicture(); if (text)