LLTextBox Class Reference

#include <lltextbox.h>

Inheritance diagram for LLTextBox:

Inheritance graph
[legend]
Collaboration diagram for LLTextBox:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LLTextBox (const LLString &name, const LLRect &rect, const LLString &text=LLString::null, const LLFontGL *font=NULL, BOOL mouse_opaque=TRUE)
 LLTextBox (const LLString &name, const LLString &text, F32 max_width=200, const LLFontGL *font=NULL, BOOL mouse_opaque=TRUE)
virtual ~LLTextBox ()
virtual EWidgetType getWidgetType () const
virtual LLString getWidgetTag () const
virtual LLXMLNodePtr getXML (bool save_children=true) const
virtual void draw ()
virtual void reshape (S32 width, S32 height, BOOL called_from_parent=TRUE)
virtual BOOL handleMouseDown (S32 x, S32 y, MASK mask)
virtual BOOL handleMouseUp (S32 x, S32 y, MASK mask)
void setColor (const LLColor4 &c)
void setDisabledColor (const LLColor4 &c)
void setBackgroundColor (const LLColor4 &c)
void setBorderColor (const LLColor4 &c)
void setText (const LLStringExplicit &text)
void setWrappedText (const LLStringExplicit &text, F32 max_width=-1.0)
void setBackgroundVisible (BOOL visible)
void setBorderVisible (BOOL visible)
void setFontStyle (U8 style)
void setBorderDropshadowVisible (BOOL visible)
void setHPad (S32 pixels)
void setVPad (S32 pixels)
void setRightAlign ()
void setHAlign (LLFontGL::HAlign align)
void setClickedCallback (void(*cb)(void *data))
void setCallbackUserData (void *data)
const LLFontGLgetFont () const
void reshapeToFitText ()
const LLStringgetText () const
S32 getTextPixelWidth ()
S32 getTextPixelHeight ()
virtual void setValue (const LLSD &value)
virtual LLSD getValue () const
virtual BOOL setTextArg (const LLString &key, const LLStringExplicit &text)

Static Public Member Functions

static LLViewfromXML (LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory)

Protected Member Functions

void setLineLengths ()
void drawText (S32 x, S32 y, const LLColor4 &color)

Protected Attributes

LLUIString mText
const LLFontGLmFontGL
LLColor4 mTextColor
LLColor4 mDisabledColor
LLColor4 mBackgroundColor
LLColor4 mBorderColor
BOOL mBackgroundVisible
BOOL mBorderVisible
U8 mFontStyle
BOOL mBorderDropShadowVisible
S32 mHPad
S32 mVPad
LLFontGL::HAlign mHAlign
LLFontGL::VAlign mVAlign
std::vector< S32mLineLengthList
void(* mClickedCallback )(void *data)
voidmCallbackUserData

Detailed Description

Definition at line 44 of file lltextbox.h.


Constructor & Destructor Documentation

LLTextBox::LLTextBox ( const LLString name,
const LLRect rect,
const LLString text = LLString::null,
const LLFontGL font = NULL,
BOOL  mouse_opaque = TRUE 
)

Definition at line 45 of file lltextbox.cpp.

References FALSE, mFontGL, LLUICtrl::setTabStop(), setText(), and LLFontGL::sSansSerifSmall.

Referenced by fromXML().

LLTextBox::LLTextBox ( const LLString name,
const LLString text,
F32  max_width = 200,
const LLFontGL font = NULL,
BOOL  mouse_opaque = TRUE 
)

Definition at line 69 of file lltextbox.cpp.

References FALSE, reshapeToFitText(), LLUICtrl::setTabStop(), and setWrappedText().

LLTextBox::~LLTextBox (  )  [virtual]

Definition at line 93 of file lltextbox.cpp.


Member Function Documentation

void LLTextBox::draw (  )  [virtual]

Reimplemented from LLView.

Definition at line 296 of file lltextbox.cpp.

References LLView::drawDebugRect(), drawText(), FALSE, LLControlGroup::getColor(), LLView::getEnabled(), LLRectBase< Type >::getHeight(), LLView::getLocalRect(), LLControlGroup::getS32(), LLView::getVisible(), LLRectBase< Type >::getWidth(), gl_drop_shadow(), gl_rect_2d(), gl_rect_2d_offset_local(), LLFontGL::HCENTER, LLFontGL::LEFT, mBackgroundColor, mBackgroundVisible, mBorderDropShadowVisible, mBorderVisible, mDisabledColor, mHAlign, mHPad, LLView::mRect, mTextColor, mVPad, r, LLFontGL::RIGHT, S32, LLUI::sColorsGroup, LLUI::sConfigGroup, and LLView::sDebugRects.

Referenced by LLViewerWindow::draw().

void LLTextBox::drawText ( S32  x,
S32  y,
const LLColor4 color 
) [protected]

Definition at line 358 of file lltextbox.cpp.

References LLFontGL::getLineHeight(), LLRectBase< Type >::getWidth(), LLUIString::getWString(), llfloor(), mFontGL, mFontStyle, mHAlign, mLineLengthList, LLView::mRect, mText, mVAlign, NULL, LLFontGL::render(), S32, S32_MAX, and TRUE.

Referenced by draw().

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

Definition at line 426 of file lltextbox.cpp.

References FALSE, LLUICtrlFactory::getAttributeColor(), LLFontGL::getStyleFromString(), LLUICtrl::initFromXML(), LLTextBox(), mFontStyle, LLView::selectFont(), LLView::selectFontHAlign(), setColor(), setHAlign(), and LLView::setMouseOpaque().

const LLFontGL* LLTextBox::getFont (  )  const [inline]

Definition at line 89 of file lltextbox.h.

References mFontGL.

Referenced by LLPanelGroupGeneral::postBuild().

const LLString& LLTextBox::getText (  )  const [inline]

Definition at line 93 of file lltextbox.h.

References LLUIString::getString(), and mText.

Referenced by LLPanelEstateCovenant::getEstateName(), LLCheckBoxCtrl::getLabel(), LLPanelEstateCovenant::getOwnerName(), LLDragHandleTop::getTitle(), getValue(), LLSpinCtrl::getXML(), LLSliderCtrl::getXML(), LLColorSwatchCtrl::getXML(), LLCheckBoxCtrl::getXML(), LLPanelGroupRoles::postBuild(), LLPanelGroupNotices::postBuild(), LLPanelGroupLandMoney::postBuild(), LLPanelGroupGeneral::postBuild(), LLPanelGroup::postBuild(), LLPanelGroupTab::postBuild(), LLFloaterIMPanel::postBuild(), LLPanelGroupRolesSubTab::postBuildSubTab(), LLStatusBar::refresh(), LLCheckBoxCtrl::reshape(), LLDragHandleTop::reshapeTitleBox(), and LLSliderCtrl::setLabelArg().

S32 LLTextBox::getTextPixelHeight (  ) 

Definition at line 268 of file lltextbox.cpp.

References LLFontGL::getLineHeight(), mFontGL, mLineLengthList, and S32.

Referenced by reshapeToFitText().

S32 LLTextBox::getTextPixelWidth (  ) 

Definition at line 243 of file lltextbox.cpp.

References LLFontGL::getWidth(), LLUIString::getWString(), mFontGL, mLineLengthList, mText, and S32.

Referenced by LLStatusBar::refresh(), and reshapeToFitText().

LLSD LLTextBox::getValue (  )  const [virtual]

Reimplemented from LLUICtrl.

Definition at line 284 of file lltextbox.cpp.

References getText().

LLString LLTextBox::getWidgetTag (  )  const [virtual]

Implements LLView.

Definition at line 104 of file lltextbox.cpp.

References LL_TEXT_BOX_TAG.

EWidgetType LLTextBox::getWidgetType (  )  const [virtual]

Implements LLView.

Definition at line 98 of file lltextbox.cpp.

References WIDGET_TYPE_TEXT_BOX.

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

Reimplemented from LLUICtrl.

Definition at line 393 of file lltextbox.cpp.

References LLView::addColorXML(), LLUICtrl::getXML(), mBackgroundColor, mBackgroundVisible, mBorderColor, mBorderDropShadowVisible, mBorderVisible, mDisabledColor, mFontGL, mHAlign, mHPad, mText, mTextColor, mVPad, LLFontGL::nameFromFont(), LLFontGL::nameFromHAlign(), and TRUE.

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

Reimplemented from LLView.

Definition at line 109 of file lltextbox.cpp.

References FALSE, gFocusMgr, make_ui_sound(), mClickedCallback, LLView::MOUSE_DOWN, LLView::mSoundFlags, LLFocusMgr::setMouseCapture(), and TRUE.

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

Reimplemented from LLView.

Definition at line 132 of file lltextbox.cpp.

References FALSE, gFocusMgr, LLView::hasMouseCapture(), make_ui_sound(), mCallbackUserData, mClickedCallback, LLView::MOUSE_UP, LLView::mSoundFlags, NULL, LLFocusMgr::setMouseCapture(), and TRUE.

void LLTextBox::reshape ( S32  width,
S32  height,
BOOL  called_from_parent = TRUE 
) [virtual]

Reimplemented from LLView.

Definition at line 351 of file lltextbox.cpp.

References LLView::reshape(), and setLineLengths().

Referenced by reshapeToFitText().

void LLTextBox::reshapeToFitText (  ) 

Definition at line 385 of file lltextbox.cpp.

References getTextPixelHeight(), getTextPixelWidth(), height, mHPad, mVPad, reshape(), S32, and width.

Referenced by LLViewerWindow::handlePerFrameHover(), and LLTextBox().

void LLTextBox::setBackgroundColor ( const LLColor4 c  )  [inline]

Definition at line 72 of file lltextbox.h.

References c, and mBackgroundColor.

Referenced by LLViewerWindow::initBase(), LLGroupNotifyBox::LLGroupNotifyBox(), and LLNotifyBox::LLNotifyBox().

void LLTextBox::setBackgroundVisible ( BOOL  visible  )  [inline]

Definition at line 78 of file lltextbox.h.

References mBackgroundVisible.

Referenced by LLViewerWindow::initBase(), and LLGroupNotifyBox::LLGroupNotifyBox().

void LLTextBox::setBorderColor ( const LLColor4 c  )  [inline]

Definition at line 73 of file lltextbox.h.

References c, and mBorderColor.

Referenced by LLViewerWindow::initBase().

void LLTextBox::setBorderDropshadowVisible ( BOOL  visible  )  [inline]

Definition at line 81 of file lltextbox.h.

References mBorderDropShadowVisible.

Referenced by LLViewerWindow::initBase().

void LLTextBox::setBorderVisible ( BOOL  visible  )  [inline]

Definition at line 79 of file lltextbox.h.

References mBorderVisible.

Referenced by LLViewerWindow::initBase(), LLGroupNotifyBox::LLGroupNotifyBox(), LLNotifyBox::LLNotifyBox(), and LLPreviewGesture::postBuild().

void LLTextBox::setCallbackUserData ( void data  )  [inline]

Reimplemented from LLUICtrl.

Definition at line 87 of file lltextbox.h.

References mCallbackUserData.

Referenced by LLPanelLogin::LLPanelLogin().

void LLTextBox::setClickedCallback ( void(*)(void *data)  cb  )  [inline]

Definition at line 86 of file lltextbox.h.

References mClickedCallback.

Referenced by LLPanel::childSetActionTextbox(), LLFloaterTestImpl::LLFloaterTestImpl(), and LLPanelLogin::LLPanelLogin().

void LLTextBox::setColor ( const LLColor4 c  )  [inline, virtual]

Reimplemented from LLUICtrl.

Definition at line 70 of file lltextbox.h.

References c, and mTextColor.

Referenced by LLAlertDialog::createDialog(), LLSpinCtrl::draw(), LLCheckBoxCtrl::draw(), fromXML(), LLViewerWindow::initBase(), LLGroupNotifyBox::LLGroupNotifyBox(), LLNetMap::LLNetMap(), LLNotifyBox::LLNotifyBox(), LLWorldMapView::LLWorldMapView(), LLPanelEvent::postBuild(), LLSliderCtrl::setEnabled(), and LLUploadDialog::setMessage().

void LLTextBox::setDisabledColor ( const LLColor4 c  )  [inline]

Definition at line 71 of file lltextbox.h.

References c, and mDisabledColor.

Referenced by LLGroupNotifyBox::LLGroupNotifyBox().

void LLTextBox::setFontStyle ( U8  style  )  [inline]

Definition at line 80 of file lltextbox.h.

References mFontStyle.

Referenced by LLViewerWindow::initBase(), LLGroupNotifyBox::LLGroupNotifyBox(), LLNetMap::LLNetMap(), LLNotifyBox::LLNotifyBox(), and LLDragHandleTop::setTitle().

void LLTextBox::setHAlign ( LLFontGL::HAlign  align  )  [inline]

Definition at line 85 of file lltextbox.h.

References mHAlign.

Referenced by fromXML(), LLGroupNotifyBox::LLGroupNotifyBox(), and LLTextureCtrl::LLTextureCtrl().

void LLTextBox::setHPad ( S32  pixels  )  [inline]

Definition at line 82 of file lltextbox.h.

References mHPad.

Referenced by LLViewerWindow::initBase().

void LLTextBox::setLineLengths (  )  [protected]

Definition at line 170 of file lltextbox.cpp.

References end, LLUIString::getWString(), mLineLengthList, mText, and S32.

Referenced by reshape(), setText(), and setTextArg().

void LLTextBox::setRightAlign (  )  [inline]

Definition at line 84 of file lltextbox.h.

References mHAlign, and LLFontGL::RIGHT.

void LLTextBox::setText ( const LLStringExplicit text  ) 

Definition at line 164 of file lltextbox.cpp.

References LLUIString::assign(), mText, and setLineLengths().

Referenced by LLSliderCtrl::clear(), LLFloaterLagMeter::determineClient(), LLFloaterLagMeter::determineNetwork(), LLFloaterLagMeter::determineServer(), LLPanelPlace::displayItemInfo(), LLPanelEvent::draw(), LLDebugVarMessageBox::draw(), LLFloaterImport::handleMouseDown(), LLNameBox::LLNameBox(), LLPanelLogin::LLPanelLogin(), LLTextBox(), LLPanelPlace::postBuild(), LLStatusBar::refresh(), LLPreviewGesture::refresh(), LLNameBox::refresh(), LLPanelLandCovenant::refresh(), LLPanelLandObjects::refresh(), LLPanelLandGeneral::refresh(), LLPanelEstateCovenant::refreshFromRegion(), LLPanelLandGeneral::refreshNames(), LLPanelPlace::resetLocation(), LLStatusBar::setBalance(), LLTextureCtrl::setCaption(), LLPanelGroupVoting::impl::setEnableVoteProposal(), LLPanelEstateCovenant::setEstateName(), LLStatusBar::setHealth(), LLTextureCtrl::setLabel(), LLSpinCtrl::setLabel(), LLSliderCtrl::setLabel(), LLColorSwatchCtrl::setLabel(), LLCheckBoxCtrl::setLabel(), LLPanelPlace::setLocationString(), LLUploadDialog::setMessage(), LLNameBox::setNameID(), LLPanelEstateCovenant::setOwnerName(), LLFloaterTools::setStatusText(), LLViewChildren::setText(), LLTabContainerCommon::setTitle(), LLDragHandleTop::setTitle(), setValue(), setWrappedText(), LLPanelGroupInvite::update(), LLPanelGroupGeneral::update(), LLFloaterBuyLandUI::updateCovenantInfo(), LLPanelEstateCovenant::updateEstateName(), LLPanelLandCovenant::updateEstateName(), LLFloaterBuyLandUI::updateEstateName(), LLPanelEstateCovenant::updateEstateOwnerName(), LLPanelLandCovenant::updateEstateOwnerName(), LLFloaterBuyLandUI::updateEstateOwnerName(), LLPanelEstateCovenant::updateLastModified(), LLPanelLandCovenant::updateLastModified(), LLFloaterBuyLandUI::updateLastModified(), LLFloaterEventLog::updateList(), LLPanelGroupInvite::updateLists(), and LLSliderCtrl::updateText().

BOOL LLTextBox::setTextArg ( const LLString key,
const LLStringExplicit text 
) [virtual]

Reimplemented from LLUICtrl.

Definition at line 289 of file lltextbox.cpp.

References mText, LLUIString::setArg(), setLineLengths(), and TRUE.

Referenced by LLPanelLandOptions::refresh(), LLPanelLandObjects::refresh(), LLPanelLandGeneral::refresh(), LLPanelLandGeneral::refreshNames(), LLSliderCtrl::setLabelArg(), LLCheckBoxCtrl::setLabelArg(), and LLFloaterTexturePicker::updateImageStats().

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

Reimplemented from LLView.

Definition at line 279 of file lltextbox.cpp.

References LLSD::asString(), and setText().

void LLTextBox::setVPad ( S32  pixels  )  [inline]

Definition at line 83 of file lltextbox.h.

References mVPad.

Referenced by LLViewerWindow::initBase().

void LLTextBox::setWrappedText ( const LLStringExplicit text,
F32  max_width = -1.0 
)

Definition at line 197 of file lltextbox.cpp.

References end, LLView::getRect(), LLRectBase< Type >::getWidth(), LLFontGL::maxDrawableChars(), mFontGL, setText(), TRUE, utf8str_to_wstring(), and wstring_to_utf8str().

Referenced by LLPanel::childSetWrappedText(), LLViewerWindow::handlePerFrameHover(), LLNotifyBox::LLNotifyBox(), LLTextBox(), LLFloaterBuyLandUI::refreshUI(), LLViewChildren::setWrappedText(), and LLFloaterBuyCurrencyUI::updateUI().


Member Data Documentation

LLColor4 LLTextBox::mBackgroundColor [protected]

Definition at line 112 of file lltextbox.h.

Referenced by draw(), getXML(), and setBackgroundColor().

BOOL LLTextBox::mBackgroundVisible [protected]

Definition at line 115 of file lltextbox.h.

Referenced by draw(), getXML(), and setBackgroundVisible().

LLColor4 LLTextBox::mBorderColor [protected]

Definition at line 113 of file lltextbox.h.

Referenced by getXML(), and setBorderColor().

BOOL LLTextBox::mBorderDropShadowVisible [protected]

Definition at line 119 of file lltextbox.h.

Referenced by draw(), getXML(), and setBorderDropshadowVisible().

BOOL LLTextBox::mBorderVisible [protected]

Definition at line 116 of file lltextbox.h.

Referenced by draw(), getXML(), and setBorderVisible().

void* LLTextBox::mCallbackUserData [protected]

Reimplemented from LLUICtrl.

Definition at line 128 of file lltextbox.h.

Referenced by handleMouseUp(), and setCallbackUserData().

void(* LLTextBox::mClickedCallback)(void *data) [protected]

Referenced by handleMouseDown(), handleMouseUp(), and setClickedCallback().

LLColor4 LLTextBox::mDisabledColor [protected]

Definition at line 110 of file lltextbox.h.

Referenced by draw(), getXML(), and setDisabledColor().

const LLFontGL* LLTextBox::mFontGL [protected]

Definition at line 108 of file lltextbox.h.

Referenced by drawText(), getFont(), getTextPixelHeight(), getTextPixelWidth(), getXML(), LLTextBox(), and setWrappedText().

U8 LLTextBox::mFontStyle [protected]

Definition at line 118 of file lltextbox.h.

Referenced by drawText(), fromXML(), and setFontStyle().

LLFontGL::HAlign LLTextBox::mHAlign [protected]

Definition at line 123 of file lltextbox.h.

Referenced by draw(), drawText(), getXML(), setHAlign(), and setRightAlign().

S32 LLTextBox::mHPad [protected]

Definition at line 121 of file lltextbox.h.

Referenced by draw(), getXML(), reshapeToFitText(), and setHPad().

std::vector<S32> LLTextBox::mLineLengthList [protected]

Definition at line 126 of file lltextbox.h.

Referenced by drawText(), getTextPixelHeight(), getTextPixelWidth(), and setLineLengths().

LLUIString LLTextBox::mText [protected]

Definition at line 107 of file lltextbox.h.

Referenced by drawText(), getText(), getTextPixelWidth(), getXML(), setLineLengths(), setText(), and setTextArg().

LLColor4 LLTextBox::mTextColor [protected]

Definition at line 109 of file lltextbox.h.

Referenced by draw(), getXML(), and setColor().

LLFontGL::VAlign LLTextBox::mVAlign [protected]

Definition at line 124 of file lltextbox.h.

Referenced by drawText().

S32 LLTextBox::mVPad [protected]

Definition at line 122 of file lltextbox.h.

Referenced by draw(), getXML(), reshapeToFitText(), and setVPad().


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