void LLCurrencyUIManager::Impl::prepare() { LLLineEditor* lindenAmount = mPanel.getChild<LLLineEditor>("currency_amt"); if (lindenAmount) { lindenAmount->setPrevalidate(LLLineEditor::prevalidateNonNegativeS32); lindenAmount->setKeystrokeCallback(onCurrencyKey); lindenAmount->setCallbackUserData(this); } }
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); } } }
BOOL LLPreviewGesture::postBuild() { LLLineEditor* edit; LLComboBox* combo; LLButton* btn; LLScrollListCtrl* list; LLTextBox* text; LLCheckBoxCtrl* check; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "trigger_editor"); edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitCallback(onCommitSetDirty); edit->setCommitOnFocusLost(TRUE); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mTriggerEditor = edit; text = LLViewerUICtrlFactory::getTextBoxByName(this, "replace_text"); text->setEnabled(FALSE); mReplaceText = text; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "replace_editor"); edit->setEnabled(FALSE); edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitCallback(onCommitSetDirty); edit->setCommitOnFocusLost(TRUE); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mReplaceEditor = edit; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "modifier_combo"); combo->setCommitCallback(onCommitSetDirty); combo->setCallbackUserData(this); mModifierCombo = combo; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "key_combo"); combo->setCommitCallback(onCommitSetDirty); combo->setCallbackUserData(this); mKeyCombo = combo; list = LLViewerUICtrlFactory::getScrollListByName(this, "library_list"); list->setCommitCallback(onCommitLibrary); list->setDoubleClickCallback(onClickAdd); list->setCallbackUserData(this); mLibraryList = list; btn = LLViewerUICtrlFactory::getButtonByName(this, "add_btn"); btn->setClickedCallback(onClickAdd); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mAddBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "up_btn"); btn->setClickedCallback(onClickUp); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mUpBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "down_btn"); btn->setClickedCallback(onClickDown); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mDownBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "delete_btn"); btn->setClickedCallback(onClickDelete); btn->setCallbackUserData(this); btn->setEnabled(FALSE); mDeleteBtn = btn; list = LLViewerUICtrlFactory::getScrollListByName(this, "step_list"); list->setCommitCallback(onCommitStep); list->setCallbackUserData(this); mStepList = list; // Options text = LLViewerUICtrlFactory::getTextBoxByName(this, "options_text"); text->setBorderVisible(TRUE); mOptionsText = text; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "animation_list"); combo->setVisible(FALSE); combo->setCommitCallback(onCommitAnimation); combo->setCallbackUserData(this); mAnimationCombo = combo; LLRadioGroup* group; group = LLViewerUICtrlFactory::getRadioGroupByName(this, "animation_trigger_type"); group->setVisible(FALSE); group->setCommitCallback(onCommitAnimationTrigger); group->setCallbackUserData(this); mAnimationRadio = group; combo = LLViewerUICtrlFactory::getComboBoxByName(this, "sound_list"); combo->setVisible(FALSE); combo->setCommitCallback(onCommitSound); combo->setCallbackUserData(this); mSoundCombo = combo; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "chat_editor"); edit->setVisible(FALSE); edit->setCommitCallback(onCommitChat); //edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitOnFocusLost(TRUE); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mChatEditor = edit; check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_anim_check"); check->setVisible(FALSE); check->setCommitCallback(onCommitWait); check->setCallbackUserData(this); mWaitAnimCheck = check; check = LLViewerUICtrlFactory::getCheckBoxByName(this, "wait_time_check"); check->setVisible(FALSE); check->setCommitCallback(onCommitWait); check->setCallbackUserData(this); mWaitTimeCheck = check; edit = LLViewerUICtrlFactory::getLineEditorByName(this, "wait_time_editor"); edit->setEnabled(FALSE); edit->setVisible(FALSE); edit->setPrevalidate(LLLineEditor::prevalidateFloat); // edit->setKeystrokeCallback(onKeystrokeCommit); edit->setCommitOnFocusLost(TRUE); edit->setCommitCallback(onCommitWaitTime); edit->setCallbackUserData(this); edit->setIgnoreTab(TRUE); mWaitTimeEditor = edit; // Buttons at the bottom check = LLViewerUICtrlFactory::getCheckBoxByName(this, "active_check"); check->setCommitCallback(onCommitActive); check->setCallbackUserData(this); mActiveCheck = check; btn = LLViewerUICtrlFactory::getButtonByName(this, "save_btn"); btn->setClickedCallback(onClickSave); btn->setCallbackUserData(this); mSaveBtn = btn; btn = LLViewerUICtrlFactory::getButtonByName(this, "preview_btn"); btn->setClickedCallback(onClickPreview); btn->setCallbackUserData(this); mPreviewBtn = btn; // Populate the comboboxes addModifiers(); addKeys(); addAnimations(); addSounds(); const LLInventoryItem* item = getItem(); if (item) { childSetCommitCallback("desc", LLPreview::onText, this); childSetText("desc", item->getDescription()); childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe); } return TRUE; }
BOOL LLPanelGroupLandMoney::postBuild() { /* This power was removed to make group roles simpler bool has_parcel_view = gAgent.hasPowerInGroup(mGroupID, GP_LAND_VIEW_OWNED); bool has_accounting_view = gAgent.hasPowerInGroup(mGroupID, GP_ACCOUNTING_VIEW); */ bool can_view = gAgent.isInGroup(mGroupID); mImplementationp->mGroupOverLimitIconp = getChild<LLIconCtrl>("group_over_limit_icon"); mImplementationp->mGroupOverLimitTextp = getChild<LLTextBox>("group_over_limit_text"); mImplementationp->mYourContributionEditorp = getChild<LLLineEditor>("your_contribution_line_editor"); if ( mImplementationp->mYourContributionEditorp ) { LLLineEditor* editor = mImplementationp->mYourContributionEditorp; editor->setCommitCallback(mImplementationp->contributionCommitCallback); editor->setKeystrokeCallback(mImplementationp->contributionKeystrokeCallback); editor->setCallbackUserData(this); } mImplementationp->mMapButtonp = getChild<LLButton>("map_button"); mImplementationp->mGroupParcelsp = getChild<LLScrollListCtrl>("group_parcel_list"); mImplementationp->mCantViewParcelsText = getString("cant_view_group_land_text"); mImplementationp->mCantViewAccountsText = getString("cant_view_group_accounting_text"); if ( mImplementationp->mMapButtonp ) { mImplementationp->mMapButtonp->setClickedCallback(LLPanelGroupLandMoney::impl::mapCallback, mImplementationp); } if ( mImplementationp->mGroupOverLimitTextp ) { mImplementationp->mGroupOverLimitTextp->setVisible(FALSE); } if ( mImplementationp->mGroupOverLimitIconp ) { mImplementationp->mGroupOverLimitIconp->setVisible(FALSE); } if ( mImplementationp->mMapButtonp ) { mImplementationp->mMapButtonp->setEnabled(FALSE); } if ( !can_view ) { if ( mImplementationp->mGroupParcelsp ) { mImplementationp->mGroupParcelsp->addCommentText( mImplementationp->mCantViewParcelsText); mImplementationp->mGroupParcelsp->setEnabled(FALSE); } } LLButton* earlierp, *laterp; LLTextEditor* textp; LLPanel* panelp; LLTabContainer* tabcp = getChild<LLTabContainer>("group_money_tab_container"); if ( !can_view ) { if ( tabcp ) { S32 i; S32 tab_count = tabcp->getTabCount(); for (i = tab_count - 1; i >=0; --i) { tabcp->enableTabButton(i, false); } } } std::string loading_text = getString("loading_txt"); //pull out the widgets for the L$ details tab earlierp = getChild<LLButton>("earlier_details_button", true); laterp = getChild<LLButton>("later_details_button", true); textp = getChild<LLTextEditor>("group_money_details_text", true); panelp = getChild<LLPanel>("group_money_details_tab", true); if ( !can_view ) { textp->setText(mImplementationp->mCantViewAccountsText); } else { mImplementationp->mMoneyDetailsTabEHp = new LLGroupMoneyDetailsTabEventHandler(earlierp, laterp, textp, tabcp, panelp, loading_text, mGroupID); } textp = getChild<LLTextEditor>("group_money_planning_text", true); panelp = getChild<LLPanel>("group_money_planning_tab", true); if ( !can_view ) { textp->setText(mImplementationp->mCantViewAccountsText); } else { mImplementationp->mMoneyPlanningTabEHp = new LLGroupMoneyPlanningTabEventHandler(textp, tabcp, panelp, loading_text, mGroupID); } //pull out the widgets for the L$ sales tab earlierp = getChild<LLButton>("earlier_sales_button", true); laterp = getChild<LLButton>("later_sales_button", true); textp = getChild<LLTextEditor>("group_money_sales_text", true); panelp = getChild<LLPanel>("group_money_sales_tab", true); if ( !can_view ) { textp->setText(mImplementationp->mCantViewAccountsText); } else { mImplementationp->mMoneySalesTabEHp = new LLGroupMoneySalesTabEventHandler(earlierp, laterp, textp, tabcp, panelp, loading_text, mGroupID); } return LLPanelGroupTab::postBuild(); }