本文整理汇总了C++中LLFloaterColorPicker::getCurG方法的典型用法代码示例。如果您正苦于以下问题:C++ LLFloaterColorPicker::getCurG方法的具体用法?C++ LLFloaterColorPicker::getCurG怎么用?C++ LLFloaterColorPicker::getCurG使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLFloaterColorPicker
的用法示例。
在下文中一共展示了LLFloaterColorPicker::getCurG方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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 ();
}
}
}
}
示例2: 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");
}
}
}