// 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 LLNearbyChatToastPanel::setHeaderVisibility(EShowItemHeader e) { LLUICtrl* icon = getChild<LLUICtrl>("avatar_icon", false); if(icon) icon->setVisible(e == CHATITEMHEADER_SHOW_ONLY_ICON || e==CHATITEMHEADER_SHOW_BOTH); }
// 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 ); }
BOOL LLFloaterTOS::postBuild() { childSetAction("Continue", onContinue, this); childSetAction("Cancel", onCancel, this); childSetCommitCallback("agree_chk", updateAgree, this); if (hasChild("tos_text")) { // this displays the critical message LLUICtrl *tos_text = getChild<LLUICtrl>("tos_text"); tos_text->setEnabled( FALSE ); tos_text->setFocus(TRUE); tos_text->setValue(LLSD(mMessage)); return TRUE; } // disable Agree to TOS radio button until the page has fully loaded LLCheckBoxCtrl* tos_agreement = getChild<LLCheckBoxCtrl>("agree_chk"); tos_agreement->setEnabled( false ); // hide the SL text widget if we're displaying TOS with using a browser widget. LLUICtrl *editor = getChild<LLUICtrl>("tos_text"); editor->setVisible( FALSE ); LLMediaCtrl* web_browser = getChild<LLMediaCtrl>("tos_html"); if ( web_browser ) { web_browser->addObserver(this); // Don't use the start_url parameter for this browser instance -- it may finish loading before we get to add our observer. // Store the URL separately and navigate here instead. web_browser->navigateTo( getString( "loading_url" ) ); } return TRUE; }