Navigation
API > API/Developer > API/Developer/ToolWidgets
A Basic Filter Bar widget, which can be used to filter items of type [FilterType] given a list of custom filters Use the GetAllActiveFilters() function to get the FilterCollection of Active Filters in this FilterBar, that can be used to filter your items Use MakeAddFilterButton() to make the button that summons the dropdown showing all the filters
| Name | SBasicFilterBar |
| Type | class |
| Header File | /Engine/Source/Developer/ToolWidgets/Public/Filters/SBasicFilterBar.h |
| Include Path | #include "Filters/SBasicFilterBar.h" |
Syntax
template<typename FilterType>
class SBasicFilterBar : public SCompoundWidget
Inheritance Hierarchy
- FSharedFromThisBase → TSharedFromThis → SWidget → SCompoundWidget → SBasicFilterBar
- FSlateControlledConstruction → SWidget → SCompoundWidget → SBasicFilterBar
Derived Classes
Classes
| Name | Remarks |
|---|---|
| SFilter | A single filter in the filter list. Can be removed by clicking the remove button on it. |
| SFilterCheckBox | A class for check boxes in the filter list. |
Structs
| Name | Remarks |
|---|---|
| FArguments |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FCreateTextFilter | TBaseDelegate_NoParams< TSharedPtr< ICustomTextFilter< FilterType > > > | Delegate to create a TTextFilter used to compare FilterType with text queries | Filters/SBasicFilterBar.h |
| FOnFilterChanged | TBaseDelegate_NoParams< void > | Delegate for when filters have changed | Filters/SBasicFilterBar.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddFilter
(
TSharedRef< FFilterBase< FilterType > > InFilter |
Add a custom filter to the FilterBar. | Filters/SBasicFilterBar.h | |
void AttachFilterSearchBox
(
TSharedPtr< SFilterSearchBox > InFilterSearchBox |
Attach an SFilterSearchBox to this filter bar, overriding the SFilterSearchBox:: OnSaveSearchClicked event to save a search as a filter | Filters/SBasicFilterBar.h | |
void Construct
(
const FArguments& InArgs |
Filters/SBasicFilterBar.h | ||
void DisableAllFilters() |
Disable all the filters that are currently visible on the filter bar | Filters/SBasicFilterBar.h | |
void EnableAllFilters() |
Enable all the filters that are currently visible on the filter bar | Filters/SBasicFilterBar.h | |
virtual TSharedPtr< TFilterCollection< FilterType > > GetAllActiveFilters() |
Use this function to get all currently active filters (to filter your items) Not const on purpose: Subclasses might need to update the filter collection before getting it | Filters/SBasicFilterBar.h | |
TSharedPtr< FFilterBase< FilterType > > GetFilter
(
const FString& InName |
Retrieve a specific filter | Filters/SBasicFilterBar.h | |
ECheckBoxState GetFilterCheckState
(
const TSharedPtr< FFilterBase< FilterType > >& InFilter |
Returns the check box state of the specified filter (in the filter drop down). | Filters/SBasicFilterBar.h | |
EFilterBarLayout GetFilterLayout() |
Filters/SBasicFilterBar.h | ||
bool HasAnyFilters() |
Returns true if any filters are applied | Filters/SBasicFilterBar.h | |
bool IsFilterActive
(
const TSharedPtr< FFilterBase< FilterType > >& InFilter |
Returns true if the specified filter is both checked (pinned on the filter bar) and active (contributing to filter the result). | Filters/SBasicFilterBar.h | |
virtual void RemoveAllFilters() |
Remove all filters from the filter bar, while disabling any active ones | Filters/SBasicFilterBar.h | |
void SetFilterCheckState
(
const TSharedPtr< FFilterBase< FilterType > >& InFilter, |
Set the check box state of the specified filter (in the filter drop down) and pin/unpin a filter widget on/from the filter bar. | Filters/SBasicFilterBar.h | |
virtual void SetFilterLayout
(
EFilterBarLayout InFilterBarLayout |
Filters/SBasicFilterBar.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void AddFilterToBar
(
const TSharedRef< SFilter >& FilterToAdd |
'Activate' A filter by adding it to the filter bar, does not turn it on | Filters/SBasicFilterBar.h | |
TSharedRef< SFilter > AddFilterToBar
(
const TSharedRef< FFilterBase< FilterType > >& Filter |
'Activate' A filter by adding it to the filter bar, does not turn it on | Filters/SBasicFilterBar.h | |
void AddWidgetToLayout
(
const TSharedRef< SWidget > WidgetToAdd |
Add a widget to the current filter layout | Filters/SBasicFilterBar.h | |
void CreateAddCustomTextFilterWindow() |
Creates a dialog box to Add a custom text filter | Filters/SBasicFilterBar.h | |
void CreateCustomTextFilterFromSearch
(
const FText& InSearchText |
Creates a dialog to add a custom text filter from the given search text | Filters/SBasicFilterBar.h | |
void CreateCustomTextFilterWindow
(
const FCustomTextFilterData& CustomTextFilterData, |
Creates a dialog box with the SCustomTextFilterDialog Widget | Filters/SBasicFilterBar.h | |
void CreateEditCustomTextFilterWindow
(
TSharedPtr< ICustomTextFilter< FilterType > > InFilter |
Creates a dialog box to Edit an existing custom text filter | Filters/SBasicFilterBar.h | |
void CreateOtherFiltersMenuCategory
(
FToolMenuSection& Section, |
Handler for when the add filter menu is populated by a non-category | Filters/SBasicFilterBar.h | |
void CreateOtherFiltersMenuCategory
(
UToolMenu* InMenu, |
Handler for when the add filter menu is populated by a non-category | Filters/SBasicFilterBar.h | |
void CreateTextFiltersMenu
(
UToolMenu* InMenu |
Populate the Custom Filters submenu in the Add Filter dropdown | Filters/SBasicFilterBar.h | |
void CustomTextFilterClicked
(
ECheckBoxState CheckBoxState, |
Handler for when a checkbox next to a custom text filter is clicked | Filters/SBasicFilterBar.h | |
void EnableOnlyThisFilter
(
const TSharedRef< SFilter >& FilterToEnable |
Handler for when the enable only this button was clicked on a single filter | Filters/SBasicFilterBar.h | |
void FrontendFilterCategoryClicked
(
TSharedPtr< FFilterCategory > MenuCategory |
Handler for when a filter category is clicked | Filters/SBasicFilterBar.h | |
void FrontendFilterChanged
(
TSharedRef< FFilterBase< FilterType > > FrontendFilter |
Handler for when a frontend filter state has changed | Filters/SBasicFilterBar.h | |
void FrontendFilterClicked
(
TSharedRef< FFilterBase< FilterType > > FrontendFilter |
Handler for a frontend filter is clicked | Filters/SBasicFilterBar.h | |
| Filters/SBasicFilterBar.h | |||
const FSlateBrush * GetFilterBadgeIcon() |
Overlay for filter icon, badge if there are any active filters | Filters/SBasicFilterBar.h | |
ECheckBoxState IsFrontendFilterCategoryChecked
(
TSharedPtr< FFilterCategory > MenuCategory |
Handler to determine the "checked" state of a frontend filter category in the filter dropdown | Filters/SBasicFilterBar.h | |
bool IsFrontendFilterCategoryInUse
(
TSharedPtr< FFilterCategory > MenuCategory |
Handler to check if a filter category is in use | Filters/SBasicFilterBar.h | |
bool IsFrontendFilterInUse
(
TSharedRef< FFilterBase< FilterType > > FrontendFilter |
Handler to check if a frontend filter is in use | Filters/SBasicFilterBar.h | |
virtual void OnCancelCustomTextFilterDialog() |
Handler to close the custom text filter dialog | Filters/SBasicFilterBar.h | |
virtual void OnCreateCustomTextFilter
(
const FCustomTextFilterData& InFilterData, |
Handler for when a custom text filter is created | Filters/SBasicFilterBar.h | |
virtual void OnDeleteCustomTextFilter
(
const TSharedPtr< ICustomTextFilter< FilterType > > InFilter |
Handler for when a custom text filter is deleted | Filters/SBasicFilterBar.h | |
bool OnIsFilterActive
(
TWeakPtr< FFilterBase< FilterType > > InWeakFilter |
Called externally to determine if a filter has been checked/pinned and activated | Filters/SBasicFilterBar.h | |
virtual void OnModifyCustomTextFilter
(
const FCustomTextFilterData& InFilterData, |
Handler for when a custom text filter is modified | Filters/SBasicFilterBar.h | |
void OnResetFilters() |
Called when reset filters option is pressed | Filters/SBasicFilterBar.h | |
void OnSetFilterActive
(
bool bActive, |
Called externally to check/pin a filter, and activates/deactivates it | Filters/SBasicFilterBar.h | |
void PopulateCommonFilterSections
(
UToolMenu* Menu |
Helper function to add common sections to the Add Filter Menu | Filters/SBasicFilterBar.h | |
void PopulateCustomFilters
(
UToolMenu* Menu |
Helper function to add all custom filters to the Add Filter Menu | Filters/SBasicFilterBar.h | |
virtual void RemoveAllButThis
(
const TSharedRef< SFilter >& FilterToKeep |
Remove all filters except the specified one | Filters/SBasicFilterBar.h | |
virtual void RemoveFilter
(
const TSharedRef< SFilter >& FilterToRemove |
Remove a filter from the filter bar | Filters/SBasicFilterBar.h | |
void RemoveFilter
(
const TSharedRef< FFilterBase< FilterType > >& InFilterToRemove, |
Remove a filter from the filter bar | Filters/SBasicFilterBar.h | |
void RemoveFilterAndUpdate
(
const TSharedRef< SFilter >& FilterToRemove |
Remove a filter from the filter bar | Filters/SBasicFilterBar.h | |
void RemoveWidgetFromLayout
(
const TSharedRef< SWidget > WidgetToRemove |
Remove a widget from the current filter layout | Filters/SBasicFilterBar.h | |
void SetFrontendFilterActive
(
const TSharedRef< FFilterBase< FilterType > >& Filter, |
Sets the active state of a frontend filter. | Filters/SBasicFilterBar.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TSharedRef< SWidget > MakeAddFilterButton
(
TSharedRef< SBasicFilterBar< FilterType > > InFilterBar |
Makes the button that summons the Add Filter dropdown on click | Filters/SBasicFilterBar.h |
See Also
-
SFilterBar in EditorWidgets if you want a Filter Bar that includes Asset Type Filters NOTE: The filter functions create copies
-
so you want to use a reference or pointer as the template type when possible Sample Usage: SAssignNew(MyFilterBar
-
SBasicFilterBar
) .OnFilterChanged() // A delegate for when the list of filters changes .CustomFilters() // An array of filters available to this FilterBar ( -
FGenericFilter to create simple delegate based filters)