本文整理汇总了C++中LLColorSwatchCtrl类的典型用法代码示例。如果您正苦于以下问题:C++ LLColorSwatchCtrl类的具体用法?C++ LLColorSwatchCtrl怎么用?C++ LLColorSwatchCtrl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLColorSwatchCtrl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onColorControlMoved
// color control callbacks
void LLFloaterEditSky::onColorControlMoved(LLUICtrl* ctrl, WLColorControl* color_ctrl)
{
LLWLParamManager::getInstance()->mAnimator.deactivate();
LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
LLVector4 color_vec(swatch->get().mV);
// Set intensity to maximum of the RGB values.
color_vec.mV[3] = llmax(color_vec.mV[0], llmax(color_vec.mV[1], color_vec.mV[2]));
// Multiply RGB values by the appropriate factor.
F32 k = WL_CLOUD_SLIDER_SCALE;
if (color_ctrl->isSunOrAmbientColor)
{
k = WL_SUN_AMBIENT_SLIDER_SCALE;
}
if (color_ctrl->isBlueHorizonOrDensity)
{
k = WL_BLUE_HORIZON_DENSITY_SCALE;
}
color_vec *= k; // intensity isn't affected by the multiplication
// Apply the new RGBI value.
*color_ctrl = color_vec;
color_ctrl->update(LLWLParamManager::getInstance()->mCurParams);
LLWLParamManager::getInstance()->propagateParameters();
}
示例2: childSetEnabled
// virtual
void LLPanelVolume::clearCtrls()
{
LLPanel::clearCtrls();
childSetEnabled("select_single",false);
childSetVisible("select_single",true);
childSetEnabled("edit_object",false);
childSetVisible("edit_object",false);
childSetEnabled("Light Checkbox Ctrl",false);
childSetEnabled("label color",false);
childSetEnabled("label color",false);
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( FALSE );
LightColorSwatch->setValid( FALSE );
}
childSetEnabled("Light Intensity",false);
childSetEnabled("Light Radius",false);
childSetEnabled("Light Falloff",false);
childSetEnabled("Flexible1D Checkbox Ctrl",false);
childSetEnabled("FlexNumSections",false);
childSetEnabled("FlexGravity",false);
childSetEnabled("FlexTension",false);
childSetEnabled("FlexFriction",false);
childSetEnabled("FlexWind",false);
childSetEnabled("FlexForceX",false);
childSetEnabled("FlexForceY",false);
childSetEnabled("FlexForceZ",false);
}
示例3: onColorChanged
//////////////////////////////////////////////////////////////////////////////
// called (infrequently) when the color changes so the subject of the swatch can be updated.
void LLColorSwatchCtrl::onColorChanged ( void* data, EColorPickOp pick_op )
{
LLColorSwatchCtrl* subject = ( LLColorSwatchCtrl* )data;
if ( subject )
{
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)subject->mPickerHandle.get();
if (pickerp)
{
// move color across from selector to internal widget storage
LLColor4 updatedColor ( pickerp->getCurR (),
pickerp->getCurG (),
pickerp->getCurB (),
subject->mColor.mV[VALPHA] ); // keep current alpha
subject->mColor = updatedColor;
subject->setControlValue(updatedColor.getValue());
if (pick_op == COLOR_CANCEL && subject->mOnCancelCallback)
{
subject->mOnCancelCallback(subject, subject->mCallbackUserData);
}
else if (pick_op == COLOR_SELECT && subject->mOnSelectCallback)
{
subject->mOnSelectCallback(subject, subject->mCallbackUserData);
}
else
{
// just commit change
subject->onCommit ();
}
}
}
}
示例4: setVisible
void LLFloaterColorPicker::showUI ()
{
setVisible ( TRUE );
setFocus ( TRUE );
openFloater(getKey());
// HACK: if system color picker is required - close the SL one we made and use default system dialog
if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
{
LLColorSwatchCtrl* swatch = getSwatch ();
setVisible ( FALSE );
// code that will get switched in for default system color picker
if ( swatch )
{
LLColor4 curCol = swatch->get ();
send_agent_pause();
getWindow()->dialogColorPicker( &curCol [ 0 ], &curCol [ 1 ], &curCol [ 2 ] );
send_agent_resume();
setOrigRgb ( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] );
setCurRgb( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] );
LLColorSwatchCtrl::onColorChanged ( swatch, LLColorSwatchCtrl::COLOR_CHANGE );
}
closeFloater();
}
}
示例5: onChangeWaterColor
void LLFloaterEnvSettings::onChangeWaterColor(LLUICtrl* ctrl, WaterColorControl* colorControl)
{
LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
*colorControl = swatch->get();
colorControl->update(LLWaterParamManager::instance()->mCurParams);
LLWaterParamManager::instance()->propagateParameters();
}
示例6: onWaterFogColorMoved
void LLFloaterWater::onWaterFogColorMoved(LLUICtrl* ctrl, WaterColorControl* color_ctrl)
{
LLColorSwatchCtrl* swatch = static_cast<LLColorSwatchCtrl*>(ctrl);
*color_ctrl = swatch->get();
color_ctrl->update(LLWaterParamManager::getInstance()->mCurParams);
LLWaterParamManager::getInstance()->propagateParameters();
}
示例7: onLightCancelColor
void LLPanelVolume::onLightCancelColor(const LLSD& data)
{
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setColor(mLightSavedColor);
}
onLightSelectColor(data);
}
示例8: sendColor
void LLPanelFace::sendColor()
{
LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(!mColorSwatch)return;
LLColor4 color = mColorSwatch->get();
LLSelectMgr::getInstance()->selectionSetColorOnly( color );
}
示例9: onCommitLight
// static
void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
LLViewerObject* objectp = self->mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLVOVolume *volobjp = (LLVOVolume *)objectp;
volobjp->setLightIntensity((F32)self->getChild<LLUICtrl>("Light Intensity")->getValue().asReal());
volobjp->setLightRadius((F32)self->getChild<LLUICtrl>("Light Radius")->getValue().asReal());
volobjp->setLightFalloff((F32)self->getChild<LLUICtrl>("Light Falloff")->getValue().asReal());
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LLColor4 clr = LightColorSwatch->get();
volobjp->setLightColor(LLColor3(clr));
}
LLTextureCtrl* LightTextureCtrl = self->getChild<LLTextureCtrl>("light texture control");
if(LightTextureCtrl)
{
LLUUID id = LightTextureCtrl->getImageAssetID();
if (id.notNull())
{
if (!volobjp->isLightSpotlight())
{ //this commit is making this a spot light, set UI to default params
volobjp->setLightTextureID(id);
LLVector3 spot_params = volobjp->getSpotLightParams();
self->getChild<LLUICtrl>("Light FOV")->setValue(spot_params.mV[0]);
self->getChild<LLUICtrl>("Light Focus")->setValue(spot_params.mV[1]);
self->getChild<LLUICtrl>("Light Ambiance")->setValue(spot_params.mV[2]);
}
else
{ //modifying existing params
LLVector3 spot_params;
spot_params.mV[0] = (F32) self->getChild<LLUICtrl>("Light FOV")->getValue().asReal();
spot_params.mV[1] = (F32) self->getChild<LLUICtrl>("Light Focus")->getValue().asReal();
spot_params.mV[2] = (F32) self->getChild<LLUICtrl>("Light Ambiance")->getValue().asReal();
volobjp->setSpotLightParams(spot_params);
}
}
else if (volobjp->isLightSpotlight())
{ //no longer a spot light
volobjp->setLightTextureID(id);
//self->getChildView("Light FOV")->setEnabled(FALSE);
//self->getChildView("Light Focus")->setEnabled(FALSE);
//self->getChildView("Light Ambiance")->setEnabled(FALSE);
}
}
}
示例10: onLightCancelColor
void LLPanelVolume::onLightCancelColor(LLUICtrl* ctrl, void* userdata)
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setColor(self->mLightSavedColor);
}
onLightSelectColor(NULL, userdata);
}
示例11: onBackgroundChange
void lggBeamMapFloater::onBackgroundChange(LLUICtrl* ctrl, void* userdata)
{
lggBeamMapFloater* self = (lggBeamMapFloater*)userdata;
LLColorSwatchCtrl* cctrl = (LLColorSwatchCtrl*)ctrl;
if(cctrl)
{
self->getChild<LLPanel>("beamshape_draw")->setBackgroundColor(cctrl->get());
}
}
示例12: getChildView
// virtual
void LLPanelVolume::clearCtrls()
{
LLPanel::clearCtrls();
getChildView("select_single")->setEnabled(false);
getChildView("select_single")->setVisible(true);
getChildView("edit_object")->setEnabled(false);
getChildView("edit_object")->setVisible(false);
getChildView("Light Checkbox Ctrl")->setEnabled(false);
getChildView("label color")->setEnabled(false);
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LightColorSwatch->setEnabled( FALSE );
LightColorSwatch->setValid( FALSE );
}
childSetEnabled("label texture",false);
LLTextureCtrl* LightTextureCtrl = getChild<LLTextureCtrl>("light texture control");
if(LightTextureCtrl)
{
LightTextureCtrl->setEnabled( FALSE );
LightTextureCtrl->setValid( FALSE );
}
getChildView("Light Intensity")->setEnabled(false);
getChildView("Light Radius")->setEnabled(false);
getChildView("Light Falloff")->setEnabled(false);
getChildView("Flexible1D Checkbox Ctrl")->setEnabled(false);
getChildView("FlexNumSections")->setEnabled(false);
getChildView("FlexGravity")->setEnabled(false);
getChildView("FlexTension")->setEnabled(false);
getChildView("FlexFriction")->setEnabled(false);
getChildView("FlexWind")->setEnabled(false);
getChildView("FlexForceX")->setEnabled(false);
getChildView("FlexForceY")->setEnabled(false);
getChildView("FlexForceZ")->setEnabled(false);
#if MESH_ENABLED
mSpinPhysicsGravity->setEnabled(FALSE);
mSpinPhysicsFriction->setEnabled(FALSE);
mSpinPhysicsDensity->setEnabled(FALSE);
mSpinPhysicsRestitution->setEnabled(FALSE);
#endif //MESH_ENABLED
}
示例13: childSetCommitCallback
BOOL LLPanelVolume::postBuild()
{
// Flexible Objects Parameters
{
childSetCommitCallback("Flexible1D Checkbox Ctrl",onCommitIsFlexible,this);
childSetCommitCallback("FlexNumSections",onCommitFlexible,this);
childSetValidate("FlexNumSections",precommitValidate);
childSetCommitCallback("FlexGravity",onCommitFlexible,this);
childSetValidate("FlexGravity",precommitValidate);
childSetCommitCallback("FlexFriction",onCommitFlexible,this);
childSetValidate("FlexFriction",precommitValidate);
childSetCommitCallback("FlexWind",onCommitFlexible,this);
childSetValidate("FlexWind",precommitValidate);
childSetCommitCallback("FlexTension",onCommitFlexible,this);
childSetValidate("FlexTension",precommitValidate);
childSetCommitCallback("FlexForceX",onCommitFlexible,this);
childSetValidate("FlexForceX",precommitValidate);
childSetCommitCallback("FlexForceY",onCommitFlexible,this);
childSetValidate("FlexForceY",precommitValidate);
childSetCommitCallback("FlexForceZ",onCommitFlexible,this);
childSetValidate("FlexForceZ",precommitValidate);
}
// LIGHT Parameters
{
childSetCommitCallback("Light Checkbox Ctrl",onCommitIsLight,this);
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch){
LightColorSwatch->setOnCancelCallback(onLightCancelColor);
LightColorSwatch->setOnSelectCallback(onLightSelectColor);
childSetCommitCallback("colorswatch",onCommitLight,this);
}
childSetCommitCallback("Light Intensity",onCommitLight,this);
childSetValidate("Light Intensity",precommitValidate);
childSetCommitCallback("Light Radius",onCommitLight,this);
childSetValidate("Light Radius",precommitValidate);
childSetCommitCallback("Light Falloff",onCommitLight,this);
childSetValidate("Light Falloff",precommitValidate);
}
// Start with everyone disabled
clearCtrls();
return TRUE;
}
示例14: onLightSelectColor
void LLPanelVolume::onLightSelectColor(const LLSD& data)
{
LLViewerObject* objectp = mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLVOVolume *volobjp = (LLVOVolume *)objectp;
LLColorSwatchCtrl* LightColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LLColor4 clr = LightColorSwatch->get();
LLColor3 clr3( clr );
volobjp->setLightColor(clr3);
mLightSavedColor = clr;
}
}
示例15: onCommitLight
// static
void LLPanelVolume::onCommitLight( LLUICtrl* ctrl, void* userdata )
{
LLPanelVolume* self = (LLPanelVolume*) userdata;
LLViewerObject* objectp = self->mObject;
if (!objectp || (objectp->getPCode() != LL_PCODE_VOLUME))
{
return;
}
LLVOVolume *volobjp = (LLVOVolume *)objectp;
volobjp->setLightIntensity((F32)self->childGetValue("Light Intensity").asReal());
volobjp->setLightRadius((F32)self->childGetValue("Light Radius").asReal());
volobjp->setLightFalloff((F32)self->childGetValue("Light Falloff").asReal());
LLColorSwatchCtrl* LightColorSwatch = self->getChild<LLColorSwatchCtrl>("colorswatch");
if(LightColorSwatch)
{
LLColor4 clr = LightColorSwatch->get();
volobjp->setLightColor(LLColor3(clr));
}
}