本文整理汇总了C++中cegui::Window::setTooltipText方法的典型用法代码示例。如果您正苦于以下问题:C++ Window::setTooltipText方法的具体用法?C++ Window::setTooltipText怎么用?C++ Window::setTooltipText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cegui::Window
的用法示例。
在下文中一共展示了Window::setTooltipText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void ArrayEditor<ElementType>::SetupWidget(Model* model)
{
// Set dimensions
CEGUI::UDim dimLeft = model->IsShareable() ? cegui_absdim(16) : cegui_absdim(0);
// Setup label widget
CEGUI::Window* labelWidget = mHeaderWidget->getChildAtIdx(0);
labelWidget->setArea(CEGUI::URect(dimLeft, cegui_absdim(0), CEGUI::UDim(0.5f, -2), cegui_reldim(1)));
labelWidget->setText(utf8StringToCEGUI(model->GetName()));
labelWidget->setTooltipText(model->GetTooltip());
// Setup buttons
if (model->IsReadOnly())
{
mButtonAddElement->setEnabled(false);
mButtonSave->setEnabled(false);
mButtonRevert->setEnabled(false);
}
else
{
mButtonAddElement->setEnabled(true);
mButtonSave->setEnabled(false);
mButtonRevert->setEnabled(false);
}
// Setup is-shared checkbox
CEGUI::Checkbox* isSharedCheckbox = static_cast<CEGUI::Checkbox*>(mHeaderWidget->getChildAtIdx(4));
if (model->IsShareable())
{
isSharedCheckbox->setVisible(true);
isSharedCheckbox->setPosition(CEGUI::UVector2(cegui_absdim(0), cegui_absdim(0)));
isSharedCheckbox->setSelected(model->IsShared());
}
else
{
isSharedCheckbox->setVisible(false);
}
// Setup body widget
mEditorWidget->getChildAtIdx(1)->setHeight(cegui_absdim(0));
mBodyLayout->Clear();
}
示例2: cargarImagen
void Gui::cargarImagen(const string &imagen, const string &nombre)
{
CEGUI::Window *myImageWindow = CEGUI::WindowManager::getSingleton().createWindow("Menu/StaticImage", nombre);
wMgrPtr->getWindow("Root")->addChildWindow(myImageWindow);
myImageWindow->setPosition(CEGUI::UVector2( CEGUI::UDim( 0, 0 ), CEGUI::UDim( 0, 0 ) ) );
cout<<"h " << h << endl;
float proporcion = (float)h / 1920;
cout<<"proporcion " << proporcion << endl;
int ancho = 944*proporcion;
cout<<"ancho " << ancho << endl;
myImageWindow->setSize(CEGUI::UVector2(CEGUI::UDim(0,ancho),CEGUI::UDim(1,0)));
myImageWindow->setProperty("Image",imagen);
myImageWindow->setProperty("BackgroundEnabled", "true");
myImageWindow->setProperty("FrameEnabled", "False");
myImageWindow->setText("Prueba de texto dentro de la ventana");
myImageWindow->setTooltipText("Texto de la imagen");
myImageWindow->setAlpha(1.0);
}
示例3: DoDraw
void DrawWarfare::DoDraw(Logic::ShowWarfare* evnt){
if(!isOpen&&evnt->isReSend){
return;
}
if(evnt->isReSend&& PriorIdDraw){
return;
}
isOpen =true;
mIsResend = false;
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::Window *res;
CEGUI::ProgressBar *prog;
Ogre::String name ="BattlifieldSheet/";
Ogre::String text;
mCountry = evnt->contry;
if(wmgr.isWindowPresent("BattlifieldSheet")){
if(!evnt->isReSend){
ClearFromAllChild(mFrameWindow);
}
if(!evnt->isReSend){
mFrameWindow->addChildWindow(mCloseBtn);
}
}else{
mFrameWindow= wmgr.createWindow("TaharezLook/StaticImage", "BattlifieldSheet");
mFrameWindow->setSize(CEGUI::UVector2(CEGUI::UDim(1, 0), CEGUI::UDim(1, 0)));
mCloseBtn= wmgr.createWindow("TaharezLook/Button", "BattlifieldSheet/Close");
mCloseBtn->setPosition(CEGUI::UVector2(CEGUI::UDim(0,0), CEGUI::UDim(0, 0)));
mCloseBtn->setSize(CEGUI::UVector2(CEGUI::UDim(0.15, 0), CEGUI::UDim(0.05, 0)));
mCloseBtn->setText("Close");
mCloseBtn->subscribeEvent(CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&BaseDraw::Close,(BaseDraw*) this));
mFrameWindow->addChildWindow(mCloseBtn);
}
int i=0,j=0;
std::map<Ogre::String,int>::iterator charItr;
std::map<Ogre::String,Ogre::String>::iterator charContItr;
float size= evnt->countryChar.size();
for(charContItr=evnt->countryChar.begin();charContItr!= evnt->countryChar.end();++charContItr){
name="BattlifieldSheet/countrychar"+Logic::LogicStd::IntToString(i);
if(wmgr.isWindowPresent(name)){
res= wmgr.getWindow(name);
if(!evnt->isReSend){
mFrameWindow->addChildWindow(res);
}
}else{
res= wmgr.createWindow("TaharezLook/StaticText", name);
res->setPosition(CEGUI::UVector2(CEGUI::UDim(1/size*i,0), CEGUI::UDim(0.1, 0)));
res->setSize(CEGUI::UVector2(CEGUI::UDim(1/size, 0), CEGUI::UDim(0.15, 0)));
mFrameWindow->addChildWindow(res);
}
i++;
res->setText(charContItr->first+" :\n "+charContItr->second);
}
std::vector<Logic::UnitForSendWar>::iterator unitItr;
i=0;
for(unitItr=evnt->playerUnit.begin();unitItr!= evnt->playerUnit.end();++unitItr){
name="BattlifieldSheet/unitName"+Logic::LogicStd::IntToString(i);
if(wmgr.isWindowPresent(name)){
res= wmgr.getWindow(name);
if(!evnt->isReSend){
mFrameWindow->addChildWindow(res);
}
}else{
res= wmgr.createWindow("TaharezLook/StaticText", name);
res->setPosition(CEGUI::UVector2(CEGUI::UDim(0.1*i,0), CEGUI::UDim(0.25, 0)));
res->setSize(CEGUI::UVector2(CEGUI::UDim(0.1, 0), CEGUI::UDim(0.3, 0)));
mFrameWindow->addChildWindow(res);
}
res->setText(unitItr->name);
j=0;
name="";
for(charItr=unitItr->character.begin();charItr!= unitItr->character.end();++charItr){
if(charItr->first=="Manpower"){
text="\n HP:"+Logic::LogicStd::IntToString(charItr->second);
}
name +=charItr->first+" : "+Logic::LogicStd::IntToString(charItr->second)+"\n";
}
res->setText(unitItr->name+text);
res->setTooltipText(name);
i++;
}
i=0;
for(unitItr=evnt->NPCUnit.begin();unitItr!= evnt->NPCUnit.end();++unitItr){
name="BattlifieldSheet/npcunitName"+Logic::LogicStd::IntToString(i);
if(wmgr.isWindowPresent(name)){
res= wmgr.getWindow(name);
if(!evnt->isReSend){
mFrameWindow->addChildWindow(res);
}
//.........这里部分代码省略.........
示例4: SetPlayerShopGoodsItemInfo
//.........这里部分代码省略.........
sprintf(tempText, "PlayerShop/backgrond/Goods%d/Text", index+1);
wnd = GetWndMgr().getWindow(tempText);
wnd->setVisible(false);
}
// 逛商店页面
else if( shopState == PlayerShop::SHOPPING_SHOP)
{
sprintf(tempText, "PlayerShop/backgrond/Goods%d/Text", index+1);
wnd = GetWndMgr().getWindow(tempText);
wnd->setVisible(false);
}
}
// 设置物品上架信息
// 物品图片
sprintf(tempText, "PlayerShop/backgrond/Goods%d/Icon", index+1);
CEGUI::DefaultWindow* iconWnd = WDefaultWindow(GetWndMgr().getWindow(tempText));
if(iconWnd && tgGoodsItem.goodsIconId != 0)
{
// 获得当前背包栏对应的物品图标数据,并将该图标设置成对应背包组件的额外图片。
const char *strIconPath = GetGame()->GetPicList()->GetPicFilePathName(CPicList::PT_GOODS_ICON, tgGoodsItem.goodsIconId);
GetFilePath(strIconPath,strImageFilePath);
GetFileName(strIconPath,strImageFileName);
CEGUI::String strImagesetName = "GoodIcon/";
strImagesetName += strImageFileName;
SetBackGroundImage(iconWnd,strImagesetName.c_str(),strImageFilePath,strImageFileName);
// 当物品数大于1的时候才显示数量
if(tgGoodsItem.tradeType==PlayerShop::TT_GROUP && tgGoodsItem.oneGroupNum>=1)
{
char strGoodsNum[32];
sprintf_s(strGoodsNum,"%4d",tgGoodsItem.oneGroupNum);
iconWnd->setText(strGoodsNum);
}
}
// 物品数
sprintf(tempText, "PlayerShop/backgrond/Goods%d/Num", index+1);
wnd = GetWndMgr().getWindow(tempText);
if (wnd)
{
if (tgGoodsItem.tradeType==PlayerShop::TT_SINGLE)
{
sprintf_s(tempText,"剩%d件",tgGoodsItem.groupNum);
}else if (tgGoodsItem.tradeType==PlayerShop::TT_GROUP)
{
sprintf_s(tempText,"剩%d组",tgGoodsItem.groupNum);
}
wnd->setText(ToCEGUIString(tempText));
}
// 物品名
sprintf(tempText, "PlayerShop/backgrond/Goods%d/Name", index+1);
wnd = GetWndMgr().getWindow(tempText);
if (wnd)
{
char strGoodsName[32] = "";
DWORD dwNameSize = (DWORD)strlen(tgGoodsItem.strGoodsName.c_str());
if (tgGoodsItem.tradeType==PlayerShop::TT_SINGLE&&dwNameSize>18)
{
_snprintf(strGoodsName,19,"%s",tgGoodsItem.strGoodsName.c_str());
sprintf((strGoodsName+18),"...");
}else if (tgGoodsItem.tradeType==PlayerShop::TT_GROUP&&dwNameSize>10)
{
_snprintf(strGoodsName,11,"%s",tgGoodsItem.strGoodsName.c_str());
sprintf((strGoodsName+10),"...");
}
else
sprintf(strGoodsName,"%s",tgGoodsItem.strGoodsName.c_str());
wnd->setText(ToCEGUIString(strGoodsName));
wnd->setTooltipText(tgGoodsItem.strGoodsName);
}
// 交易方式
sprintf(tempText, "PlayerShop/backgrond/Goods%d/TradeType", index+1);
wnd = GetWndMgr().getWindow(tempText);
if (wnd)
{
if (tgGoodsItem.tradeType==PlayerShop::TT_SINGLE)
{
wnd->setText(ToCEGUIString("单个贩卖"));
//CEGUI::FreeTypeFont * font = static_cast<CEGUI::FreeTypeFont*>( wnd->getFont() );
//font->setPointSize(8);
}
else if (tgGoodsItem.tradeType==PlayerShop::TT_GROUP)
{
wnd->setText(ToCEGUIString("成组贩卖"));
}
}
// 价格
sprintf(tempText, "PlayerShop/backgrond/Goods%d/Price", index+1);
wnd = GetWndMgr().getWindow(tempText);
if (wnd)
{
sprintf(tempText,"%d",tgGoodsItem.price);
wnd->setText(tempText);
}
}