本文整理汇总了C++中LLPanelGroupTab::setAllowEdit方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPanelGroupTab::setAllowEdit方法的具体用法?C++ LLPanelGroupTab::setAllowEdit怎么用?C++ LLPanelGroupTab::setAllowEdit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLPanelGroupTab
的用法示例。
在下文中一共展示了LLPanelGroupTab::setAllowEdit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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;
}