void LLFloaterPostProcess::onChangeEffectName(LLUICtrl* ctrl, void * userData) { // get the combo box and name LLComboBox * comboBox = static_cast<LLComboBox*>(ctrl); LLLineEditor* editBox = sPostProcess->getChild<LLLineEditor>("PPEffectNameEditor"); // set the parameter's new name editBox->setValue(comboBox->getSelectedValue()); }
virtual void onOpen(const LLSD& key) { LLLineEditor* edit = getChild<LLLineEditor>("name ed"); if (edit) { edit->setFocus(TRUE); edit->selectAll(); } }
// static void LLPanelPermissions::onCommitDesc(LLUICtrl*, void* data) { //llinfos << "LLPanelPermissions::onCommitDesc()" << llendl; LLPanelPermissions* self = (LLPanelPermissions*)data; LLLineEditor* le = self->getChild<LLLineEditor>("Object Description"); if(le) { LLSelectMgr::getInstance()->selectionSetObjectDescription(le->getText()); } }
void LLCurrencyUIManager::Impl::prepare() { LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt"); if (lindenAmount) { lindenAmount->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); lindenAmount->setKeystrokeCallback(onCurrencyKey); lindenAmount->setCallbackUserData(this); } }
// static void LLPanelPermissions::onCommitName(LLUICtrl*, void* data) { //llinfos << "LLPanelPermissions::onCommitName()" << llendl; LLPanelPermissions* self = (LLPanelPermissions*)data; LLLineEditor* tb = self->getChild<LLLineEditor>("Object Name"); if(tb) { LLSelectMgr::getInstance()->selectionSetObjectName(tb->getText()); // LLSelectMgr::getInstance()->selectionSetObjectName(self->mLabelObjectName->getText()); } }
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 LLPanel::childSetKeystrokeCallback(const std::string& id, void (*keystroke_callback)(LLLineEditor* caller, void* user_data), void *user_data) { LLLineEditor* child = getChild<LLLineEditor>(id); if (child) { child->setKeystrokeCallback(keystroke_callback); if (user_data) { child->setCallbackUserData(user_data); } } }
//////////////////////////////////////////////////////////////////////////////// // static void LLFloaterHtml::onCommitUrlEdit(LLUICtrl* ctrl, void* user_data) { LLFloaterHtml* self = (LLFloaterHtml*)user_data; LLLineEditor* editor = (LLLineEditor*)ctrl; std::string url = editor->getText(); if ( self->mWebBrowser ) { self->mWebBrowser->navigateTo( url ); }; }
void LLFloaterLuaConsole::onClickReset(void *data) { LLFloaterLuaConsole *self = (LLFloaterLuaConsole *)data; FLLua::init(); LLLineEditor *editor = self->getChild<LLLineEditor>("Lua Editor", TRUE); if(editor->getLength()) { editor->updateHistory(); editor->clear(); } }
// static void LLFloaterEditUI::onCommitLabel(LLUICtrl* ctrl, void* data) { LLView* view = LLView::sEditingUIView; if (!view) return; LLLineEditor* line = (LLLineEditor*)ctrl; const std::string& text = line->getText(); LLButton* btn = dynamic_cast<LLButton*>(view); if (btn) { btn->setLabelUnselected(text); btn->setLabelSelected(text); } }
// virtual BOOL LLPanelFriends::postBuild() { mFriendsList = getChild<LLScrollListCtrl>("friend_list"); mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); mFriendsList->setMaximumSelectCallback(onMaximumSelect); mFriendsList->setCommitOnSelectionChange(TRUE); childSetCommitCallback("friend_list", onSelectName, this); childSetCommitCallback("buddy_group_combobox", onChangeContactGroup, this); childSetDoubleClickCallback("friend_list", onClickIM); // <dogmode> // Contact search and group system. // 09/05/2010 - Charley Levenque LLLineEditor* contact = getChild<LLLineEditor>("buddy_search_lineedit"); if (contact) { contact->setKeystrokeCallback(&onContactSearchKeystroke); } getChild<LLTextBox>("s_num")->setValue("0"); getChild<LLTextBox>("f_num")->setValue(llformat("%d", mFriendsList->getItemCount())); U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE; refreshNames(changed_mask); childSetAction("im_btn", onClickIM, this); childSetAction("assign_btn", onClickAssign, this); childSetAction("expand_collapse_btn", onClickExpand, this); childSetAction("profile_btn", onClickProfile, this); childSetAction("offer_teleport_btn", onClickOfferTeleport, this); childSetAction("pay_btn", onClickPay, this); childSetAction("add_btn", onClickAddFriend, this); childSetAction("remove_btn", onClickRemove, this); //childSetAction("export_btn", onClickExport, this); Making Dummy View -HgB //childSetAction("import_btn", onClickImport, this); Making Dummy View -HgB setDefaultBtn("im_btn"); updateFriends(LLFriendObserver::ADD); refreshUI(); // primary sort = online status, secondary sort = name mFriendsList->sortByColumn(std::string("friend_name"), TRUE); mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE); updateColumns(this); return TRUE; }
// static void LLPanelLogin::onLastNameEditLostFocus(LLUICtrl* ctrl, void* data) { if (sInstance) { LLLineEditor* edit = sInstance->getChild<LLLineEditor>("last_name_edit"); if(ctrl == edit) { if (edit->isDirty()) { clearPassword(); LLViewerLogin::getInstance()->setNameEditted(true); } } } }
void LLPanelLogin::mungePassword(LLUICtrl* caller, void* user_data) { LLPanelLogin* self = (LLPanelLogin*)user_data; LLLineEditor* editor = (LLLineEditor*)caller; std::string password = editor->getText(); // Re-md5 if we've changed at all if (password != self->mIncomingPassword) { LLMD5 pass((unsigned char *)password.c_str()); char munged_password[MD5HEX_STR_SIZE]; pass.hex_digest(munged_password); self->mMungedPassword = munged_password; } }
FloaterGridManager::FloaterGridManager(const LLSD& key) : mState(NORMAL), mCurGrid(gHippoGridManager->getCurrentGridNick()), mIncomingPassword(""), mMungedPassword("") { llinfos << "Opening grid manager" << llendl; LLUICtrlFactory::getInstance()->buildFloater(this, "floater_grid_manager.xml"); center(); LLLineEditor* edit = getChild<LLLineEditor>("avatar_password_edit"); if (edit) { edit->setDrawAsterixes(TRUE); } }
void LLFloaterPostProcess::onSaveEffect(void* userData) { LLLineEditor* editBox = static_cast<LLLineEditor*>(userData); std::string effectName(editBox->getValue().asString()); if (gPostProcess->mAllEffects.has(effectName)) { LLSD payload; payload["effect_name"] = effectName; LLNotificationsUtil::add("PPSaveEffectAlert", LLSD(), payload, &LLFloaterPostProcess::saveAlertCallback); } else { gPostProcess->saveEffect(effectName); sPostProcess->syncMenu(); } }
//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; }
// 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 }
// static BOOL FSPanelLogin::areCredentialFieldsDirty() { if (!sInstance) { LL_WARNS() << "Attempted getServer with no login view shown" << LL_ENDL; } else { LLComboBox* combo = sInstance->getChild<LLComboBox>("username_combo"); if(combo && combo->isDirty()) { return true; } LLLineEditor* ctrl = sInstance->getChild<LLLineEditor>("password_edit"); if(ctrl && ctrl->isDirty()) { return true; } } return false; }
// static void LLFloaterProperties::onCommitName(LLUICtrl* ctrl, void* data) { //llinfos << "LLFloaterProperties::onCommitName()" << llendl; LLFloaterProperties* self = (LLFloaterProperties*)data; if(!self) { return; } LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->findItem(); if(!item) { return; } LLLineEditor* labelItemName = self->getChild<LLLineEditor>("LabelItemName"); if(labelItemName&& (item->getName() != labelItemName->getText()) && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE)) ) { LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->rename(labelItemName->getText()); if(self->mObjectID.isNull()) { new_item->updateServer(FALSE); gInventory.updateItem(new_item); gInventory.notifyObservers(); } else { LLViewerObject* object = gObjectList.findObject(self->mObjectID); if(object) { object->updateInventory( new_item, TASK_INVENTORY_ITEM_KEY, false); } } } }
//----------------------------------------------------------------------------- // postBuild() //----------------------------------------------------------------------------- BOOL LLFloaterNameDesc::postBuild() { LLRect r; std::string asset_name = mFilename; LLStringUtil::replaceNonstandardASCII( asset_name, '?' ); LLStringUtil::replaceChar(asset_name, '|', '?'); LLStringUtil::stripNonprintable(asset_name); LLStringUtil::trim(asset_name); asset_name = gDirUtilp->getBaseFileName(asset_name, true); // no extsntion setTitle(mFilename); centerWithin(gViewerWindow->getRootView()->getRect()); S32 line_width = getRect().getWidth() - 2 * PREVIEW_HPAD; S32 y = getRect().getHeight() - PREVIEW_LINE_HEIGHT; r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); y -= PREVIEW_LINE_HEIGHT; r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); getChild<LLUICtrl>("name_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); getChild<LLUICtrl>("name_form")->setValue(LLSD(asset_name)); LLLineEditor *NameEditor = getChild<LLLineEditor>("name_form"); if (NameEditor) { NameEditor->setMaxTextLength(DB_INV_ITEM_NAME_STR_LEN); NameEditor->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f); y -= PREVIEW_LINE_HEIGHT; r.setLeftTopAndSize( PREVIEW_HPAD, y, line_width, PREVIEW_LINE_HEIGHT ); getChild<LLUICtrl>("description_form")->setCommitCallback(boost::bind(&LLFloaterNameDesc::doCommit, this)); LLLineEditor *DescEditor = getChild<LLLineEditor>("description_form"); if (DescEditor) { DescEditor->setMaxTextLength(DB_INV_ITEM_DESC_STR_LEN); DescEditor->setPrevalidate(&LLTextValidate::validateASCIIPrintableNoPipe); } y -= llfloor(PREVIEW_LINE_HEIGHT * 1.2f); // Cancel button getChild<LLUICtrl>("cancel_btn")->setCommitCallback(boost::bind(&LLFloaterNameDesc::onBtnCancel, this)); getChild<LLUICtrl>("ok_btn")->setLabelArg("[AMOUNT]", llformat("%d", LLGlobalEconomy::Singleton::getInstance()->getPriceUpload() )); std::string type_currency = LLGridManager::getInstance()->getCurrency(); getChild<LLUICtrl>("ok_btn")->setLabelArg(std::string("[CUR]"), type_currency); setDefaultBtn("ok_btn"); return TRUE; }
BOOL LLFloaterRegionDebugConsole::postBuild() { LLLineEditor* input = getChild<LLLineEditor>("region_debug_console_input"); input->setEnableLineHistory(true); childSetCommitCallback("region_debug_console_input", &LLFloaterRegionDebugConsole::onInput, this); input->setFocus(true); input->setCommitOnFocusLost(false); mOutput = getChild<LLTextEditor>("region_debug_console_output"); std::string url = gAgent.getRegion()->getCapability("SimConsoleAsync"); if (url.empty()) { mOutput->appendText( CONSOLE_NOT_SUPPORTED + PROMPT, false, false); return TRUE; } mOutput->appendText("> ", false, false); return TRUE; }
// 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; }
void LLPanelGroupLandMoney::impl::contributionCommitCallback(LLUICtrl* ctrl, void* userdata) { LLPanelGroupLandMoney* tabp = (LLPanelGroupLandMoney*) userdata; LLLineEditor* editorp = (LLLineEditor*) ctrl; if ( tabp && editorp ) { impl* self = tabp->mImplementationp; int your_contribution = 0; int new_contribution = 0; new_contribution= atoi(editorp->getText().c_str()); your_contribution = self->getStoredContribution(); //reset their junk data to be "good" data to us self->setYourContributionTextField(new_contribution); //check to see if they're contribution text has changed self->mNeedsApply = new_contribution != your_contribution; tabp->notifyObservers(); } }
// 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); } } }
// static BOOL LLPanelLogin::areCredentialFieldsDirty() { if (!sInstance) { llwarns << "Attempted getServer with no login view shown" << llendl; } else { std::string username = sInstance->getChild<LLUICtrl>("username_edit")->getValue().asString(); LLStringUtil::trim(username); std::string password = sInstance->getChild<LLUICtrl>("password_edit")->getValue().asString(); LLLineEditor* ctrl = sInstance->getChild<LLLineEditor>("username_edit"); if(ctrl && ctrl->isDirty()) { return true; } ctrl = sInstance->getChild<LLLineEditor>("password_edit"); if(ctrl && ctrl->isDirty()) { return true; } } return false; }
void LLFloaterProperties::onCommitDescription() { //llinfos << "LLFloaterProperties::onCommitDescription()" << llendl; LLViewerInventoryItem* item = (LLViewerInventoryItem*)findItem(); if(!item) return; LLLineEditor* labelItemDesc = getChild<LLLineEditor>("LabelItemDesc"); if(!labelItemDesc) { return; } if((item->getDescription() != labelItemDesc->getText()) && (gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE))) { LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(item); new_item->setDescription(labelItemDesc->getText()); if(mObjectID.isNull()) { new_item->updateServer(FALSE); gInventory.updateItem(new_item); gInventory.notifyObservers(); } else { LLViewerObject* object = gObjectList.findObject(mObjectID); if(object) { object->updateInventory( new_item, TASK_INVENTORY_ITEM_KEY, false); } } } }
void LLFloaterLuaConsole::onClickSend(void *data) { LLFloaterLuaConsole *self = (LLFloaterLuaConsole *)data; LLLineEditor *editor = self->getChild<LLLineEditor>("Lua Editor", TRUE); if(editor->getLength()) { LLColor4 text_color = gSavedSettings.getColor4("llOwnerSayChatColor"); LLViewerTextEditor *out = self->getChild<LLViewerTextEditor>("Lua Output Editor"); out->appendColoredText("] "+editor->getText(), false, true, text_color); //echo command, like a proper console. FLLua::callCommand(editor->getText()); editor->updateHistory(); editor->clear(); } }
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); } }