diff options
author | Steven Bennetts <steve@lindenlab.com> | 2008-02-19 21:42:32 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2008-02-19 21:42:32 +0000 |
commit | 2e32d44e7165775936beae5d9ef636ff9d3f2bd2 (patch) | |
tree | 8153bc399994aabf6e1c41c2d8332e4e8c4ddb78 /indra/llui/lltextbox.h | |
parent | db0f5847ea8b96b3c1ac08e7aeb43d83daacb8e4 (diff) |
merge svn+ssh://svn.lindenlab.com/svn/linden/qa/combo-merge-ui-2008-02-13 -r 79986 : 80178 -> release.
QAR-290 = QAR-271 + QAR-191
Diffstat (limited to 'indra/llui/lltextbox.h')
-rw-r--r-- | indra/llui/lltextbox.h | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index d25452b941..ce3a9bb12e 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -35,11 +35,8 @@ #include "lluictrl.h" #include "v4color.h" #include "llstring.h" -#include "llfontgl.h" #include "lluistring.h" -class LLUICtrlFactory; - class LLTextBox : public LLUICtrl @@ -48,18 +45,22 @@ public: // By default, follows top and left and is mouse-opaque. // If no text, text = name. // If no font, uses default system font. - LLTextBox(const LLString& name, const LLRect& rect, const LLString& text = LLString::null, + LLTextBox(const LLString& name, const LLRect& rect, const LLString& text, const LLFontGL* font = NULL, BOOL mouse_opaque = TRUE ); // Construct a textbox which handles word wrapping for us. 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; + // "Simple" constructors for text boxes that have the same name and label *TO BE DEPRECATED* + LLTextBox(const LLString& name_and_label, const LLRect& rect); + LLTextBox(const LLString& name_and_label); + + virtual ~LLTextBox() {} + virtual EWidgetType getWidgetType() const { return WIDGET_TYPE_TEXT_BOX; } + virtual LLString getWidgetTag() const { return LL_TEXT_BOX_TAG; } virtual LLXMLNodePtr getXML(bool save_children = true) const; - static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); + static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); virtual void draw(); virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE); @@ -77,8 +78,7 @@ public: void setHoverActive( BOOL active ) { mHoverActive = active; } void setText( const LLStringExplicit& text ); - void setWrappedText(const LLStringExplicit& text, F32 max_width = -1.0); - // default width means use existing control width + void setWrappedText(const LLStringExplicit& text, F32 max_width = -1.0); // -1 means use existing control width void setUseEllipses( BOOL use_ellipses ) { mUseEllipses = use_ellipses; } void setBackgroundVisible(BOOL visible) { mBackgroundVisible = visible; } @@ -90,7 +90,7 @@ public: void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } void setClickedCallback( void (*cb)(void *data) ){ mClickedCallback = cb; } // mouse down and up within button - void setCallbackUserData( void* data ) { mCallbackUserData = data; } + void setCallbackUserData( void* data ) { mCallbackUserData = data; } const LLFontGL* getFont() const { return mFontGL; } @@ -100,16 +100,14 @@ public: S32 getTextPixelWidth(); S32 getTextPixelHeight(); - - virtual void setValue(const LLSD& value ); - virtual LLSD getValue() const; + virtual void setValue(const LLSD& value ) { setText(value.asString()); } + virtual LLSD getValue() const { return LLSD(getText()); } virtual BOOL setTextArg( const LLString& key, const LLStringExplicit& text ); -protected: +private: void setLineLengths(); void drawText(S32 x, S32 y, const LLColor4& color ); -protected: LLUIString mText; const LLFontGL* mFontGL; LLColor4 mTextColor; |