本文整理汇总了C++中childSetVisible函数的典型用法代码示例。如果您正苦于以下问题:C++ childSetVisible函数的具体用法?C++ childSetVisible怎么用?C++ childSetVisible使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了childSetVisible函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: childSetEnabled
void LLFloaterProperties::refreshFromItem(LLInventoryItem* item)
{
////////////////////////
// PERMISSIONS LOOKUP //
////////////////////////
// do not enable the UI for incomplete items.
LLViewerInventoryItem* i = (LLViewerInventoryItem*)item;
BOOL is_complete = i->isComplete();
const LLPermissions& perm = item->getPermissions();
BOOL can_agent_manipulate = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_MANIPULATE);
BOOL can_agent_sell = gAgent.allowOperation(PERM_OWNER, perm,
GP_OBJECT_SET_SALE);
// You need permission to modify the object to modify an inventory
// item in it.
LLViewerObject* object = NULL;
if(!mObjectID.isNull()) object = gObjectList.findObject(mObjectID);
BOOL is_obj_modify = TRUE;
if(object)
{
is_obj_modify = object->permOwnerModify();
}
//////////////////////
// ITEM NAME & DESC //
//////////////////////
BOOL is_modifiable = gAgent.allowOperation(PERM_MODIFY, perm,
GP_OBJECT_MANIPULATE)
&& is_obj_modify && is_complete;
childSetEnabled("LabelItemNameTitle",TRUE);
childSetEnabled("LabelItemName",is_modifiable);
childSetText("LabelItemName",item->getName());
childSetEnabled("LabelItemDescTitle",TRUE);
childSetEnabled("LabelItemDesc",is_modifiable);
childSetVisible("IconLocked",!is_modifiable);
childSetText("LabelItemDesc",item->getDescription());
//////////////////
// CREATOR NAME //
//////////////////
if(!gCacheName) return;
if(!gAgent.getRegion()) return;
if (item->getCreatorUUID().notNull())
{
std::string name;
gCacheName->getFullName(item->getCreatorUUID(), name);
childSetEnabled("BtnCreator",TRUE);
childSetEnabled("LabelCreatorTitle",TRUE);
childSetEnabled("LabelCreatorName",TRUE);
childSetText("LabelCreatorName",name);
}
else
{
childSetEnabled("BtnCreator",FALSE);
childSetEnabled("LabelCreatorTitle",FALSE);
childSetEnabled("LabelCreatorName",FALSE);
childSetText("LabelCreatorName",getString("unknown"));
}
////////////////
// OWNER NAME //
////////////////
if(perm.isOwned())
{
std::string name;
if (perm.isGroupOwned())
{
gCacheName->getGroupName(perm.getGroup(), name);
}
else
{
gCacheName->getFullName(perm.getOwner(), name);
}
childSetEnabled("BtnOwner",TRUE);
childSetEnabled("LabelOwnerTitle",TRUE);
childSetEnabled("LabelOwnerName",TRUE);
childSetText("LabelOwnerName",name);
}
else
{
childSetEnabled("BtnOwner",FALSE);
childSetEnabled("LabelOwnerTitle",FALSE);
childSetEnabled("LabelOwnerName",FALSE);
childSetText("LabelOwnerName",getString("public"));
}
//////////////////
// ACQUIRE DATE //
//////////////////
// *TODO: Localize / translate this
time_t time_utc = item->getCreationDate();
if (0 == time_utc)
{
childSetText("LabelAcquiredDate",getString("unknown"));
//.........这里部分代码省略.........
开发者ID:Boy,项目名称:rainbow,代码行数:101,代码来源:llfloaterproperties.cpp
示例2: LLFloater
LLFloaterTexturePicker::LLFloaterTexturePicker(
LLTextureCtrl* owner,
const LLRect& rect,
const std::string& label,
PermissionMask immediate_filter_perm_mask,
PermissionMask non_immediate_filter_perm_mask,
BOOL can_apply_immediately,
const std::string& fallback_image_name)
:
LLFloater( std::string("texture picker"),
rect,
std::string( "Pick: " ) + label,
TRUE,
TEX_PICKER_MIN_WIDTH, TEX_PICKER_MIN_HEIGHT ),
mOwner( owner ),
mImageAssetID( owner->getImageAssetID() ),
mFallbackImageName( fallback_image_name ),
mWhiteImageAssetID( gSavedSettings.getString( "UIImgWhiteUUID" ) ),
mInvisibleImageAssetID(gSavedSettings.getString("UIImgInvisibleUUID")),
mAlphaImageAssetID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"),
mOriginalImageAssetID(owner->getImageAssetID()),
mLabel(label),
mTentativeLabel(NULL),
mResolutionLabel(NULL),
mIsDirty( FALSE ),
mActive( TRUE ),
mSearchEdit(NULL),
mImmediateFilterPermMask(immediate_filter_perm_mask),
mNonImmediateFilterPermMask(non_immediate_filter_perm_mask),
mContextConeOpacity(0.f)
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_texture_ctrl.xml");
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this);
childSetAction("Alpha", LLFloaterTexturePicker::onBtnAlpha,this);
childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this);
childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this);
// tag: vaa emerald local_asset_browser [begin]
// childSetAction("Local", LLFloaterTexturePicker::onBtnLocal, this);
// childSetAction("Server", LLFloaterTexturePicker::onBtnServer, this);
childSetAction("Add", LLFloaterTexturePicker::onBtnAdd, this);
childSetAction("Remove", LLFloaterTexturePicker::onBtnRemove, this);
childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this);
mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list");
mLocalScrollCtrl->setCallbackUserData(this);
mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit);
LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl );
// tag: vaa emerald local_asset_browser [end]
childSetAction("CpToInv", LLFloaterTexturePicker::onBtnCpToInv,this);
childSetAction("jelly_roll_btn", LLFloaterTexturePicker::onClickJellyRoll,this);
childSetCommitCallback("show_folders_check", onShowFolders, this);
childSetVisible("show_folders_check", FALSE);
mSearchEdit = getChild<LLSearchEditor>("inventory search editor");
mSearchEdit->setSearchCallback(onSearchEdit, this);
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
if(mInventoryPanel)
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_TEXTURE;
filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setFilterPermMask(immediate_filter_perm_mask);
mInventoryPanel->setSelectCallback(onSelectionChange, this);
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE);
// store this filter as the default one
mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures
// mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE);
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
}
mCanApplyImmediately = can_apply_immediately;
mNoCopyTextureSelected = FALSE;
childSetValue("apply_immediate_check", gSavedSettings.getBOOL("ApplyTextureImmediately"));
childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this);
if (!can_apply_immediately)
{
childSetEnabled("show_folders_check", FALSE);
//.........这里部分代码省略.........
开发者ID:fractured-crystal,项目名称:SingularityViewer,代码行数:101,代码来源:lltexturectrl.cpp
示例3: getString
//.........这里部分代码省略.........
U32 base_mask_off = 0;
U32 owner_mask_off = 0;
U32 owner_mask_on = 0;
U32 group_mask_on = 0;
U32 group_mask_off = 0;
U32 everyone_mask_on = 0;
U32 everyone_mask_off = 0;
U32 next_owner_mask_on = 0;
U32 next_owner_mask_off = 0;
BOOL valid_base_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_BASE,
&base_mask_on,
&base_mask_off);
//BOOL valid_owner_perms =//
LLSelectMgr::getInstance()->selectGetPerm(PERM_OWNER,
&owner_mask_on,
&owner_mask_off);
BOOL valid_group_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_GROUP,
&group_mask_on,
&group_mask_off);
BOOL valid_everyone_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_EVERYONE,
&everyone_mask_on,
&everyone_mask_off);
BOOL valid_next_perms = LLSelectMgr::getInstance()->selectGetPerm(PERM_NEXT_OWNER,
&next_owner_mask_on,
&next_owner_mask_off);
bool supports_export = LFSimFeatureHandler::instance().simSupportsExport();
if( gSavedSettings.getBOOL("DebugPermissions") )
{
childSetVisible("perm_modify", false);
if (valid_base_perms)
{
std::string perm_string = mask_to_string(base_mask_on);
if (!supports_export && base_mask_on & PERM_EXPORT) // Hide Export when not available
perm_string.erase(perm_string.find_last_of("E"));
if (U32 diff_mask = base_mask_on ^ owner_mask_on) // When different, show the user's potential permissions lowercase.
{
if (diff_mask & PERM_MOVE)
LLStringUtil::replaceChar(perm_string, 'V', 'v');
if (diff_mask & PERM_MODIFY)
LLStringUtil::replaceChar(perm_string, 'M', 'm');
if (diff_mask & PERM_COPY)
LLStringUtil::replaceChar(perm_string, 'C', 'c');
if (diff_mask & PERM_TRANSFER)
LLStringUtil::replaceChar(perm_string, 'T', 't');
if (diff_mask & PERM_EXPORT)
LLStringUtil::replaceChar(perm_string, 'E', 'e');
}
getChild<LLUICtrl>("B:")->setValue("B: " + perm_string);
getChildView("B:")->setVisible( TRUE);
/*
perm_string = mask_to_string(owner_mask_on);
if (!supports_export && owner_mask_on & PERM_EXPORT) // Hide Export when not available
perm_string.erase(perm_string.find_last_of("E"));
getChild<LLUICtrl>("O:")->setValue("O: " + perm_string);
getChildView("O:")->setVisible( TRUE);
*/
getChild<LLUICtrl>("G:")->setValue("G: " + mask_to_string(group_mask_on));
getChildView("G:")->setVisible( TRUE);
开发者ID:SimFederal,项目名称:SingularityViewer,代码行数:66,代码来源:llpanelpermissions.cpp
示例4: nbRect
void LLNavigationBar::showFavoritesPanel(BOOL visible)
{
bool npVisible = gSavedSettings.getBOOL("ShowNavbarNavigationPanel");
LLFavoritesBarCtrl* fb = getChild<LLFavoritesBarCtrl>("favorite");
LLRect nbRect(getRect());
LLRect fbRect(fb->getRect());
if (visible)
{
if (npVisible)
{
// Favorites Panel must be shown. Navigation Panel is visible.
S32 fbHeight = fbRect.getHeight();
S32 newHeight = nbRect.getHeight() + fbHeight;
nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), newHeight);
fbRect.setLeftTopAndSize(mDefaultFpRect.mLeft, mDefaultFpRect.mTop, fbRect.getWidth(), fbRect.getHeight());
}
else
{
// Favorites Panel must be shown. Navigation Panel is hidden.
S32 fpHeight = mDefaultFpRect.getHeight();
nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fpHeight);
fbRect.setLeftTopAndSize(fbRect.mLeft, fpHeight, fbRect.getWidth(), fpHeight);
}
reshape(nbRect.getWidth(), nbRect.getHeight());
setRect(nbRect);
getParent()->reshape(nbRect.getWidth(), nbRect.getHeight());
fb->reshape(fbRect.getWidth(), fbRect.getHeight());
fb->setRect(fbRect);
}
else
{
if (npVisible)
{
// Favorites Panel must be hidden. Navigation Panel is visible.
S32 fbHeight = fbRect.getHeight();
S32 newHeight = nbRect.getHeight() - fbHeight;
nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), newHeight);
}
else
{
// Favorites Panel must be hidden. Navigation Panel is hidden.
nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), 0);
}
reshape(nbRect.getWidth(), nbRect.getHeight());
setRect(nbRect);
getParent()->reshape(nbRect.getWidth(), nbRect.getHeight());
}
childSetVisible("bg_icon", visible);
childSetVisible("bg_icon_no_fav", !visible);
fb->setVisible(visible);
}
开发者ID:Xara,项目名称:Opensource-V2-SL-Viewer,代码行数:65,代码来源:llnavigationbar.cpp
示例5: mTentativeLabel
LLFloaterLandmark::LLFloaterLandmark(const LLSD& data)
:
mTentativeLabel(NULL),
mResolutionLabel(NULL),
mIsDirty( FALSE ),
mActive( TRUE ),
mSearchEdit(NULL),
mContextConeOpacity(0.f)
{
LLUICtrlFactory::getInstance()->buildFloater(this,"floater_landmark_ctrl.xml");
mTentativeLabel = getChild<LLTextBox>("Multiple");
mResolutionLabel = getChild<LLTextBox>("unknown");
childSetCommitCallback("show_folders_check", onShowFolders, this);
childSetVisible("show_folders_check", FALSE);
mSearchEdit = getChild<LLSearchEditor>("inventory search editor");
mSearchEdit->setSearchCallback(onSearchEdit, this);
mInventoryPanel = getChild<LLInventoryPanel>("inventory panel");
if(mInventoryPanel)
{
U32 filter_types = 0x0;
filter_types |= 0x1 << LLInventoryType::IT_LANDMARK;
// filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT;
mInventoryPanel->setFilterTypes(filter_types);
//mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss.
mInventoryPanel->setSelectCallback(onSelectionChange, this);
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
mInventoryPanel->setAllowMultiSelect(FALSE);
// store this filter as the default one
mInventoryPanel->getRootFolder()->getFilter()->markDefault();
// Commented out to stop opening all folders with textures
mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_LANDMARK);
// don't put keyboard focus on selected item, because the selection callback
// will assume that this was user input
mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO);
}
mSavedFolderState = new LLSaveFolderState();
mNoCopyLandmarkSelected = FALSE;
childSetAction("Close", LLFloaterLandmark::onBtnClose,this);
childSetAction("New", LLFloaterLandmark::onBtnNew,this);
childSetAction("NewFolder", LLFloaterLandmark::onBtnNewFolder,this);
childSetAction("Edit", LLFloaterLandmark::onBtnEdit,this);
childSetAction("Rename", LLFloaterLandmark::onBtnRename,this);
childSetAction("Delete", LLFloaterLandmark::onBtnDelete,this);
setCanMinimize(FALSE);
mSavedFolderState->setApply(FALSE);
}
开发者ID:9skunks,项目名称:imprudence,代码行数:61,代码来源:llfloaterlandmark.cpp
示例6: LLFloater
//-----------------------------------------------------------------------------
// Member functions
//-----------------------------------------------------------------------------
LLFloaterReporter::LLFloaterReporter(
const std::string& name,
const LLRect& rect,
const std::string& title,
EReportType report_type)
:
LLFloater(name, rect, title),
mReportType(report_type),
mObjectID(),
mScreenID(),
mAbuserID(),
mDeselectOnClose( FALSE ),
mPicking( FALSE),
mPosition(),
mCopyrightWarningSeen( FALSE ),
mResourceDatap(new LLResourceData())
{
if (report_type == BUG_REPORT)
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_bug.xml");
}
else
{
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_report_abuse.xml");
}
childSetText("abuse_location_edit", gAgent.getSLURL() );
// [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0a
if (rlv_handler_t::isEnabled())
{
// Can't filter these since they get sent as part of the report so just hide them instead
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC))
{
childSetVisible("abuse_location_edit", false);
childSetVisible("pos_field", false);
}
if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
childSetVisible("owner_name", false);
childSetVisible("abuser_name_edit", false);
}
}
// [/RLVa:KB]
LLButton* pick_btn = getChild<LLButton>("pick_btn");
if (pick_btn)
{
// XUI: Why aren't these in viewerart.ini?
pick_btn->setImages( std::string("UIImgFaceUUID"),
std::string("UIImgFaceSelectedUUID") );
childSetAction("pick_btn", onClickObjPicker, this);
}
if (report_type != BUG_REPORT)
{
// abuser name is selected from a list
LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit");
le->setEnabled( FALSE );
}
childSetAction("select_abuser", onClickSelectAbuser, this);
childSetAction("send_btn", onClickSend, this);
childSetAction("cancel_btn", onClickCancel, this);
enableControls(TRUE);
// convert the position to a string
LLVector3d pos = gAgent.getPositionGlobal();
LLViewerRegion *regionp = gAgent.getRegion();
if (regionp)
{
pos -= regionp->getOriginGlobal();
}
setPosBox(pos);
gReporterInstances.addData(report_type, this);
// Take a screenshot, but don't draw this floater.
setVisible(FALSE);
takeScreenshot();
setVisible(TRUE);
// Default text to be blank
childSetText("object_name", LLStringUtil::null);
childSetText("owner_name", LLStringUtil::null);
childSetFocus("summary_edit");
mDefaultSummary = childGetText("details_edit");
gDialogVisible = TRUE;
// only request details for abuse reports (not BUG reports)
if (report_type != BUG_REPORT)
{
//.........这里部分代码省略.........
开发者ID:kinggoon,项目名称:SingularityViewer,代码行数:101,代码来源:llfloaterreporter.cpp
示例7: childSetVisible
// virtual
void LLFloaterWorldMap::draw()
{
// Hide/Show Mature Events controls
childSetVisible("events_mature_icon", gAgent.canAccessMature());
childSetVisible("events_mature_label", gAgent.canAccessMature());
childSetVisible("event_mature_chk", gAgent.canAccessMature());
childSetVisible("events_adult_icon", gAgent.canAccessMature());
childSetVisible("events_adult_label", gAgent.canAccessMature());
childSetVisible("event_adult_chk", gAgent.canAccessMature());
bool adult_enabled = gAgent.canAccessAdult();
if (!adult_enabled)
{
childSetValue("event_adult_chk", FALSE);
}
childSetEnabled("event_adult_chk", adult_enabled);
// On orientation island, users don't have a home location yet, so don't
// let them teleport "home". It dumps them in an often-crowed welcome
// area (infohub) and they get confused. JC
LLViewerRegion* regionp = gAgent.getRegion();
bool agent_on_prelude = (regionp && regionp->isPrelude());
bool enable_go_home = gAgent.isGodlike() || !agent_on_prelude;
childSetEnabled("Go Home", enable_go_home);
updateLocation();
LLTracker::ETrackingStatus tracking_status = LLTracker::getTrackingStatus();
if (LLTracker::TRACKING_AVATAR == tracking_status)
{
childSetColor("avatar_icon", gTrackColor);
}
else
{
childSetColor("avatar_icon", gDisabledTrackColor);
}
if (LLTracker::TRACKING_LANDMARK == tracking_status)
{
childSetColor("landmark_icon", gTrackColor);
}
else
{
childSetColor("landmark_icon", gDisabledTrackColor);
}
if (LLTracker::TRACKING_LOCATION == tracking_status)
{
childSetColor("location_icon", gTrackColor);
}
else
{
if (mCompletingRegionName != "")
{
F64 seconds = LLTimer::getElapsedSeconds();
double value = fmod(seconds, 2);
value = 0.5 + 0.5*cos(value * 3.14159f);
LLColor4 loading_color(0.0, F32(value/2), F32(value), 1.0);
childSetColor("location_icon", loading_color);
}
else
{
childSetColor("location_icon", gDisabledTrackColor);
}
}
// check for completion of tracking data
if (mWaitingForTracker)
{
centerOnTarget(TRUE);
}
childSetEnabled("Teleport", (BOOL)tracking_status);
// childSetEnabled("Clear", (BOOL)tracking_status);
childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->mIsTrackingUnknownLocation);
childSetEnabled("copy_slurl", (mSLURL.size() > 0) );
setMouseOpaque(TRUE);
getDragHandle()->setMouseOpaque(TRUE);
//RN: snaps to zoom value because interpolation caused jitter in the text rendering
if (!mZoomTimer.getStarted() && mCurZoomVal != (F32)childGetValue("zoom slider").asReal())
{
mZoomTimer.start();
}
F32 interp = mZoomTimer.getElapsedTimeF32() / MAP_ZOOM_TIME;
if (interp > 1.f)
{
interp = 1.f;
mZoomTimer.stop();
}
mCurZoomVal = lerp(mCurZoomVal, (F32)childGetValue("zoom slider").asReal(), interp);
F32 map_scale = 256.f*pow(2.f, mCurZoomVal);
LLWorldMapView::setScale( map_scale );
LLFloater::draw();
}
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:98,代码来源:llfloaterworldmap.cpp
示例8: getString
//.........这里部分代码省略.........
childSetEnabled("checkbox next owner can modify",false);
childSetValue("checkbox next owner can copy",FALSE);
childSetEnabled("checkbox next owner can copy",false);
childSetValue("checkbox next owner can transfer",FALSE);
childSetEnabled("checkbox next owner can transfer",false);
//checkbox for sale
childSetValue("checkbox for sale",FALSE);
childSetEnabled("checkbox for sale",false);
//checkbox include in search
childSetValue("search_check", FALSE);
childSetEnabled("search_check", false);
LLRadioGroup* RadioSaleType = getChild<LLRadioGroup>("sale type");
if(RadioSaleType)
{
RadioSaleType->setSelectedIndex(-1);
RadioSaleType->setEnabled(FALSE);
}
childSetEnabled("Cost",false);
childSetText("Cost",getString("Cost Default"));
childSetText("Edit Cost",LLStringUtil::null);
childSetEnabled("Edit Cost",false);
childSetEnabled("label click action",false);
LLComboBox* ComboClickAction = getChild<LLComboBox>("clickaction");
if(ComboClickAction)
{
ComboClickAction->setEnabled(FALSE);
ComboClickAction->clear();
}
childSetVisible("B:",false);
childSetVisible("O:",false);
childSetVisible("G:",false);
childSetVisible("E:",false);
childSetVisible("N:",false);
childSetVisible("F:",false);
return;
}
// figure out a few variables
BOOL is_one_object = (object_count == 1);
// BUG: fails if a root and non-root are both single-selected.
BOOL is_perm_modify = (LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()
&& LLSelectMgr::getInstance()->selectGetRootsModify())
|| LLSelectMgr::getInstance()->selectGetModify();
const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
S32 string_index = 0;
std::string MODIFY_INFO_STRINGS[] =
{
getString("text modify info 1"),
getString("text modify info 2"),
getString("text modify info 3"),
getString("text modify info 4")
};
if(!is_perm_modify)
{
string_index += 2;
}
if(!is_one_object)
{
++string_index;
开发者ID:VirtualReality,项目名称:Viewer,代码行数:67,代码来源:llpanelpermissions.cpp
示例9: childSetVisible
void LLPanelDirClassified::refresh()
{
BOOL godlike = gAgent.isGodlike();
childSetVisible("Delete", godlike);
childSetEnabled("Delete", godlike);
}
开发者ID:Nora28,项目名称:imprudence,代码行数:6,代码来源:llpaneldirclassified.cpp
示例10: LLPanel
LLStatusBar::LLStatusBar(const std::string& name, const LLRect& rect)
: LLPanel(name, LLRect(), FALSE), // not mouse opaque
mBalance(0),
mHealth(100),
mSquareMetersCredit(0),
mSquareMetersCommitted(0)
{
// status bar can possible overlay menus?
setMouseOpaque(FALSE);
setIsChrome(TRUE);
mBalanceTimer = new LLFrameTimer();
mHealthTimer = new LLFrameTimer();
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml");
// status bar can never get a tab
setFocusRoot(FALSE);
mTextParcelName = getChild<LLTextBox>("ParcelNameText" );
mTextBalance = getChild<LLTextBox>("BalanceText" );
mTextHealth = getChild<LLTextBox>("HealthText" );
mTextTime = getChild<LLTextBox>("TimeText" );
childSetAction("scriptout", onClickScriptDebug, this);
childSetAction("health", onClickHealth, this);
childSetAction("no_fly", onClickFly, this);
childSetAction("buyland", onClickBuyLand, this );
childSetAction("no_build", onClickBuild, this );
childSetAction("no_scripts", onClickScripts, this );
childSetAction("restrictpush", onClickPush, this );
childSetAction("status_no_voice", onClickVoice, this );
childSetCommitCallback("search_editor", onCommitSearch, this);
childSetAction("search_btn", onClickSearch, this);
childSetVisible("search_editor", gSavedSettings.getBOOL("ShowSearchBar"));
childSetVisible("search_btn", gSavedSettings.getBOOL("ShowSearchBar"));
childSetVisible("menubar_search_bevel_bg", gSavedSettings.getBOOL("ShowSearchBar"));
childSetAction("buycurrency", onClickBuyCurrency, this );
childSetActionTextbox("BalanceText", onClickBalance );
childSetActionTextbox("ParcelNameText", onClickParcelInfo );
// TODO: Disable buying currency when connected to non-SL grids
// that don't support currency yet -- MC
LLButton* buybtn = getChild<LLButton>("buycurrency");
buybtn->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
// Adding Net Stat Graph
S32 x = getRect().getWidth() - 2;
S32 y = 0;
LLRect r;
r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1);
mSGBandwidth = new LLStatGraph("BandwidthGraph", r);
mSGBandwidth->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
mSGBandwidth->setStat(&LLViewerStats::getInstance()->mKBitStat);
std::string text = childGetText("bandwidth_tooltip") + " ";
LLUIString bandwidth_tooltip = text; // get the text from XML until this widget is XML driven
mSGBandwidth->setLabel(bandwidth_tooltip.getString());
mSGBandwidth->setUnits("Kbps");
mSGBandwidth->setPrecision(0);
mSGBandwidth->setMouseOpaque(FALSE);
addChild(mSGBandwidth);
x -= SIM_STAT_WIDTH + 2;
r.set( x-SIM_STAT_WIDTH, y+MENU_BAR_HEIGHT-1, x, y+1);
mSGPacketLoss = new LLStatGraph("PacketLossPercent", r);
mSGPacketLoss->setFollows(FOLLOWS_BOTTOM | FOLLOWS_RIGHT);
mSGPacketLoss->setStat(&LLViewerStats::getInstance()->mPacketsLostPercentStat);
text = childGetText("packet_loss_tooltip") + " ";
LLUIString packet_loss_tooltip = text; // get the text from XML until this widget is XML driven
mSGPacketLoss->setLabel(packet_loss_tooltip.getString());
mSGPacketLoss->setUnits("%");
mSGPacketLoss->setMin(0.f);
mSGPacketLoss->setMax(5.f);
mSGPacketLoss->setThreshold(0, 0.5f);
mSGPacketLoss->setThreshold(1, 1.f);
mSGPacketLoss->setThreshold(2, 3.f);
mSGPacketLoss->setPrecision(1);
mSGPacketLoss->setMouseOpaque(FALSE);
mSGPacketLoss->mPerSec = FALSE;
addChild(mSGPacketLoss);
childSetActionTextbox("stat_btn", onClickStatGraph);
}
开发者ID:ArminW,项目名称:imprudence,代码行数:88,代码来源:llstatusbar.cpp
示例11: childGetRect
// Per-frame updates of visibility
void LLStatusBar::refresh()
{
if(gDisconnected)
return; //or crash if the sim crashes; because: already ~LLMenuBarGL()
// Adding Net Stat Meter back in
F32 bwtotal = gViewerThrottle.getMaxBandwidth() / 1000.f;
mSGBandwidth->setMin(0.f);
mSGBandwidth->setMax(bwtotal*1.25f);
mSGBandwidth->setThreshold(0, bwtotal*0.75f);
mSGBandwidth->setThreshold(1, bwtotal);
mSGBandwidth->setThreshold(2, bwtotal);
// Let's not have to reformat time everywhere, shall we? -- MC
gViewerTime->refresh();
mTextTime->setText(gViewerTime->getCurTimeStr());
mTextTime->setToolTip(gViewerTime->getCurDateStr());
LLRect r;
const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge();
S32 x = MENU_RIGHT + MENU_PARCEL_SPACING;
S32 y = 0;
bool search_visible = gSavedSettings.getBOOL("ShowSearchBar");
// reshape menu bar to its content's width
if (MENU_RIGHT != gMenuBarView->getRect().getWidth())
{
gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight());
}
LLViewerRegion *region = gAgent.getRegion();
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
LLRect buttonRect;
if (LLHUDIcon::iconsNearby())
{
childGetRect( "scriptout", buttonRect );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect("scriptout",r);
childSetVisible("scriptout", true);
x += buttonRect.getWidth();
}
else
{
childSetVisible("scriptout", false);
}
if ((region && region->getAllowDamage()) ||
(parcel && parcel->getAllowDamage()) )
{
// set visibility based on flashing
if( mHealthTimer->hasExpired() )
{
childSetVisible("health", true);
}
else
{
BOOL flash = S32(mHealthTimer->getElapsedSeconds() * ICON_FLASH_FREQUENCY) & 1;
childSetVisible("health", flash);
}
mTextHealth->setVisible(TRUE);
// Health
childGetRect( "health", buttonRect );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect("health", r);
x += buttonRect.getWidth();
const S32 health_width = S32( LLFontGL::getFontSansSerifSmall()->getWidth(std::string("100%")) );
r.set(x, y+TEXT_HEIGHT - 2, x+health_width, y);
mTextHealth->setRect(r);
x += health_width;
}
else
{
// invisible if region doesn't allow damage
childSetVisible("health", false);
mTextHealth->setVisible(FALSE);
}
if ((region && region->getBlockFly()) ||
(parcel && !parcel->getAllowFly()) )
{
// No Fly Zone
childGetRect( "no_fly", buttonRect );
childSetVisible( "no_fly", true );
r.setOriginAndSize( x, y, buttonRect.getWidth(), buttonRect.getHeight());
childSetRect( "no_fly", r );
x += buttonRect.getWidth();
}
else
{
// Fly Zone
childSetVisible("no_fly", false);
}
BOOL no_build = parcel && !parcel->getAllowModify();
//.........这里部分代码省略.........
开发者ID:ArminW,项目名称:imprudence,代码行数:101,代码来源:llstatusbar.cpp
示例12: childSetVisible
void LLFloaterBuyCurrencyUI::updateUI()
{
bool hasError = mManager.hasError();
mManager.updateUI(!hasError && !mManager.buying());
// section zero: title area
{
childSetVisible("info_buying", false);
childSetVisible("info_cannot_buy", false);
childSetVisible("info_need_more", false);
if (hasError)
{
childSetVisible("info_cannot_buy", true);
}
else if (mHasTarget)
{
childSetVisible("info_need_more", true);
}
else
{
childSetVisible("info_buying", true);
}
}
// error section
if (hasError)
{
mChildren.setBadge(std::string("step_error"), LLViewChildren::BADGE_ERROR);
LLTextBox* message = getChild<LLTextBox>("error_message");
if (message)
{
message->setVisible(true);
message->setWrappedText(mManager.errorMessage());
}
childSetVisible("error_web", !mManager.errorURI().empty());
if (!mManager.errorURI().empty())
{
childHide("getting_data");
}
}
else
{
childHide("step_error");
childHide("error_message");
childHide("error_web");
}
// currency
childSetVisible("contacting", false);
childSetVisible("buy_action", false);
childSetVisible("buy_action_unknown", false);
if (!hasError)
{
mChildren.setBadge(std::string("step_1"), LLViewChildren::BADGE_NOTE);
if (mManager.buying())
{
childSetVisible("contacting", true);
}
else
{
if (mHasTarget)
{
childSetVisible("buy_action", true);
childSetTextArg("buy_action", "[NAME]", mTargetName);
childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice));
}
else
{
childSetVisible("buy_action_unknown", true);
}
}
S32 balance = gStatusBar->getBalance();
childShow("balance_label");
childShow("balance_amount");
childSetTextArg("balance_amount", "[AMT]", llformat("%d", balance));
S32 buying = mManager.getAmount();
childShow("buying_label");
childShow("buying_amount");
childSetTextArg("buying_amount", "[AMT]", llformat("%d", buying));
S32 total = balance + buying;
childShow("total_label");
childShow("total_amount");
childSetTextArg("total_amount", "[AMT]", llformat("%d", total));
childSetVisible("purchase_warning_repurchase", false);
childSetVisible("purchase_warning_notenough", false);
if (mHasTarget)
{
if (total >= mTargetPrice)
{
childSetVisible("purchase_warning_repurchase", true);
}
//.........这里部分代码省略.........
开发者ID:AlexRa,项目名称:Kirstens-clone,代码行数:101,代码来源:llfloaterbuycurrency.cpp
示例13: childSetText
void LLFloaterBuyLandUI::refreshUI()
{
// section zero: title area
{
LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("info_image");
if (snapshot)
{
snapshot->setImageAssetID(
mParcelValid ? mParcelSnapshot : LLUUID::null);
}
if (mParcelValid)
{
childSetText("info_parcel", mParcelLocation);
LLStringUtil::format_map_t string_args;
string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea);
string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects);
childSetText("info_size", getString("meters_supports_object", string_args));
F32 cost_per_sqm = 0.0f;
if (mParcelActualArea > 0)
{
cost_per_sqm = (F32)mParcelPrice / (F32)mParcelActualArea;
}
LLStringUtil::format_map_t info_price_args;
info_price_args["[PRICE]"] = llformat("%d", mParcelPrice);
info_price_args["[PRICE_PER_SQM]"] = llformat("%.1f", cost_per_sqm);
if (mParcelSoldWithObjects)
{
info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_with_objects");
}
else
{
info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_without_objects");
}
childSetText("info_price", getString("info_price_string", info_price_args));
childSetVisible("info_price", mParcelIsForSale);
}
else
{
childSetText("info_parcel", getString("no_parcel_selected"));
childSetText("info_size", LLStringUtil::null);
childSetText("info_price", LLStringUtil::null);
}
childSetText("info_action",
mCanBuy
?
mIsForGroup
? getString("buying_for_group")//"Buying land for group:"
: getString("buying_will")//"Buying this land will:"
:
mCannotBuyIsError
? getString("cannot_buy_now")//"Cannot buy now:"
: getString("not_for_sale")//"Not for sale:"
);
}
bool showingError = !mCanBuy || !mSiteValid;
// error section
if (showingError)
{
mChildren.setBadge(std::string("step_error"),
mCannotBuyIsError
? LLViewChildren::BADGE_ERROR
: LLViewChildren::BADGE_WARN);
LLTextBox* message = getChild<LLTextBox>("error_message");
if (message)
{
message->setVisible(true);
message->setWrappedText(
!mCanBuy ? mCannotBuyReason : "(waiting for data)"
);
}
childSetVisible("error_web",
mCannotBuyIsError && !mCannotBuyURI.empty());
}
else
{
childHide("step_error");
childHide("error_message");
childHide("error_web");
}
// section one: account
if (!showingError)
{
mChildren.setBadge(std::string("step_1"),
mSiteMembershipUpgrade
? LLViewChildren::BADGE_NOTE
: LLViewChildren::BADGE_OK);
childSetText("account_action", mSiteMembershipAction);
//.........这里部分代码省略.........
开发者ID:Avian-IW,项目名称:InWorldz-Viewer,代码行数:101,代码来源:llfloaterbuyland.cpp
示例14: childSetEnabled
void LLPanelPermissions::disableAll()
{
childSetEnabled("perm_modify", FALSE);
childSetText("perm_modify", LLStringUtil::null);
childSetEnabled("Creator:", FALSE);
childSetText("Creator Name", LLStringUtil::null);
childSetEnabled("Creator Name", FALSE);
childSetEnabled("Owner:", FALSE);
childSetText("Owner Name", LLStringUtil::null);
childSetEnabled("Owner Name", FALSE);
childSetEnabled("Group:", FALSE);
childSetText("Group Name Proxy", LLStringUtil::null);
childSetEnabled("Group Name Proxy", FALSE);
childSetEnabled("button set group", FALSE);
childSetText("Object Name", LLStringUtil::null);
childSetEnabled("Object Name", FALSE);
childSetEnabled("Name:", FALSE);
childSetText("Group Name", LLStringUtil::null);
childSetEnabled("Group Name", FALSE);
childSetEnabled("Description:", FALSE);
childSetText("Object Description", LLStringUtil::null);
childSetEnabled("Object Description", FALSE);
childSetEnabled("Permissions:", FALSE);
childSetValue("checkbox share with group", FALSE);
childSetEnabled("checkbox share with group", FALSE);
childSetEnabled("button deed", FALSE);
childSetValue("checkbox allow everyone move", FALSE);
childSetEnabled("checkbox allow everyone move", FALSE);
childSetValue("checkbox allow everyone copy", FALSE);
childSetEnabled("checkbox allow everyone copy", FALSE);
//Next owner can:
childSetEnabled("Next owner can:", FALSE);
childSetValue("checkbox next owner can modify", FALSE);
childSetEnabled("checkbox next owner can modify", FALSE);
childSetValue("checkbox next owner can copy", FALSE);
childSetEnabled("checkbox next owner can copy", FALSE);
childSetValue("checkbox next owner can transfer", FALSE);
childSetEnabled("checkbox next owner can transfer", FALSE);
//checkbox for sale
childSetValue("checkbox for sale", FALSE);
childSetEnabled("checkbox for sale", FALSE);
//checkbox include in search
childSetValue("search_check", FALSE);
childSetEnabled("search_check", FALSE);
LLComboBox* combo_sale_type = getChild<LLComboBox>("sale type");
combo_sale_type->setValue(LLSaleInfo::FS_COPY);
combo_sale_type->setEnabled(FALSE);
childSetEnabled("Cost", FALSE);
childSetText("Cost", getString("Cost Default"));
childSetText("Edit Cost", LLStringUtil::null);
childSetEnabled("Edit Cost", FALSE);
childSetEnabled("label click action", FALSE);
LLComboBox* combo_click_action = getChild<LLComboBox>("clickaction");
if (combo_click_action)
{
combo_click_action->setEnabled(FALSE);
combo_click_action->clear();
}
childSetVisible("B:", FALSE);
childSetVisible("O:", FALSE);
childSetVisible("G:", FALSE);
childSetVisible("E:", FALSE);
childSetVisible("N:", FALSE);
childSetVisible("F:", FALSE);
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:78,代码来源:llpanelpermissions.cpp
示例15: clearCtrls
void LLPanelVolume::getState( )
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
LLViewerObject* root_objectp = objectp;
if(!objectp)
{
objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
// *FIX: shouldn't we just keep the child?
if (objectp)
{
LLViewerObject* parentp = objectp->getRootEdit();
if (parentp)
{
root_objectp = parentp;
}
else
{
root_objectp = objectp;
}
}
}
LLVOVolume *volobjp = NULL;
if ( objectp && (objectp->getPCode() == LL_PCODE_VOLUME))
{
volobjp = (LLVOVolume *)objectp;
}
if( !objectp )
{
//forfeit focus
if (gFocusMgr.childHasKeyboardFocus(this))
{
gFocusMgr.setKeyboardFocus(NULL);
}
// Disable all text input fields
clearCtrls();
return;
}
BOOL owners_identical;
LLUUID owner_id;
std::string owner_name;
owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
// BUG? Check for all objects being editable?
BOOL editable = root_objectp->permModify();
BOOL single_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )
&& LLSelectMgr::getInstance()->getSelection()->getObjectCount() == 1;
// Select Single Message
if (single_volume)
{
childSetVisible("edit_object",true);
childSetEnabled("edit_object",true);
childSetVisible("select_single",false);
}
else
{
childSetVisible("edit_object",false);
childSetVisible("select_single",true);
childSetEnabled("select_single",true);
}
// Light properties
BOOL is_light = volobjp && volobjp->getIsLight();
childSetValue("Light Checkbox Ctrl",is_light);
childSetEnabled("Light Checkbox Ctrl",editable && single_volume && volobjp);
if (is_light && editable && single_volume)
{
childSetEnabled("label color",true);
//mLabelColor ->setEnabled( TRUE );
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( TRUE );
LightColorSwatch->setValid( TRUE );
LightColorSwatch->set(volobjp->getLightBaseColor());
}
childSetEnabled("label texture",true);
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
if (LightTextureCtrl)
{
LightTextureCtrl->setEnabled(TRUE);
LightTextureCtrl->setValid(TRUE);
LightTextureCtrl->setImageAssetID(volobjp->getLightTextureID());
}
childSetEnabled("Light Intensity",true);
childSetEnabled("Light Radius",true);
childSetEnabled("Light Falloff",true);
childSetEnabled("Light FOV",true);
childSetEnabled("Light Focus",true);
childSetEnabled("Light Ambiance",true);
//.........这里部分代码省略.........
|
请发表评论