Worldstone
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
SearchableListWidget.h
1 #pragma once
2 #include <Vector.h>
3 #include <string>
4 #include "imgui/imgui_bgfx.h"
5 
9 {
10  template<class T>
11  using Vector = WorldStone::Vector<T>;
12 
13  Vector<std::string> elements;
14  Vector<const char*> filteredElements;
15  int currentSelectionIndex;
16 
17  ImGuiTextFilter textFilter;
18 
19  void updateFilteredElementsList();
20 
21 public:
23  void replaceElements(Vector<std::string> newElements);
24 
30  bool display();
31 
33  const char* getSelectedElement();
34 };
An imgui ListBox associated to a search filter.
Just a placeholder to use if we ever want to implement our own vector type.
const char * getSelectedElement()
void replaceElements(Vector< std::string > newElements)
Replace all the elements of the list by a new one.
bool display()
Display the filter and the ListBox.