21 #ifndef __ANTARES_UI_COMMON_COMPONENT_SPOTLIGHT_SPOTLIGHT_H__
22 #define __ANTARES_UI_COMMON_COMPONENT_SPOTLIGHT_SPOTLIGHT_H__
24 #include <yuni/yuni.h>
27 #include <yuni/core/event.h>
28 #include <wx/bitmap.h>
29 #include <wx/textctrl.h>
30 #include <wx/combobox.h>
31 #include <yuni/core/color/rgb.h>
35 namespace Antares::Component
43 optResultsInAPopup = 1,
61 #include "searchtoken.h"
65 #include "separator.h"
72 #include "null-provider.h"
113 void search(
const wxString& text);
136 void onMapLayerAdded(
const wxString* text);
138 void onMapLayerRemoved(
const wxString* text);
140 void onMapLayerRenamed(
const wxString* text);
173 void createComponents(
Spotlight* parent,
bool input,
bool results);
178 void onComboUpdated(wxCommandEvent& evt);
224 #include "spotlight.hxx"
Panel implementation.
Definition: panel.h:34
Definition: spotlight.h:38
void convertRawTextIntoSearchTokenVector(SearchToken::Vector &out, const Yuni::String &text)
Convert a raw text into a vector of tokens.
Definition: spotlight.cpp:306
int pDisplayHandle
Display monitor handle.
Definition: spotlight.h:207
@ defaultFlags
Default flags used by the constructor.
Definition: spotlight.h:57
wxWindow * pLayoutParent
Parent to consider for layout positioning when used from a frame.
Definition: spotlight.h:209
void updateResults()
Update the GUI with the new results.
Definition: spotlight.cpp:366
void onInputUpdated(wxCommandEvent &evt)
Event: the text input has been changed.
Definition: spotlight.cpp:559
static void FrameClose()
Close any opened window.
Definition: spotlight.cpp:728
IItem::VectorPtr pResults
Result set.
Definition: spotlight.h:189
virtual ~Spotlight()
Destructor.
Definition: spotlight.cpp:65
static void FrameShow(wxWindow *parent, IProvider::Ptr provider, uint flags=optGroups, uint width=340)
Display the spotlight in a frame.
Definition: spotlight.cpp:608
Options
Definition: spotlight.h:41
@ optBkgWhite
Use a white background instead of the default one.
Definition: spotlight.h:51
@ optGroups
Display groups as well.
Definition: spotlight.h:45
@ optAutoResizeParent
Try to automatically resize the parent window when according to the list.
Definition: spotlight.h:47
@ optNoSearchInput
The search input will not be shown.
Definition: spotlight.h:49
wxComboBox * pLayerFilter
ComboBox Filter.
Definition: spotlight.h:197
Yuni::String pLastResearch
The last research.
Definition: spotlight.h:193
uint pFlags
Flags.
Definition: spotlight.h:185
uint pItemHeight
Item height.
Definition: spotlight.h:203
IProvider::Ptr provider() const
Get the provider.
Definition: spotlight.hxx:36
Spotlight(wxWindow *parent, uint flags=defaultFlags)
Default constructor.
Definition: spotlight.cpp:51
wxTextCtrl * pEdit
Text edit.
Definition: spotlight.h:199
Yuni::Event< void(const IItem::VectorPtr &, const SearchToken::VectorPtr &)> onUpdateItems
Event: update items.
Definition: spotlight.h:160
void resetSearchInput()
Reset the search input.
Definition: spotlight.cpp:483
uint itemHeight() const
Get the item height.
Definition: spotlight.hxx:61
Yuni::Event< void(IProvider::Ptr)> pResetProvider
Internal updater for the provider.
Definition: spotlight.h:195
void redoResearch()
Redo the last search.
Definition: spotlight.cpp:254
bool pAllowFrameResize
Previous height.
Definition: spotlight.h:213
void resizeParentWindow()
Resize the parent window.
Definition: spotlight.cpp:384
void search(const Yuni::String &text)
Update the component with a given search string.
void onMapLayerChanged(const wxString *text)
set the value of the search input
Definition: spotlight.cpp:533
wxWindow * pListbox
The listbox.
Definition: spotlight.h:201
std::shared_ptr< Vector > VectorPtr
Vector Ptr.
Definition: iitem.h:34
std::shared_ptr< IProvider > Ptr
ptr
Definition: provider.h:33
std::shared_ptr< Vector > VectorPtr
Vector ptr.
Definition: searchtoken.h:35
std::vector< Ptr > Vector
Vector of search tokens.
Definition: searchtoken.h:33