summaryrefslogtreecommitdiff
path: root/indra/llui/llflatlistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llflatlistview.cpp')
-rw-r--r--indra/llui/llflatlistview.cpp37
1 files changed, 24 insertions, 13 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp
index bc34012267..d499e08ecb 100644
--- a/indra/llui/llflatlistview.cpp
+++ b/indra/llui/llflatlistview.cpp
@@ -53,6 +53,17 @@ LLFlatListView::Params::Params()
no_items_text("no_items_text")
{};
+LLFlatListView::~LLFlatListView()
+{
+ clear();
+ // Route menu back to the default
+ if( gEditMenuHandler == this )
+ {
+ gEditMenuHandler = NULL;
+ }
+};
+
+
void LLFlatListView::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */)
{
LLScrollContainer::reshape(width, height, called_from_parent);
@@ -558,15 +569,6 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask)
}
break;
}
- case 'A':
- {
- if(MASK_CONTROL & mask)
- {
- selectAll();
- handled = TRUE;
- }
- break;
- }
default:
break;
}
@@ -791,10 +793,15 @@ bool LLFlatListView::selectNextItemPair(bool is_up_direction, bool reset_selecti
return false;
}
-bool LLFlatListView::selectAll()
+BOOL LLFlatListView::canSelectAll() const
+{
+ return !mItemPairs.empty() && mAllowSelection;
+}
+
+void LLFlatListView::selectAll()
{
if (!mAllowSelection)
- return false;
+ return;
mSelectedItemPairs.clear();
@@ -814,8 +821,6 @@ bool LLFlatListView::selectAll()
// Stretch selected item rect to ensure it won't be clipped
mSelectedItemsBorder->setRect(getLastSelectedItemRect().stretch(-1));
-
- return true;
}
bool LLFlatListView::isSelected(item_pair_t* item_pair) const
@@ -953,11 +958,17 @@ void LLFlatListView::getValues(std::vector<LLSD>& values) const
void LLFlatListView::onFocusReceived()
{
mSelectedItemsBorder->setVisible(TRUE);
+ gEditMenuHandler = this;
}
// virtual
void LLFlatListView::onFocusLost()
{
mSelectedItemsBorder->setVisible(FALSE);
+ // Route menu back to the default
+ if( gEditMenuHandler == this )
+ {
+ gEditMenuHandler = NULL;
+ }
}
//virtual