本文整理汇总了C++中LLColorSwatchCtrl::setEnabled方法的典型用法代码示例。如果您正苦于以下问题:C++ LLColorSwatchCtrl::setEnabled方法的具体用法?C++ LLColorSwatchCtrl::setEnabled怎么用?C++ LLColorSwatchCtrl::setEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLColorSwatchCtrl
的用法示例。
在下文中一共展示了LLColorSwatchCtrl::setEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getState
void LLPanelFace::getState()
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
if( objectp
&& objectp->getPCode() == LL_PCODE_VOLUME
&& objectp->permModify())
{
BOOL editable = objectp->permModify();
// only turn on auto-adjust button if there is a media renderer and the media is loaded
childSetEnabled("textbox autofix",FALSE);
//mLabelTexAutoFix->setEnabled ( FALSE );
childSetEnabled("button align",FALSE);
//mBtnAutoFix->setEnabled ( FALSE );
if(LLViewerMedia::hasMedia())
{
childSetEnabled("textbox autofix",editable);
childSetEnabled("button align",editable);
}
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
// {
//
// //mLabelTexAutoFix->setEnabled ( editable );
//
// //mBtnAutoFix->setEnabled ( editable );
// }
childSetEnabled("button apply",editable);
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
// Texture
{
LLUUID id;
struct f1 : public LLSelectedTEGetFunctor<LLUUID>
{
LLUUID get(LLViewerObject* object, S32 te)
{
LLViewerImage* image = object->getTEImage(te);
return image ? image->getID() : LLUUID::null;
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );
if (identical)
{
// All selected have the same texture
if(texture_ctrl)
{
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
else
{
if(texture_ctrl)
{
if( id.isNull() )
{
// None selected
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( FALSE );
texture_ctrl->setImageAssetID( LLUUID::null );
}
else
{
// Tentative: multiple selected with different textures
texture_ctrl->setTentative( TRUE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
}
}
LLAggregatePermissions texture_perms;
if(texture_ctrl)
{
// texture_ctrl->setValid( editable );
if (LLSelectMgr::getInstance()->selectGetAggregateTexturePermissions(texture_perms))
{
BOOL can_copy =
texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_EMPTY ||
texture_perms.getValue(PERM_COPY) == LLAggregatePermissions::AP_ALL;
BOOL can_transfer =
texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_EMPTY ||
texture_perms.getValue(PERM_TRANSFER) == LLAggregatePermissions::AP_ALL;
texture_ctrl->setCanApplyImmediately(can_copy && can_transfer);
}
else
{
texture_ctrl->setCanApplyImmediately(FALSE);
}
}
//.........这里部分代码省略.........
示例2: getState
void LLPanelFace::getState()
{
LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject();
LLCalc* calcp = LLCalc::getInstance();
if( objectp
&& objectp->getPCode() == LL_PCODE_VOLUME
// <edit>
//&& objectp->permModify())
)
// </edit>
{
// <edit>
//BOOL editable = objectp->permModify();
BOOL editable = TRUE;
// </edit>
// only turn on auto-adjust button if there is a media renderer and the media is loaded
childSetEnabled("textbox autofix",FALSE);
//mLabelTexAutoFix->setEnabled ( FALSE );
childSetEnabled("button align",FALSE);
//mBtnAutoFix->setEnabled ( FALSE );
//if ( LLMediaEngine::getInstance()->getMediaRenderer () )
// if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () )
// {
//
// //mLabelTexAutoFix->setEnabled ( editable );
//
// //mBtnAutoFix->setEnabled ( editable );
// }
S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME ))
&& (selected_count == 1);
childSetEnabled("copytextures", single_volume && editable);
childSetEnabled("pastetextures", single_volume && editable);
childSetEnabled("textbox params", single_volume && editable);
childSetEnabled("button apply",editable);
bool identical;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control");
// Texture
{
LLUUID id;
struct f1 : public LLSelectedTEGetFunctor<LLUUID>
{
LLUUID get(LLViewerObject* object, S32 te)
{
LLViewerImage* image = object->getTEImage(te);
return image ? image->getID() : LLUUID::null;
}
} func;
identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id );
if (identical)
{
// All selected have the same texture
if(texture_ctrl)
{
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
else
{
if(texture_ctrl)
{
if( id.isNull() )
{
// None selected
texture_ctrl->setTentative( FALSE );
texture_ctrl->setEnabled( FALSE );
texture_ctrl->setImageAssetID( LLUUID::null );
}
else
{
// Tentative: multiple selected with different textures
texture_ctrl->setTentative( TRUE );
texture_ctrl->setEnabled( editable );
texture_ctrl->setImageAssetID( id );
}
}
}
if(LLViewerMedia::textureHasMedia(id))
{
childSetEnabled("textbox autofix",editable);
childSetEnabled("button align",editable);
}
}
LLAggregatePermissions texture_perms;
if(texture_ctrl)
{
// texture_ctrl->setValid( editable );
//.........这里部分代码省略.........
示例3: getState
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);
//.........这里部分代码省略.........
示例4: getState
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)
{
getChildView("edit_object")->setVisible(true);
getChildView("edit_object")->setEnabled(true);
getChildView("select_single")->setVisible(false);
}
else
{
getChildView("edit_object")->setVisible(false);
getChildView("select_single")->setVisible(true);
getChildView("select_single")->setEnabled(true);
}
// Light properties
BOOL is_light = volobjp && volobjp->getIsLight();
getChild<LLUICtrl>("Light Checkbox Ctrl")->setValue(is_light);
getChildView("Light Checkbox Ctrl")->setEnabled(editable && single_volume && volobjp);
if (is_light && editable && single_volume)
{
getChildView("label color")->setEnabled(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());
}
getChildView("Light Intensity")->setEnabled(true);
getChildView("Light Radius")->setEnabled(true);
getChildView("Light Falloff")->setEnabled(true);
getChildView("Light FOV")->setEnabled(true);
getChildView("Light Focus")->setEnabled(true);
getChildView("Light Ambiance")->setEnabled(true);
//.........这里部分代码省略.........
示例5: getState
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 = TRUE;
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("Light Intensity",true);
childSetEnabled("Light Radius",true);
childSetEnabled("Light Falloff",true);
childSetValue("Light Intensity",volobjp->getLightIntensity());
childSetValue("Light Radius",volobjp->getLightRadius());
childSetValue("Light Falloff",volobjp->getLightFalloff());
mLightSavedColor = volobjp->getLightColor();
}
else
{
getChild<LLSpinCtrl>("Light Intensity", true)->clear();
getChild<LLSpinCtrl>("Light Radius", true)->clear();
getChild<LLSpinCtrl>("Light Falloff", true)->clear();
childSetEnabled("label color",false);
//.........这里部分代码省略.........