// static bool LLUICtrl::controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type) { LLUICtrl* ctrl = handle.get(); if (ctrl) { if (type == "value") { ctrl->setValue(newvalue); return true; } else if (type == "enabled") { ctrl->setEnabled(newvalue.asBoolean()); return true; } else if(type =="disabled") { ctrl->setEnabled(!newvalue.asBoolean()); return true; } else if (type == "visible") { ctrl->setVisible(newvalue.asBoolean()); return true; } else if (type == "invisible") { ctrl->setVisible(!newvalue.asBoolean()); return true; } } return false; }
void LLPanel::setCtrlsEnabled( BOOL b ) { LLView::ctrl_list_t ctrls = getCtrlList(); for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) { LLUICtrl* ctrl = *ctrl_it; ctrl->setEnabled( b ); } }
// virtual void LLPanel::clearCtrls() { LLView::ctrl_list_t ctrls = getCtrlList(); for (LLView::ctrl_list_t::iterator ctrl_it = ctrls.begin(); ctrl_it != ctrls.end(); ++ctrl_it) { LLUICtrl* ctrl = *ctrl_it; ctrl->setFocus( FALSE ); ctrl->setEnabled( FALSE ); ctrl->clear(); } }
// enable/disable teleport destination coordinates void LLFloaterWorldMap::enableTeleportCoordsDisplay( bool enabled ) { // [RLVa:KB] - Checked: 2012-02-08 (RLVa-1.4.5) | Added: RLVa-1.4.5 LLUICtrl* pCtrl = getChild<LLUICtrl>("events_label"); pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); pCtrl = getChild<LLUICtrl>("teleport_coordinate_x"); pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); pCtrl->setEnabled(enabled); pCtrl = getChild<LLUICtrl>("teleport_coordinate_y"); pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); pCtrl->setEnabled(enabled); pCtrl = getChild<LLUICtrl>("teleport_coordinate_z"); pCtrl->setVisible(!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); pCtrl->setEnabled(enabled); // [/RLVa:KB] // childSetEnabled("teleport_coordinate_x", enabled ); // childSetEnabled("teleport_coordinate_y", enabled ); // childSetEnabled("teleport_coordinate_z", enabled ); }
void LLMakeOutfitDialog::refresh() { bool fUseOutfits = getUseOutfits(); for (S32 idxType = 0; idxType < LLWearableType::WT_COUNT; idxType++) { LLWearableType::EType wtType = (LLWearableType::EType)idxType; if (LLAssetType::AT_BODYPART != LLWearableType::getAssetType(wtType)) continue; LLUICtrl* pCheckCtrl = getChild<LLUICtrl>(std::string("checkbox_") + LLWearableType::getTypeLabel(wtType)); if (!pCheckCtrl) continue; pCheckCtrl->setEnabled(!fUseOutfits); if (fUseOutfits) pCheckCtrl->setValue(true); } childSetEnabled("checkbox_use_links", !fUseOutfits); }
// virtual BOOL LLFloaterReporter::postBuild() { LLSLURL slurl; LLAgentUI::buildSLURL(slurl); getChild<LLUICtrl>("abuse_location_edit")->setValue(slurl.getSLURLString()); enableControls(TRUE); // convert the position to a string LLVector3d pos = gAgent.getPositionGlobal(); LLViewerRegion *regionp = gAgent.getRegion(); if (regionp) { getChild<LLUICtrl>("sim_field")->setValue(regionp->getName()); pos -= regionp->getOriginGlobal(); } setPosBox(pos); // Take a screenshot, but don't draw this floater. setVisible(FALSE); takeScreenshot(); setVisible(TRUE); // Default text to be blank getChild<LLUICtrl>("object_name")->setValue(LLStringUtil::null); getChild<LLUICtrl>("owner_name")->setValue(LLStringUtil::null); mOwnerName = LLStringUtil::null; getChild<LLUICtrl>("summary_edit")->setFocus(TRUE); mDefaultSummary = getChild<LLUICtrl>("details_edit")->getValue().asString(); // send a message and ask for information about this region - // result comes back in processRegionInfo(..) LLMessageSystem* msg = gMessageSystem; msg->newMessage("RequestRegionInfo"); msg->nextBlock("AgentData"); msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); gAgent.sendReliableMessage(); // abuser name is selected from a list LLUICtrl* le = getChild<LLUICtrl>("abuser_name_edit"); le->setEnabled( false ); LLButton* pick_btn = getChild<LLButton>("pick_btn"); // XUI: Why aren't these in viewerart.ini? pick_btn->setImages(std::string("UIImgFaceUUID"), std::string("UIImgFaceSelectedUUID") ); childSetAction("pick_btn", onClickObjPicker, this); childSetAction("select_abuser", boost::bind(&LLFloaterReporter::onClickSelectAbuser, this)); childSetAction("send_btn", onClickSend, this); childSetAction("cancel_btn", onClickCancel, this); // grab the user's name std::string reporter; gAgent.buildFullname(reporter); getChild<LLUICtrl>("reporter_field")->setValue(reporter); center(); return TRUE; }