From 4b73121eefadf258da16ca94a47fc4525fc2aadd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 7 Oct 2014 22:05:55 +0200 Subject: [PATCH] CComponentsInfoBox: small cleanup --- src/gui/components/cc_item_infobox.cpp | 12 +++++++++--- src/gui/components/cc_item_infobox.h | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_item_infobox.cpp b/src/gui/components/cc_item_infobox.cpp index 4fa846ede..25ecbe9c4 100644 --- a/src/gui/components/cc_item_infobox.cpp +++ b/src/gui/components/cc_item_infobox.cpp @@ -35,13 +35,19 @@ using namespace std; //sub class CComponentsInfoBox from CComponentsItem -CComponentsInfoBox::CComponentsInfoBox( const int& x_pos, const int& y_pos, const int& w, const int& h, +CComponentsInfoBox::CComponentsInfoBox( const int& x_pos, + const int& y_pos, + const int& w, + const int& h, std::string info_text, const int mode, Font* font_text, CComponentsForm *parent, bool has_shadow, - fb_pixel_t color_text, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) + fb_pixel_t color_text, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) { cc_item_type = CC_ITEMTYPE_TEXT_INFOBOX; @@ -75,7 +81,7 @@ CComponentsInfoBox::~CComponentsInfoBox() void CComponentsInfoBox::setPicture(const std::string& picture_name) { - pic_name = picture_name; + pic_name = picture_name; } void CComponentsInfoBox::setPicture(const char* picture_name) diff --git a/src/gui/components/cc_item_infobox.h b/src/gui/components/cc_item_infobox.h index 4e22c97ca..da6043757 100644 --- a/src/gui/components/cc_item_infobox.h +++ b/src/gui/components/cc_item_infobox.h @@ -56,18 +56,27 @@ class CComponentsInfoBox : public CComponentsText void paintPicture(); ///property: path or name of displayed image std::string pic_name; - + + ///set scale mode of image + bool scale_image; + public: ///object: internal used CTextBox object CComponentsText * cctext; - CComponentsInfoBox( const int& x_pos = 0, const int& y_pos = 0, const int& w = 800, const int& h = 600, + CComponentsInfoBox( const int& x_pos = 0, + const int& y_pos = 0, + const int& w = 800, + const int& h = 600, std::string info_text = "", const int mode = CTextBox::AUTO_WIDTH, Font* font_text = NULL, CComponentsForm *parent = NULL, bool has_shadow = CC_SHADOW_OFF, - fb_pixel_t color_text = COL_MENUCONTENT_TEXT, 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); + fb_pixel_t color_text = COL_MENUCONTENT_TEXT, + 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();