diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index f932d4d44..47f41ad2f 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -59,6 +59,31 @@ CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_capt_locale), icon_name, parent, selected, enabled, has_shadow, color_frame, color_body, color_shadow); } +CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, const char* icon_name, + CComponentsForm* parent, + bool selected, + bool enabled, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + string _icon_name = icon_name == NULL ? "" : string(icon_name); + initVarButton(x_pos, y_pos, w, h, caption, _icon_name, parent, selected, enabled, has_shadow, color_frame, color_body, color_shadow); +} + +CComponentsButton::CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const neutrino_locale_t& caption_locale, const char* icon_name, + CComponentsForm* parent, + bool selected, + bool enabled, + bool has_shadow, + fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) +{ + string _icon_name = icon_name == NULL ? "" : string(icon_name); + cc_btn_capt_locale = caption_locale; + initVarButton(x_pos, y_pos, w, h, g_Locale->getText(cc_btn_capt_locale), _icon_name, parent, selected, enabled, has_shadow, color_frame, color_body, color_shadow); +} + void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, const std::string& icon_name, diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index d3dabcd82..3e5001d11 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -82,7 +82,8 @@ class CComponentsButton : public CComponentsFrmChain public: ///basic constructor for button object with most needed params, no button icon is definied here CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, - const std::string& caption, const std::string& icon_name = "", + const std::string& caption, + const std::string& icon_name = "", CComponentsForm *parent = NULL, bool selected = false, bool enabled = true, @@ -98,6 +99,24 @@ class CComponentsButton : public CComponentsFrmChain bool has_shadow = CC_SHADOW_OFF, fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const neutrino_locale_t& caption_locale, + const char* icon_name = NULL, + CComponentsForm *parent = NULL, + bool selected = false, + bool enabled = true, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + + CComponentsButton( const int& x_pos, const int& y_pos, const int& w, const int& h, + const std::string& caption, + const char* icon_name = NULL, + CComponentsForm *parent = NULL, + bool selected = false, + bool enabled = true, + bool has_shadow = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_LIGHT_GRAY, fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, fb_pixel_t color_shadow = COL_MENUCONTENTDARK_PLUS_0); + ///set text color virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_capt_col = caption_color;};