本文整理汇总了C++中LLPreviewTexture::setFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPreviewTexture::setFocus方法的具体用法?C++ LLPreviewTexture::setFocus怎么用?C++ LLPreviewTexture::setFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPreviewTexture
的用法示例。
在下文中一共展示了LLPreviewTexture::setFocus方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: open
void LLLocalInventory::open(LLUUID item_id)
{
LLViewerInventoryItem* item = gInventory.getItem(item_id);
if(!item)
{
llwarns << "Trying to open non-existent item" << llendl;
return;
}
LLAssetType::EType type = item->getType();
if(type == LLAssetType::AT_SOUND)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("PreviewSoundRect");
rect.translate(left - rect.mLeft, top - rect.mTop);
LLPreviewSound* floaterp;
floaterp = new LLPreviewSound("Preview sound",
rect,
"",
item_id);
floaterp->setFocus(TRUE);
gFloaterView->adjustToFitScreen(floaterp, FALSE);
}
else if(type == LLAssetType::AT_ANIMATION)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("PreviewAnimRect");
rect.translate(left - rect.mLeft, top - rect.mTop);
LLPreviewAnim* floaterp;
floaterp = new LLPreviewAnim("Preview anim",
rect,
"",
item_id,
LLPreviewAnim::NONE);
floaterp->setFocus(TRUE);
gFloaterView->adjustToFitScreen(floaterp, FALSE);
}
else if(type == LLAssetType::AT_TEXTURE)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("PreviewTextureRect");
rect.translate( left - rect.mLeft, top - rect.mTop );
LLPreviewTexture* preview;
preview = new LLPreviewTexture("preview texture",
rect,
"Preview texture",
item_id,
LLUUID::null,
FALSE);
//preview->setSourceID(source_id);
preview->setFocus(TRUE);
gFloaterView->adjustToFitScreen(preview, FALSE);
}
else if(type == LLAssetType::AT_GESTURE)
{
// If only the others were like this
LLPreviewGesture::show("preview gesture", item_id, LLUUID::null, TRUE);
}
else if(type == LLAssetType::AT_LANDMARK)
{
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("PreviewLandmarkRect");
rect.translate( left - rect.mLeft, top - rect.mTop );
LLPreviewLandmark* preview;
preview = new LLPreviewLandmark("preview landmark",
rect,
"Preview landmark",
item_id);
preview->setFocus(TRUE);
gFloaterView->adjustToFitScreen(preview, FALSE);
}
else
{
llwarns << "Dunno how to open type " << type << llendl;
}
}