本文整理汇总了C++中cegui::String::find_last_of方法的典型用法代码示例。如果您正苦于以下问题:C++ String::find_last_of方法的具体用法?C++ String::find_last_of怎么用?C++ String::find_last_of使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::String
的用法示例。
在下文中一共展示了String::find_last_of方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateNewFontName
void FontDemo::generateNewFontName()
{
CEGUI::String fileName = d_fontFileNameSelector->getText();
CEGUI::String pointSize = d_fontSizeEditbox->getText();
CEGUI::String fontName = fileName.substr(0, fileName.find_last_of("."));
fontName += "-" + pointSize;
d_fontNameEditbox->setText(fontName);
}
示例2: OnPlayerShopSubBuyNum
bool OnPlayerShopSubBuyNum(const CEGUI::EventArgs& e)
{
CEGUI::Window* wnd = WEArgs(e).window;
if(!wnd) return false;
CEGUI::Window* goodsWnd = wnd->getParent();
if (goodsWnd)
{
CGoods* goods = static_cast<CGoods*>(goodsWnd->getUserData());
if (!goods) return false;
PlayerShop::tagGoodsItem* pGoodsItem = GetPlayerShop().FindtagGoods(goods);
if (pGoodsItem!=NULL)
{
char str[32];
// 取得输入框控件名
CEGUI::String name = wnd->getName();
name.assign(name, 0, name.find_last_of("/"));
name += "/BuyNum";
CEGUI::Window* buyNumWnd = GetWndMgr().getWindow(name);
int num = atoi(buyNumWnd->getText().c_str());
if (num<=0)
{
sprintf(str,"%d",0);
wnd->disable();
}
else
sprintf(str,"%d",num--);
buyNumWnd->setText(ToCEGUIString(str));
pGoodsItem->readyTradeNum = num;
}
}
return true;
}