BOOL LLVoiceRemoteCtrl::postBuild()
{
	mTalkBtn = getChild<LLButton>("push_to_talk");
	mTalkBtn->setClickedCallback(onBtnTalkClicked);
	mTalkBtn->setHeldDownCallback(onBtnTalkHeld);
	mTalkBtn->setMouseUpCallback(onBtnTalkReleased);

	mTalkLockBtn = getChild<LLButton>("ptt_lock");
	mTalkLockBtn->setClickedCallback(onBtnLock);
	mTalkLockBtn->setCallbackUserData(this);

	mSpeakersBtn = getChild<LLButton>("speakers_btn");
	mSpeakersBtn->setClickedCallback(onClickSpeakers);
	mSpeakersBtn->setCallbackUserData(this);

	childSetAction("show_channel", onClickPopupBtn, this);
	childSetAction("end_call_btn", onClickEndCall, this);

	LLTextBox* text = getChild<LLTextBox>("channel_label");
	if (text)
	{
		text->setUseEllipses(TRUE);
	}

	childSetAction("voice_channel_bg", onClickVoiceChannel, this);


	return TRUE;
}
BOOL LLVoiceRemoteCtrl::postBuild()
{
	mTalkBtn = getChild<LLButton>("push_to_talk");
	mTalkBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkClicked));
	mTalkBtn->setHeldDownCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkHeld));
	mTalkBtn->setMouseUpCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkReleased));

	mTalkLockBtn = getChild<LLButton>("ptt_lock");
	mTalkLockBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnLock,this));

	mSpeakersBtn = getChild<LLButton>("speakers_btn");
	mSpeakersBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickSpeakers));

	childSetAction("show_channel", onClickPopupBtn, this);
	childSetAction("end_call_btn", onClickEndCall, this);

	LLTextBox* text = getChild<LLTextBox>("channel_label");
	if (text)
	{
		text->setUseEllipses(TRUE);
	}

	childSetAction("voice_channel_bg", onClickVoiceChannel, this);

	mEndCallBtn.connect(this,"end_call_btn");
	mVoiceVolIcon.connect(this,"voice_volume");
	mVoiceChanIcon.connect(this,"voice_channel_icon");
	mVoiceChanBgBtn.connect(this,"voice_channel_bg");
	mChanLabelTextBox.connect(this,"channel_label");
	mShowChanBtn.connect(this,"show_channel");
	return TRUE;
}
BOOL LLVoiceRemoteCtrl::postBuild()
{
	mTalkBtn = getChild<LLButton>("push_to_talk");
	mTalkBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkClicked));
	mTalkBtn->setHeldDownCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkHeld));
	mTalkBtn->setMouseUpCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnTalkReleased));

	mTalkLockBtn = getChild<LLButton>("ptt_lock");
	mTalkLockBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onBtnLock,this));

	mSpeakersBtn = getChild<LLButton>("speakers_btn");
	mSpeakersBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickSpeakers));

	childSetAction("show_channel", onClickPopupBtn, this);
	if (LLButton* end_call_btn = findChild<LLButton>("end_call_btn"))
		end_call_btn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickEndCall));

	LLTextBox* text = findChild<LLTextBox>("channel_label");
	if (text)
	{
		text->setUseEllipses(TRUE);
	}

	if (LLButton* voice_channel_bg = findChild<LLButton>("voice_channel_bg"))
		voice_channel_bg->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickVoiceChannel));

	mPosLockBtn = getChild<LLButton>("pos_lock_btn");
	mPosLockBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickPosLock, this));
	mPosLockBtn->setEnabled(LLVoiceClient::getInstance()->voiceEnabled());

	mPosLockToCamBtn = getChild<LLButton>("pos_lock_to_cam_btn");
	mPosLockToCamBtn->setClickedCallback(boost::bind(&LLVoiceRemoteCtrl::onClickPosLockToCam, this));
	mPosLockToCamBtn->setEnabled(LLVoiceClient::getInstance()->voiceEnabled());

	mVoiceVolIcon.connect(this,"voice_volume");
	mShowChanBtn.connect(this,"show_channel");
	return TRUE;
}