BOOL LLToolBar::postBuild()
{
	mCommunicateBtn.connect(this, "communicate_btn");
	mCommunicateBtn->setCommitCallback(boost::bind(&LLToolBar::onClickCommunicate, this, _2));
	mFlyBtn.connect(this, "fly_btn");
	mBuildBtn.connect(this, "build_btn");
	mMapBtn.connect(this, "map_btn");
	mRadarBtn.connect(this, "radar_btn");
	mInventoryBtn.connect(this, "inventory_btn");

	for (child_list_const_iter_t child_iter = getChildList()->begin();
		 child_iter != getChildList()->end(); ++child_iter)
	{
		LLView *view = *child_iter;
		LLButton* buttonp = dynamic_cast<LLButton*>(view);
		if(buttonp)
		{
			buttonp->setSoundFlags(LLView::SILENT);
		}
	}

#if LL_DARWIN
	LLResizeHandle::Params p;
	p.rect(LLRect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT));
	p.name(std::string(""));
	p.min_width(RESIZE_HANDLE_WIDTH);
	p.min_height(RESIZE_HANDLE_HEIGHT);
	p.corner(LLResizeHandle::RIGHT_BOTTOM);
	addChildInBack(new LLFakeResizeHandle(p));
	reshape(getRect().getWidth(), getRect().getHeight());
#endif // LL_DARWIN

	return TRUE;
}
Esempio n. 2
0
BOOL LLToolBar::postBuild()
{
	childSetCommitCallback("communicate_btn", onClickCommunicate, this);

	childSetAction("chat_btn", onClickChat, this);
	childSetControlName("chat_btn", "ChatVisible");

	//childSetAction("appearance_btn", onClickAppearance, this);
	//childSetControlName("appearance_btn", "");

	childSetAction("radar_list_btn", onClickRadarList, this);
	childSetControlName("radar_list_btn", "ShowRadar");

	childSetAction("fly_btn", onClickFly, this);
	childSetControlName("fly_btn", "FlyBtnState");

	//childSetAction("sit_btn", onClickSit, this);
	//childSetControlName("sit_btn", "SitBtnState");

	childSetAction("snapshot_btn", onClickSnapshot, this);
	childSetControlName("snapshot_btn", "SnapshotBtnState");

	childSetAction("directory_btn", onClickDirectory, this);
	childSetControlName("directory_btn", "ShowDirectory");

	childSetAction("build_btn", onClickBuild, this);
	childSetControlName("build_btn", "BuildBtnState");

	childSetAction("radar_btn", onClickRadar, this);
	childSetControlName("radar_btn", "ShowMiniMap");

	childSetAction("map_btn", onClickMap, this);
	childSetControlName("map_btn", "ShowWorldMap");

	childSetAction("inventory_btn", onClickInventory, this);
	childSetControlName("inventory_btn", "ShowInventory");

	mCommunicateBtn.connect(this, "communicate_btn");
	mFlyBtn.connect(this, "fly_btn");
	mBuildBtn.connect(this, "build_btn");
	mMapBtn.connect(this, "map_btn");
	mRadarBtn.connect(this, "radar_btn");
	mInventoryBtn.connect(this, "inventory_btn");

	for (child_list_const_iter_t child_iter = getChildList()->begin();
		 child_iter != getChildList()->end(); ++child_iter)
	{
		LLView *view = *child_iter;
		LLButton* buttonp = dynamic_cast<LLButton*>(view);
		if(buttonp)
		{
			buttonp->setSoundFlags(LLView::SILENT);
		}
	}

#if LL_DARWIN
	if(mResizeHandle == NULL)
	{
		LLResizeHandle::Params p;
		p.rect(LLRect(0, 0, RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT));
		p.name(std::string(""));
		p.min_width(RESIZE_HANDLE_WIDTH);
		p.min_height(RESIZE_HANDLE_HEIGHT);
		p.corner(LLResizeHandle::RIGHT_BOTTOM);
		mResizeHandle = new LLFakeResizeHandle(p);		this->addChildInBack(mResizeHandle);
		LLLayoutStack* toolbar_stack = getChild<LLLayoutStack>("toolbar_stack");
		toolbar_stack->reshape(toolbar_stack->getRect().getWidth() - RESIZE_HANDLE_WIDTH, toolbar_stack->getRect().getHeight());
	}
#endif // LL_DARWIN

	layoutButtons();

	return TRUE;
}