diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrl.cpp | 18 | ||||
-rw-r--r-- | indra/llui/llaccordionctrl.h | 7 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 13 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.h | 4 |
4 files changed, 41 insertions, 1 deletions
diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index fc93793ed8..3a1e9f19fa 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -826,6 +826,24 @@ void LLAccordionCtrl::setFilterSubString(const std::string& filter_string) mNoVisibleTabsHelpText->setValue(text); } +const LLAccordionCtrlTab* LLAccordionCtrl::getExpandedTab() const +{ + typedef std::vector<LLAccordionCtrlTab*>::const_iterator tabs_const_iterator; + + const LLAccordionCtrlTab* result = 0; + + for (tabs_const_iterator i = mAccordionTabs.begin(); i != mAccordionTabs.end(); ++i) + { + if ((*i)->isExpanded()) + { + result = *i; + break; + } + } + + return result; +} + S32 LLAccordionCtrl::calcExpandedTabHeight(S32 tab_index /* = 0 */, S32 available_height /* = 0 */) { if(tab_index < 0) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index fc6f2d896c..677b598a32 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -129,6 +129,13 @@ public: */ void setFilterSubString(const std::string& filter_string); + /** + * This method returns the first expanded accordion tab. + * It is expected to be called for accordion which doesn't allow multiple + * tabs to be expanded. Use with care. + */ + const LLAccordionCtrlTab* getExpandedTab() const; + private: void initNoTabsWidget(const LLTextBox::Params& tb_params); void updateNoTabsHelpTextVisibility(); diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 1bc8086a27..54bb328a18 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -968,3 +968,16 @@ BOOL LLAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) } return LLUICtrl::handleToolTip(x, y, mask); } +BOOL LLAccordionCtrlTab::handleScrollWheel ( S32 x, S32 y, S32 clicks ) +{ + if( LLUICtrl::handleScrollWheel(x,y,clicks)) + { + return TRUE; + } + if( mScrollbar && mScrollbar->getVisible() && mScrollbar->handleScrollWheel( 0, 0, clicks ) ) + { + return TRUE; + } + return FALSE; +} + diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 480b26e130..7bf7eeef8f 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -166,10 +166,12 @@ public: virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent); virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); + virtual bool addChild(LLView* child, S32 tab_group); - bool isExpanded() { return mDisplayChildren; } + bool isExpanded() const { return mDisplayChildren; } S32 getHeaderHeight(); |