NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
SearchCtrl Class Reference

Implementation of a generic search control based on a combo box. More...

#include <searchctrl.hpp>

Inheritance diagram for SearchCtrl:
Collaboration diagram for SearchCtrl:

Public Member Functions

 SearchCtrl (wxWindow *parent, wxWindowID id, const wxString &value=wxEmptyString, int style=wxCB_SORT)
 
void OnItemSelect (wxCommandEvent &event)
 This event handler function will be fired, if the user selects a proposed string in the opened dropdown list. More...
 
void OnTextChange (wxCommandEvent &event)
 This event handler function will be fired, if the user changes the text in the control. It will provide a dropdown menu with possible candidates matching to the provided search string. More...
 
void OnMouseEnter (wxMouseEvent &event)
 This event handler will show the drop down list, if the text field contains data and the mouse enters the text field. Replacement for the buggy EVT_SET_FOCUS event. More...
 
 DECLARE_EVENT_TABLE ()
 

Protected Member Functions

virtual bool selectItem (const wxString &value)
 Child classes may override this member function to do something, when the user selects an item in the popup. More...
 
virtual wxString getDragDropText (const wxString &value)
 Child classes may override this member function to provide a custom string for the built-in drag-drop functionality. More...
 
virtual wxArrayString getCandidates (const wxString &enteredText)
 Child classes must override this member function to provide the candidates to be filled into the popup based upon the letters entered in the text entry window. More...
 

Protected Attributes

SearchCtrlPopuppopUp
 

Private Attributes

bool textChangeMutex
 
wxString textEntryValue
 

Friends

class SearchCtrlPopup
 

Detailed Description

Implementation of a generic search control based on a combo box.

Definition at line 134 of file searchctrl.hpp.

Constructor & Destructor Documentation

◆ SearchCtrl()

SearchCtrl::SearchCtrl ( wxWindow *  parent,
wxWindowID  id,
const wxString &  value = wxEmptyString,
int  style = wxCB_SORT 
)
inline

Definition at line 152 of file searchctrl.hpp.

References popUp, and SearchCtrlPopup.

Member Function Documentation

◆ DECLARE_EVENT_TABLE()

SearchCtrl::DECLARE_EVENT_TABLE ( )

◆ getCandidates()

wxArrayString SearchCtrl::getCandidates ( const wxString &  enteredText)
protectedvirtual

Child classes must override this member function to provide the candidates to be filled into the popup based upon the letters entered in the text entry window.

Parameters
enteredTextconst wxString&
Returns
wxArrayString

Reimplemented in ToolBarSearchCtrl, TreeSearchCtrl, and PackageListSearchCtrl.

Definition at line 447 of file searchctrl.cpp.

Referenced by OnTextChange().

◆ getDragDropText()

wxString SearchCtrl::getDragDropText ( const wxString &  value)
protectedvirtual

Child classes may override this member function to provide a custom string for the built-in drag-drop functionality.

Parameters
valueconst wxString&
Returns
wxString

Reimplemented in ToolBarSearchCtrl.

Definition at line 431 of file searchctrl.cpp.

◆ OnItemSelect()

void SearchCtrl::OnItemSelect ( wxCommandEvent &  event)

This event handler function will be fired, if the user selects a proposed string in the opened dropdown list.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 465 of file searchctrl.cpp.

References selectItem().

Here is the call graph for this function:

◆ OnMouseEnter()

void SearchCtrl::OnMouseEnter ( wxMouseEvent &  event)

This event handler will show the drop down list, if the text field contains data and the mouse enters the text field. Replacement for the buggy EVT_SET_FOCUS event.

Parameters
eventwxMouseEvent&
Returns
void

Definition at line 530 of file searchctrl.cpp.

◆ OnTextChange()

void SearchCtrl::OnTextChange ( wxCommandEvent &  event)

This event handler function will be fired, if the user changes the text in the control. It will provide a dropdown menu with possible candidates matching to the provided search string.

Parameters
eventwxCommandEvent&
Returns
void

Definition at line 488 of file searchctrl.cpp.

References getCandidates(), popUp, SearchCtrlPopup::Set(), textChangeMutex, and textEntryValue.

Here is the call graph for this function:

◆ selectItem()

bool SearchCtrl::selectItem ( const wxString &  value)
protectedvirtual

Child classes may override this member function to do something, when the user selects an item in the popup.

Parameters
valueconst wxString&
Returns
bool true on success, false otherwise.

Reimplemented in ToolBarSearchCtrl, TreeSearchCtrl, and PackageListSearchCtrl.

Definition at line 414 of file searchctrl.cpp.

Referenced by OnItemSelect().

Friends And Related Function Documentation

◆ SearchCtrlPopup

friend class SearchCtrlPopup
friend

Definition at line 141 of file searchctrl.hpp.

Referenced by SearchCtrl().

Member Data Documentation

◆ popUp

◆ textChangeMutex

bool SearchCtrl::textChangeMutex
private

Definition at line 137 of file searchctrl.hpp.

Referenced by OnTextChange().

◆ textEntryValue

wxString SearchCtrl::textEntryValue
private

Definition at line 138 of file searchctrl.hpp.

Referenced by OnTextChange().


The documentation for this class was generated from the following files: