BOOL LLButton::postBuild()
{
	autoResize();

	// <FS:Zi> Add checkbox control toggle
	if(!mCheckboxControl.empty())
	{
		mCheckboxControlPanel=LLUICtrlFactory::createFromFile<LLPanel>("panel_button_checkbox.xml",this,LLDefaultChildRegistry::instance());
		if(mCheckboxControlPanel)
		{
			mCheckboxControlPanel->reshape(getRect().getWidth(),getRect().getHeight());

			LLCheckBoxCtrl* check=mCheckboxControlPanel->findChild<LLCheckBoxCtrl>("check_control");
			if(check)
			{
				check->setControlName(mCheckboxControl,NULL);
			}
			else
			{
				LL_WARNS() << "Could not find checkbox control for button " << getName() << LL_ENDL;
			}
		}
		else
		{
			LL_WARNS() << "Could not create checkbox panel for button " << getName() << LL_ENDL;
		}
	}
	// <FS:Zi>

	addBadgeToParentHolder();

	return LLUICtrl::postBuild();
}
// <FS:Ansariel> Re-add setBadgeLabel
void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label)
{
	if (mBadge == NULL)
	{
		mBadge = createBadge(LLUICtrlFactory::getDefaultParams<LLBadge>());

		addBadgeToParentHolder();
	}

	if (mBadge)
	{
		mBadge->setLabel(label);

		//
		// Push the badge to the front so it renders on top
		//

		LLView * parent = mBadge->getParent();

		if (parent)
		{
			parent->sendChildToFront(mBadge);
		}
	}
}
Exemple #3
0
BOOL LLButton::postBuild()
{
	autoResize();

	addBadgeToParentHolder();

	return LLUICtrl::postBuild();
}