diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index a126ab040..7846ef20d 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -68,7 +68,8 @@ CComponentsButton::CComponentsButton( const int x_pos, const int y_pos, const i { initVarButton(); cc_btn_icon = icon_name; - cc_btn_capt = g_Locale->getText(caption_locale);; + cc_btn_capt_locale = caption_locale; + cc_btn_capt = g_Locale->getText(cc_btn_capt_locale); cc_btn_capt_col = COL_MENUCONTENT_TEXT; x = x_pos; @@ -95,6 +96,7 @@ void CComponentsButton::initVarButton() cc_btn_font = NULL; cc_btn_icon = ""; cc_btn_capt = ""; + cc_btn_capt_locale = NONEXISTANT_LOCALE; } void CComponentsButton::initIcon() @@ -194,7 +196,8 @@ void CComponentsButton::setCaption(const std::string& text) void CComponentsButton::setCaption(const neutrino_locale_t locale_text) { - cc_btn_capt = g_Locale->getText(locale_text); + cc_btn_capt_locale = locale_text; + cc_btn_capt = g_Locale->getText(cc_btn_capt_locale); } void CComponentsButton::initCCBtnItems() diff --git a/src/gui/components/cc_frm_button.h b/src/gui/components/cc_frm_button.h index f1cacda17..976433e81 100644 --- a/src/gui/components/cc_frm_button.h +++ b/src/gui/components/cc_frm_button.h @@ -47,8 +47,11 @@ class CComponentsButton : public CComponentsForm ///initialize all required attributes and objects void initVarButton(); - ///property: button text + ///property: button text as string, see also setCaption() and getCaptionString() std::string cc_btn_capt; + ///property: button text as locale, see also setCaption() and getCaptionLocale() + neutrino_locale_t cc_btn_capt_locale; + ///property: icon name, only icons supported, to find in gui/widget/icons.h std::string cc_btn_icon; @@ -86,6 +89,11 @@ class CComponentsButton : public CComponentsForm ///set caption: parameter as locale virtual void setCaption(const neutrino_locale_t locale_text); + ///get caption, type as std::string + virtual std::string getCaptionString(){return cc_btn_capt;}; + ///get loacalized caption id, type = neutrino_locale_t + virtual neutrino_locale_t getCaptionLocale(){return cc_btn_capt_locale;}; + ///reinitialize items virtual void Refresh(){initCCBtnItems();};