mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CComponentsButton: simplify assignment of button message values
Count of alternate message values was limited to 1 value. Now it is possible to add any count of message values. directKey and directKeyAlt were removed from struct type 'button_label_cc' and directKeys was added as container for possible message values. Some methods of CComponentsFooter had to be adapted for that.
This commit is contained in:
@@ -124,8 +124,7 @@ void CComponentsButton::initVarButton( const int& x_pos, const int& y_pos, const
|
|||||||
cc_btn_font = NULL;
|
cc_btn_font = NULL;
|
||||||
cc_btn_icon = icon_name;
|
cc_btn_icon = icon_name;
|
||||||
cc_btn_text = caption;
|
cc_btn_text = caption;
|
||||||
cc_directKey = CRCInput::RC_nokey;
|
cc_directKeys.push_back(CRCInput::RC_nokey);
|
||||||
cc_directKeyAlt = cc_directKey;
|
|
||||||
cc_btn_result = -1;
|
cc_btn_result = -1;
|
||||||
cc_btn_alias = -1;
|
cc_btn_alias = -1;
|
||||||
|
|
||||||
|
@@ -70,9 +70,9 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
|
|||||||
///property: icon name, only icons supported, to find in gui/widget/icons.h
|
///property: icon name, only icons supported, to find in gui/widget/icons.h
|
||||||
std::string cc_btn_icon;
|
std::string cc_btn_icon;
|
||||||
|
|
||||||
///property: assigned event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKey(), getButtonDirectKey()
|
///property: container for all assigned event message values, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKey(), hasButtonDirectKey()
|
||||||
neutrino_msg_t cc_directKey;
|
std::vector<neutrino_msg_t>cc_directKeys;
|
||||||
///property: assigned an alternate event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKeyAlt(), getButtonDirectKeyAlt()
|
///property: assigned an alternate event message value, see driver/rcinput.h for possible values, default value = CRCInput::RC_nokey, see also setButtonDirectKeyAlt(), hasButtonDirectKeyAlt()
|
||||||
neutrino_msg_t cc_directKeyAlt;
|
neutrino_msg_t cc_directKeyAlt;
|
||||||
///property: assigned return value, see also setButtonResult(), getButtonResult(), default value = -1 (not defined)
|
///property: assigned return value, see also setButtonResult(), getButtonResult(), default value = -1 (not defined)
|
||||||
int cc_btn_result;
|
int cc_btn_result;
|
||||||
@@ -135,7 +135,7 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
|
|||||||
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
|
fb_pixel_t color_frame = COL_SHADOW_PLUS_0, fb_pixel_t color_body = COL_BUTTON_BODY, fb_pixel_t color_shadow = COL_SHADOW_PLUS_0);
|
||||||
|
|
||||||
///set text color
|
///set text color
|
||||||
inline virtual void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;};
|
void setButtonTextColor(fb_pixel_t caption_color){cc_btn_text_col = caption_color;};
|
||||||
|
|
||||||
/**Member to modify background behavior of embeded caption object.
|
/**Member to modify background behavior of embeded caption object.
|
||||||
* @param[in] mode
|
* @param[in] mode
|
||||||
@@ -159,42 +159,80 @@ class CComponentsButton : public CComponentsFrmChain, public CCTextScreen
|
|||||||
};
|
};
|
||||||
|
|
||||||
///set caption: parameter as string
|
///set caption: parameter as string
|
||||||
virtual void setCaption(const std::string& text);
|
void setCaption(const std::string& text);
|
||||||
///set caption: parameter as locale
|
///set caption: parameter as locale
|
||||||
virtual void setCaption(const neutrino_locale_t locale_text);
|
void setCaption(const neutrino_locale_t locale_text);
|
||||||
|
|
||||||
///get caption, type as std::string
|
///get caption, type as std::string
|
||||||
inline virtual std::string getCaptionString(){return cc_btn_text;};
|
std::string getCaptionString(){return cc_btn_text;};
|
||||||
///get loacalized caption id, type = neutrino_locale_t
|
///get loacalized caption id, type = neutrino_locale_t
|
||||||
inline virtual neutrino_locale_t getCaptionLocale(){return cc_btn_text_locale;};
|
neutrino_locale_t getCaptionLocale(){return cc_btn_text_locale;};
|
||||||
|
|
||||||
///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font
|
///property: set font for label caption, parameter as font object, value NULL causes usaage of dynamic font
|
||||||
virtual void setButtonFont(Font* font){cc_btn_font = font; initCCBtnItems();};
|
void setButtonFont(Font* font){cc_btn_font = font; initCCBtnItems();};
|
||||||
|
|
||||||
///reinitialize items
|
///reinitialize items
|
||||||
virtual void Refresh(){initCCBtnItems();};
|
void Refresh(){initCCBtnItems();};
|
||||||
|
|
||||||
///paint button object
|
///paint button object
|
||||||
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
void paint(bool do_save_bg = CC_SAVE_SCREEN_YES);
|
||||||
|
|
||||||
///assigns an event msg value to button object, parameter1 as neutrino_msg_t, see driver/rcinput.h for possible values
|
/**
|
||||||
inline virtual void setButtonDirectKey(const neutrino_msg_t& msg){cc_directKey = msg;};
|
* Assigns a single event msg value to button object
|
||||||
///assigns an alternate event msg value to button object, parameter1 as neutrino_msg_t, see driver/rcinput.h for possible values
|
* @param[in] neutrino_msg_t
|
||||||
inline virtual void setButtonDirectKeyA(const neutrino_msg_t& msg){cc_directKeyAlt = msg;};
|
* @li excepts type msg_result_t
|
||||||
///returns an event msg value to button object, see driver/rcinput.h for possible values
|
* @note This method adds only one message key value into the cc_directKeys container, \n
|
||||||
inline virtual neutrino_msg_t getButtonDirectKey(){return cc_directKey;};
|
* Already existant keys will be removed. When more than one key value is required, \n
|
||||||
///returns an alternate event msg value to button object, but returns the primary direct key if no key was defined, see driver/rcinput.h for possible values
|
* use setButtonDirectKeys().
|
||||||
inline virtual neutrino_msg_t getButtonDirectKeyA(){return cc_directKeyAlt != CRCInput::RC_nokey ? cc_directKeyAlt : cc_directKey ;};
|
* @see setButtonDirectKeys(), driver/rcinput.h for possible values
|
||||||
|
*/
|
||||||
|
|
||||||
|
void setButtonDirectKey(const neutrino_msg_t& msg){cc_directKeys.clear(); cc_directKeys.push_back(msg);}
|
||||||
|
/**
|
||||||
|
* Assigns a container with any event msg values to button object
|
||||||
|
* @param[in] v_directKeys
|
||||||
|
* @li excepts type std::vector<neutrino_msg_t>
|
||||||
|
* @note This method adds any message key values into the cc_directKeys container, \n
|
||||||
|
* Already existant keys will be removed. When only one key value is required, \n
|
||||||
|
* use setButtonDirectKey().
|
||||||
|
* @see driver/rcinput.h for possible values
|
||||||
|
*/
|
||||||
|
void setButtonDirectKeys(const std::vector<neutrino_msg_t> &v_directKeys){cc_directKeys = v_directKeys;}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns current primary event msg value of button object.
|
||||||
|
* @return neutrino_msg_t
|
||||||
|
* @note This method returns only the first existant message value from cc_directKeys container \n
|
||||||
|
* Other existant keys ar ignored. If a certain value is required, \n
|
||||||
|
* use hasButtonDirectKey().
|
||||||
|
* @see bool hasButtonDirectKey(), driver/rcinput.h for possible values
|
||||||
|
*/
|
||||||
|
neutrino_msg_t getButtonDirectKey(){return cc_directKeys[0];}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if filtered event msg value of button object is found in cc_directKeys container.
|
||||||
|
* @return bool
|
||||||
|
* @param[in] msg
|
||||||
|
* @li exepts type neutrino_msg_t as filter for searched message
|
||||||
|
* @see neutrino_msg_t getButtonDirectKey(), driver/rcinput.h for possible values
|
||||||
|
*/
|
||||||
|
bool hasButtonDirectKey(const neutrino_msg_t& msg)
|
||||||
|
{
|
||||||
|
for (size_t i= 0; i< cc_directKeys.size(); i++)
|
||||||
|
if (cc_directKeys[i] == msg)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
///assigns an return value to button object, parameter1 as int
|
///assigns an return value to button object, parameter1 as int
|
||||||
inline virtual void setButtonResult(const int& result_value){cc_btn_result = result_value;};
|
void setButtonResult(const int& result_value){cc_btn_result = result_value;}
|
||||||
///returns current result value of button object
|
///returns current result value of button object
|
||||||
inline virtual int getButtonResult(){return cc_btn_result;};
|
int getButtonResult(){return cc_btn_result;}
|
||||||
|
|
||||||
///assigns an alias value to button object, parameter1 as int, e.g. previous known as mbYes, mbNo... from message boxes
|
///assigns an alias value to button object, parameter1 as int, e.g. previous known as mbYes, mbNo... from message boxes
|
||||||
inline virtual void setButtonAlias(const int& alias_value){cc_btn_alias = alias_value;};
|
void setButtonAlias(const int& alias_value){cc_btn_alias = alias_value;}
|
||||||
///returns an alias value from button object, see also cc_btn_alias
|
///returns an alias value from button object, see also cc_btn_alias
|
||||||
inline virtual int getButtonAlias(){return cc_btn_alias;};
|
int getButtonAlias(){return cc_btn_alias;}
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Sub class of CComponentsButton.
|
//! Sub class of CComponentsButton.
|
||||||
|
@@ -192,8 +192,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label_cc * const con
|
|||||||
CComponentsButton *btn = new CComponentsButton(0, y_btn, w_btn, h_btn, txt, icon_name, NULL, false, true, ccf_enable_button_shadow);
|
CComponentsButton *btn = new CComponentsButton(0, y_btn, w_btn, h_btn, txt, icon_name, NULL, false, true, ccf_enable_button_shadow);
|
||||||
|
|
||||||
btn->doPaintBg(ccf_enable_button_bg);
|
btn->doPaintBg(ccf_enable_button_bg);
|
||||||
btn->setButtonDirectKey(content[i].directKey);
|
btn->setButtonDirectKeys(content[i].directKeys);
|
||||||
btn->setButtonDirectKeyA(content[i].directKeyAlt);
|
|
||||||
btn->setButtonResult(content[i].btn_result);
|
btn->setButtonResult(content[i].btn_result);
|
||||||
btn->setButtonAlias(content[i].btn_alias);
|
btn->setButtonAlias(content[i].btn_alias);
|
||||||
btn->setButtonFont(ccf_btn_font);
|
btn->setButtonFont(ccf_btn_font);
|
||||||
@@ -253,7 +252,7 @@ void CComponentsFooter::setButtonLabels(const struct button_label * const conten
|
|||||||
buttons[i].locale = content[i].locale;
|
buttons[i].locale = content[i].locale;
|
||||||
//NOTE: here are used default values, because old button label struct don't know about this,
|
//NOTE: here are used default values, because old button label struct don't know about this,
|
||||||
//if it possible, don't use this methode!
|
//if it possible, don't use this methode!
|
||||||
buttons[i].directKey = buttons[i].directKeyAlt = CRCInput::RC_nokey;
|
buttons[i].directKeys.push_back(CRCInput::RC_nokey);
|
||||||
buttons[i].btn_result = -1;
|
buttons[i].btn_result = -1;
|
||||||
buttons[i].btn_alias = -1;
|
buttons[i].btn_alias = -1;
|
||||||
}
|
}
|
||||||
@@ -269,8 +268,7 @@ void CComponentsFooter::setButtonLabels(const vector<button_label_cc> &v_content
|
|||||||
buttons[i].button = v_content[i].button;
|
buttons[i].button = v_content[i].button;
|
||||||
buttons[i].text = v_content[i].text;
|
buttons[i].text = v_content[i].text;
|
||||||
buttons[i].locale = v_content[i].locale;
|
buttons[i].locale = v_content[i].locale;
|
||||||
buttons[i].directKey = v_content[i].directKey;
|
buttons[i].directKeys = v_content[i].directKeys;
|
||||||
buttons[i].directKeyAlt = v_content[i].directKeyAlt;
|
|
||||||
buttons[i].btn_result = v_content[i].btn_result;
|
buttons[i].btn_result = v_content[i].btn_result;
|
||||||
buttons[i].btn_alias = v_content[i].btn_alias;
|
buttons[i].btn_alias = v_content[i].btn_alias;
|
||||||
}
|
}
|
||||||
@@ -284,15 +282,13 @@ void CComponentsFooter::setButtonLabel( const char *button_icon,
|
|||||||
const int& label_width,
|
const int& label_width,
|
||||||
const neutrino_msg_t& msg,
|
const neutrino_msg_t& msg,
|
||||||
const int& result_value,
|
const int& result_value,
|
||||||
const int& alias_value,
|
const int& alias_value)
|
||||||
const neutrino_msg_t& directKeyAlt)
|
|
||||||
{
|
{
|
||||||
button_label_cc button[1];
|
button_label_cc button[1];
|
||||||
|
|
||||||
button[0].button = button_icon;
|
button[0].button = button_icon;
|
||||||
button[0].text = text;
|
button[0].text = text;
|
||||||
button[0].directKey = msg;
|
button[0].directKeys.push_back(msg);
|
||||||
button[0].directKeyAlt = directKeyAlt;
|
|
||||||
button[0].btn_result = result_value;
|
button[0].btn_result = result_value;
|
||||||
button[0].btn_alias = alias_value;
|
button[0].btn_alias = alias_value;
|
||||||
|
|
||||||
@@ -305,12 +301,11 @@ void CComponentsFooter::setButtonLabel( const char *button_icon,
|
|||||||
const int& label_width,
|
const int& label_width,
|
||||||
const neutrino_msg_t& msg,
|
const neutrino_msg_t& msg,
|
||||||
const int& result_value,
|
const int& result_value,
|
||||||
const int& alias_value,
|
const int& alias_value)
|
||||||
const neutrino_msg_t& directKeyAlt)
|
|
||||||
{
|
{
|
||||||
string txt = locale != NONEXISTANT_LOCALE ? g_Locale->getText(locale) : "";
|
string txt = locale != NONEXISTANT_LOCALE ? g_Locale->getText(locale) : "";
|
||||||
|
|
||||||
setButtonLabel(button_icon, txt, chain_width, label_width, msg, result_value, alias_value, directKeyAlt);
|
setButtonLabel(button_icon, txt, chain_width, label_width, msg, result_value, alias_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CComponentsFooter::enableButtonBg(bool enable)
|
void CComponentsFooter::enableButtonBg(bool enable)
|
||||||
|
@@ -99,8 +99,7 @@ class CComponentsFooter : public CComponentsHeader
|
|||||||
const int& label_width = 0,
|
const int& label_width = 0,
|
||||||
const neutrino_msg_t& msg = CRCInput::RC_nokey,
|
const neutrino_msg_t& msg = CRCInput::RC_nokey,
|
||||||
const int& result_value = -1,
|
const int& result_value = -1,
|
||||||
const int& alias_value = -1,
|
const int& alias_value = -1);
|
||||||
const neutrino_msg_t& directKeyAlt = CRCInput::RC_nokey);
|
|
||||||
///add single button label with locale label type as content, chain_width as int, label width as int
|
///add single button label with locale label type as content, chain_width as int, label width as int
|
||||||
void setButtonLabel( const char *button_icon,
|
void setButtonLabel( const char *button_icon,
|
||||||
const neutrino_locale_t& locale,
|
const neutrino_locale_t& locale,
|
||||||
@@ -108,8 +107,7 @@ class CComponentsFooter : public CComponentsHeader
|
|||||||
const int& label_width = 0,
|
const int& label_width = 0,
|
||||||
const neutrino_msg_t& msg = CRCInput::RC_nokey,
|
const neutrino_msg_t& msg = CRCInput::RC_nokey,
|
||||||
const int& result_value = -1,
|
const int& result_value = -1,
|
||||||
const int& alias_value = -1,
|
const int& alias_value = -1);
|
||||||
const neutrino_msg_t& directKeyAlt = CRCInput::RC_nokey);
|
|
||||||
|
|
||||||
///enables background of buttons, parameter bool show, default= true
|
///enables background of buttons, parameter bool show, default= true
|
||||||
void enableButtonBg(bool enable = true);
|
void enableButtonBg(bool enable = true);
|
||||||
|
@@ -179,16 +179,19 @@ typedef struct cc_string_ext_txt_t
|
|||||||
//for 'button_label' type with string
|
//for 'button_label' type with string
|
||||||
typedef struct button_label_cc
|
typedef struct button_label_cc
|
||||||
{
|
{
|
||||||
const char * button;
|
const char * button;
|
||||||
std::string text;
|
std::string text;
|
||||||
neutrino_locale_t locale;
|
neutrino_locale_t locale;
|
||||||
neutrino_msg_t directKey;
|
std::vector<neutrino_msg_t> directKeys;
|
||||||
neutrino_msg_t directKeyAlt;
|
int btn_result;
|
||||||
int btn_result;
|
int btn_alias;
|
||||||
int btn_alias;
|
std::string bg_image;
|
||||||
std::string bg_image;
|
std::string hint;
|
||||||
std::string hint;
|
//defaults
|
||||||
button_label_cc(): button(NULL), text(std::string()), locale(NONEXISTANT_LOCALE){}
|
button_label_cc(): button(NULL),
|
||||||
|
text(std::string()),
|
||||||
|
locale(NONEXISTANT_LOCALE),
|
||||||
|
directKeys(1, CRCInput::RC_nokey){}
|
||||||
} button_label_cc_struct;
|
} button_label_cc_struct;
|
||||||
|
|
||||||
#define CC_WIDTH_MIN 16
|
#define CC_WIDTH_MIN 16
|
||||||
|
@@ -134,8 +134,8 @@ void CMsgBox::initButtons()
|
|||||||
if (mb_show_button & mbOk){
|
if (mb_show_button & mbOk){
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_OKAY;
|
btn.button = NEUTRINO_ICON_BUTTON_OKAY;
|
||||||
btn.text = BTN_TEXT(mbOk);
|
btn.text = BTN_TEXT(mbOk);
|
||||||
btn.directKey = CRCInput::RC_ok;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = btn.directKey;
|
btn.directKeys.push_back(CRCInput::RC_ok);
|
||||||
btn.btn_result = mbrOk;
|
btn.btn_result = mbrOk;
|
||||||
btn.btn_alias = mbOk;
|
btn.btn_alias = mbOk;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
@@ -143,8 +143,9 @@ void CMsgBox::initButtons()
|
|||||||
if (mb_show_button & mbNo){
|
if (mb_show_button & mbNo){
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_RED;
|
btn.button = NEUTRINO_ICON_BUTTON_RED;
|
||||||
btn.text = BTN_TEXT(mbNo);
|
btn.text = BTN_TEXT(mbNo);
|
||||||
btn.directKey = CRCInput::RC_red;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = CRCInput::RC_home;
|
btn.directKeys.push_back(CRCInput::RC_red);
|
||||||
|
btn.directKeys.push_back(CRCInput::RC_home);
|
||||||
btn.btn_result = mbrNo;
|
btn.btn_result = mbrNo;
|
||||||
btn.btn_alias = mbNo;
|
btn.btn_alias = mbNo;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
@@ -152,8 +153,9 @@ void CMsgBox::initButtons()
|
|||||||
if (mb_show_button & mbYes){
|
if (mb_show_button & mbYes){
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_GREEN;
|
btn.button = NEUTRINO_ICON_BUTTON_GREEN;
|
||||||
btn.text = BTN_TEXT(mbYes);
|
btn.text = BTN_TEXT(mbYes);
|
||||||
btn.directKey = CRCInput::RC_green;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = CRCInput::RC_ok;
|
btn.directKeys.push_back(CRCInput::RC_green);
|
||||||
|
btn.directKeys.push_back(CRCInput::RC_ok);
|
||||||
btn.btn_result = mbrYes;
|
btn.btn_result = mbrYes;
|
||||||
btn.btn_alias = mbYes;
|
btn.btn_alias = mbYes;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
@@ -161,8 +163,9 @@ void CMsgBox::initButtons()
|
|||||||
if (mb_show_button & mbCancel){
|
if (mb_show_button & mbCancel){
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_HOME;
|
btn.button = NEUTRINO_ICON_BUTTON_HOME;
|
||||||
btn.text = BTN_TEXT(mbCancel);
|
btn.text = BTN_TEXT(mbCancel);
|
||||||
btn.directKey = CRCInput::RC_home;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = CRCInput::RC_setup;
|
btn.directKeys.push_back(CRCInput::RC_home);
|
||||||
|
btn.directKeys.push_back(CRCInput::RC_setup);
|
||||||
btn.btn_result = mbrCancel;
|
btn.btn_result = mbrCancel;
|
||||||
btn.btn_alias = mbCancel;
|
btn.btn_alias = mbCancel;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
@@ -170,8 +173,8 @@ void CMsgBox::initButtons()
|
|||||||
if (mb_show_button & mbBack){
|
if (mb_show_button & mbBack){
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_HOME;
|
btn.button = NEUTRINO_ICON_BUTTON_HOME;
|
||||||
btn.text = BTN_TEXT(mbBack);
|
btn.text = BTN_TEXT(mbBack);
|
||||||
btn.directKey = CRCInput::RC_home;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = btn.directKey;
|
btn.directKeys.push_back(CRCInput::RC_home);
|
||||||
btn.btn_result = mbrBack;
|
btn.btn_result = mbrBack;
|
||||||
btn.btn_alias = mbBack;
|
btn.btn_alias = mbBack;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
@@ -179,15 +182,18 @@ void CMsgBox::initButtons()
|
|||||||
if (mb_show_button & mbNoYes){
|
if (mb_show_button & mbNoYes){
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_RED;
|
btn.button = NEUTRINO_ICON_BUTTON_RED;
|
||||||
btn.text = BTN_TEXT(mbYes);
|
btn.text = BTN_TEXT(mbYes);
|
||||||
btn.directKey = CRCInput::RC_red;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = CRCInput::RC_ok;
|
btn.directKeys.push_back(CRCInput::RC_red);
|
||||||
|
btn.directKeys.push_back(CRCInput::RC_ok);
|
||||||
btn.btn_result = mbrYes;
|
btn.btn_result = mbrYes;
|
||||||
btn.btn_alias = mbYes;
|
btn.btn_alias = mbYes;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
|
|
||||||
btn.button = NEUTRINO_ICON_BUTTON_GREEN;
|
btn.button = NEUTRINO_ICON_BUTTON_GREEN;
|
||||||
btn.text = BTN_TEXT(mbNo);
|
btn.text = BTN_TEXT(mbNo);
|
||||||
btn.directKey = CRCInput::RC_green;
|
btn.directKeys.clear();
|
||||||
btn.directKeyAlt = CRCInput::RC_home;
|
btn.directKeys.push_back(CRCInput::RC_green);
|
||||||
|
btn.directKeys.push_back(CRCInput::RC_home);
|
||||||
btn.btn_result = mbrNo;
|
btn.btn_result = mbrNo;
|
||||||
btn.btn_alias = mbNo;
|
btn.btn_alias = mbNo;
|
||||||
v_buttons.push_back(btn);
|
v_buttons.push_back(btn);
|
||||||
@@ -299,7 +305,7 @@ int CMsgBox::exec()
|
|||||||
//***action buttons without preselection***
|
//***action buttons without preselection***
|
||||||
for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){
|
for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){
|
||||||
CComponentsButton* btn_action = static_cast<CComponentsButton*>(ccw_footer->getButtonChainObject()->getCCItem(i));
|
CComponentsButton* btn_action = static_cast<CComponentsButton*>(ccw_footer->getButtonChainObject()->getCCItem(i));
|
||||||
if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){
|
if (btn_action->hasButtonDirectKey(msg)){
|
||||||
result = (msg_result_t)btn_action->getButtonResult();
|
result = (msg_result_t)btn_action->getButtonResult();
|
||||||
dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button);
|
dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button);
|
||||||
loop = false;
|
loop = false;
|
||||||
|
Reference in New Issue
Block a user