本文整理汇总了C++中irr::core::stringw::c_str方法的典型用法代码示例。如果您正苦于以下问题:C++ stringw::c_str方法的具体用法?C++ stringw::c_str怎么用?C++ stringw::c_str使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类irr::core::stringw
的用法示例。
在下文中一共展示了stringw::c_str方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setLabel
void ButtonWidget::setLabel(const irr::core::stringw &label)
{
// This method should only be called AFTER a widget is added
assert(m_element != NULL);
m_element->setText( label.c_str() );
setText(label);
}
示例2: setLabel
// -----------------------------------------------------------------------------
void RibbonWidget::setLabel(const int id, irr::core::stringw new_name)
{
if (m_labels.size() == 0) return; // ignore this call for ribbons without labels
assert(id >= 0);
assert(id < m_labels.size());
m_labels[id].setText( new_name.c_str() );
m_text = new_name;
}
示例3: renameCell
// -----------------------------------------------------------------------------
void ListWidget::renameCell(const int row_index, const int col_index, const irr::core::stringw newName, const int icon)
{
// May only be called AFTER this widget has been add()ed
assert(m_element != NULL);
CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
assert(list != NULL);
list->setCell(row_index, col_index, newName.c_str(), icon);
list->setItemOverrideColor( row_index, EGUI_LBC_TEXT , video::SColor(255,0,0,0) );
list->setItemOverrideColor( row_index, EGUI_LBC_TEXT_HIGHLIGHT, video::SColor(255,255,255,255) );
}
示例4: addUnlockedPicture
void FeatureUnlockedCutScene::addUnlockedPicture(irr::video::ITexture* picture,
float w, float h,
irr::core::stringw msg)
{
if (picture == NULL)
{
Log::warn("FeatureUnlockedCutScene::addUnlockedPicture", "Unlockable has no picture: %s",
core::stringc(msg.c_str()).c_str());
picture = irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"main_help.png"));
}
m_unlocked_stuff.push_back( new UnlockedThing(picture, w, h, msg) );
} // addUnlockedPicture
示例5: addUnlockedPicture
void FeatureUnlockedCutScene::addUnlockedPicture(irr::video::ITexture* picture,
float w, float h,
irr::core::stringw msg)
{
if (picture == NULL)
{
std::cerr << "[FeatureUnlockedCutScene::addUnlockedPicture] WARNING: unlockable has no picture : "
<< core::stringc(msg.c_str()).c_str() << "\n";
picture = irr_driver->getTexture(file_manager->getAsset(FileManager::GUI,"main_help.png"));
}
m_unlocked_stuff.push_back( new UnlockedThing(picture, w, h, msg) );
} // addUnlockedPicture
示例6: setValue
void SpinnerWidget::setValue(irr::core::stringw new_value)
{
const int size = (int)m_labels.size();
for (int n=0; n<size; n++)
{
if (m_labels[n] == new_value)
{
setValue(n);
return;
}
}
Log::fatal("SpinnerWidget::setValue", "Cannot find element named '%s'",
irr::core::stringc(new_value.c_str()).c_str());
}
示例7: setValue
void SpinnerWidget::setValue(irr::core::stringw new_value)
{
const int size = (int)m_labels.size();
for (int n=0; n<size; n++)
{
if (m_labels[n] == new_value)
{
setValue(n);
return;
}
}
std::cerr << "ERROR [SpinnerWidget::setValue] : cannot find element named '"
<< irr::core::stringc(new_value.c_str()).c_str() << "'\n";
assert(false);
}
示例8: setLabel
// ----------------------------------------------------------------------------
void RibbonWidget::setLabel(const unsigned int id, irr::core::stringw new_name)
{
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;
assert(id < m_labels.size());
m_labels[id].setText(new_name.c_str());
//m_text = new_name;
}
} // setLabel
示例9: w_gettext
/**
* \param original Message to translate
* \param context Optional, can be set to differentiate 2 strings that are identical
* in English but could be different in other languages
*/
const wchar_t* Translations::w_gettext(const char* original, const char* context)
{
if (original[0] == '\0') return L"";
#if TRANSLATE_VERBOSE
Log::info("Translations", "Translating %s", original);
#endif
const std::string& original_t = (context == NULL ?
m_dictionary.translate(original) :
m_dictionary.translate_ctxt(context, original));
if (original_t == original)
{
static irr::core::stringw converted_string;
converted_string = StringUtils::utf8ToWide(original);
#if TRANSLATE_VERBOSE
std::wcout << L" translation : " << converted_string << std::endl;
#endif
return converted_string.c_str();
}
// print
//for (int n=0;; n+=4)
static core::stringw original_tw;
original_tw = StringUtils::utf8ToWide(original_t);
const wchar_t* out_ptr = original_tw.c_str();
if (REMOVE_BOM) out_ptr++;
#if TRANSLATE_VERBOSE
std::wcout << L" translation : " << out_ptr << std::endl;
#endif
return out_ptr;
}
示例10: doInit
void MessageDialog::doInit(irr::core::stringw msg, MessageDialogType type,
IConfirmDialogListener* listener, bool own_listener)
{
loadFromFile("confirm_dialog.stkgui");
m_listener = listener;
m_own_listener = own_listener;
LabelWidget* message = getWidget<LabelWidget>("title");
message->setText( msg.c_str(), false );
// If the dialog is a simple 'OK' dialog, then hide the "Yes" button and
// change "Cancel" to "OK"
if (type == MessageDialog::MESSAGE_DIALOG_OK)
{
ButtonWidget* yesbtn = getWidget<ButtonWidget>("confirm");
yesbtn->setVisible(false);
ButtonWidget* cancelbtn = getWidget<ButtonWidget>("cancel");
cancelbtn->setText(_("OK"));
cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
}
}
示例11: getDescription
/** Returns the description of this achievement. */
irr::core::stringw getDescription() const { return _(m_description.c_str()); }
示例12: getName
/** Returns the name of this achievement. */
irr::core::stringw getName() const { return _LTR(m_name.c_str()); }
示例13: isRTLText
bool isRTLText(const irr::core::stringw &str) { return isRTLText(str.c_str()); }
示例14: selectItemWithLabel
void ListWidget::selectItemWithLabel(const irr::core::stringw& name)
{
CGUISTKListBox* list = getIrrlichtElement<CGUISTKListBox>();
assert(list != NULL);
return list->setSelectedByCellText( name.c_str() );
}
示例15: stringw_to_stdstring
std::string stringw_to_stdstring(irr::core::stringw sw)
{
std::stringstream ss;
ss << sw.c_str();
return ss.str();
}