summaryrefslogtreecommitdiff
path: root/indra/llui/llview.cpp
diff options
context:
space:
mode:
authorJosh Bell <josh@lindenlab.com>2007-03-31 01:41:19 +0000
committerJosh Bell <josh@lindenlab.com>2007-03-31 01:41:19 +0000
commitea8fb7238e6f12383ee4bc081475fa6235637581 (patch)
treef384da93c884353bef55cf887f6c86f2081db271 /indra/llui/llview.cpp
parentffc6680d956069625fc1fe5da133bdf7922cea83 (diff)
svn merge -r 59364:59813 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance --> release
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r--indra/llui/llview.cpp38
1 files changed, 25 insertions, 13 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 02a99b00cd..da5c77fc94 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -155,18 +155,12 @@ LLView::~LLView()
gFocusMgr.removeKeyboardFocusWithoutCallback( this );
}
- if( gFocusMgr.getMouseCapture() == this )
+ if( hasMouseCapture() )
{
llwarns << "View holding mouse capture deleted: " << getName() << ". Mouse capture removed." << llendl;
gFocusMgr.removeMouseCaptureWithoutCallback( this );
}
- if( gFocusMgr.getTopView() == this )
- {
- llwarns << "View holding top view deleted: " << getName() << ". Top view removed." << llendl;
- gFocusMgr.removeTopViewWithoutCallback( this );
- }
-
sViewHandleMap.erase(mViewHandle);
deleteAllChildren();
@@ -733,9 +727,9 @@ void LLView::setEnabled(BOOL enabled)
// virtual
void LLView::setVisible(BOOL visible)
{
- if( !visible && (gFocusMgr.getTopView() == this) )
+ if( !visible && (gFocusMgr.getTopCtrl() == this) )
{
- gFocusMgr.setTopView( NULL, NULL );
+ gFocusMgr.setTopCtrl( NULL );
}
if ( mVisible != visible )
@@ -1034,7 +1028,14 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
return handled_view;
}
+void LLView::onMouseCaptureLost()
+{
+}
+BOOL LLView::hasMouseCapture()
+{
+ return gFocusMgr.getMouseCapture() == this;
+}
BOOL LLView::handleMouseUp(S32 x, S32 y, MASK mask)
{
@@ -1591,6 +1592,13 @@ const LLRect LLView::getLocalRect() const
return local_rect;
}
+const LLRect LLView::getLocalSnapRect() const
+{
+ LLRect local_snap_rect = getSnapRect();
+ local_snap_rect.translate(-mRect.mLeft, -mRect.mBottom);
+ return local_snap_rect;
+}
+
void LLView::updateRect()
{
if (mSpanChildren && mChildList.size())
@@ -2087,6 +2095,12 @@ const LLCtrlQuery & LLView::getFocusRootsQuery()
}
+void LLView::userSetShape(const LLRect& new_rect)
+{
+ reshape(new_rect.getWidth(), new_rect.getHeight());
+ translate(new_rect.mLeft - mRect.mLeft, new_rect.mBottom - mRect.mBottom);
+}
+
LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir,
LLView::ESnapType snap_type, S32 threshold, S32 padding)
{
@@ -2108,8 +2122,7 @@ LLView* LLView::findSnapRect(LLRect& new_rect, const LLCoordGL& mouse_dir,
BOOL snapped_x = FALSE;
BOOL snapped_y = FALSE;
- LLRect parent_local_snap_rect = mParentView->getSnapRect();
- parent_local_snap_rect.translate(-mParentView->getRect().mLeft, -mParentView->getRect().mBottom);
+ LLRect parent_local_snap_rect = mParentView->getLocalSnapRect();
if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS)
{
@@ -2284,8 +2297,7 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna
BOOL snapped_x = FALSE;
BOOL snapped_y = FALSE;
- LLRect parent_local_snap_rect = mParentView->getSnapRect();
- parent_local_snap_rect.translate(-mParentView->getRect().mLeft, -mParentView->getRect().mBottom);
+ LLRect parent_local_snap_rect = mParentView->getLocalSnapRect();
if (snap_type == SNAP_PARENT || snap_type == SNAP_PARENT_AND_SIBLINGS)
{