本文整理汇总了C++中LLPreviewNotecard::setFocus方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPreviewNotecard::setFocus方法的具体用法?C++ LLPreviewNotecard::setFocus怎么用?C++ LLPreviewNotecard::setFocus使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPreviewNotecard
的用法示例。
在下文中一共展示了LLPreviewNotecard::setFocus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fire
// override
void fire(const LLUUID& inv_item)
{
if(!mTextEditor)
{
// The parent text editor may have vanished by now.
// In that case just quit.
return;
}
LLInventoryItem* item = gInventory.getItem(inv_item);
if(!item)
{
LL_WARNS() << "Item add reported, but not found in inventory!: " << inv_item << LL_ENDL;
}
else
{
// [RLVa:KB] - Checked: 2009-11-11 (RLVa-1.1.0a) | Modified: RLVa-1.1.0a
if (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE))
{
RlvUtil::notifyBlockedViewXXX(LLAssetType::AT_NOTECARD);
return;
}
// [/RLVa:KB]
// See if we can bring an existing preview to the front
if(!LLPreview::show(item->getUUID(), true))
{
if (gSavedSettings.getBOOL("ShowNewInventory")) // Singu Note: ShowNewInventory is true, not false, when they want a preview
{
// There isn't one, so make a new preview
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("NotecardEditorRect");
rect.translate(left - rect.mLeft, top - rect.mTop);
LLPreviewNotecard* preview;
preview = new LLPreviewNotecard("preview notecard",
rect,
std::string("Embedded Note: ") + item->getName(),
item->getUUID(),
LLUUID::null,
item->getAssetUUID(),
true,
(LLViewerInventoryItem*)item);
preview->setSourceID(LLUUID::null);
preview->setFocus(TRUE);
// Force to be entirely onscreen.
gFloaterView->adjustToFitScreen(preview, FALSE);
}
}
}
}
示例2: fire
// override
void fire(const LLUUID& inv_item)
{
if(!mTextEditor)
{
// The parent text editor may have vanished by now.
// In that case just quit.
return;
}
LLInventoryItem* item = gInventory.getItem(inv_item);
if(!item)
{
llwarns << "Item add reported, but not found in inventory!: " << inv_item << llendl;
}
else
{
// See if we can bring an existing preview to the front
if(!LLPreview::show(item->getUUID(), true))
{
if(!gSavedSettings.getBOOL("ShowNewInventory"))
{
// There isn't one, so make a new preview
S32 left, top;
gFloaterView->getNewFloaterPosition(&left, &top);
LLRect rect = gSavedSettings.getRect("NotecardEditorRect");
rect.translate(left - rect.mLeft, top - rect.mTop);
LLPreviewNotecard* preview;
preview = new LLPreviewNotecard("preview notecard",
rect,
std::string("Embedded Note: ") + item->getName(),
item->getUUID(),
LLUUID::null,
item->getAssetUUID(),
true,
(LLViewerInventoryItem*)item);
preview->setSourceID(LLUUID::null);
preview->setFocus(TRUE);
// Force to be entirely onscreen.
gFloaterView->adjustToFitScreen(preview, FALSE);
}
}
}
}