summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-19 01:45:44 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-19 01:45:44 +0000
commit8103710c054ec6ea4a46f9732e569e543691184b (patch)
treeac03dd6d385e3345c57eff0e1064a011597fe5d6 /indra/llui
parent4ee757b45d527699b094bf9422244171fdd7d693 (diff)
Merging revisions 2046-2068 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1414 EXT-1213 EXT-1539 EXT-1253 EXT-1446 EXT-1438 EXT-1233 EXT-1466 EXT-1446 EXT-1512 EXT-1231 * Dev: EXT-719 (landmarks) EXT-747 EXT-1446 EXT-1378 EXT-397 EXT-1476 * IM changes
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llflatlistview.cpp14
-rw-r--r--indra/llui/llflatlistview.h2
-rw-r--r--indra/llui/llfloater.cpp6
-rw-r--r--indra/llui/llfloater.h3
-rw-r--r--indra/llui/llscrollbar.cpp9
-rw-r--r--indra/llui/llscrollcontainer.cpp6
-rw-r--r--indra/llui/llview.cpp26
-rw-r--r--indra/llui/llview.h2
8 files changed, 57 insertions, 11 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index e9df361472..bba5464b00 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -44,6 +44,9 @@ const LLSD UNSELECTED_EVENT = LLSD().insert("selected", false);
static const std::string COMMENT_TEXTBOX = "comment_text";
+//forward declaration
+bool llsds_are_equal(const LLSD& llsd_1, const LLSD& llsd_2);
+
LLFlatListView::Params::Params()
: item_pad("item_pad"),
allow_select("allow_select"),
@@ -333,6 +336,17 @@ void LLFlatListView::sort()
rearrangeItems();
}
+bool LLFlatListView::updateValue(const LLSD& old_value, const LLSD& new_value)
+{
+ if (old_value.isUndefined() || new_value.isUndefined()) return false;
+ if (llsds_are_equal(old_value, new_value)) return false;
+
+ item_pair_t* item_pair = getItemPair(old_value);
+ if (!item_pair) return false;
+
+ item_pair->second = new_value;
+ return true;
+}
//////////////////////////////////////////////////////////////////////////
// PROTECTED STUFF
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index af5a9cfa9b..888258efdc 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -273,6 +273,8 @@ public:
void setComparator(const ItemComparator* comp) { mItemComparator = comp; }
void sort();
+ bool updateValue(const LLSD& old_value, const LLSD& new_value);
+
protected:
/** Pairs LLpanel representing a single item LLPanel and LLSD associated with it */
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 47ca4899df..44c5f8c0de 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1262,6 +1262,12 @@ BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons inde
return FALSE;
}
+BOOL LLFloater::handleScrollWheel(S32 x, S32 y, S32 clicks)
+{
+ LLPanel::handleScrollWheel(x,y,clicks);
+ return TRUE;//always
+}
+
// virtual
BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask)
{
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 7a6c3f6863..123de12398 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -206,6 +206,9 @@ public:
virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
virtual BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask);
+
+ virtual BOOL handleScrollWheel(S32 x, S32 y, S32 mask);
+
virtual void draw();
virtual void onOpen(const LLSD& key) {}
diff --git a/indra/llui/llscrollbar.cpp b/indra/llui/llscrollbar.cpp
index a75a0c6979..0d674528dc 100644
--- a/indra/llui/llscrollbar.cpp
+++ b/indra/llui/llscrollbar.cpp
@@ -409,8 +409,13 @@ BOOL LLScrollbar::handleHover(S32 x, S32 y, MASK mask)
BOOL LLScrollbar::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
- changeLine( clicks * mStepSize, TRUE );
- return TRUE;
+ S32 pos = llclamp(mDocPos + clicks * mStepSize, 0, getDocPosMax());
+ if (pos != mDocPos)
+ {
+ setDocPos(pos, TRUE);
+ return TRUE;
+ }
+ return FALSE;
}
BOOL LLScrollbar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp
index 5597d494fe..d8606c6889 100644
--- a/indra/llui/llscrollcontainer.cpp
+++ b/indra/llui/llscrollcontainer.cpp
@@ -235,6 +235,8 @@ BOOL LLScrollContainer::handleKeyHere(KEY key, MASK mask)
BOOL LLScrollContainer::handleScrollWheel( S32 x, S32 y, S32 clicks )
{
+ if(LLUICtrl::handleScrollWheel(x,y,clicks))
+ return TRUE;
for( S32 i = 0; i < SCROLLBAR_COUNT; i++ )
{
// Note: tries vertical and then horizontal
@@ -246,9 +248,7 @@ BOOL LLScrollContainer::handleScrollWheel( S32 x, S32 y, S32 clicks )
return TRUE;
}
}
-
- // Eat scroll wheel event (to avoid scrolling nested containers?)
- return TRUE;
+ return FALSE;
}
BOOL LLScrollContainer::handleDragAndDrop(S32 x, S32 y, MASK mask,
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index ff6fe5a7ea..31f12fe312 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -672,6 +672,26 @@ LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask)
}
+LLView* LLView::childFromPoint(S32 x, S32 y)
+{
+ if (!getVisible() )
+ return false;
+ for ( child_list_iter_t child_it = mChildList.begin(); child_it != mChildList.end(); ++child_it)
+ {
+ LLView* viewp = *child_it;
+ S32 local_x = x - viewp->getRect().mLeft;
+ S32 local_y = y - viewp->getRect().mBottom;
+ if (!viewp->pointInView(local_x, local_y)
+ || !viewp->getVisible() )
+ {
+ continue;
+ }
+ return viewp;
+
+ }
+ return 0;
+}
+
BOOL LLView::handleToolTip(S32 x, S32 y, MASK mask)
{
BOOL handled = FALSE;
@@ -901,12 +921,6 @@ LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks)
handled_view = viewp;
break;
}
-
- if (viewp->blockMouseEvent(local_x, local_y))
- {
- handled_view = viewp;
- break;
- }
}
}
return handled_view;
diff --git a/indra/llui/llview.h b/indra/llui/llview.h
index 5e35068733..73146b2c1f 100644
--- a/indra/llui/llview.h
+++ b/indra/llui/llview.h
@@ -445,6 +445,8 @@ public:
/*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const;
/*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const;
+ virtual LLView* childFromPoint(S32 x, S32 y);
+
// view-specific handlers
virtual void onMouseEnter(S32 x, S32 y, MASK mask);
virtual void onMouseLeave(S32 x, S32 y, MASK mask);