This commit is contained in:
Marianne Gagnon 2014-09-06 17:58:59 -04:00
parent 27306018d5
commit 016ba2caf3
2 changed files with 16 additions and 8 deletions

View File

@ -722,15 +722,21 @@ EventPropagation RibbonWidget::transmitEvent(Widget* w,
// ----------------------------------------------------------------------------
void RibbonWidget::setLabel(const unsigned int id, irr::core::stringw new_name)
{
// This method should only be called AFTER a widget is added
assert(m_element != NULL);
if (m_element == NULL)
{
// before adding
m_children[id].setText(new_name);
}
else
{
// after adding
// ignore this call for ribbons without labels
if (m_labels.size() == 0) return;
// ignore this call for ribbons without labels
if (m_labels.size() == 0) return;
assert(id < m_labels.size());
m_labels[id].setText( new_name.c_str() );
m_text = new_name;
assert(id < m_labels.size());
m_labels[id].setText(new_name.c_str());
//m_text = new_name;
}
} // setLabel
// ----------------------------------------------------------------------------

View File

@ -134,12 +134,14 @@ void GPInfoScreen::beforeAddingWidget()
RibbonWidget* ribbonButtons = getWidget<RibbonWidget>("buttons");
int id_continue_button = ribbonButtons->findItemNamed("continue");
ribbonButtons->setItemVisible(id_continue_button, saved_gp != NULL);
ribbonButtons->setLabel(id_continue_button, _("Continue saved GP"));
}
else
{
RibbonWidget* ribbonButtons = getWidget<RibbonWidget>("buttons");
int id_continue_button = ribbonButtons->findItemNamed("continue");
ribbonButtons->setItemVisible(id_continue_button, true);
ribbonButtons->setLabel(id_continue_button, _("Reload"));
}
}