|
@@ -832,6 +832,8 @@ GuiTreeViewCtrl::GuiTreeViewCtrl()
|
|
|
mTexSelected = NULL;
|
|
|
|
|
|
mRenderTooltipDelegate.bind( this, &GuiTreeViewCtrl::renderTooltip );
|
|
|
+
|
|
|
+ mDoFilterChildren = true;
|
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
@@ -1122,7 +1124,7 @@ void GuiTreeViewCtrl::_expandObjectHierarchy( SimGroup* group )
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
-void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdate )
|
|
|
+void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdate, bool skipFlter )
|
|
|
{
|
|
|
if (!item || !mActive || !isVisible() || !mProfile )
|
|
|
return;
|
|
@@ -1145,7 +1147,7 @@ void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdat
|
|
|
|
|
|
// If we have a filter pattern, sync the item's filtering status to it.
|
|
|
|
|
|
- if( !getFilterText().isEmpty() )
|
|
|
+ if( !getFilterText().isEmpty() && !skipFlter)
|
|
|
{
|
|
|
// Determine the filtering status by looking for the filter
|
|
|
// text in the item's display text.
|
|
@@ -1154,7 +1156,11 @@ void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdat
|
|
|
item->getDisplayText( sizeof( displayText ), displayText );
|
|
|
if( !dStristr( displayText, mFilterText ) )
|
|
|
{
|
|
|
- item->mState.set( Item::Filtered );
|
|
|
+ //Last check, see if we special-exception this item
|
|
|
+ if (!mItemFilterExceptionList.contains(item->mId))
|
|
|
+ item->mState.set(Item::Filtered);
|
|
|
+ else
|
|
|
+ item->mState.clear(Item::Filtered);
|
|
|
|
|
|
// If it's not a parent, we're done. Otherwise, there may be children
|
|
|
// that are not filtered so we need to process them first.
|
|
@@ -1163,7 +1169,9 @@ void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdat
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
- item->mState.clear( Item::Filtered );
|
|
|
+ {
|
|
|
+ item->mState.clear(Item::Filtered);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
item->mState.clear( Item::Filtered );
|
|
@@ -1217,7 +1225,10 @@ void GuiTreeViewCtrl::_buildItem( Item* item, U32 tabLevel, bool bForceFullUpdat
|
|
|
Item *pChildTemp = child;
|
|
|
child = child->mNext;
|
|
|
|
|
|
- _buildItem( pChildTemp, tabLevel + 1, bForceFullUpdate );
|
|
|
+ if (!mItemFilterExceptionList.contains(item->mId) && !mDoFilterChildren && !item->isFiltered())
|
|
|
+ _buildItem( pChildTemp, tabLevel + 1, bForceFullUpdate, true );
|
|
|
+ else
|
|
|
+ _buildItem(pChildTemp, tabLevel + 1, bForceFullUpdate, false);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -4775,6 +4786,18 @@ void GuiTreeViewCtrl::setFilterText( const String& text )
|
|
|
mFlags.set( RebuildVisible );
|
|
|
}
|
|
|
|
|
|
+void GuiTreeViewCtrl::setItemFilterException(U32 item, bool isExempted)
|
|
|
+{
|
|
|
+ if (isExempted)
|
|
|
+ {
|
|
|
+ mItemFilterExceptionList.push_back(item);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ mItemFilterExceptionList.remove(item);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
//=============================================================================
|
|
|
// Console Methods.
|
|
|
//=============================================================================
|
|
@@ -5574,6 +5597,20 @@ DefineEngineMethod( GuiTreeViewCtrl, setFilterText, void, ( const char* pattern
|
|
|
object->setFilterText( pattern );
|
|
|
}
|
|
|
|
|
|
+DefineEngineMethod(GuiTreeViewCtrl, setFilterChildren, void, (bool doFilterChildren), (true),
|
|
|
+ "Sets if the filter will also apply to any children of items that manage to pass being filtered.\n\n"
|
|
|
+ "@param doFilterChildren If true, items that pass the filter do not have their children filtered. If false, all items are filtered.\n\n")
|
|
|
+{
|
|
|
+ object->setFilterChildren(doFilterChildren);
|
|
|
+}
|
|
|
+
|
|
|
+DefineEngineMethod(GuiTreeViewCtrl, setItemFilterException, void, (U32 item, bool isExempt), (0, true),
|
|
|
+ "Set a given item to be excluded from being filtered.\n\n"
|
|
|
+ "@param item Item ID of the item that is to be exempt from the filter.\n\n"
|
|
|
+ "@param isExempt If the item is exempt from the filter.\n\n")
|
|
|
+{
|
|
|
+ object->setItemFilterException(item, isExempt);
|
|
|
+}
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
|
DefineEngineMethod( GuiTreeViewCtrl, clearFilterText, void, (),,
|