diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-11-11 15:08:00 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-11-11 15:08:00 -0800 |
commit | d023672e597770671720f8b68f7799b662f82175 (patch) | |
tree | 3c645a16baaa3c1259bb86cf84dba1876a1beee1 /indra/llui/llscrolllistcell.h | |
parent | 8ec85a68acee6b600320b10eea2b9aa11e434e83 (diff) |
Add ToolTip functionality to LLScrollListCell
This change enables a user to set a custom tool tip on a particular
scroll list cell by calling setToolTip(). Then, this tool tip is
used. If this is not done, the existing tooltip functionality is left
alone.
Reviewed by Richard
Diffstat (limited to 'indra/llui/llscrolllistcell.h')
-rw-r--r-- | indra/llui/llscrolllistcell.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 758623f121..cff8434b32 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -66,6 +66,7 @@ public: Optional<void*> userdata; Optional<LLSD> value; + Optional<std::string> tool_tip; Optional<const LLFontGL*> font; Optional<LLColor4> font_color; @@ -80,6 +81,7 @@ public: enabled("enabled", true), visible("visible", true), value("value"), + tool_tip("tool_tip", ""), font("font", LLFontGL::getFontSansSerifSmall()), font_color("font_color", LLColor4::black), color("color", LLColor4::white), @@ -87,6 +89,7 @@ public: { addSynonym(column, "name"); addSynonym(font_color, "font-color"); + addSynonym(tool_tip, "tooltip"); } }; @@ -101,11 +104,13 @@ public: virtual S32 getHeight() const { return 0; } virtual const LLSD getValue() const; virtual void setValue(const LLSD& value) { } + virtual const std::string &getToolTip() const { return mToolTip; } + virtual void setToolTip(const std::string &str) { mToolTip = str; } virtual BOOL getVisible() const { return TRUE; } virtual void setWidth(S32 width) { mWidth = width; } virtual void highlightText(S32 offset, S32 num_chars) {} virtual BOOL isText() const { return FALSE; } - virtual BOOL needsToolTip() const { return FALSE; } + virtual BOOL needsToolTip() const { return ! mToolTip.empty(); } virtual void setColor(const LLColor4&) {} virtual void onCommit() {}; @@ -114,6 +119,7 @@ public: private: S32 mWidth; + std::string mToolTip; }; class LLScrollListSpacer : public LLScrollListCell @@ -143,6 +149,7 @@ public: /*virtual*/ void setColor(const LLColor4&); /*virtual*/ BOOL isText() const; + /*virtual*/ const std::string & getToolTip() const; /*virtual*/ BOOL needsToolTip() const; void setText(const LLStringExplicit& text); |