本文整理汇总了C++中IconButtonWidget::setText方法的典型用法代码示例。如果您正苦于以下问题:C++ IconButtonWidget::setText方法的具体用法?C++ IconButtonWidget::setText怎么用?C++ IconButtonWidget::setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IconButtonWidget
的用法示例。
在下文中一共展示了IconButtonWidget::setText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadedFromFile
// ----------------------------------------------------------------------------
void MessageDialog::loadedFromFile()
{
LabelWidget* message = getWidget<LabelWidget>("title");
message->setText( m_msg, false );
RibbonWidget* ribbon = getWidget<RibbonWidget>("buttons");
ribbon->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
// If the dialog is a simple 'OK' dialog, then hide the "Yes" button and
// change "Cancel" to "OK"
if (m_type == MessageDialog::MESSAGE_DIALOG_OK)
{
IconButtonWidget* yesbtn = getWidget<IconButtonWidget>("cancel");
yesbtn->setVisible(false);
IconButtonWidget* cancelbtn = getWidget<IconButtonWidget>("confirm");
cancelbtn->setText(_("OK"));
cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}
else if (m_type == MessageDialog::MESSAGE_DIALOG_YESNO)
{
IconButtonWidget* cancelbtn = getWidget<IconButtonWidget>("cancel");
cancelbtn->setText(_("No"));
if(m_focus_on_cancel)
cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}
else if (m_type == MessageDialog::MESSAGE_DIALOG_OK_CANCEL)
{
// In case of a OK_CANCEL dialog, change the text from 'Yes' to 'Ok'
IconButtonWidget* yesbtn = getWidget<IconButtonWidget>("confirm");
yesbtn->setText(_("OK"));
IconButtonWidget* cancelbtn = getWidget<IconButtonWidget>("cancel");
if (m_focus_on_cancel)
cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}
}