本文整理汇总了C++中LLPanelGroupTab类的典型用法代码示例。如果您正苦于以下问题:C++ LLPanelGroupTab类的具体用法?C++ LLPanelGroupTab怎么用?C++ LLPanelGroupTab使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLPanelGroupTab类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateTabVisibility
void LLPanelGroup::changed(LLGroupChange gc)
{
updateTabVisibility();
// Notify the currently active panel that group manager information has changed.
LLPanelGroupTab* panelp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
if (panelp)
{
panelp->update(gc);
}
}
示例2:
LLPanelGroup::~LLPanelGroup()
{
LLGroupMgr::getInstance()->removeObserver(this);
for (int i = mTabContainer->getTabCount() - 1; i >=0; --i)
{
LLPanelGroupTab* panelp =
(LLPanelGroupTab*) mTabContainer->getPanelByIndex(i);
if ( panelp ) panelp->removeObserver(this);
}
}
示例3: updateTabVisibility
void LLPanelGroup::updateTabVisibility()
{
for (int i = mTabContainer->getTabCount() - 1; i >=0; --i)
{
LLPanelGroupTab* panelp =
(LLPanelGroupTab*) mTabContainer->getPanelByIndex(i);
BOOL visible = panelp->isVisibleByAgent(&gAgent) || gAgent.isGodlike();
mTabContainer->enableTabButton(i, visible);
if ( !visible && mCurrentTab == panelp )
{
//we are disabling the currently selected tab
//select the previous one
mTabContainer->selectPrevTab();
mCurrentTab =
(LLPanelGroupTab*) mTabContainer->getCurrentPanel();
}
}
}
示例4: apply
bool LLPanelGroup::apply()
{
// Pass this along to the currently visible tab.
if (!mTabContainer) return false;
LLPanelGroupTab* panelp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
if (!panelp) return false;
std::string mesg;
if ( !panelp->needsApply(mesg) )
{
// We don't need to apply anything.
// We're done.
return true;
}
// Ignore the needs apply message.
// Try to do the actual apply.
std::string apply_mesg;
if ( panelp->apply( apply_mesg ) )
{
// Force updating agent data. This should trigger updates
// of the group data.
gAgent.sendAgentDataUpdateRequest();
// Everything worked. We're done.
return true;
}
// There was a problem doing the actual apply.
// Inform the user.
if ( !apply_mesg.empty() )
{
LLSD args;
args["MESSAGE"] = apply_mesg;
LLNotifications::instance().add("GenericAlert", args);
}
return false;
}
示例5: apply
bool LLPanelGroup::apply()
{
// Pass this along to the currently visible tab.
if (!mTabContainer) return false;
LLPanelGroupTab* panelp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
if (!panelp) return false;
std::string mesg;
if ( !panelp->needsApply(mesg) )
{
// We don't need to apply anything.
// We're done.
return true;
}
// Ignore the needs apply message.
// Try to do the actual apply.
std::string apply_mesg;
if ( panelp->apply( apply_mesg ) )
{
// Everything worked. We're done.
return true;
}
// There was a problem doing the actual apply.
// Inform the user.
if ( !apply_mesg.empty() )
{
LLStringUtil::format_map_t args;
args["[MESSAGE]"] = apply_mesg;
gViewerWindow->alertXml("GenericAlert", args);
}
return false;
}
示例6: postBuild
BOOL LLPanelGroup::postBuild()
{
mTabContainer = getChild<LLTabContainer>("group_tab_container");
if (mTabContainer)
{
// Select the initial tab specified via constructor
const BOOL recurse = TRUE;
LLPanelGroupTab* tabp =
getChild<LLPanelGroupTab>(mInitialTab, recurse);
if (!tabp)
{
//our initial tab selection was invalid, just select the
//first tab then or default to selecting the initial
//selected tab specified in the layout file
tabp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
//no tab was initially selected through constructor
//or the XML, select the first tab
if (!tabp)
{
mTabContainer->selectFirstTab();
tabp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
}
}
else
{
mTabContainer->selectTabPanel(tabp);
}
mCurrentTab = tabp;
// Add click callbacks.
S32 i;
S32 tab_count = mTabContainer->getTabCount();
for (i = tab_count - 1; i >=0; --i)
{
LLPanel* tab_panel = mTabContainer->getPanelByIndex(i);
LLPanelGroupTab* panelp =(LLPanelGroupTab*)tab_panel; // bit of a hack
// Pass on whether or not to allow edit to tabs.
panelp->setAllowEdit(mAllowEdit);
panelp->addObserver(this);
mTabContainer->setTabChangeCallback(panelp, onClickTab);
mTabContainer->setTabUserData(panelp, this);
}
updateTabVisibility();
// Act as though this tab was just activated.
mCurrentTab->activate();
}
mDefaultNeedsApplyMesg = getString("default_needs_apply_text");
mWantApplyMesg = getString("want_apply_text");
LLButton* button = getChild<LLButton>("btn_ok");
if (button)
{
button->setClickedCallback(onBtnOK);
button->setCallbackUserData(this);
button->setVisible(mAllowEdit);
}
button = getChild<LLButton>("btn_cancel");
if (button)
{
button->setClickedCallback(onBtnCancel);
button->setCallbackUserData(this);
button->setVisible(mAllowEdit);
}
button = getChild<LLButton>("btn_apply");
if (button)
{
button->setClickedCallback(onBtnApply);
button->setVisible(mAllowEdit);
button->setEnabled(FALSE);
mApplyBtn = button;
}
button = getChild<LLButton>("btn_refresh");
if (button)
{
button->setClickedCallback(onBtnRefresh);
button->setCallbackUserData(this);
button->setVisible(mAllowEdit);
}
return TRUE;
}
示例7: onClickHelp
// static
void LLPanelGroupTab::onClickHelp(void* user_data)
{
LLPanelGroupTab* self = static_cast<LLPanelGroupTab*>(user_data);
self->handleClickHelp();
}
示例8: postBuild
BOOL LLPanelGroup::postBuild()
{
mTabContainer = getChild<LLTabContainer>("group_tab_container");
if (mTabContainer)
{
//our initial tab selection was invalid, just select the
//first tab then or default to selecting the initial
//selected tab specified in the layout file
LLPanelGroupTab* tabp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
//no tab was initially selected through constructor
//or the XML, select the first tab
if (!tabp)
{
mTabContainer->selectFirstTab();
tabp = (LLPanelGroupTab*) mTabContainer->getCurrentPanel();
}
mCurrentTab = tabp;
// Add click callbacks.
for (int i = mTabContainer->getTabCount() - 1; i >=0; --i)
{
LLPanel* tab_panel = mTabContainer->getPanelByIndex(i);
LLPanelGroupTab* panelp =(LLPanelGroupTab*)tab_panel; // bit of a hack
// Pass on whether or not to allow edit to tabs.
panelp->setAllowEdit(mAllowEdit);
panelp->addObserver(this);
}
mTabContainer->setCommitCallback(boost::bind(&LLPanelGroup::handleClickTab,this));
updateTabVisibility();
// Act as though this tab was just activated.
mCurrentTab->activate();
}
mDefaultNeedsApplyMesg = getString("default_needs_apply_text");
mWantApplyMesg = getString("want_apply_text");
LLButton* button = getChild<LLButton>("btn_ok");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnOK,this));
button->setVisible(mAllowEdit);
}
button = getChild<LLButton>("btn_cancel");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnCancel,this));
button->setEnabled(mAllowEdit); // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing
}
button = getChild<LLButton>("btn_apply");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnApply,this));
button->setEnabled(FALSE);
mApplyBtn = button;
}
button = getChild<LLButton>("btn_refresh");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnRefresh,this));
}
return TRUE;
}