virtual void onOpen(const LLSD& key)
 {
     LLLineEditor* edit = getChild<LLLineEditor>("name ed");
     if (edit)
     {
         edit->setFocus(TRUE);
         edit->selectAll();
     }
 }
示例#2
0
void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group)
{
	gCacheName->get(target_id, is_group, boost::bind(&LLFloaterPay::onCacheOwnerName, this, _1, _2, _3, _4));

	// Make sure the amount field has focus

	childSetFocus("amount", TRUE);
	
	LLLineEditor* amount = getChild<LLLineEditor>("amount");
	amount->selectAll();
	mTargetIsGroup = is_group;
}
void LLCurrencyUIManager::Impl::updateUI()
{
	if (mHidden)
	{
		mPanel.getChildView("currency_action")->setVisible(FALSE);
		mPanel.getChildView("currency_amt")->setVisible(FALSE);
		mPanel.getChildView("currency_est")->setVisible(FALSE);
		return;
	}

	mPanel.getChildView("currency_action")->setVisible(TRUE);

	LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt");
	if (lindenAmount) 
	{
		lindenAmount->setVisible(true);
		lindenAmount->setLabel(mZeroMessage);
		
		if (!mUserEnteredCurrencyBuy)
		{
			if (!mZeroMessage.empty() && mUserCurrencyBuy == 0)
			{
				lindenAmount->setText(LLStringUtil::null);
			}
			else
			{
				lindenAmount->setText(llformat("%d", mUserCurrencyBuy));
			}

			lindenAmount->selectAll();
		}
	}

	mPanel.getChild<LLUICtrl>("currency_est")->setTextArg("[LOCALAMOUNT]", getLocalEstimate());
	mPanel.getChildView("currency_est")->setVisible( hasEstimate() && mUserCurrencyBuy > 0);

	mPanel.getChildView("currency_links")->setVisible( mSupportsInternationalBilling);
	mPanel.getChildView("exchange_rate_note")->setVisible( mSupportsInternationalBilling);

	if (mPanel.getChildView("buy_btn")->getEnabled()
		||mPanel.getChildView("currency_est")->getVisible()
		|| mPanel.getChildView("error_web")->getVisible())
	{
		mPanel.getChildView("getting_data")->setVisible(FALSE);
	}
}
void LLCurrencyUIManager::Impl::updateUI()
{
	if (mHidden)
	{
		mPanel.childHide("currency_action");
		mPanel.childHide("currency_amt");
		mPanel.childHide("currency_est");
		return;
	}

	mPanel.childShow("currency_action");
	mPanel.childSetTextArg("currency_action", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

	LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt");
	if (lindenAmount) 
	{
		lindenAmount->setVisible(true);
		lindenAmount->setLabel(mZeroMessage);
		
		if (!mUserEnteredCurrencyBuy)
		{
			if (!mZeroMessage.empty() && mUserCurrencyBuy == 0)
			{
				lindenAmount->setText(LLStringUtil::null);
			}
			else
			{
				lindenAmount->setText(llformat("%d", mUserCurrencyBuy));
			}

			lindenAmount->selectAll();
		}
	}

	mPanel.childSetTextArg("currency_est", "[USD]", llformat("%#.2f", mSiteCurrencyEstimatedCost / 100.0));
	mPanel.childSetVisible("currency_est", mSiteCurrencyEstimated && mUserCurrencyBuy > 0);

	if (mPanel.childIsEnabled("buy_btn")
		||mPanel.childIsVisible("currency_est")
		|| mPanel.childIsVisible("error_web"))
	{
		mPanel.childSetVisible("getting_data",FALSE);
	}
}
//virtual
BOOL LLFloaterPriceForListing::postBuild()
{
	LLLineEditor* edit = getChild<LLLineEditor>("price_edit");
	if (edit)
	{
		edit->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32);
		std::string min_price = llformat("%d", MINIMUM_PRICE_FOR_LISTING);
		edit->setText(min_price);
		edit->selectAll();
		edit->setFocus(TRUE);
	}

	childSetAction("set_price_btn", onClickSetPrice, this);

	childSetAction("cancel_btn", onClickCancel, this);

	setDefaultBtn("set_price_btn");
	return TRUE;
}
示例#6
0
// static
void LLPanelLogin::giveFocus()
{
#if USE_VIEWER_AUTH
	if (sInstance)
	{
		sInstance->setFocus(TRUE);
	}
#else
	if( sInstance )
	{
		// Grab focus and move cursor to first blank input field
		std::string first = sInstance->getChild<LLComboBox>("name_combo")->getTextEntry();
		std::string pass = sInstance->childGetText("password_edit");

		BOOL have_first = !first.empty();
		BOOL have_pass = !pass.empty();

		if (!have_first)
		{
			// User doesn't have a name, so start there.
			LLComboBox* combo = sInstance->getChild<LLComboBox>("name_combo");
			combo->setFocusText(TRUE);
		}
		else if (!have_pass)
		{
			LLLineEditor* edit = NULL;
			// User saved his name but not his password.  Move
			// focus to password field.
			edit = sInstance->getChild<LLLineEditor>("password_edit");
			edit->setFocus(TRUE);
			edit->selectAll();
		}
		else
		{
			// else, we have both name and password.
			// We get here waiting for the login to happen.
			LLButton* connect_btn = sInstance->getChild<LLButton>("connect_btn");
			connect_btn->setFocus(TRUE);
		}
	}
#endif
}
示例#7
0
// static
void LLPanelLogin::giveFocus()
{
#if USE_VIEWER_AUTH
	if (sInstance)
	{
		sInstance->setFocus(TRUE);
	}
#else
	if( sInstance )
	{
		// Grab focus and move cursor to first blank input field
		std::string first = sInstance->childGetText("first_name_edit");
		std::string pass = sInstance->childGetText("password_edit");

		BOOL have_first = !first.empty();
		BOOL have_pass = !pass.empty();

		LLLineEditor* edit = NULL;
		if (have_first && !have_pass)
		{
			// User saved his name but not his password.  Move
			// focus to password field.
			edit = sInstance->getChild<LLLineEditor>("password_edit");
		}
		else
		{
			// User doesn't have a name, so start there.
			edit = sInstance->getChild<LLLineEditor>("first_name_edit");
		}

		if (edit)
		{
			edit->setFocus(TRUE);
			edit->selectAll();
		}
	}
#endif
}
void LLFloaterPay::finishPayUI(const LLUUID& target_id, BOOL is_group)
{
	std::string slurl;
	if (is_group)
	{
		setTitle(getString("payee_group"));
		slurl = LLSLURL("group", target_id, "inspect").getSLURLString();
	}
	else
	{
		setTitle(getString("payee_resident"));
		slurl = LLSLURL("agent", target_id, "inspect").getSLURLString();
	}
	getChild<LLTextBox>("payee_name")->setText(slurl);
	
	// Make sure the amount field has focus

	LLLineEditor* amount = getChild<LLLineEditor>("amount");
	amount->setFocus(TRUE);
	amount->selectAll();

	mTargetIsGroup = is_group;
}
示例#9
0
// static
void LLPanelLogin::giveFocus()
{
	if( sInstance )
	{
		if (!sInstance->getVisible()) sInstance->setVisible(true);
		// Grab focus and move cursor to first blank input field
		std::string username = sInstance->getChild<LLUICtrl>("username_combo")->getValue().asString();
		std::string pass = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString();

		BOOL have_username = !username.empty();
		BOOL have_pass = !pass.empty();

		LLLineEditor* edit = NULL;
		LLComboBox* combo = NULL;
		if (have_username && !have_pass)
		{
			// User saved his name but not his password.  Move
			// focus to password field.
			edit = sInstance->getChild<LLLineEditor>("password_edit");
		}
		else
		{
			// User doesn't have a name, so start there.
			combo = sInstance->getChild<LLComboBox>("username_combo");
		}

		if (edit)
		{
			edit->setFocus(TRUE);
			edit->selectAll();
		}
		else if (combo)
		{
			combo->setFocus(TRUE);
		}
	}
}