widget/msgbox: add overloaded version of setButtonText()

Allows usage of locale as parameter.
This commit is contained in:
2023-03-04 16:08:07 +01:00
parent 283a0e539a
commit d0bdd9078c
2 changed files with 19 additions and 2 deletions

View File

@@ -7,7 +7,7 @@
Günther@tuxbox.berlios.org
Implementation of CComponent Window class.
Copyright (C) 2014-2017 Thilo Graf 'dbt'
Copyright (C) 2014-2017, 2023 Thilo Graf 'dbt'
License: GPL
@@ -419,6 +419,11 @@ void CMsgBox::setButtonText(const int& showed_button, const std::string& text)
initButtons();
}
void CMsgBox::setButtonText(const int &showed_button, const neutrino_locale_t &Locale)
{
setButtonText(showed_button, g_Locale->getText(Locale));
}
inline std::string CMsgBox::BTN_TEXT(const int& showed_button)
{
string ret = "";

View File

@@ -328,7 +328,19 @@ class CMsgBox : public CHintBox
* @param[in] text
* @li expects type std::string, sets the new text for button
*/
void setButtonText(const int& showed_button, const std::string& text);
void setButtonText(const int &showed_button, const std::string &text);
/**
* Default defined button text is already predefiend with parameter 'ShowButtons' from constructor.
* This member allows to define an alternate text for an already defined button,
* Result values are not touched!
* @param[in] showed_button
* @li expects type int
* @see setShowedButtons()
* @param[in] text
* @li expects type neutrino_locale_t, sets the new text for button
*/
void setButtonText(const int &showed_button, const neutrino_locale_t &Locale);
/**
* enables background of buttons