LLColorSwatchCtrl Class Reference

#include <llcolorswatch.h>

Inheritance diagram for LLColorSwatchCtrl:

Inheritance graph
[legend]
Collaboration diagram for LLColorSwatchCtrl:

Collaboration graph
[legend]
List of all members.

Public Types

typedef enum LLColorSwatchCtrl::e_color_pick_op EColorPickOp
 COLOR_CHANGE
 COLOR_SELECT
 COLOR_CANCEL
enum  e_color_pick_op { COLOR_CHANGE, COLOR_SELECT, COLOR_CANCEL }

Public Member Functions

 LLColorSwatchCtrl (const std::string &name, const LLRect &rect, const LLColor4 &color, void(*on_commit_callback)(LLUICtrl *ctrl, void *userdata), void *callback_userdata)
 LLColorSwatchCtrl (const std::string &name, const LLRect &rect, const std::string &label, const LLColor4 &color, void(*on_commit_callback)(LLUICtrl *ctrl, void *userdata), void *callback_userdata)
 ~LLColorSwatchCtrl ()
virtual void setValue (const LLSD &value)
virtual EWidgetType getWidgetType () const
virtual LLString getWidgetTag () const
virtual LLSD getValue () const
const LLColor4get ()
void set (const LLColor4 &color, BOOL update_picker=FALSE, BOOL from_event=FALSE)
void setOriginal (const LLColor4 &color)
void setValid (BOOL valid)
void setLabel (const std::string &label)
void setCanApplyImmediately (BOOL apply)
void setOnCancelCallback (LLUICtrlCallback cb)
void setOnSelectCallback (LLUICtrlCallback cb)
void showPicker (BOOL take_focus)
virtual BOOL handleMouseDown (S32 x, S32 y, MASK mask)
virtual BOOL handleMouseUp (S32 x, S32 y, MASK mask)
virtual BOOL handleDoubleClick (S32 x, S32 y, MASK mask)
virtual BOOL handleHover (S32 x, S32 y, MASK mask)
virtual BOOL handleUnicodeCharHere (llwchar uni_char, BOOL called_from_parent)
virtual void draw ()
virtual void setEnabled (BOOL enabled)
virtual LLXMLNodePtr getXML (bool save_children=true) const

Static Public Member Functions

static LLViewfromXML (LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)
static void onColorChanged (void *data, EColorPickOp pick_op=COLOR_CHANGE)

Protected Attributes

BOOL mValid
LLColor4 mColor
LLColor4 mBorderColor
LLTextBoxmCaption
LLViewHandle mPickerHandle
LLViewBordermBorder
BOOL mCanApplyImmediately
LLUICtrlCallback mOnCancelCallback
LLUICtrlCallback mOnSelectCallback
LLPointer< LLViewerImagemAlphaGradientImage

Detailed Description

Definition at line 48 of file llcolorswatch.h.


Member Typedef Documentation

typedef enum LLColorSwatchCtrl::e_color_pick_op LLColorSwatchCtrl::EColorPickOp


Member Enumeration Documentation

enum LLColorSwatchCtrl::e_color_pick_op

Enumerator:
COLOR_CHANGE 
COLOR_SELECT 
COLOR_CANCEL 

Definition at line 52 of file llcolorswatch.h.


Constructor & Destructor Documentation

LLColorSwatchCtrl::LLColorSwatchCtrl ( const std::string &  name,
const LLRect rect,
const LLColor4 color,
void(*)(LLUICtrl *ctrl, void *userdata)  on_commit_callback,
void callback_userdata 
)

Definition at line 52 of file llcolorswatch.cpp.

References LLView::addChild(), LLViewBorder::BEVEL_IN, BTN_HEIGHT_SMALL, FOLLOWS_BOTTOM, FOLLOWS_LEFT, FOLLOWS_RIGHT, LLRectBase< Type >::getHeight(), LLViewerImageList::getImageFromUUID(), LLControlGroup::getString(), LLRectBase< Type >::getWidth(), gImageList, gViewerArt, mAlphaGradientImage, mBorder, mCaption, MIPMAP_FALSE, LLView::mRect, LLStringBase< char >::null, LLView::setFollows(), LLFontGL::sSansSerifSmall, and TRUE.

Referenced by fromXML().

LLColorSwatchCtrl::LLColorSwatchCtrl ( const std::string &  name,
const LLRect rect,
const std::string &  label,
const LLColor4 color,
void(*)(LLUICtrl *ctrl, void *userdata)  on_commit_callback,
void callback_userdata 
)

Definition at line 80 of file llcolorswatch.cpp.

References LLView::addChild(), LLViewBorder::BEVEL_IN, BTN_HEIGHT_SMALL, FOLLOWS_BOTTOM, FOLLOWS_LEFT, FOLLOWS_RIGHT, LLRectBase< Type >::getHeight(), LLViewerImageList::getImageFromUUID(), LLControlGroup::getString(), LLRectBase< Type >::getWidth(), gImageList, gViewerArt, mAlphaGradientImage, mBorder, mCaption, MIPMAP_FALSE, LLView::mRect, LLStringBase< char >::null, LLView::setFollows(), LLFontGL::sSansSerifSmall, and TRUE.

LLColorSwatchCtrl::~LLColorSwatchCtrl (  ) 

Definition at line 108 of file llcolorswatch.cpp.

References LLFloaterColorPicker::cancelSelection(), LLFloater::close(), LLFloater::getFloaterByHandle(), mAlphaGradientImage, mPickerHandle, and NULL.


Member Function Documentation

void LLColorSwatchCtrl::draw (  )  [virtual]

Reimplemented from LLView.

Definition at line 203 of file llcolorswatch.cpp.

References LLViewerImage::bindTexture(), LLColor4::black, border, BTN_HEIGHT_SMALL, LLView::draw(), FALSE, LLRectBase< Type >::getHeight(), LLView::getVisible(), LLRectBase< Type >::getWidth(), gl_draw_x(), gl_rect_2d(), gl_rect_2d_checkerboard(), gl_rect_2d_simple_tex(), glColor4fv, glPopMatrix, glTranslatef, LLColor4::grey, LLUICtrl::hasFocus(), mAlphaGradientImage, mBorder, mBorderColor, LLRectBase< Type >::mBottom, mColor, LLRectBase< Type >::mLeft, LLView::mRect, LLColor4::mV, mValid, LLPointer< Type >::notNull(), LLViewBorder::setKeyboardFocusHighlight(), LLRectBase< Type >::stretch(), TRUE, and VALPHA.

LLView * LLColorSwatchCtrl::fromXML ( LLXMLNodePtr  node,
LLView parent,
LLUICtrlFactory factory 
) [static]

Definition at line 358 of file llcolorswatch.cpp.

References LLView::createRect(), f, FALSE, LLUICtrl::initFromXML(), LLColorSwatchCtrl(), NULL, and setCanApplyImmediately().

const LLColor4& LLColorSwatchCtrl::get (  )  [inline]

Definition at line 72 of file llcolorswatch.h.

References mColor.

Referenced by LLPanelEditWearable::onColorCommit(), LLPanelVolume::onCommitLight(), LLPanelVolume::onLightSelectColor(), and LLPanelFace::sendColor().

virtual LLSD LLColorSwatchCtrl::getValue (  )  const [inline, virtual]

Reimplemented from LLUICtrl.

Definition at line 71 of file llcolorswatch.h.

References LLColor4::getValue(), and mColor.

Referenced by LLFloaterSettingsDebug::updateControl().

virtual LLString LLColorSwatchCtrl::getWidgetTag (  )  const [inline, virtual]

Implements LLView.

Definition at line 70 of file llcolorswatch.h.

References LL_COLOR_SWATCH_CTRL_TAG.

virtual EWidgetType LLColorSwatchCtrl::getWidgetType (  )  const [inline, virtual]

Implements LLView.

Definition at line 69 of file llcolorswatch.h.

References WIDGET_TYPE_COLOR_SWATCH.

LLXMLNodePtr LLColorSwatchCtrl::getXML ( bool  save_children = true  )  const [virtual]

Reimplemented from LLUICtrl.

Definition at line 340 of file llcolorswatch.cpp.

References LLTextBox::getText(), LLUICtrl::getXML(), mBorderColor, mCanApplyImmediately, mCaption, mColor, LLColor4::mV, and TRUE.

BOOL LLColorSwatchCtrl::handleDoubleClick ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 120 of file llcolorswatch.cpp.

References handleMouseDown().

BOOL LLColorSwatchCtrl::handleHover ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 125 of file llcolorswatch.cpp.

References LLView::getWindow(), LLWindow::setCursor(), TRUE, and UI_CURSOR_HAND.

BOOL LLColorSwatchCtrl::handleMouseDown ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 170 of file llcolorswatch.cpp.

References gViewerWindow, LLViewerWindow::setMouseCapture(), and TRUE.

Referenced by handleDoubleClick().

BOOL LLColorSwatchCtrl::handleMouseUp ( S32  x,
S32  y,
MASK  mask 
) [virtual]

Reimplemented from LLView.

Definition at line 180 of file llcolorswatch.cpp.

References FALSE, LLView::getVisible(), gViewerWindow, LLView::hasMouseCapture(), llassert, LLView::mEnabled, NULL, LLView::pointInView(), LLViewerWindow::setMouseCapture(), showPicker(), and TRUE.

BOOL LLColorSwatchCtrl::handleUnicodeCharHere ( llwchar  uni_char,
BOOL  called_from_parent 
) [virtual]

Reimplemented from LLView.

Definition at line 131 of file llcolorswatch.cpp.

References LLView::getVisible(), LLView::handleUnicodeCharHere(), LLView::mEnabled, showPicker(), and TRUE.

void LLColorSwatchCtrl::onColorChanged ( void data,
EColorPickOp  pick_op = COLOR_CHANGE 
) [static]

Definition at line 273 of file llcolorswatch.cpp.

References COLOR_CANCEL, COLOR_SELECT, LLFloaterColorPicker::getCurB(), LLFloaterColorPicker::getCurG(), LLFloaterColorPicker::getCurR(), LLFloater::getFloaterByHandle(), LLView::setControlValue(), and VALPHA.

Referenced by LLFloaterColorPicker::cancelSelection(), LLFloaterColorPicker::handleMouseDown(), LLFloaterColorPicker::handleMouseUp(), LLFloaterColorPicker::onClickSelect(), LLFloaterColorPicker::onColorSelect(), LLFloaterColorPicker::onImmediateCheck(), LLFloaterColorPicker::onTextEntryChanged(), and LLFloaterColorPicker::showUI().

void LLColorSwatchCtrl::set ( const LLColor4 color,
BOOL  update_picker = FALSE,
BOOL  from_event = FALSE 
)

Definition at line 151 of file llcolorswatch.cpp.

References LLFloater::getFloaterByHandle(), LLColor4::getValue(), mColor, mPickerHandle, LLColor4::mV, LLView::setControlValue(), LLFloaterColorPicker::setCurRgb(), VBLUE, VGREEN, and VRED.

Referenced by LLPanelEditWearable::draw(), LLPanelVolume::getState(), LLPanelFace::getState(), setValue(), and LLFloaterSettingsDebug::updateControl().

void LLColorSwatchCtrl::setCanApplyImmediately ( BOOL  apply  )  [inline]

Definition at line 78 of file llcolorswatch.h.

References mCanApplyImmediately.

Referenced by fromXML(), LLPanelFace::getState(), and LLPanelFace::postBuild().

void LLColorSwatchCtrl::setEnabled ( BOOL  enabled  )  [virtual]

Reimplemented from LLView.

Definition at line 249 of file llcolorswatch.cpp.

References LLFloaterColorPicker::cancelSelection(), LLFloater::close(), LLFloater::getFloaterByHandle(), mCaption, mPickerHandle, and LLView::setEnabled().

Referenced by LLPanelVolume::clearCtrls(), LLPanelVolume::getState(), and LLPanelFace::getState().

void LLColorSwatchCtrl::setLabel ( const std::string &  label  ) 

Definition at line 165 of file llcolorswatch.cpp.

References mCaption, and LLTextBox::setText().

void LLColorSwatchCtrl::setOnCancelCallback ( LLUICtrlCallback  cb  )  [inline]

Definition at line 79 of file llcolorswatch.h.

References mOnCancelCallback.

Referenced by LLPanelVolume::postBuild(), and LLPanelFace::postBuild().

void LLColorSwatchCtrl::setOnSelectCallback ( LLUICtrlCallback  cb  )  [inline]

Definition at line 80 of file llcolorswatch.h.

References mOnSelectCallback.

Referenced by LLPanelVolume::postBuild(), and LLPanelFace::postBuild().

void LLColorSwatchCtrl::setOriginal ( const LLColor4 color  ) 

Definition at line 141 of file llcolorswatch.cpp.

References LLFloater::getFloaterByHandle(), mColor, mPickerHandle, LLColor4::mV, LLFloaterColorPicker::setOrigRgb(), VBLUE, VGREEN, and VRED.

Referenced by LLPanelFace::getState().

void LLColorSwatchCtrl::setValid ( BOOL  valid  ) 

Definition at line 306 of file llcolorswatch.cpp.

References LLFloater::getFloaterByHandle(), mPickerHandle, mValid, and LLFloaterColorPicker::setActive().

Referenced by LLPanelVolume::clearCtrls(), LLPanelVolume::getState(), and LLPanelFace::getState().

void LLColorSwatchCtrl::setValue ( const LLSD value  )  [virtual]

Reimplemented from LLView.

Definition at line 266 of file llcolorswatch.cpp.

References set(), and TRUE.

Referenced by LLFloaterSettingsDebug::updateControl().

void LLColorSwatchCtrl::showPicker ( BOOL  take_focus  ) 

Definition at line 317 of file llcolorswatch.cpp.

References LLFloater::addDependentFloater(), LLFloater::getFloaterByHandle(), LLFloaterView::getParentFloater(), gFloaterView, LLFloaterColorPicker::initUI(), mCanApplyImmediately, mColor, mPickerHandle, LLColor4::mV, LLFloater::setFocus(), LLFloaterColorPicker::showUI(), TRUE, VBLUE, VGREEN, and VRED.

Referenced by handleMouseUp(), and handleUnicodeCharHere().


Member Data Documentation

LLPointer<LLViewerImage> LLColorSwatchCtrl::mAlphaGradientImage [protected]

Definition at line 107 of file llcolorswatch.h.

Referenced by draw(), LLColorSwatchCtrl(), and ~LLColorSwatchCtrl().

LLViewBorder* LLColorSwatchCtrl::mBorder [protected]

Definition at line 102 of file llcolorswatch.h.

Referenced by draw(), and LLColorSwatchCtrl().

LLColor4 LLColorSwatchCtrl::mBorderColor [protected]

Definition at line 99 of file llcolorswatch.h.

Referenced by draw(), and getXML().

BOOL LLColorSwatchCtrl::mCanApplyImmediately [protected]

Definition at line 103 of file llcolorswatch.h.

Referenced by getXML(), setCanApplyImmediately(), and showPicker().

LLTextBox* LLColorSwatchCtrl::mCaption [protected]

Definition at line 100 of file llcolorswatch.h.

Referenced by getXML(), LLColorSwatchCtrl(), setEnabled(), and setLabel().

LLColor4 LLColorSwatchCtrl::mColor [protected]

Definition at line 98 of file llcolorswatch.h.

Referenced by draw(), get(), getValue(), getXML(), set(), setOriginal(), and showPicker().

LLUICtrlCallback LLColorSwatchCtrl::mOnCancelCallback [protected]

Definition at line 104 of file llcolorswatch.h.

Referenced by setOnCancelCallback().

LLUICtrlCallback LLColorSwatchCtrl::mOnSelectCallback [protected]

Definition at line 105 of file llcolorswatch.h.

Referenced by setOnSelectCallback().

LLViewHandle LLColorSwatchCtrl::mPickerHandle [protected]

Definition at line 101 of file llcolorswatch.h.

Referenced by set(), setEnabled(), setOriginal(), setValid(), showPicker(), and ~LLColorSwatchCtrl().

BOOL LLColorSwatchCtrl::mValid [protected]

Definition at line 97 of file llcolorswatch.h.

Referenced by draw(), and setValid().


The documentation for this class was generated from the following files:
Generated on Thu Jul 1 06:11:13 2010 for Second Life Viewer by  doxygen 1.4.7