当前位置: 首页>>代码示例>>C++>>正文


C++ LLPanelGroupTab::addObserver方法代码示例

本文整理汇总了C++中LLPanelGroupTab::addObserver方法的典型用法代码示例。如果您正苦于以下问题:C++ LLPanelGroupTab::addObserver方法的具体用法?C++ LLPanelGroupTab::addObserver怎么用?C++ LLPanelGroupTab::addObserver使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LLPanelGroupTab的用法示例。


在下文中一共展示了LLPanelGroupTab::addObserver方法的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;
}
开发者ID:VirtualReality,项目名称:Viewer,代码行数:94,代码来源:llpanelgroup.cpp

示例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;
}
开发者ID:normanfly,项目名称:SingularityViewer,代码行数:72,代码来源:llpanelgroup.cpp


注:本文中的LLPanelGroupTab::addObserver方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。