本文整理汇总了C++中LLFloaterColorPicker类的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterColorPicker类的具体用法?C++ LLFloaterColorPicker怎么用?C++ LLFloaterColorPicker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LLFloaterColorPicker类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LLFloaterColorPicker
void LLColorSwatchCtrl::showPicker(BOOL take_focus)
{
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (!pickerp)
{
pickerp = new LLFloaterColorPicker(this, mCanApplyImmediately);
LLFloater* parent = gFloaterView->getParentFloater(this);
if (parent)
{
parent->addDependentFloater(pickerp);
}
mPickerHandle = pickerp->getHandle();
}
// initialize picker with current color
pickerp->initUI ( mColor.mV [ VRED ], mColor.mV [ VGREEN ], mColor.mV [ VBLUE ] );
// display it
pickerp->showUI ();
if (take_focus)
{
pickerp->setFocus(TRUE);
}
}
示例2: 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 ();
}
}
}
}
示例3: setOriginal
// forces color of this swatch and any associated floater to the input value, if currently invalid
void LLColorSwatchCtrl::setOriginal(const LLColor4& color)
{
mColor = color;
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (pickerp)
{
pickerp->setOrigRgb(mColor.mV[VRED], mColor.mV[VGREEN], mColor.mV[VBLUE]);
}
}
示例4: setValid
void LLColorSwatchCtrl::setValid(BOOL valid )
{
mValid = valid;
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (pickerp)
{
pickerp->setActive(valid);
}
}
示例5:
LLColorSwatchCtrl::~LLColorSwatchCtrl ()
{
// parent dialog is destroyed so we are too and we need to cancel selection
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (pickerp)
{
pickerp->cancelSelection();
pickerp->closeFloater();
}
}
示例6: onTextCommit
//////////////////////////////////////////////////////////////////////////////
// called when 'text is committed' - i,e. focus moves from a text field
void LLFloaterColorPicker::onTextCommit ( LLUICtrl* ctrl, void* data )
{
if ( data )
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self )
{
self->onTextEntryChanged ( ctrl );
}
}
}
示例7: closeFloaterColorPicker
// This is called when the main floatercustomize panel is closed.
// Since this class has pointers up to its parents, we need to cleanup
// this class first in order to avoid a crash.
void LLColorSwatchCtrl::closeFloaterColorPicker()
{
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (pickerp)
{
pickerp->setSwatch(NULL);
pickerp->closeFloater();
}
mPickerHandle.markDead();
}
示例8: onColorSelect
void LLFloaterColorPicker::onColorSelect( const LLTextureEntry& te, void *data )
{
LLFloaterColorPicker* self = (LLFloaterColorPicker*)data;
if (self)
{
self->setCurRgb(te.getColor().mV[VRED], te.getColor().mV[VGREEN], te.getColor().mV[VBLUE]);
if (self->mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
}
示例9: onImmediateCheck
void LLFloaterColorPicker::onImmediateCheck( LLUICtrl* ctrl, void* data)
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if (self)
{
gSavedSettings.setBOOL("ApplyColorImmediately", self->mApplyImmediateCheck->get());
if (self->mApplyImmediateCheck->get())
{
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_CHANGE );
}
}
}
示例10: onClickCancel
//////////////////////////////////////////////////////////////////////////////
// called when 'cancel' clicked
void LLFloaterColorPicker::onClickCancel ( void* data )
{
if (data)
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self )
{
self->cancelSelection ();
self->closeFloater();
}
}
}
示例11: set
void LLColorSwatchCtrl::set(const LLColor4& color, BOOL update_picker, BOOL from_event)
{
mColor = color;
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (pickerp && update_picker)
{
pickerp->setCurRgb(mColor.mV[VRED], mColor.mV[VGREEN], mColor.mV[VBLUE]);
}
if (!from_event)
{
setControlValue(mColor.getValue());
}
}
示例12: onClickCopyLSL
// <FS:Zi> Add float LSL color entry widgets
void LLFloaterColorPicker::onClickCopyLSL ( void* data )
{
if (data)
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self )
{
getWindow()->copyTextToClipboard(utf8str_to_wstring(llformat("<%.3f, %.3f, %.3f>",self->getCurR(),self->getCurG(),self->getCurB())));
LLNotificationsUtil::add("LSLColorCopiedToClipboard");
}
}
}
示例13: onClickSelect
//////////////////////////////////////////////////////////////////////////////
// called when 'select' clicked
void LLFloaterColorPicker::onClickSelect ( void* data )
{
if (data)
{
LLFloaterColorPicker* self = ( LLFloaterColorPicker* )data;
if ( self )
{
// apply to selection
LLColorSwatchCtrl::onColorChanged ( self->getSwatch (), LLColorSwatchCtrl::COLOR_SELECT );
self->closeFloater();
}
}
}
示例14: setEnabled
void LLColorSwatchCtrl::setEnabled( BOOL enabled )
{
mCaption->setEnabled( enabled );
LLView::setEnabled( enabled );
if (!enabled)
{
LLFloaterColorPicker* pickerp = (LLFloaterColorPicker*)mPickerHandle.get();
if (pickerp)
{
pickerp->cancelSelection();
pickerp->close();
}
}
}