summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerwindow.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-09 13:19:46 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-09 13:19:46 +0000
commitd0d1534e34a544a2a2acc9993421f587bb4f6ede (patch)
tree99eb3d9b83bcbcaaedf3413aa2eecbf3cf329fbe /indra/newview/llviewerwindow.cpp
parentdf50590145a835531a9539a96e8349f910161f53 (diff)
parent7b029036339ae1770307ff33ccd5d540e2618748 (diff)
merge from viewer-2-0
Diffstat (limited to 'indra/newview/llviewerwindow.cpp')
-rw-r--r--indra/newview/llviewerwindow.cpp96
1 files changed, 75 insertions, 21 deletions
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 30f2d2c41b..d0a1a31ebd 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -131,6 +131,7 @@
#include "llmorphview.h"
#include "llmoveview.h"
#include "llnavigationbar.h"
+#include "llpopupview.h"
#include "llpreviewtexture.h"
#include "llprogressview.h"
#include "llresmgr.h"
@@ -690,23 +691,23 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK
}
// Topmost view gets a chance before the hierarchy
- LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
- if (top_ctrl)
- {
- S32 local_x, local_y;
- top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
- if (top_ctrl->pointInView(local_x, local_y))
- {
- return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ;
- }
- else
- {
- if (down)
- {
- gFocusMgr.setTopCtrl(NULL);
- }
- }
- }
+ //LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl();
+ //if (top_ctrl)
+ //{
+ // S32 local_x, local_y;
+ // top_ctrl->screenPointToLocal( x, y, &local_x, &local_y );
+ // if (top_ctrl->pointInView(local_x, local_y))
+ // {
+ // return top_ctrl->handleAnyMouseClick(local_x, local_y, mask, clicktype, down) ;
+ // }
+ // else
+ // {
+ // if (down)
+ // {
+ // gFocusMgr.setTopCtrl(NULL);
+ // }
+ // }
+ //}
// Give the UI views a chance to process the click
if( mRootView->handleAnyMouseClick(x, y, mask, clicktype, down) )
@@ -1552,11 +1553,13 @@ void LLViewerWindow::initBase()
mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle();
mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
+ mPopupView = main_view->getChild<LLPopupView>("popup_holder");
// Constrain floaters to inside the menu and status bar regions.
gFloaterView = main_view->getChild<LLFloaterView>("Floater View");
gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View");
+
// Console
llassert( !gConsole );
LLConsole::Params cp;
@@ -2018,9 +2021,9 @@ void LLViewerWindow::drawDebugText()
void LLViewerWindow::draw()
{
-#if LL_DEBUG
+//#if LL_DEBUG
LLView::sIsDrawing = TRUE;
-#endif
+//#endif
stop_glerror();
LLUI::setLineWidth(1.f);
@@ -2132,9 +2135,9 @@ void LLViewerWindow::draw()
LLUI::popMatrix();
gGL.popMatrix();
-#if LL_DEBUG
+//#if LL_DEBUG
LLView::sIsDrawing = FALSE;
-#endif
+//#endif
}
// Takes a single keydown event, usually when UI is visible
@@ -2426,6 +2429,30 @@ void LLViewerWindow::handleScrollWheel(S32 clicks)
return;
}
+void LLViewerWindow::addPopup(LLView* popup)
+{
+ if (mPopupView)
+ {
+ mPopupView->addPopup(popup);
+ }
+}
+
+void LLViewerWindow::removePopup(LLView* popup)
+{
+ if (mPopupView)
+ {
+ mPopupView->removePopup(popup);
+ }
+}
+
+void LLViewerWindow::clearPopups()
+{
+ if (mPopupView)
+ {
+ mPopupView->clearPopups();
+ }
+}
+
void LLViewerWindow::moveCursorToCenter()
{
if (! gSavedSettings.getBOOL("DisableMouseWarp"))
@@ -2554,6 +2581,33 @@ void LLViewerWindow::updateUI()
}
// aggregate visible views that contain mouse cursor in display order
+ LLPopupView::popup_list_t popups = mPopupView->getCurrentPopups();
+
+ for(LLPopupView::popup_list_t::iterator popup_it = popups.begin(); popup_it != popups.end(); ++popup_it)
+ {
+ LLView* popup = popup_it->get();
+ if (popup && popup->calcScreenBoundingRect().pointInRect(x, y))
+ {
+ // iterator over contents of top_ctrl, and throw into mouse_hover_set
+ for (LLView::tree_iterator_t it = popup->beginTreeDFS();
+ it != popup->endTreeDFS();
+ ++it)
+ {
+ LLView* viewp = *it;
+ if (viewp->getVisible()
+ && viewp->calcScreenBoundingRect().pointInRect(x, y))
+ {
+ // we have a view that contains the mouse, add it to the set
+ mouse_hover_set.insert(viewp->getHandle());
+ }
+ else
+ {
+ // skip this view and all of its children
+ it.skipDescendants();
+ }
+ }
+ }
+ }
// while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events
if (top_ctrl && top_ctrl->calcScreenBoundingRect().pointInRect(x, y))