21#ifndef __ANTARES_UI_COMMON_COMPONENT_SPOTLIGHT_SPOTLIGHT_H__
22#define __ANTARES_UI_COMMON_COMPONENT_SPOTLIGHT_SPOTLIGHT_H__
27#include <yuni/core/event.h>
29#include <wx/textctrl.h>
30#include <wx/combobox.h>
31#include <yuni/core/color/rgb.h>
45 optResultsInAPopup = 1,
62#include "searchtoken.h"
70#include "null-provider.h"
111 void search(
const wxString& text);
134 void onMapLayerAdded(
const wxString* text);
136 void onMapLayerRemoved(
const wxString* text);
138 void onMapLayerRenamed(
const wxString* text);
171 void createComponents(
Spotlight* parent,
bool input,
bool results);
176 void onComboUpdated(wxCommandEvent& evt);
222#include "spotlight.hxx"
Panel implementation.
Definition panel.h:36
std::shared_ptr< Vector > VectorPtr
Vector Ptr.
Definition spotlight.h:35
std::shared_ptr< IProvider > Ptr
ptr
Definition spotlight.h:34
std::vector< Ptr > Vector
Vector of search tokens.
Definition spotlight.h:34
std::shared_ptr< Vector > VectorPtr
Vector ptr.
Definition spotlight.h:36
Definition spotlight.h:40
void convertRawTextIntoSearchTokenVector(SearchToken::Vector &out, const Yuni::String &text)
Convert a raw text into a vector of tokens.
Definition spotlight.cpp:290
int pDisplayHandle
Display monitor handle.
Definition spotlight.h:205
wxWindow * pLayoutParent
Parent to consider for layout positioning when used from a frame.
Definition spotlight.h:207
void updateResults()
Update the GUI with the new results.
Definition spotlight.cpp:344
void onInputUpdated(wxCommandEvent &evt)
Event: the text input has been changed.
Definition spotlight.cpp:510
static void FrameClose()
Close any opened window.
Definition spotlight.cpp:657
IItem::VectorPtr pResults
Result set.
Definition spotlight.h:187
virtual ~Spotlight()
Destructor.
Definition spotlight.cpp:67
static void FrameShow(wxWindow *parent, IProvider::Ptr provider, uint flags=optGroups, uint width=340)
Display the spotlight in a frame.
Definition spotlight.cpp:553
Options
Definition spotlight.h:43
@ optBkgWhite
Use a white background instead of the default one.
Definition spotlight.h:53
@ optGroups
Display groups as well.
Definition spotlight.h:47
@ optAutoResizeParent
Try to automatically resize the parent window when according to the list.
Definition spotlight.h:49
@ optNoSearchInput
The search input will not be shown.
Definition spotlight.h:51
wxComboBox * pLayerFilter
ComboBox Filter.
Definition spotlight.h:195
Yuni::String pLastResearch
The last research.
Definition spotlight.h:191
@ defaultFlags
Default flags used by the constructor.
Definition spotlight.h:58
uint pFlags
Flags.
Definition spotlight.h:183
uint pItemHeight
Item height.
Definition spotlight.h:201
IProvider::Ptr provider() const
Get the provider.
Definition spotlight.hxx:36
Spotlight(wxWindow *parent, uint flags=defaultFlags)
Default constructor.
Definition spotlight.cpp:53
wxTextCtrl * pEdit
Text edit.
Definition spotlight.h:197
Yuni::Event< void(const IItem::VectorPtr &, const SearchToken::VectorPtr &)> onUpdateItems
Event: update items.
Definition spotlight.h:158
void resetSearchInput()
Reset the search input.
Definition spotlight.cpp:444
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:193
void redoResearch()
Redo the last search.
Definition spotlight.cpp:246
bool pAllowFrameResize
Previous height.
Definition spotlight.h:211
void resizeParentWindow()
Resize the parent window.
Definition spotlight.cpp:358
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:488
wxWindow * pListbox
The listbox.
Definition spotlight.h:199