diff options
Diffstat (limited to 'indra/llui')
| -rw-r--r-- | indra/llui/llaccordionctrl.cpp | 31 | ||||
| -rw-r--r-- | indra/llui/llaccordionctrl.h | 1 | ||||
| -rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 29 | ||||
| -rw-r--r-- | indra/llui/llaccordionctrltab.h | 1 | ||||
| -rw-r--r-- | indra/llui/llbadgeowner.cpp | 8 | ||||
| -rw-r--r-- | indra/llui/llbadgeowner.h | 1 | ||||
| -rw-r--r-- | indra/llui/llcombobox.cpp | 8 | ||||
| -rw-r--r-- | indra/llui/llcombobox.h | 2 | ||||
| -rw-r--r-- | indra/llui/llfolderview.h | 2 | ||||
| -rw-r--r-- | indra/llui/lllineeditor.cpp | 1 | ||||
| -rw-r--r-- | indra/llui/llmultisliderctrl.cpp | 1 | ||||
| -rw-r--r-- | indra/llui/llsliderctrl.cpp | 1 | ||||
| -rw-r--r-- | indra/llui/llspinctrl.cpp | 3 | ||||
| -rw-r--r-- | indra/llui/lltextbase.cpp | 33 | ||||
| -rw-r--r-- | indra/llui/lluictrl.cpp | 3 | ||||
| -rw-r--r-- | indra/llui/llview.cpp | 10 | ||||
| -rw-r--r-- | indra/llui/llview.h | 1 | 
17 files changed, 133 insertions, 3 deletions
| diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 623f570cef..962b8e9bb5 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -655,6 +655,37 @@ void	LLAccordionCtrl::onScrollPosChangeCallback(S32, LLScrollbar*)  {  	updateLayout(getRect().getWidth(),getRect().getHeight());  } + +// virtual +void LLAccordionCtrl::onUpdateScrollToChild(const LLUICtrl *cntrl) +{ +    if (mScrollbar && mScrollbar->getVisible()) +    { +        // same as scrollToShowRect +        LLRect rect; +        cntrl->localRectToOtherView(cntrl->getLocalRect(), &rect, this); + +        // Translate to parent coordinatess to check if we are in visible rectangle +        rect.translate(getRect().mLeft, getRect().mBottom); + +        if (!getRect().contains(rect)) +        { +            // for accordition's scroll, height is in pixels +            // Back to local coords and calculate position for scroller +            S32 bottom = mScrollbar->getDocPos() - rect.mBottom + getRect().mBottom; +            S32 top = mScrollbar->getDocPos() - rect.mTop + getRect().mTop; + +            S32 scroll_pos = llclamp(mScrollbar->getDocPos(), +                bottom, // min vertical scroll +                top); // max vertical scroll  + +            mScrollbar->setDocPos(scroll_pos); +        } +    } + +    LLUICtrl::onUpdateScrollToChild(cntrl); +} +  void	LLAccordionCtrl::onOpen		(const LLSD& key)  {  	for(size_t i=0;i<mAccordionTabs.size();++i) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index 1fe64c472e..b38a76d27f 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -111,6 +111,7 @@ public:  	void	draw();  	void	onScrollPosChangeCallback(S32, LLScrollbar*); +	virtual void onUpdateScrollToChild(const LLUICtrl * cntrl);  	void	onOpen		(const LLSD& key);  	S32		notifyParent(const LLSD& info); diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 1034a21905..098621b543 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -452,6 +452,35 @@ void LLAccordionCtrlTab::onVisibilityChange(BOOL new_visibility)  	notifyParent(LLSD().with("child_visibility_change", new_visibility));  } +// virtual +void LLAccordionCtrlTab::onUpdateScrollToChild(const LLUICtrl *cntrl) +{ +    if (mScrollbar && mScrollbar->getVisible()) +    { +        LLRect rect; +        cntrl->localRectToOtherView(cntrl->getLocalRect(), &rect, this); + +        // Translate to parent coordinatess to check if we are in visible rectangle +        rect.translate(getRect().mLeft, getRect().mBottom); + +        if (!getRect().contains(rect)) +        { +            // for accordition's scroll, height is in pixels +            // Back to local coords and calculate position for scroller +            S32 bottom = mScrollbar->getDocPos() - rect.mBottom + getRect().mBottom; +            S32 top = mScrollbar->getDocPos() - rect.mTop + getRect().mTop; + +            S32 scroll_pos = llclamp(mScrollbar->getDocPos(), +                bottom, // min vertical scroll +                top); // max vertical scroll  + +            mScrollbar->setDocPos(scroll_pos); +        } +    } + +    LLUICtrl::onUpdateScrollToChild(cntrl); +} +  BOOL LLAccordionCtrlTab::handleMouseDown(S32 x, S32 y, MASK mask)  {  	if(mCollapsible && mHeaderVisible && mCanOpenClose) diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index 0263bce4be..2c72e8c036 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -159,6 +159,7 @@ public:  	 * Raises notifyParent event with "child_visibility_change" = new_visibility  	 */  	void onVisibilityChange(BOOL new_visibility); +	virtual void onUpdateScrollToChild(const LLUICtrl * cntrl);  	// Changes expand/collapse state and triggers expand/collapse callbacks  	virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index 0557cd4375..5f11c383ef 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -56,6 +56,14 @@ void LLBadgeOwner::initBadgeParams(const LLBadge::Params& p)  	}  } +void LLBadgeOwner::reshapeBadge(const LLRect& new_rect) +{ +	if (mBadge) +	{ +		mBadge->setShape(new_rect); +	} +} +  void LLBadgeOwner::setBadgeVisibility(bool visible)  {  	if (mBadge) diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h index 01ed95f3a3..4ce208fa0d 100644 --- a/indra/llui/llbadgeowner.h +++ b/indra/llui/llbadgeowner.h @@ -46,6 +46,7 @@ public:  	bool hasBadgeHolderParent() const { return mHasBadgeHolderParent; };  	void setBadgeVisibility(bool visible);  	void setDrawBadgeAtTop(bool draw_at_top); +	void reshapeBadge(const LLRect& new_rect);  private: diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index c7f0326ed4..52dc908655 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -514,6 +514,14 @@ S32 LLComboBox::getCurrentIndex() const  	return -1;  } +void LLComboBox::setEnabledByValue(const LLSD& value, BOOL enabled) +{ +    LLScrollListItem *found = mList->getItem(value); +    if (found) +    { +        found->setEnabled(enabled); +    } +}  void LLComboBox::createLineEditor(const LLComboBox::Params& p)  { diff --git a/indra/llui/llcombobox.h b/indra/llui/llcombobox.h index 7d38c051a5..4af3313162 100644 --- a/indra/llui/llcombobox.h +++ b/indra/llui/llcombobox.h @@ -158,6 +158,8 @@ public:  	BOOL			setCurrentByIndex( S32 index );  	S32				getCurrentIndex() const; +	void			setEnabledByValue(const LLSD& value, BOOL enabled); +  	void			createLineEditor(const Params&);  	//======================================================================== diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 6bb5e6c02e..c175034d75 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -241,6 +241,8 @@ public:  	void dumpSelectionInformation();  	virtual S32	notify(const LLSD& info) ; + +	void setShowEmptyMessage(bool show_msg) { mShowEmptyMessage = show_msg; }  	bool useLabelSuffix() { return mUseLabelSuffix; }  	virtual void updateMenu(); diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 70304cdfd2..1badd54fca 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -2151,6 +2151,7 @@ void LLLineEditor::clear()  void LLLineEditor::onTabInto()  {  	selectAll(); +    LLUICtrl::onTabInto();  }  //virtual diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp index 20e2b569f1..b3df7c154b 100644 --- a/indra/llui/llmultisliderctrl.cpp +++ b/indra/llui/llmultisliderctrl.cpp @@ -509,6 +509,7 @@ void LLMultiSliderCtrl::onTabInto()  	{  		mEditor->onTabInto();   	} +    LLF32UICtrl::onTabInto();  }  void LLMultiSliderCtrl::reportInvalidData() diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp index 3b89a8ca63..d80a434f22 100644 --- a/indra/llui/llsliderctrl.cpp +++ b/indra/llui/llsliderctrl.cpp @@ -479,6 +479,7 @@ void LLSliderCtrl::onTabInto()  	{  		mEditor->onTabInto();   	} +    LLF32UICtrl::onTabInto();  }  void LLSliderCtrl::reportInvalidData() diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index ce3fc29d32..ee78b82429 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -442,7 +442,8 @@ void LLSpinCtrl::setAllowEdit(BOOL allow_edit)  void LLSpinCtrl::onTabInto()  { -	mEditor->onTabInto();  +	mEditor->onTabInto(); +    LLF32UICtrl::onTabInto();  } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 83b851eed2..30bf938591 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1017,7 +1017,38 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask)  	// handle triple click  	if (!mTripleClickTimer.hasExpired())  	{ -		selectAll(); +		S32 real_line = getLineNumFromDocIndex(mCursorPos, false); +		S32 line_start = -1; +		S32 line_end = -1; +		for (line_list_t::const_iterator it = mLineInfoList.begin(), end_it = mLineInfoList.end(); +				it != end_it; +				++it) +		{ +			if (it->mLineNum < real_line) +			{ +				continue; +			} +			if (it->mLineNum > real_line) +			{ +				break; +			} +			if (line_start == -1) +			{ +				line_start = it->mDocIndexStart; +			} +			line_end = it->mDocIndexEnd; +			line_end = llclamp(line_end, 0, getLength()); +		} + +		if (line_start == -1) +		{ +			return TRUE; +		} + +		mSelectionEnd = line_start; +		mSelectionStart = line_end; +		setCursorPos(line_start); +  		return TRUE;  	} diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index c98da0d410..544a76e8d5 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -721,8 +721,9 @@ void LLUICtrl::resetDirty()  }  // virtual -void LLUICtrl::onTabInto()				 +void LLUICtrl::onTabInto()  { +    onUpdateScrollToChild(this);  }  // virtual diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 593c8b12fc..d81e2cd494 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -641,6 +641,16 @@ void LLView::onVisibilityChange ( BOOL new_visibility )  }  // virtual +void LLView::onUpdateScrollToChild(const LLUICtrl * cntrl) +{ +    LLView* parent_view = getParent(); +    if (parent_view) +    { +        parent_view->onUpdateScrollToChild(cntrl); +    } +} + +// virtual  void LLView::translate(S32 x, S32 y)  {  	mRect.translate(x, y); diff --git a/indra/llui/llview.h b/indra/llui/llview.h index db81900aaf..5c91c37d3c 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -301,6 +301,7 @@ public:  	virtual BOOL	setLabelArg( const std::string& key, const LLStringExplicit& text );  	virtual void	onVisibilityChange ( BOOL new_visibility ); +	virtual void	onUpdateScrollToChild(const LLUICtrl * cntrl);  	void			pushVisible(BOOL visible)	{ mLastVisible = mVisible; setVisible(visible); }  	void			popVisible()				{ setVisible(mLastVisible); } | 
