diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-14 10:22:24 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-05-14 10:22:24 +0100 |
commit | a5f365c331149b03366be421aa1597dfbcb1bb33 (patch) | |
tree | d792c599804e87f892cfcca12e8260e68be3855a /indra/llui | |
parent | 3ce4cecd681f3f95c7b1fe04db75c384d0b0854e (diff) | |
parent | 07678ad2db9ffca1cacdab4f28c63e01e8e6f514 (diff) |
merge from PE's viewer-trunk
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 51 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.h | 6 |
3 files changed, 47 insertions, 12 deletions
diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 3ecab90756..88a1652671 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -101,6 +101,7 @@ set(llui_SOURCE_FILES lluictrlfactory.cpp lluiimage.cpp lluistring.cpp + lluitextutil.cpp llundo.cpp llurlaction.cpp llurlentry.cpp @@ -197,6 +198,7 @@ set(llui_HEADER_FILES llui.h lluiimage.h lluistring.h + lluitextutil.h llundo.h llurlaction.h llurlentry.h diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 596da782ce..0db2dca615 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -32,12 +32,13 @@ #include "linden_common.h" -#include "lluictrl.h" -#include "llscrollbar.h" #include "llaccordionctrltab.h" -#include "lllocalcliprect.h" +#include "lllocalcliprect.h" +#include "llscrollbar.h" #include "lltextbox.h" +#include "lluictrl.h" +#include "lluitextutil.h" static const std::string DD_BUTTON_NAME = "dd_button"; static const std::string DD_TEXTBOX_NAME = "dd_textbox"; @@ -72,7 +73,8 @@ public: virtual BOOL postBuild(); - void setTitle(const std::string& title); + std::string getTitle(); + void setTitle(const std::string& title, const std::string& hl); virtual void onMouseEnter(S32 x, S32 y, MASK mask); virtual void onMouseLeave(S32 x, S32 y, MASK mask); @@ -146,10 +148,28 @@ BOOL LLAccordionCtrlTab::LLAccordionCtrlTabHeader::postBuild() return TRUE; } -void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitle(const std::string& title) +std::string LLAccordionCtrlTab::LLAccordionCtrlTabHeader::getTitle() { if(mHeaderTextbox) - mHeaderTextbox->setText(title); + { + return mHeaderTextbox->getText(); + } + else + { + return LLStringUtil::null; + } +} + +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitle(const std::string& title, const std::string& hl) +{ + if(mHeaderTextbox) + { + LLTextUtil::textboxSetHighlightedVal( + mHeaderTextbox, + LLStyle::Params(), + title, + hl); + } } void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() @@ -436,12 +456,25 @@ void LLAccordionCtrlTab::setAccordionView(LLView* panel) addChild(panel,0); } -void LLAccordionCtrlTab::setTitle(const std::string& title) +std::string LLAccordionCtrlTab::getTitle() +{ + LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); + if (header) + { + return header->getTitle(); + } + else + { + return LLStringUtil::null; + } +} + +void LLAccordionCtrlTab::setTitle(const std::string& title, const std::string& hl) { LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); if (header) { - header->setTitle(title); + header->setTitle(title, hl); } } @@ -903,5 +936,3 @@ BOOL LLAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) } return LLUICtrl::handleToolTip(x, y, mask); } - - diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index de254ed3eb..f5b7fd0af6 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -113,8 +113,10 @@ public: void setAccordionView(LLView* panel); LLView* getAccordionView() { return mContainerPanel; }; - // Set text in LLAccordionCtrlTabHeader - void setTitle(const std::string& title); + std::string getTitle(); + + // Set text and highlight substring in LLAccordionCtrlTabHeader + void setTitle(const std::string& title, const std::string& hl = LLStringUtil::null); boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb); boost::signals2::connection setFocusLostCallback(const focus_signal_t::slot_type& cb); |