当前位置: 首页>>代码示例>>C++>>正文


C++ LLViewerTextEditor::setEnabled方法代码示例

本文整理汇总了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;
	}
}
开发者ID:Katharine,项目名称:kittyviewer,代码行数:85,代码来源:llpreviewnotecard.cpp

示例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;
    }
}
开发者ID:Boy,项目名称:netbook,代码行数:85,代码来源:llpreviewnotecard.cpp


注:本文中的LLViewerTextEditor::setEnabled方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。