summaryrefslogtreecommitdiff
path: root/indra/llui/llfolderview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llfolderview.cpp')
-rw-r--r--indra/llui/llfolderview.cpp314
1 files changed, 157 insertions, 157 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index 650ae9ae75..0ac04e374d 100644
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -84,12 +84,12 @@ F32 LLFolderView::sAutoOpenTime = 1.f;
class LLCloseAllFoldersFunctor : public LLFolderViewFunctor
{
public:
- LLCloseAllFoldersFunctor(BOOL close) { mOpen = !close; }
+ LLCloseAllFoldersFunctor(bool close) { mOpen = !close; }
virtual ~LLCloseAllFoldersFunctor() {}
virtual void doFolder(LLFolderViewFolder* folder);
virtual void doItem(LLFolderViewItem* item);
- BOOL mOpen;
+ bool mOpen;
};
@@ -167,21 +167,21 @@ LLFolderView::LLFolderView(const Params& p)
mAllowMultiSelect(p.allow_multiselect),
mAllowDrag(p.allow_drag),
mShowEmptyMessage(p.show_empty_message),
- mShowFolderHierarchy(FALSE),
+ mShowFolderHierarchy(false),
mRenameItem( NULL ),
- mNeedsScroll( FALSE ),
+ mNeedsScroll( false ),
mUseLabelSuffix(p.use_label_suffix),
mSuppressFolderMenu(p.suppress_folder_menu),
- mPinningSelectedItem(FALSE),
- mNeedsAutoSelect( FALSE ),
- mAutoSelectOverride(FALSE),
- mNeedsAutoRename(FALSE),
- mShowSelectionContext(FALSE),
- mShowSingleSelection(FALSE),
+ mPinningSelectedItem(false),
+ mNeedsAutoSelect( false ),
+ mAutoSelectOverride(false),
+ mNeedsAutoRename(false),
+ mShowSelectionContext(false),
+ mShowSingleSelection(false),
mArrangeGeneration(0),
mSignalSelectCallback(0),
mMinWidth(0),
- mDragAndDropThisFrame(FALSE),
+ mDragAndDropThisFrame(false),
mCallbackRegistrar(NULL),
mEnableRegistrar(NULL),
mUseEllipses(p.use_ellipses),
@@ -205,7 +205,7 @@ LLFolderView::LLFolderView(const Params& p)
mAutoOpenItems.setDepth(AUTO_OPEN_STACK_DEPTH);
mAutoOpenCandidate = NULL;
mAutoOpenTimer.stop();
- mKeyboardSelection = FALSE;
+ mKeyboardSelection = false;
mIndentation = getParentFolder() ? getParentFolder()->getIndentation() + mLocalIndentation : 0;
//clear label
@@ -280,9 +280,9 @@ LLFolderView::~LLFolderView( void )
mViewModel = NULL;
}
-BOOL LLFolderView::canFocusChildren() const
+bool LLFolderView::canFocusChildren() const
{
- return FALSE;
+ return false;
}
void LLFolderView::addFolder( LLFolderViewFolder* folder)
@@ -293,7 +293,7 @@ void LLFolderView::addFolder( LLFolderViewFolder* folder)
void LLFolderView::closeAllFolders()
{
// Close all the folders
- setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN);
+ setOpenArrangeRecursively(false, LLFolderViewFolder::RECURSE_DOWN);
arrangeAll();
}
@@ -303,7 +303,7 @@ void LLFolderView::openTopLevelFolders()
iter != mFolders.end();)
{
folders_t::iterator fit = iter++;
- (*fit)->setOpen(TRUE);
+ (*fit)->setOpen(true);
}
}
@@ -343,7 +343,7 @@ void LLFolderView::filter( LLFolderViewFilter& filter )
getViewModelItem()->filter(filter);
}
-void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
+void LLFolderView::reshape(S32 width, S32 height, bool called_from_parent)
{
LLRect scroll_rect;
if (mScrollContainer)
@@ -360,7 +360,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
width = scroll_rect.getWidth();
}
LLView::reshape(width, height, called_from_parent);
- mReshapeSignal(mSelectedItems, FALSE);
+ mReshapeSignal(mSelectedItems, false);
}
void LLFolderView::addToSelectionList(LLFolderViewItem* item)
@@ -371,9 +371,9 @@ void LLFolderView::addToSelectionList(LLFolderViewItem* item)
}
if (mSelectedItems.size())
{
- mSelectedItems.back()->setIsCurSelection(FALSE);
+ mSelectedItems.back()->setIsCurSelection(false);
}
- item->setIsCurSelection(TRUE);
+ item->setIsCurSelection(true);
mSelectedItems.push_back(item);
}
@@ -381,7 +381,7 @@ void LLFolderView::removeFromSelectionList(LLFolderViewItem* item)
{
if (mSelectedItems.size())
{
- mSelectedItems.back()->setIsCurSelection(FALSE);
+ mSelectedItems.back()->setIsCurSelection(false);
}
selected_items_t::iterator item_iter;
@@ -398,7 +398,7 @@ void LLFolderView::removeFromSelectionList(LLFolderViewItem* item)
}
if (mSelectedItems.size())
{
- mSelectedItems.back()->setIsCurSelection(TRUE);
+ mSelectedItems.back()->setIsCurSelection(true);
}
}
@@ -419,19 +419,19 @@ LLFolderView::selected_items_t& LLFolderView::getSelectedItems( void )
}
// Record the selected item and pass it down the hierachy.
-BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem,
- BOOL take_keyboard_focus)
+bool LLFolderView::setSelection(LLFolderViewItem* selection, bool openitem,
+ bool take_keyboard_focus)
{
mSignalSelectCallback = take_keyboard_focus ? SIGNAL_KEYBOARD_FOCUS : SIGNAL_NO_KEYBOARD_FOCUS;
if( selection == this )
{
- return FALSE;
+ return false;
}
if( selection && take_keyboard_focus)
{
- mParentPanel.get()->setFocus(TRUE);
+ mParentPanel.get()->setFocus(true);
}
// clear selection down here because change of keyboard focus can potentially
@@ -443,7 +443,7 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem,
addToSelectionList(selection);
}
- BOOL rv = LLFolderViewFolder::setSelection(selection, openitem, take_keyboard_focus);
+ bool rv = LLFolderViewFolder::setSelection(selection, openitem, take_keyboard_focus);
if(openitem && selection)
{
selection->getParentFolder()->requestArrange();
@@ -454,14 +454,14 @@ BOOL LLFolderView::setSelection(LLFolderViewItem* selection, BOOL openitem,
return rv;
}
-BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected)
+bool LLFolderView::changeSelection(LLFolderViewItem* selection, bool selected)
{
- BOOL rv = FALSE;
+ bool rv = false;
// can't select root folder
if(!selection || selection == this)
{
- return FALSE;
+ return false;
}
if (!mAllowMultiSelect)
@@ -478,7 +478,7 @@ BOOL LLFolderView::changeSelection(LLFolderViewItem* selection, BOOL selected)
}
}
- BOOL on_list = (item_iter != mSelectedItems.end());
+ bool on_list = (item_iter != mSelectedItems.end());
if(selected && !on_list)
{
@@ -510,7 +510,7 @@ void LLFolderView::sanitizeSelection()
LLFolderViewItem* item = *item_iter;
// ensure that each ancestor is open and potentially passes filtering
- BOOL visible = false;
+ bool visible = false;
if(item->getViewModelItem() != NULL)
{
visible = item->getViewModelItem()->potentiallyVisible(); // initialize from filter state for this item
@@ -558,7 +558,7 @@ void LLFolderView::sanitizeSelection()
std::vector<LLFolderViewItem*>::iterator item_it;
for (item_it = items_to_remove.begin(); item_it != items_to_remove.end(); ++item_it )
{
- changeSelection(*item_it, FALSE); // toggle selection (also removes from list)
+ changeSelection(*item_it, false); // toggle selection (also removes from list)
}
// if nothing selected after prior constraints...
@@ -596,7 +596,7 @@ void LLFolderView::sanitizeSelection()
if (new_selection)
{
- setSelection(new_selection, FALSE, FALSE);
+ setSelection(new_selection, false, false);
}
}
}
@@ -664,12 +664,12 @@ void LLFolderView::draw()
if (hasVisibleChildren())
{
- mStatusTextBox->setVisible( FALSE );
+ mStatusTextBox->setVisible( false );
}
else if (mShowEmptyMessage)
{
mStatusTextBox->setValue(getFolderViewModel()->getStatusText(mItems.empty() && mFolders.empty()));
- mStatusTextBox->setVisible( TRUE );
+ mStatusTextBox->setVisible( true );
// firstly reshape message textbox with current size. This is necessary to
// LLTextBox::getTextPixelHeight works properly
@@ -711,7 +711,7 @@ void LLFolderView::draw()
// and arrow for the root folder
LLView::draw();
- mDragAndDropThisFrame = FALSE;
+ mDragAndDropThisFrame = false;
}
void LLFolderView::finishRenamingItem( void )
@@ -830,7 +830,7 @@ void LLFolderView::autoOpenItem( LLFolderViewFolder* item )
while (close_item && close_item != item->getParentFolder())
{
mAutoOpenItems.pop();
- close_item->setOpenArrangeRecursively(FALSE);
+ close_item->setOpenArrangeRecursively(false);
close_item = mAutoOpenItems.check();
}
@@ -838,7 +838,7 @@ void LLFolderView::autoOpenItem( LLFolderViewFolder* item )
mAutoOpenItems.push(item);
- item->setOpen(TRUE);
+ item->setOpen(true);
if(!item->isSingleFolderMode())
{
LLRect content_rect = (mScrollContainer ? mScrollContainer->getContentWindowRect() : LLRect());
@@ -852,7 +852,7 @@ void LLFolderView::closeAutoOpenedFolders()
while (mAutoOpenItems.check())
{
LLFolderViewFolder* close_item = mAutoOpenItems.pop();
- close_item->setOpen(FALSE);
+ close_item->setOpen(false);
}
if (mAutoOpenCandidate)
@@ -863,7 +863,7 @@ void LLFolderView::closeAutoOpenedFolders()
mAutoOpenTimer.stop();
}
-BOOL LLFolderView::autoOpenTest(LLFolderViewFolder* folder)
+bool LLFolderView::autoOpenTest(LLFolderViewFolder* folder)
{
if (folder && mAutoOpenCandidate == folder)
{
@@ -877,10 +877,10 @@ BOOL LLFolderView::autoOpenTest(LLFolderViewFolder* folder)
{
autoOpenItem(folder);
mAutoOpenTimer.stop();
- return TRUE;
+ return true;
}
}
- return FALSE;
+ return false;
}
// otherwise new candidate, restart timer
@@ -890,14 +890,14 @@ BOOL LLFolderView::autoOpenTest(LLFolderViewFolder* folder)
}
mAutoOpenCandidate = folder;
mAutoOpenTimer.start();
- return FALSE;
+ return false;
}
-BOOL LLFolderView::canCopy() const
+bool LLFolderView::canCopy() const
{
if (!(getVisible() && getEnabled() && (mSelectedItems.size() > 0)))
{
- return FALSE;
+ return false;
}
for (selected_items_t::const_iterator selected_it = mSelectedItems.begin(); selected_it != mSelectedItems.end(); ++selected_it)
@@ -905,10 +905,10 @@ BOOL LLFolderView::canCopy() const
const LLFolderViewItem* item = *selected_it;
if (!item->getViewModelItem()->isItemCopyable())
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
// copy selected item
@@ -933,11 +933,11 @@ void LLFolderView::copy()
mSearchString.clear();
}
-BOOL LLFolderView::canCut() const
+bool LLFolderView::canCut() const
{
if (!(getVisible() && getEnabled() && (mSelectedItems.size() > 0)))
{
- return FALSE;
+ return false;
}
for (selected_items_t::const_iterator selected_it = mSelectedItems.begin(); selected_it != mSelectedItems.end(); ++selected_it)
@@ -947,10 +947,10 @@ BOOL LLFolderView::canCut() const
if (!listener || !listener->isItemRemovable())
{
- return FALSE;
+ return false;
}
}
- return TRUE;
+ return true;
}
void LLFolderView::cut()
@@ -982,11 +982,11 @@ void LLFolderView::cut()
mSearchString.clear();
}
-BOOL LLFolderView::canPaste() const
+bool LLFolderView::canPaste() const
{
if (mSelectedItems.empty())
{
- return FALSE;
+ return false;
}
if(getVisible() && getEnabled())
@@ -1003,13 +1003,13 @@ BOOL LLFolderView::canPaste() const
listener = folderp->getViewModelItem();
if (!listener || !listener->isClipboardPasteable())
{
- return FALSE;
+ return false;
}
}
}
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// paste selected item
@@ -1069,17 +1069,17 @@ void LLFolderView::startRenamingSelectedItem( void )
mRenamer->setText(item->getName());
mRenamer->selectAll();
- mRenamer->setVisible( TRUE );
+ mRenamer->setVisible( true );
// set focus will fail unless item is visible
- mRenamer->setFocus( TRUE );
+ mRenamer->setFocus( true );
mRenamer->setTopLostCallback(boost::bind(&LLFolderView::onRenamerLost, this));
LLUI::getInstance()->addPopup(mRenamer);
}
}
-BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
+bool LLFolderView::handleKeyHere( KEY key, MASK mask )
{
- BOOL handled = FALSE;
+ bool handled = false;
// SL-51858: Key presses are not being passed to the Popup menu.
// A proper fix is non-trivial so instead just close the menu.
@@ -1094,7 +1094,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
case KEY_F2:
mSearchString.clear();
startRenamingSelectedItem();
- handled = TRUE;
+ handled = true;
break;
case KEY_RETURN:
@@ -1104,7 +1104,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
{
finishRenamingItem();
mSearchString.clear();
- handled = TRUE;
+ handled = true;
}
}
break;
@@ -1113,7 +1113,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if( mRenameItem && mRenamer->getVisible() )
{
closeRenamer();
- handled = TRUE;
+ handled = true;
}
mSearchString.clear();
break;
@@ -1124,7 +1124,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
{
mScrollContainer->pageUp(30);
}
- handled = TRUE;
+ handled = true;
break;
case KEY_PAGE_DOWN:
@@ -1133,7 +1133,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
{
mScrollContainer->pageDown(30);
}
- handled = TRUE;
+ handled = true;
break;
case KEY_HOME:
@@ -1142,7 +1142,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
{
mScrollContainer->goToTop();
}
- handled = TRUE;
+ handled = true;
break;
case KEY_END:
@@ -1157,14 +1157,14 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if((mSelectedItems.size() > 0) && mScrollContainer)
{
LLFolderViewItem* last_selected = getCurSelectedItem();
- BOOL shift_select = mask & MASK_SHIFT;
+ bool shift_select = mask & MASK_SHIFT;
// don't shift select down to children of folders (they are implicitly selected through parent)
LLFolderViewItem* next = last_selected->getNextOpenNode(!shift_select);
if (!mKeyboardSelection || (!shift_select && (!next || next == last_selected)))
{
- setSelection(last_selected, FALSE, TRUE);
- mKeyboardSelection = TRUE;
+ setSelection(last_selected, false, true);
+ mKeyboardSelection = true;
}
if (shift_select)
@@ -1174,12 +1174,12 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if (next->isSelected())
{
// shrink selection
- changeSelection(last_selected, FALSE);
+ changeSelection(last_selected, false);
}
else if (last_selected->getParentFolder() == next->getParentFolder())
{
// grow selection
- changeSelection(next, TRUE);
+ changeSelection(next, true);
}
}
}
@@ -1193,11 +1193,11 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if(notifyParent(LLSD().with("action","select_next")) > 0 )//message was processed
{
clearSelection();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
- setSelection( next, FALSE, TRUE );
+ setSelection( next, false, true );
}
else
{
@@ -1205,14 +1205,14 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if(notifyParent(LLSD().with("action","select_next")) > 0 )//message was processed
{
clearSelection();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
}
scrollToShowSelection();
mSearchString.clear();
- handled = TRUE;
+ handled = true;
}
break;
@@ -1220,14 +1220,14 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if((mSelectedItems.size() > 0) && mScrollContainer)
{
LLFolderViewItem* last_selected = mSelectedItems.back();
- BOOL shift_select = mask & MASK_SHIFT;
+ bool shift_select = mask & MASK_SHIFT;
// don't shift select down to children of folders (they are implicitly selected through parent)
LLFolderViewItem* prev = last_selected->getPreviousOpenNode(!shift_select);
if (!mKeyboardSelection || (!shift_select && prev == this))
{
- setSelection(last_selected, FALSE, TRUE);
- mKeyboardSelection = TRUE;
+ setSelection(last_selected, false, true);
+ mKeyboardSelection = true;
}
if (shift_select)
@@ -1237,12 +1237,12 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if (prev->isSelected())
{
// shrink selection
- changeSelection(last_selected, FALSE);
+ changeSelection(last_selected, false);
}
else if (last_selected->getParentFolder() == prev->getParentFolder())
{
// grow selection
- changeSelection(prev, TRUE);
+ changeSelection(prev, true);
}
}
}
@@ -1256,18 +1256,18 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if(notifyParent(LLSD().with("action","select_prev")) > 0 )//message was processed
{
clearSelection();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
- setSelection( prev, FALSE, TRUE );
+ setSelection( prev, false, true );
}
}
scrollToShowSelection();
mSearchString.clear();
- handled = TRUE;
+ handled = true;
}
break;
@@ -1275,9 +1275,9 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if(mSelectedItems.size())
{
LLFolderViewItem* last_selected = getCurSelectedItem();
- last_selected->setOpen( TRUE );
+ last_selected->setOpen( true );
mSearchString.clear();
- handled = TRUE;
+ handled = true;
}
break;
@@ -1287,21 +1287,21 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
LLFolderViewItem* last_selected = getCurSelectedItem();
if(last_selected && last_selected->isSingleFolderMode())
{
- handled = FALSE;
+ handled = false;
break;
}
LLFolderViewItem* parent_folder = last_selected->getParentFolder();
if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder())
{
- setSelection(parent_folder, FALSE, TRUE);
+ setSelection(parent_folder, false, true);
}
else
{
- last_selected->setOpen( FALSE );
+ last_selected->setOpen( false );
}
mSearchString.clear();
scrollToShowSelection();
- handled = TRUE;
+ handled = true;
}
break;
}
@@ -1310,20 +1310,20 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
}
-BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char)
+bool LLFolderView::handleUnicodeCharHere(llwchar uni_char)
{
if ((uni_char < 0x20) || (uni_char == 0x7F)) // Control character or DEL
{
- return FALSE;
+ return false;
}
if (uni_char > 0x7f)
{
LL_WARNS() << "LLFolderView::handleUnicodeCharHere - Don't handle non-ascii yet, aborting" << LL_ENDL;
- return FALSE;
+ return false;
}
- BOOL handled = FALSE;
+ bool handled = false;
if (mParentPanel.get()->hasFocus())
{
// SL-51858: Key presses are not being passed to the Popup menu.
@@ -1344,28 +1344,28 @@ BOOL LLFolderView::handleUnicodeCharHere(llwchar uni_char)
{
mSearchString += uni_char;
}
- search(getCurSelectedItem(), mSearchString, FALSE);
+ search(getCurSelectedItem(), mSearchString, false);
- handled = TRUE;
+ handled = true;
}
return handled;
}
-BOOL LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
+bool LLFolderView::handleMouseDown( S32 x, S32 y, MASK mask )
{
- mKeyboardSelection = FALSE;
+ mKeyboardSelection = false;
mSearchString.clear();
- mParentPanel.get()->setFocus(TRUE);
+ mParentPanel.get()->setFocus(true);
LLEditMenuHandler::gEditMenuHandler = this;
return LLView::handleMouseDown( x, y, mask );
}
-BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &search_string, BOOL backward)
+bool LLFolderView::search(LLFolderViewItem* first_item, const std::string &search_string, bool backward)
{
// get first selected item
LLFolderViewItem* search_item = first_item;
@@ -1382,7 +1382,7 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
}
// search over all open nodes for first substring match (with wrapping)
- BOOL found = FALSE;
+ bool found = false;
LLFolderViewItem* original_search_item = search_item;
do
{
@@ -1408,7 +1408,7 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
S32 search_string_length = llmin(upper_case_string.size(), current_item_label.size());
if (!current_item_label.compare(0, search_string_length, upper_case_string))
{
- found = TRUE;
+ found = true;
break;
}
if (backward)
@@ -1425,26 +1425,26 @@ BOOL LLFolderView::search(LLFolderViewItem* first_item, const std::string &searc
if (found)
{
- setSelection(search_item, FALSE, TRUE);
+ setSelection(search_item, false, true);
scrollToShowSelection();
}
return found;
}
-BOOL LLFolderView::handleDoubleClick( S32 x, S32 y, MASK mask )
+bool LLFolderView::handleDoubleClick( S32 x, S32 y, MASK mask )
{
// skip LLFolderViewFolder::handleDoubleClick()
return LLView::handleDoubleClick( x, y, mask );
}
-BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
+bool LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
{
// all user operations move keyboard focus to inventory
// this way, we know when to stop auto-updating a search
- mParentPanel.get()->setFocus(TRUE);
+ mParentPanel.get()->setFocus(true);
- BOOL handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
+ bool handled = childrenHandleRightMouseDown(x, y, mask) != NULL;
S32 count = mSelectedItems.size();
LLMenuGL* menu = static_cast<LLMenuGL*>(mPopupMenuHandle.get());
@@ -1476,10 +1476,10 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
}
}
- BOOL item_clicked = FALSE;
- for (selected_items_t::iterator item_it = mSelectedItems.begin(); item_it != mSelectedItems.end(); ++item_it)
+ bool item_clicked{ false };
+ for (const auto item : mSelectedItems)
{
- item_clicked |= (*item_it)->getRect().pointInRect(x, y);
+ item_clicked |= item->getRect().pointInRect(x, y);
}
if(!item_clicked && mSingleFolderMode)
{
@@ -1516,15 +1516,15 @@ BOOL LLFolderView::handleRightMouseDown( S32 x, S32 y, MASK mask )
{
if (menu && menu->getVisible())
{
- menu->setVisible(FALSE);
+ menu->setVisible(false);
}
- setSelection(NULL, FALSE, TRUE);
+ setSelection(NULL, false, true);
}
return handled;
}
// Add "--no options--" if the menu is completely blank.
-BOOL LLFolderView::addNoOptions(LLMenuGL* menu) const
+bool LLFolderView::addNoOptions(LLMenuGL* menu) const
{
const std::string nooptions_str = "--no options--";
LLView *nooptions_item = NULL;
@@ -1537,7 +1537,7 @@ BOOL LLFolderView::addNoOptions(LLMenuGL* menu) const
LLView *menu_item = (*itor);
if (menu_item->getVisible())
{
- return FALSE;
+ return false;
}
std::string name = menu_item->getName();
if (menu_item->getName() == nooptions_str)
@@ -1547,14 +1547,14 @@ BOOL LLFolderView::addNoOptions(LLMenuGL* menu) const
}
if (nooptions_item)
{
- nooptions_item->setVisible(TRUE);
- nooptions_item->setEnabled(FALSE);
- return TRUE;
+ nooptions_item->setVisible(true);
+ nooptions_item->setEnabled(false);
+ return true;
}
- return FALSE;
+ return false;
}
-BOOL LLFolderView::handleHover( S32 x, S32 y, MASK mask )
+bool LLFolderView::handleHover( S32 x, S32 y, MASK mask )
{
return LLView::handleHover( x, y, mask );
}
@@ -1575,15 +1575,15 @@ void LLFolderView::setHoveredItem(LLFolderViewItem* itemp)
}
}
-BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+bool LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
std::string& tooltip_msg)
{
- mDragAndDropThisFrame = TRUE;
+ mDragAndDropThisFrame = true;
// have children handle it first
- BOOL handled = LLView::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data,
+ bool handled = LLView::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data,
accept, tooltip_msg);
// when drop is not handled by child, it should be handled
@@ -1614,7 +1614,7 @@ void LLFolderView::scrollToShowSelection()
{
if ( mSelectedItems.size() )
{
- mNeedsScroll = TRUE;
+ mNeedsScroll = true;
}
}
@@ -1627,7 +1627,7 @@ void LLFolderView::scrollToShowItem(LLFolderViewItem* item, const LLRect& constr
// don't scroll to items when mouse is being used to scroll/drag and drop
if (gFocusMgr.childHasMouseCapture(mScrollContainer))
{
- mNeedsScroll = FALSE;
+ mNeedsScroll = false;
return;
}
@@ -1665,18 +1665,18 @@ LLRect LLFolderView::getVisibleRect()
return visible_rect;
}
-BOOL LLFolderView::getShowSelectionContext()
+bool LLFolderView::getShowSelectionContext()
{
if (mShowSelectionContext)
{
- return TRUE;
+ return true;
}
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get();
if (menu && menu->getVisible())
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void LLFolderView::setShowSingleSelection(bool show)
@@ -1707,7 +1707,7 @@ void LLFolderView::update()
if (filter_object.isModified() && filter_object.isNotDefault() && mParentPanel.get()->getVisible())
{
- mNeedsAutoSelect = TRUE;
+ mNeedsAutoSelect = true;
}
// Filter to determine visibility before arranging
@@ -1734,7 +1734,7 @@ void LLFolderView::update()
applyFunctorRecursively(functor);
}
- // Open filtered folders for folder views with mAutoSelectOverride=TRUE.
+ // Open filtered folders for folder views with mAutoSelectOverride=true.
// Used by LLPlacesFolderView.
if (filter_object.showAllResults())
{
@@ -1747,7 +1747,7 @@ void LLFolderView::update()
scrollToShowSelection();
}
- BOOL filter_finished = mViewModel->contentsReady()
+ bool filter_finished = mViewModel->contentsReady()
&& (getViewModelItem()->passedFilter()
|| ( getViewModelItem()->getLastFilterGeneration() >= filter_object.getFirstSuccessGeneration()
&& !filter_modified));
@@ -1756,10 +1756,10 @@ void LLFolderView::update()
|| gFocusMgr.childHasMouseCapture(mParentPanel.get()))
{
// finishing the filter process, giving focus to the folder view, or dragging the scrollbar all stop the auto select process
- mNeedsAutoSelect = FALSE;
+ mNeedsAutoSelect = false;
}
- BOOL is_visible = isInVisibleChain() || mForceArrange;
+ bool is_visible = isInVisibleChain() || mForceArrange;
//Puts folders/items in proper positions
// arrange() takes the model filter flag into account and call sort() if necessary (CHUI-849)
@@ -1784,7 +1784,7 @@ void LLFolderView::update()
if (!mPinningSelectedItem && !mSelectedItems.empty())
{
// lets pin it!
- mPinningSelectedItem = TRUE;
+ mPinningSelectedItem = true;
//Computes visible area
const LLRect visible_content_rect = (mScrollContainer ? mScrollContainer->getVisibleContentRect() : LLRect());
@@ -1819,7 +1819,7 @@ void LLFolderView::update()
// stop pinning selected item after folders stop rearranging
if (!needsArrange())
{
- mPinningSelectedItem = FALSE;
+ mPinningSelectedItem = false;
}
}
@@ -1855,7 +1855,7 @@ void LLFolderView::update()
}
if (!needs_arrange || !is_visible)
{
- mNeedsScroll = FALSE;
+ mNeedsScroll = false;
}
}
}
@@ -1872,15 +1872,15 @@ void LLFolderView::update()
if (mSignalSelectCallback)
{
//RN: we use keyboard focus as a proxy for user-explicit actions
- BOOL take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS);
+ bool take_keyboard_focus = (mSignalSelectCallback == SIGNAL_KEYBOARD_FOCUS);
mSelectSignal(mSelectedItems, take_keyboard_focus);
}
- mSignalSelectCallback = FALSE;
+ mSignalSelectCallback = false;
}
}
else
{
- mSignalSelectCallback = FALSE;
+ mSignalSelectCallback = false;
}
}
@@ -1915,7 +1915,7 @@ void LLFolderView::updateRenamerPosition()
S32 width = llmax(llmin(mRenameItem->getRect().getWidth() - x, scroller_rect.getWidth() - x - getRect().mLeft), MINIMUM_RENAMER_WIDTH);
S32 height = mRenameItem->getItemHeight() - RENAME_HEIGHT_PAD;
- mRenamer->reshape( width, height, TRUE );
+ mRenamer->reshape( width, height, true );
}
}
@@ -1927,9 +1927,9 @@ void LLFolderView::updateMenuOptions(LLMenuGL* menu)
LLView::child_list_t::const_iterator menu_itor;
for (menu_itor = list->begin(); menu_itor != list->end(); ++menu_itor)
{
- (*menu_itor)->setVisible(FALSE);
- (*menu_itor)->pushVisible(TRUE);
- (*menu_itor)->setEnabled(TRUE);
+ (*menu_itor)->setVisible(false);
+ (*menu_itor)->pushVisible(true);
+ (*menu_itor)->setEnabled(true);
}
// Successively filter out invalid options
@@ -1995,7 +1995,7 @@ bool LLFolderView::selectFirstItem()
{
LLFolderViewItem* itemp = folder->getNextFromChild(0,true);
if(itemp)
- setSelection(itemp,FALSE,TRUE);
+ setSelection(itemp,false,true);
return true;
}
@@ -2006,7 +2006,7 @@ bool LLFolderView::selectFirstItem()
LLFolderViewItem* itemp = (*iit);
if (itemp->getVisible())
{
- setSelection(itemp,FALSE,TRUE);
+ setSelection(itemp,false,true);
return true;
}
}
@@ -2020,7 +2020,7 @@ bool LLFolderView::selectLastItem()
LLFolderViewItem* itemp = (*iit);
if (itemp->getVisible())
{
- setSelection(itemp,FALSE,TRUE);
+ setSelection(itemp,false,true);
return true;
}
}
@@ -2032,7 +2032,7 @@ bool LLFolderView::selectLastItem()
{
LLFolderViewItem* itemp = folder->getPreviousFromChild(0,true);
if(itemp)
- setSelection(itemp,FALSE,TRUE);
+ setSelection(itemp,false,true);
return true;
}
}
@@ -2073,15 +2073,15 @@ void LLFolderView::onRenamerLost()
{
if (mRenamer && mRenamer->getVisible())
{
- mRenamer->setVisible(FALSE);
+ mRenamer->setVisible(false);
// will commit current name (which could be same as original name)
- mRenamer->setFocus(FALSE);
+ mRenamer->setFocus(false);
}
if( mRenameItem )
{
- setSelection( mRenameItem, TRUE );
+ setSelection( mRenameItem, true );
mRenameItem = NULL;
}
}
@@ -2089,17 +2089,17 @@ void LLFolderView::onRenamerLost()
LLFolderViewItem* LLFolderView::getNextUnselectedItem()
{
LLFolderViewItem* last_item = *mSelectedItems.rbegin();
- LLFolderViewItem* new_selection = last_item->getNextOpenNode(FALSE);
+ LLFolderViewItem* new_selection = last_item->getNextOpenNode(false);
while(new_selection && new_selection->isSelected())
{
- new_selection = new_selection->getNextOpenNode(FALSE);
+ new_selection = new_selection->getNextOpenNode(false);
}
if (!new_selection)
{
- new_selection = last_item->getPreviousOpenNode(FALSE);
+ new_selection = last_item->getPreviousOpenNode(false);
while (new_selection && (new_selection->isInSelection()))
{
- new_selection = new_selection->getPreviousOpenNode(FALSE);
+ new_selection = new_selection->getPreviousOpenNode(false);
}
}
return new_selection;