Exemplo n.º 1
0
void LLChatBar::setGestureCombo(LLComboBox* combo)
{
	mGestureCombo = combo;
	if (mGestureCombo)
	{
		mGestureCombo->setCommitCallback(boost::bind(&LLChatBar::onCommitGesture, this, _1));

		// now register observer since we have a place to put the results
		mObserver = new LLChatBarGestureObserver(this);
		LLGestureMgr::instance().addObserver(mObserver);

		// refresh list from current active gestures
		refreshGestures();
	}
}
Exemplo n.º 2
0
void LLChatBar::setGestureCombo(LLComboBox* combo)
{
	mGestureCombo = combo;
	if (mGestureCombo)
	{
		mGestureCombo->setCommitCallback(onCommitGesture);
		mGestureCombo->setCallbackUserData(this);

		// now register observer since we have a place to put the results
		mObserver = new LLChatBarGestureObserver(this);
		gGestureManager.addObserver(mObserver);

		// refresh list from current active gestures
		refreshGestures();
	}
}
LLGestureComboList::LLGestureComboList(const LLGestureComboList::Params& p)
:	LLUICtrl(p),
	mLabel(p.label),
	mViewAllItemIndex(-1),
	mGetMoreItemIndex(-1),
	mShowViewAll(p.view_all),
	mShowGetMore(p.get_more)
{
	LLBottomtrayButton::Params button_params = p.combo_button;
	button_params.follows.flags(FOLLOWS_LEFT|FOLLOWS_BOTTOM|FOLLOWS_RIGHT);

	mButton = LLUICtrlFactory::create<LLBottomtrayButton>(button_params);
	mButton->reshape(getRect().getWidth(),getRect().getHeight());
	mButton->setCommitCallback(boost::bind(&LLGestureComboList::onButtonCommit, this));

	addChild(mButton);

	LLGestureScrollListCtrl::Params params(p.combo_list);
	
	params.name("GestureComboList");
	params.commit_callback.function(boost::bind(&LLGestureComboList::onItemSelected, this, _2));
	params.visible(false);
	params.commit_on_keyboard_movement(false);

	mList = LLUICtrlFactory::create<LLGestureScrollListCtrl>(params);
	addChild(mList);

	//****************************Gesture Part********************************/

	setCommitCallback(boost::bind(&LLGestureComboList::onCommitGesture, this));

	// now register us as observer since we have a place to put the results
	LLGestureMgr::instance().addObserver(this);

	// refresh list from current active gestures
	refreshGestures();

	setFocusLostCallback(boost::bind(&LLGestureComboList::hideList, this));
}