本文整理汇总了C++中LLPreviewGesture::getHost方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPreviewGesture::getHost方法的具体用法?C++ LLPreviewGesture::getHost怎么用?C++ LLPreviewGesture::getHost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPreviewGesture
的用法示例。
在下文中一共展示了LLPreviewGesture::getHost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: show
// static
LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus)
{
LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id);
if (previewp)
{
previewp->open(); /*Flawfinder: ignore*/
if (take_focus)
{
previewp->setFocus(TRUE);
}
return previewp;
}
LLPreviewGesture* self = new LLPreviewGesture();
// Finish internal construction
self->init(item_id, object_id);
// Builds and adds to gFloaterView
gUICtrlFactory->buildFloater(self, "floater_preview_gesture.xml");
self->setTitle(title);
// Move window to top-left of screen
LLMultiFloater* hostp = self->getHost();
if (hostp == NULL)
{
LLRect r = self->getRect();
LLRect screen = gFloaterView->getRect();
r.setLeftTopAndSize(0, screen.getHeight(), r.getWidth(), r.getHeight());
self->setRect(r);
}
else
{
// re-add to host to update title
hostp->addFloater(self, TRUE);
}
// this will call refresh when we have everything.
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
if(item && !item->isComplete())
{
LLInventoryGestureAvailable* observer;
observer = new LLInventoryGestureAvailable();
observer->watchItem(item_id);
gInventory.addObserver(observer);
item->fetchFromServer();
}
else
{
// not sure this is necessary.
self->refresh();
}
if (take_focus)
{
self->setFocus(TRUE);
}
return self;
}
示例2: onClickEdit
void LLFloaterGesture::onClickEdit()
{
const LLUUID& item_id = mGestureList->getCurrentID();
LLInventoryItem* item = gInventory.getItem(item_id);
if (!item) return;
LLPreviewGesture* previewp = LLPreviewGesture::show(item_id, LLUUID::null);
if (!previewp->getHost())
{
previewp->setRect(gFloaterView->findNeighboringPosition(this, previewp));
}
}
示例3: onClickEdit
// static
void LLFloaterGesture::onClickEdit(void* data)
{
LLFloaterGesture* self = (LLFloaterGesture*)data;
LLCtrlListInterface *list = self->childGetListInterface("gesture_list");
if (!list) return;
const LLUUID& item_id = list->getCurrentID();
LLInventoryItem* item = gInventory.getItem(item_id);
if (!item) return;
std::string title("Gesture: ");
title.append(item->getName());
LLPreviewGesture* previewp = LLPreviewGesture::show(title, item_id, LLUUID::null);
if (!previewp->getHost())
{
previewp->setRect(gFloaterView->findNeighboringPosition(self, previewp));
}
}
示例4: show
// static
LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID& item_id, const LLUUID& object_id, BOOL take_focus)
{
LLPreviewGesture* previewp = (LLPreviewGesture*)LLPreview::find(item_id);
if (previewp)
{
previewp->open(); /*Flawfinder: ignore*/
if (take_focus)
{
previewp->setFocus(TRUE);
}
return previewp;
}
LLPreviewGesture* self = new LLPreviewGesture();
// Finish internal construction
self->init(item_id, object_id);
// Builds and adds to gFloaterView
LLUICtrlFactory::getInstance()->buildFloater(self, "floater_preview_gesture.xml");
self->setTitle(title);
// Move window to top-left of screen
LLMultiFloater* hostp = self->getHost();
if (hostp == NULL)
{
LLRect r = self->getRect();
LLRect screen = gFloaterView->getRect();
r.setLeftTopAndSize(0, screen.getHeight(), r.getWidth(), r.getHeight());
self->setRect(r);
}
else
{
// re-add to host to update title
hostp->addFloater(self, TRUE);
}
// Start speculative download of sounds and animations
const LLUUID animation_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ANIMATION);
LLInventoryModelBackgroundFetch::instance().start(animation_folder_id);
const LLUUID sound_folder_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_SOUND);
LLInventoryModelBackgroundFetch::instance().start(sound_folder_id);
// this will call refresh when we have everything.
LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
if(item && !item->isFinished())
{
LLInventoryGestureAvailable* observer;
observer = new LLInventoryGestureAvailable();
observer->watchItem(item_id);
gInventory.addObserver(observer);
item->fetchFromServer();
}
else
{
// not sure this is necessary.
self->refresh();
}
if (take_focus)
{
self->setFocus(TRUE);
}
return self;
}