本文整理汇总了C++中LLViewerTextEditor::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ LLViewerTextEditor::setEnabled方法的具体用法?C++ LLViewerTextEditor::setEnabled怎么用?C++ LLViewerTextEditor::setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLViewerTextEditor
的用法示例。
在下文中一共展示了LLViewerTextEditor::setEnabled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadAsset
void LLPreviewNotecard::loadAsset()
{
// request the asset.
const LLInventoryItem* item = getItem();
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor)
return;
if(item)
{
if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),
GP_OBJECT_MANIPULATE)
|| gAgent.isGodlike())
{
mAssetID = item->getAssetUUID();
if(mAssetID.isNull())
{
editor->setText(LLStringUtil::null);
editor->makePristine();
editor->setEnabled(TRUE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
else
{
LLHost source_sim = LLHost::invalid;
if (mObjectUUID.notNull())
{
LLViewerObject *objectp = gObjectList.findObject(mObjectUUID);
if (objectp && objectp->getRegion())
{
source_sim = objectp->getRegion()->getHost();
}
else
{
// The object that we're trying to look at disappeared, bail.
llwarns << "Can't find object " << mObjectUUID << " associated with notecard." << llendl;
mAssetID.setNull();
editor->setText(getString("no_object"));
editor->makePristine();
editor->setEnabled(FALSE);
mAssetStatus = PREVIEW_ASSET_LOADED;
return;
}
}
gAssetStorage->getInvItemAsset(source_sim,
gAgent.getID(),
gAgent.getSessionID(),
item->getPermissions().getOwner(),
mObjectUUID,
item->getUUID(),
item->getAssetUUID(),
item->getType(),
&onLoadComplete,
(void*)new LLUUID(mItemUUID),
TRUE);
mAssetStatus = PREVIEW_ASSET_LOADING;
}
}
else
{
mAssetID.setNull();
editor->setText(getString("not_allowed"));
editor->makePristine();
editor->setEnabled(FALSE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
if(!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(),
GP_OBJECT_MANIPULATE))
{
editor->setEnabled(FALSE);
getChildView("lock")->setVisible( TRUE);
}
}
else
{
editor->setText(LLStringUtil::null);
editor->makePristine();
editor->setEnabled(TRUE);
// Don't set asset status here; we may not have set the item id yet
// (e.g. when this gets called initially)
//mAssetStatus = PREVIEW_ASSET_LOADED;
}
}
示例2: loadAsset
void LLPreviewNotecard::loadAsset()
{
// request the asset.
const LLInventoryItem* item = getItem();
LLViewerTextEditor* editor = LLViewerUICtrlFactory::getViewerTextEditorByName(this, "Notecard Editor");
if (!editor)
return;
if(item)
{
if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),
GP_OBJECT_MANIPULATE)
|| gAgent.isGodlike())
{
mAssetID = item->getAssetUUID();
if(mAssetID.isNull())
{
editor->setText(LLString::null);
editor->makePristine();
editor->setEnabled(TRUE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
else
{
LLUUID* new_uuid = new LLUUID(mItemUUID);
LLHost source_sim = LLHost::invalid;
if (mObjectUUID.notNull())
{
LLViewerObject *objectp = gObjectList.findObject(mObjectUUID);
if (objectp && objectp->getRegion())
{
source_sim = objectp->getRegion()->getHost();
}
else
{
// The object that we're trying to look at disappeared, bail.
llwarns << "Can't find object " << mObjectUUID << " associated with notecard." << llendl;
mAssetID.setNull();
editor->setText(childGetText("no_object"));
editor->makePristine();
editor->setEnabled(FALSE);
mAssetStatus = PREVIEW_ASSET_LOADED;
delete new_uuid;
return;
}
}
gAssetStorage->getInvItemAsset(source_sim,
gAgent.getID(),
gAgent.getSessionID(),
item->getPermissions().getOwner(),
mObjectUUID,
item->getUUID(),
item->getAssetUUID(),
item->getType(),
&onLoadComplete,
(void*)new_uuid,
TRUE);
mAssetStatus = PREVIEW_ASSET_LOADING;
}
}
else
{
mAssetID.setNull();
editor->setText(childGetText("not_allowed"));
editor->makePristine();
editor->setEnabled(FALSE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
if(!gAgent.allowOperation(PERM_MODIFY, item->getPermissions(),
GP_OBJECT_MANIPULATE))
{
editor->setEnabled(FALSE);
childSetVisible("lock", TRUE);
}
}
else
{
editor->setText(LLString::null);
editor->makePristine();
editor->setEnabled(TRUE);
mAssetStatus = PREVIEW_ASSET_LOADED;
}
}