diff options
Diffstat (limited to 'linden/indra/llui/llview.cpp')
-rw-r--r-- | linden/indra/llui/llview.cpp | 39 |
1 files changed, 26 insertions, 13 deletions
diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 13f1ddc..d150e10 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp | |||
@@ -5,6 +5,7 @@ | |||
5 | * | 5 | * |
6 | * Copyright (c) 2001-2007, Linden Research, Inc. | 6 | * Copyright (c) 2001-2007, Linden Research, Inc. |
7 | * | 7 | * |
8 | * Second Life Viewer Source Code | ||
8 | * The source code in this file ("Source Code") is provided by Linden Lab | 9 | * The source code in this file ("Source Code") is provided by Linden Lab |
9 | * to you under the terms of the GNU General Public License, version 2.0 | 10 | * to you under the terms of the GNU General Public License, version 2.0 |
10 | * ("GPL"), unless you have obtained a separate licensing agreement | 11 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -174,18 +175,12 @@ LLView::~LLView() | |||
174 | gFocusMgr.removeKeyboardFocusWithoutCallback( this ); | 175 | gFocusMgr.removeKeyboardFocusWithoutCallback( this ); |
175 | } | 176 | } |
176 | 177 | ||
177 | if( gFocusMgr.getMouseCapture() == this ) | 178 | if( hasMouseCapture() ) |
178 | { | 179 | { |
179 | llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; | 180 | llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl; |
180 | gFocusMgr.removeMouseCaptureWithoutCallback( this ); | 181 | gFocusMgr.removeMouseCaptureWithoutCallback( this ); |
181 | } | 182 | } |
182 | 183 | ||
183 | if( gFocusMgr.getTopView() == this ) | ||
184 | { | ||
185 | llwarns << "View holding top view deleted: " << getName() << ". Top view removed." << llendl; | ||
186 | gFocusMgr.removeTopViewWithoutCallback( this ); | ||
187 | } | ||
188 | |||
189 | sViewHandleMap.erase(mViewHandle); | 184 | sViewHandleMap.erase(mViewHandle); |
190 | 185 | ||
191 | deleteAllChildren(); | 186 | deleteAllChildren(); |
@@ -752,9 +747,9 @@ void LLView::setEnabled(BOOL enabled) | |||
752 | // virtual | 747 | // virtual |
753 | void LLView::setVisible(BOOL visible) | 748 | void LLView::setVisible(BOOL visible) |
754 | { | 749 | { |
755 | if( !visible && (gFocusMgr.getTopView() == this) ) | 750 | if( !visible && (gFocusMgr.getTopCtrl() == this) ) |
756 | { | 751 | { |
757 | gFocusMgr.setTopView( NULL, NULL ); | 752 | gFocusMgr.setTopCtrl( NULL ); |
758 | } | 753 | } |
759 | 754 | ||
760 | if ( mVisible != visible ) | 755 | if ( mVisible != visible ) |
@@ -1053,7 +1048,14 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, | |||
1053 | return handled_view; | 1048 | return handled_view; |
1054 | } | 1049 | } |
1055 | 1050 | ||
1051 | void LLView::onMouseCaptureLost() | ||
1052 | { | ||
1053 | } | ||
1056 | 1054 | ||
1055 | BOOL LLView::hasMouseCapture() | ||
1056 | { | ||
1057 | return gFocusMgr.getMouseCapture() == this; | ||
1058 | } | ||
1057 | 1059 | ||
1058 | BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask) | 1060 | BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask) |
1059 | { | 1061 | { |
@@ -1610,6 +1612,13 @@ const LLRect LLView::getLocalRect() const | |||
1610 | return local_rect; | 1612 | return local_rect; |
1611 | } | 1613 | } |
1612 | 1614 | ||
1615 | const LLRect LLView::getLocalSnapRect() const | ||
1616 | { | ||
1617 | LLRect local_snap_rect = getSnapRect(); | ||
1618 | local_snap_rect.translate(-mRect.mLeft, -mRect.mBottom); | ||
1619 | return local_snap_rect; | ||
1620 | } | ||
1621 | |||
1613 | void LLView::updateRect() | 1622 | void LLView::updateRect() |
1614 | { | 1623 | { |
1615 | if (mSpanChildren && mChildList.size()) | 1624 | if (mSpanChildren && mChildList.size()) |
@@ -2106,6 +2115,12 @@ const LLCtrlQuery & LLView::getFocusRootsQuery() | |||
2106 | } | 2115 | } |
2107 | 2116 | ||
2108 | 2117 | ||
2118 | void LLView::userSetShape(const LLRect& new_rect) | ||
2119 | { | ||
2120 | reshape(new_rect.getWidth(), new_rect.getHeight()); | ||
2121 | translate(new_rect.mLeft - mRect.mLeft, new_rect.mBottom - mRect.mBottom); | ||
2122 | } | ||
2123 | |||
2109 | LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, | 2124 | LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, |
2110 | LLView::ESnapType snap_type, S32 threshold, S32 padding) | 2125 | LLView::ESnapType snap_type, S32 threshold, S32 padding) |
2111 | { | 2126 | { |
@@ -2127,8 +2142,7 @@ LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir, | |||
2127 | BOOL snapped_x = FALSE; | 2142 | BOOL snapped_x = FALSE; |
2128 | BOOL snapped_y = FALSE; | 2143 | BOOL snapped_y = FALSE; |
2129 | 2144 | ||
2130 | LLRect parent_local_snap_rect = mParentView->getSnapRect(); | 2145 | LLRect parent_local_snap_rect = mParentView->getLocalSnapRect(); |
2131 | parent_local_snap_rect.translate(-mParentView->getRect().mLeft, -mParentView->getRect().mBottom); | ||
2132 | 2146 | ||
2133 | if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS) | 2147 | if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS) |
2134 | { | 2148 | { |
@@ -2303,8 +2317,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna | |||
2303 | BOOL snapped_x = FALSE; | 2317 | BOOL snapped_x = FALSE; |
2304 | BOOL snapped_y = FALSE; | 2318 | BOOL snapped_y = FALSE; |
2305 | 2319 | ||
2306 | LLRect parent_local_snap_rect = mParentView->getSnapRect(); | 2320 | LLRect parent_local_snap_rect = mParentView->getLocalSnapRect(); |
2307 | parent_local_snap_rect.translate(-mParentView->getRect().mLeft, -mParentView->getRect().mBottom); | ||
2308 | 2321 | ||
2309 | if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS) | 2322 | if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS) |
2310 | { | 2323 | { |