本文整理汇总了C++中LLNotifyBox类的典型用法代码示例。如果您正苦于以下问题:C++ LLNotifyBox类的具体用法?C++ LLNotifyBox怎么用?C++ LLNotifyBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLNotifyBox类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: die
void LLNotifyBox::close()
{
BOOL isTipTmp = mIsTip;
if (!mIsTip)
{
sNotifyBoxCount--;
}
die();
if(!isTipTmp)
{
LLNotifyBox * front = gNotifyBoxView->getFirstNontipBox();
if(front)
{
gNotifyBoxView->showOnly(front);
// we're assuming that close is only called by user action (for non-tips),
// so we then give focus to the next close button
if (front->getDefaultButton())
{
front->getDefaultButton()->setFocus(TRUE);
}
gFocusMgr.triggerFocusFlash(); // TODO it's ugly to call this here
}
}
}
示例2: LLNotifyBox
//static
bool LLNotifyBox::onNotification(const LLSD& notify)
{
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
if (!notification) return false;
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
{
//bring existing notification to top
LLNotifyBox* boxp = LLNotifyBox::getInstance(notification->getID());
if (boxp && !boxp->isDead())
{
gNotifyBoxView->showOnly(boxp);
}
else
{
bool is_script_dialog = (notification->getName() == "ScriptDialog" || notification->getName() == "ScriptDialogGroup");
LLNotifyBox* notify_box = new LLNotifyBox(
notification,
is_script_dialog); //layout_script_dialog);
gNotifyBoxView->addChild(notify_box);
}
}
else if (notify["sigtype"].asString() == "delete")
{
LLNotifyBox* boxp = LLNotifyBox::getInstance(notification->getID());
if (boxp && !boxp->isDead())
{
boxp->close();
}
}
return false;
}
示例3: onClickButton
// static
void LLNotifyBox::onClickButton(void* data)
{
InstanceAndS32* self_and_button = (InstanceAndS32*)data;
LLNotifyBox* self = self_and_button->mSelf;
S32 button = self_and_button->mButton;
// for caution notifications, check if the last button in the prompt was clicked
// unless it is the only button, in which case it will just be an "OK" button
if ((self->mIsCaution) && (button > 0) && (button == (self->mNumOptions - 1)))
{
// show an alert dialog containing more explanation about the debit permission
LLAlertDialog::showXml("DebitPermissionDetails");
// keep this notification open
return;
}
if (self->mBehavior->mCallback)
{
self->mBehavior->mCallback(button, self->mBehavior->mData);
self->mBehavior->mCallback = NULL; // Notification callbacks only expect to be called once ever
}
self->close();
}
示例4: getChildList
LLNotifyBox* LLNotifyBoxView::getFirstNontipBox() const
{
// *TODO: Don't make assumptions like this!
// assumes every child is a notify box
for(child_list_const_iter_t iter = getChildList()->begin();
iter != getChildList()->end();
iter++)
{
// hack! *TODO: Integrate llnotify and llgroupnotify
if (isGroupNotifyBox(*iter))
continue;
LLNotifyBox* box = static_cast<LLNotifyBox*>(*iter);
if (!box->isTip() && !box->isDead())
return box;
}
return NULL;
}
示例5: getTemplate
//static
LLNotifyBox* LLNotifyBox::showXml( const std::string& xml_desc, const LLStringUtil::format_map_t& args,
notify_callback_t callback, void *user_data)
{
LLPointer<LLNotifyBoxTemplate> xml_template = getTemplate(xml_desc);
LLNotifyBox* notify = findExistingNotify(xml_template, args);
if (notify)
{
delete notify->mBehavior;
notify->mBehavior = new LLNotifyBehavior(callback, user_data);
}
else
{
notify = new LLNotifyBox(xml_template, args, callback, user_data);
gNotifyBoxView->addChildAtEnd(notify);
notify->moveToBack();
}
return notify;
}
示例6: notification_queue
void LLNotifyBoxView::purgeMessagesMatching(const Matcher& matcher)
{
// Make a *copy* of the child list to iterate over
// since we'll be removing items from the real list as we go.
LLView::child_list_t notification_queue(*getChildList());
for(LLView::child_list_iter_t iter = notification_queue.begin();
iter != notification_queue.end();
iter++)
{
if (isGroupNotifyBox(*iter))
continue;
LLNotifyBox* notification = static_cast<LLNotifyBox*>(*iter);
if (matcher.matches(notification->getNotification()))
{
removeChild(notification);
}
}
}
示例7: getChildList
void LLNotifyBoxView::showOnly(LLView * view)
{
if(view)
{
// assumes that the argument is actually a child
LLNotifyBox * shown = dynamic_cast<LLNotifyBox*>(view);
if(!shown)
{
return ;
}
// make every other notification invisible
for(child_list_const_iter_t iter = getChildList()->begin();
iter != getChildList()->end();
iter++)
{
if(isGroupNotifyBox(*iter))
{
continue;
}
LLNotifyBox * box = (LLNotifyBox*)(*iter);
if(box != view && box->getVisible() && !box->isTip())
{
box->setVisible(FALSE);
}
}
shown->setVisible(TRUE);
sendChildToFront(shown);
}
}
示例8: chat_notification
//static
bool LLNotifyBox::onNotification(const LLSD& notify)
{
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
if (!notification) return false;
if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
{
if (notification->getPayload().has("SUPPRESS_TOAST"))
{
chat_notification(notification);
return false;
}
//bring existing notification to top
//This getInstance is ugly, as LLNotifyBox is derived from both LLInstanceTracker and LLEventTimer, which also is derived from its own LLInstanceTracker
//Have to explicitly determine which getInstance function to use.
LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID());
if (boxp && !boxp->isDead())
{
gNotifyBoxView->showOnly(boxp);
}
else
{
gNotifyBoxView->addChild(new LLNotifyBox(notification));
}
}
else if (notify["sigtype"].asString() == "delete")
{
LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID());
if (boxp && !boxp->isDead())
{
boxp->close();
}
}
return false;
}
示例9: LLNotifyBox
//static
bool LLNotifyBox::onNotification(const LLSD& notify)
{
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
if (!notification) return false;
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
{
//bring existing notification to top
//This getInstance is ugly, as LLNotifyBox is derived from both LLInstanceTracker and LLEventTimer, which also is derived from its own LLInstanceTracker
//Have to explicitly determine which getInstance function to use.
LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID());
if (boxp && !boxp->isDead())
{
gNotifyBoxView->showOnly(boxp);
}
else
{
bool is_script_dialog = (notification->getName() == "ScriptDialog" || notification->getName() == "ScriptDialogGroup");
LLNotifyBox* notify_box = new LLNotifyBox(
notification,
is_script_dialog); //layout_script_dialog);
gNotifyBoxView->addChild(notify_box);
}
}
else if (notify["sigtype"].asString() == "delete")
{
LLNotifyBox* boxp = LLInstanceTracker<LLNotifyBox, LLUUID>::getInstance(notification->getID());
if (boxp && !boxp->isDead())
{
boxp->close();
}
}
return false;
}
示例10: onClickNext
// static
void LLNotifyBox::onClickNext(void* data)
{
LLNotifyBox* self = static_cast<LLNotifyBox*>(data);
self->moveToBack(true);
}