| 249 | // SFindInFlow |
| 250 | |
| 251 | void SFindInFlow::Construct(const FArguments& InArgs, TSharedPtr<class FFlowAssetEditor> InFlowAssetEditor) |
| 252 | { |
| 253 | FlowAssetEditorPtr = InFlowAssetEditor; |
| 254 | SearchResults.Setup(); |
| 255 | |
| 256 | // Load INI settings |
| 257 | const UFlowGraphEditorSettings* Settings = GetDefault<UFlowGraphEditorSettings>(); |
| 258 | if (ensure(Settings)) |
| 259 | { |
| 260 | MaxSearchDepth = Settings->DefaultMaxSearchDepth; |
| 261 | SearchFlags = static_cast<EFlowSearchFlags>(Settings->DefaultSearchFlags); |
| 262 | } |
| 263 | |
| 264 | // Populate scope options |
| 265 | FLOW_ASSERT_ENUM_MAX(EFlowSearchScope, 3); |
| 266 | for (EFlowSearchScope Scope : TEnumRange<EFlowSearchScope>()) |
| 267 | { |
| 268 | if (FlowEnum::IsValidEnumValue(Scope)) |
| 269 | { |
| 270 | ScopeOptionList.Add(MakeShareable(new EFlowSearchScope(Scope))); |
| 271 | } |
| 272 | } |
| 273 | SelectedScopeOption = ScopeOptionList[0]; |
| 274 | |
| 275 | SAssignNew(SearchTextField, SSearchBox) |
| 276 | .OnTextCommitted(this, &SFindInFlow::OnSearchTextCommitted); |
| 277 | |
| 278 | SAssignNew(SearchButton, SButton) |
| 279 | .Text(LOCTEXT("SearchButton", "Search")) |
| 280 | .OnClicked(this, &SFindInFlow::OnSearchButtonClicked); |
| 281 | |
| 282 | SAssignNew(MaxDepthSpinBox, SSpinBox<int32>) |
| 283 | .MinValue(0) |
| 284 | .MaxValue(10) |
| 285 | .Value(MaxSearchDepth) |
| 286 | .OnValueChanged(this, &SFindInFlow::OnMaxDepthChanged) |
| 287 | .ToolTipText(LOCTEXT("MaxDepthTooltip", "Maximum recursion depth when searching inside objects")); |
| 288 | |
| 289 | SAssignNew(TreeView, STreeViewType) |
| 290 | .TreeItemsSource(&SearchResults.ItemsFound) |
| 291 | .OnGenerateRow(this, &SFindInFlow::OnGenerateRow) |
| 292 | .OnGetChildren(this, &SFindInFlow::OnGetChildren) |
| 293 | .OnSelectionChanged(this, &SFindInFlow::OnTreeSelectionChanged) |
| 294 | .OnMouseButtonDoubleClick(this, &SFindInFlow::OnTreeSelectionDoubleClicked); |
| 295 | |
| 296 | ChildSlot |
| 297 | [ |
| 298 | SNew(SVerticalBox) |
| 299 | + SVerticalBox::Slot() |
| 300 | .AutoHeight() |
| 301 | [ |
| 302 | SNew(SHorizontalBox) |
| 303 | + SHorizontalBox::Slot() |
| 304 | .FillWidth(1.0f) |
| 305 | .VAlign(VAlign_Center) |
| 306 | [ |
| 307 | SearchTextField.ToSharedRef() |
| 308 | ] |
nothing calls this directly
no test coverage detected