BOOL LLChatBar::postBuild()
{
	getChild<LLUICtrl>("Say")->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1));

	// * NOTE: mantipov: getChild with default parameters returns dummy widget.
	// Seems this class will be completle removed
	// attempt to bind to an existing combo box named gesture
	setGestureCombo(findChild<LLComboBox>( "Gesture"));

	mInputEditor = getChild<LLLineEditor>("Chat Editor");
	mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke, this);
	mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
	mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus));
	mInputEditor->setCommitOnFocusLost( FALSE );
	mInputEditor->setRevertOnEsc( FALSE );
	mInputEditor->setIgnoreTab(TRUE);
	mInputEditor->setPassDelete(TRUE);
	mInputEditor->setReplaceNewlinesWithSpaces(FALSE);

	mInputEditor->setMaxTextLength(DB_CHAT_MSG_STR_LEN);
	mInputEditor->setEnableLineHistory(TRUE);

	mIsBuilt = TRUE;

	return TRUE;
}
示例#2
0
BOOL LLChatBar::postBuild()
{
	if (LLUICtrl* history_ctrl = findChild<LLUICtrl>("History"))
		history_ctrl->setCommitCallback(boost::bind(&toggleChatHistory));
	if (LLUICtrl* say_ctrl = getChild<LLUICtrl>("Say"))
		say_ctrl->setCommitCallback(boost::bind(&LLChatBar::onClickSay, this, _1));

	// attempt to bind to an existing combo box named gesture
	if (LLComboBox* gesture_combo = findChild<LLComboBox>("Gesture"))
		setGestureCombo(gesture_combo);

	mInputEditor = findChild<LLLineEditor>("Chat Editor");
	if (mInputEditor)
	{
		mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
		mInputEditor->setKeystrokeCallback(boost::bind(&LLChatBar::onInputEditorKeystroke,this));
		mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
		mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus));
		mInputEditor->setCommitOnFocusLost( FALSE );
		mInputEditor->setRevertOnEsc( FALSE );
		mInputEditor->setIgnoreTab(TRUE);
		mInputEditor->setPassDelete(TRUE);
		mInputEditor->setReplaceNewlinesWithSpaces(FALSE);

		mInputEditor->setEnableLineHistory(TRUE);
	}

	mIsBuilt = TRUE;

	return TRUE;
}
示例#3
0
BOOL LLChatBar::postBuild()
{
	childSetAction("History", toggleChatHistory, this);
	childSetCommitCallback("Say", onClickSay, this);

	// attempt to bind to an existing combo box named gesture
	setGestureCombo(getChild<LLComboBox>( "Gesture"));

	LLButton * sayp = getChild<LLButton>("Say");
	if(sayp)
	{
		setDefaultBtn(sayp);
	}

	mInputEditor = getChild<LLLineEditor>("Chat Editor");
	if (mInputEditor)
	{
		mInputEditor->setCallbackUserData(this);
		mInputEditor->setKeystrokeCallback(&onInputEditorKeystroke);
		mInputEditor->setFocusLostCallback(&onInputEditorFocusLost, this);
		mInputEditor->setFocusReceivedCallback( &onInputEditorGainFocus, this );
		mInputEditor->setCommitOnFocusLost( FALSE );
		mInputEditor->setRevertOnEsc( FALSE );
		mInputEditor->setIgnoreTab(TRUE);
		mInputEditor->setPassDelete(TRUE);
		mInputEditor->setReplaceNewlinesWithSpaces(FALSE);

		mInputEditor->setMaxTextLength(DB_CHAT_MSG_STR_LEN);
		mInputEditor->setEnableLineHistory(TRUE);
	}

	mIsBuilt = TRUE;

	return TRUE;
}