BOOL LLFloaterAvatarPicker::postBuild()
{
	childSetKeystrokeCallback("Edit", &LLFloaterAvatarPicker::editKeystroke, (void*)this);
	childSetKeystrokeCallback("EditUUID", &LLFloaterAvatarPicker::editKeystroke, (void*)this);

	childSetAction("Find", boost::bind(&LLFloaterAvatarPicker::onBtnFind, this));
	getChildView("Find")->setEnabled(FALSE);
	childSetAction("Refresh", boost::bind(&LLFloaterAvatarPicker::onBtnRefresh, this));
	getChild<LLUICtrl>("near_me_range")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onRangeAdjust, this));

	LLScrollListCtrl* searchresults = getChild<LLScrollListCtrl>("SearchResults");
	searchresults->setDoubleClickCallback( boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
	searchresults->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));
	getChildView("SearchResults")->setEnabled(FALSE);

	LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe");
	nearme->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
	nearme->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));

	LLScrollListCtrl* friends = getChild<LLScrollListCtrl>("Friends");
	friends->setDoubleClickCallback(boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
	childSetAction("RefreshFriends", boost::bind(&LLFloaterAvatarPicker::populateFriend, this));
	getChild<LLUICtrl>("Friends")->setCommitCallback(boost::bind(&LLFloaterAvatarPicker::onList, this));

	childSetAction("ok_btn", boost::bind(&LLFloaterAvatarPicker::onBtnSelect, this));
	getChildView("ok_btn")->setEnabled(FALSE);
	childSetAction("cancel_btn", boost::bind(&LLFloaterAvatarPicker::onBtnClose, this));

	getChild<LLUICtrl>("Edit")->setFocus(TRUE);

	LLPanel* search_panel = getChild<LLPanel>("SearchPanel");
	if (search_panel)
	{
		// Start searching when Return is pressed in the line editor.
		search_panel->setDefaultBtn("Find");
	}

	getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("no_results"));

	getChild<LLTabContainer>("ResidentChooserTabs")->setCommitCallback(
		boost::bind(&LLFloaterAvatarPicker::onTabChanged,this));
	
	setAllowMultiple(FALSE);
	
	center();
	
	populateFriend();

	return TRUE;
}
BOOL LLFloaterAvatarPicker::postBuild()
{
	childSetKeystrokeCallback("Edit", editKeystroke, this);
	childSetKeystrokeCallback("EditUUID", editKeystroke, this);

	childSetAction("Find", onBtnFind, this);
	childDisable("Find");
	childSetAction("Refresh", onBtnRefresh, this);
	childSetCommitCallback("near_me_range", onRangeAdjust, this);

	childSetDoubleClickCallback("SearchResults", onBtnSelect);
	childSetDoubleClickCallback("NearMe", onBtnSelect);
	childSetCommitCallback("SearchResults", onList, this);
	childSetCommitCallback("NearMe", onList, this);
	childDisable("SearchResults");

	childSetAction("Select", onBtnSelect, this);
	childDisable("Select");

	childSetAction("Cancel", onBtnClose, this);

	childSetFocus("Edit");

	LLPanel* search_panel = getChild<LLPanel>("SearchPanel");
	if (search_panel)
	{
		// Start searching when Return is pressed in the line editor.
		search_panel->setDefaultBtn("Find");
	}

	getChild<LLScrollListCtrl>("SearchResults")->addCommentText(getString("no_results"));

	/*LLInventoryPanel* inventory_panel = getChild<LLInventoryPanel>("InventoryPanel");
	inventory_panel->setFilterTypes(0x1 << LLInventoryType::IT_CALLINGCARD);
	inventory_panel->setFollowsAll();
	inventory_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
	inventory_panel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD);
	inventory_panel->setSelectCallback(LLFloaterAvatarPicker::onCallingCardSelectionChange, this);*/
	init_cards = FALSE;

	childSetTabChangeCallback("ResidentChooserTabs", "SearchPanel",			onTabChanged, this);
	childSetTabChangeCallback("ResidentChooserTabs", "CallingCardsPanel",	onTabChanged, this);
	childSetTabChangeCallback("ResidentChooserTabs", "NearMePanel",			onTabChanged, this);
	childSetTabChangeCallback("ResidentChooserTabs", "KeyPanel",			onTabChanged, this);
	setAllowMultiple(FALSE);

	return TRUE;
}
BOOL LLFloaterAvatarPicker::postBuild()
{
	childSetKeystrokeCallback("Edit", editKeystroke, this);

	childSetAction("Find", onBtnFind, this);
	childDisable("Find");

	mListNames = getChild<LLScrollListCtrl>("Names");
	childSetDoubleClickCallback("Names",onBtnAdd);
	childSetCommitCallback("Names", onList, this);
	childDisable("Names");

	childSetAction("Select", onBtnAdd, this);
	childDisable("Select");

	childSetAction("Close", onBtnClose, this);

	childSetFocus("Edit");

	if (mListNames)
	{
		mListNames->addCommentText(std::string("No results")); // *TODO: Translate
	}

	mInventoryPanel = getChild<LLInventoryPanel>("Inventory Panel");
	if(mInventoryPanel)
	{
		mInventoryPanel->setFilterTypes(LLInventoryType::NIT_CALLCARD);
		mInventoryPanel->setFollowsAll();
		mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
		mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_CALLINGCARD);
		mInventoryPanel->setSelectCallback(LLFloaterAvatarPicker::onSelectionChange, this);
	}
	
	setAllowMultiple(FALSE);

	return TRUE;
}