changes to progress bar to make the percentage label optional
This commit is contained in:
parent
b94fe0fcde
commit
26967a41db
@ -30,9 +30,10 @@ using namespace irr;
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
ProgressBarWidget::ProgressBarWidget() : Widget(WTYPE_PROGRESS)
|
||||
ProgressBarWidget::ProgressBarWidget(bool show_label) : Widget(WTYPE_PROGRESS)
|
||||
{
|
||||
m_value = 0;
|
||||
m_show_label = show_label;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
@ -52,7 +53,10 @@ void ProgressBarWidget::add()
|
||||
void ProgressBarWidget::setValue(int value)
|
||||
{
|
||||
m_value = value;
|
||||
setLabel(std::string(StringUtils::toString(value) + "%").c_str());
|
||||
if (m_show_label)
|
||||
{
|
||||
setLabel(std::string(StringUtils::toString(value) + "%").c_str());
|
||||
}
|
||||
}
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
|
@ -45,12 +45,12 @@ namespace GUIEngine
|
||||
/** Change the label on the widget */
|
||||
void setLabel(const irr::core::stringw label);
|
||||
int m_value;
|
||||
bool m_show_label;
|
||||
|
||||
public:
|
||||
|
||||
LEAK_CHECK()
|
||||
|
||||
ProgressBarWidget();
|
||||
ProgressBarWidget(bool show_label = true);
|
||||
virtual ~ProgressBarWidget() {}
|
||||
|
||||
/** Change the value of the widget, it must be a percent. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user