CMsgBox: add option to enable/disable button background

replaces var name btn_contour for better plausibility


Origin commit data
------------------
Commit: be740c1552
Author: Thilo Graf <dbt@novatux.de>
Date: 2016-08-18 (Thu, 18 Aug 2016)
This commit is contained in:
2016-08-18 10:27:33 +02:00
parent 205838789f
commit 36d6eeea06
4 changed files with 26 additions and 16 deletions

View File

@@ -7,7 +7,7 @@
Günther@tuxbox.berlios.org
Implementation of CComponent Window class.
Copyright (C) 2014-2015 Thilo Graf 'dbt'
Copyright (C) 2014-2016 Thilo Graf 'dbt'
License: GPL
@@ -87,6 +87,7 @@ void CMsgBox::init(const int& Height, const int& ShowButtons, const msg_result_t
//enable footer and add its height
showFooter(true);
btn_enable_bg = false;
ccw_footer->doPaintBg(false);
int h_current = height;
h_current += ccw_footer->getHeight();
@@ -174,8 +175,8 @@ void CMsgBox::initButtons()
ccw_footer->setButtonLabels(v_buttons, 0, 125);
//show buttons with frame and background
ccw_footer->showButtonContour(true);
//show buttons with background
ccw_footer->enableButtonBg(btn_enable_bg);
//set position of meassage window and refresh window properties
setCenterPos();

View File

@@ -112,6 +112,9 @@ class CMsgBox : public CHintBox
///assigned button captions
std::string BTN_TEXT(const int& showed_button);
///enables/disable button background
bool btn_enable_bg;
void initButtons();
public:
/* Constructor */
@@ -181,6 +184,11 @@ class CMsgBox : public CHintBox
*/
void setButtonText(const int& showed_button, const std::string& text);
///enables background of buttons, parameter bool show, default= true
void enableButtonBg(bool enable = true);
///disables background of buttons
void disableButtonBg(){enableButtonBg(false);}
// bool setText(const std::string* newText);
};