summaryrefslogtreecommitdiff
path: root/indra/llui/llview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r--indra/llui/llview.cpp58
1 files changed, 28 insertions, 30 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index e3b61dfaa2..4770807ac7 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -145,12 +145,6 @@ LLView::~LLView()
// llassert_always(sDepth == 0); // avoid deleting views while drawing! It can subtly break list iterators
- if( gFocusMgr.getKeyboardFocus() == this )
- {
- //llwarns << "View holding keyboard focus deleted: " << getName() << ". Keyboard focus removed." << llendl;
- gFocusMgr.removeKeyboardFocusWithoutCallback( this );
- }
-
if( hasMouseCapture() )
{
//llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl;
@@ -947,16 +941,11 @@ BOOL LLView::handleDoubleClick(S32 x, S32 y, MASK mask)
BOOL LLView::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
- BOOL handled = FALSE;
if( getVisible() && getEnabled() )
{
- handled = childrenHandleScrollWheel( x, y, clicks ) != NULL;
- if( !handled && blockMouseEvent(x, y) )
- {
- handled = TRUE;
- }
+ return childrenHandleScrollWheel( x, y, clicks ) != NULL;
}
- return handled;
+ return FALSE;
}
BOOL LLView::handleRightMouseDown(S32 x, S32 y, MASK mask)
@@ -1306,6 +1295,11 @@ LLView* LLView::childrenHandleMiddleMouseUp(S32 x, S32 y, MASK mask)
void LLView::draw()
{
+ drawChildren();
+}
+
+void LLView::drawChildren()
+{
if (sDebugRects)
{
drawDebugRect();
@@ -1334,7 +1328,7 @@ void LLView::draw()
{
// Only draw views that are within the root view
localRectToScreen(viewp->getRect(),&screenRect);
- if ( rootRect.rectInRect(&screenRect) )
+ if ( rootRect.overlaps(screenRect) )
{
glMatrixMode(GL_MODELVIEW);
LLUI::pushMatrix();
@@ -1545,7 +1539,7 @@ void LLView::updateBoundingRect()
LLRect child_bounding_rect = childp->getBoundingRect();
- if (local_bounding_rect.isNull())
+ if (local_bounding_rect.isEmpty())
{
// start out with bounding rect equal to first visible child's bounding rect
local_bounding_rect = child_bounding_rect;
@@ -1553,7 +1547,7 @@ void LLView::updateBoundingRect()
else
{
// accumulate non-null children rectangles
- if (!child_bounding_rect.isNull())
+ if (!child_bounding_rect.isEmpty())
{
local_bounding_rect.unionWith(child_bounding_rect);
}
@@ -1644,7 +1638,7 @@ BOOL LLView::hasAncestor(const LLView* parentp) const
BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const
{
- LLView *child = getChildView(childname, TRUE, FALSE);
+ LLView *child = findChildView(childname, TRUE);
if (child)
{
return gFocusMgr.childHasKeyboardFocus(child);
@@ -1659,13 +1653,27 @@ BOOL LLView::childHasKeyboardFocus( const std::string& childname ) const
BOOL LLView::hasChild(const std::string& childname, BOOL recurse) const
{
- return getChildView(childname, recurse, FALSE) != NULL;
+ return findChildView(childname, recurse) != NULL;
}
//-----------------------------------------------------------------------------
// getChildView()
//-----------------------------------------------------------------------------
-LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_if_missing) const
+LLView* LLView::getChildView(const std::string& name, BOOL recurse) const
+{
+ LLView* child = findChildView(name, recurse);
+ if (!child)
+ {
+ child = getDefaultWidget<LLView>(name);
+ if (!child)
+ {
+ child = LLUICtrlFactory::createDefaultWidget<LLView>(name);
+ }
+ }
+ return child;
+}
+
+LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
{
//richard: should we allow empty names?
//if(name.empty())
@@ -1686,23 +1694,13 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse, BOOL create_
for ( child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
{
LLView* childp = *child_it;
- LLView* viewp = childp->getChildView(name, recurse, FALSE);
+ LLView* viewp = childp->findChildView(name, recurse);
if ( viewp )
{
return viewp;
}
}
}
-
- if (create_if_missing)
- {
- LLView* view = getDefaultWidget<LLView>(name);
- if (!view)
- {
- view = LLUICtrlFactory::createDefaultWidget<LLView>(name);
- }
- return view;
- }
return NULL;
}