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

This class specializes the generic search control to be placed in the toolbar and to use the internal NumeRe::DataBase as data source. More...

#include <toolbarsearchctrl.hpp>

Inheritance diagram for ToolBarSearchCtrl:
Collaboration diagram for ToolBarSearchCtrl:

Public Member Functions

 ToolBarSearchCtrl (wxWindow *parent, wxWindowID id, const NumeRe::DataBase &db, NumeReWindow *_mainframe, NumeReTerminal *_term, const wxString &hint=wxEmptyString, const wxString &calltip=wxEmptyString, const wxString &calltiphighlight=wxEmptyString, int width=300, int extension=200)
 
- Public Member Functions inherited from SearchCtrl
 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) override
 This member function performs the actions necessary, when the user selects an item in the popup list (e.g. via double click). More...
 
virtual wxString getDragDropText (const wxString &value) override
 This member function provides the text to be inserted, when the user drag-drops one of the results. This is different from the inserted text, when the user selects an item in the list. More...
 
virtual wxArrayString getCandidates (const wxString &enteredText) override
 This method returns an array of strings containing possible candidates for the passed search string. More...
 
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...
 

Private Attributes

NumeRe::DataBase searchDB
 
NumeReWindowm_mainframe
 
NumeReTerminalm_terminal
 

Additional Inherited Members

- Protected Attributes inherited from SearchCtrl
SearchCtrlPopuppopUp
 

Detailed Description

This class specializes the generic search control to be placed in the toolbar and to use the internal NumeRe::DataBase as data source.

Definition at line 35 of file toolbarsearchctrl.hpp.

Constructor & Destructor Documentation

◆ ToolBarSearchCtrl()

ToolBarSearchCtrl::ToolBarSearchCtrl ( wxWindow *  parent,
wxWindowID  id,
const NumeRe::DataBase db,
NumeReWindow _mainframe,
NumeReTerminal _term,
const wxString &  hint = wxEmptyString,
const wxString &  calltip = wxEmptyString,
const wxString &  calltiphighlight = wxEmptyString,
int  width = 300,
int  extension = 200 
)
inline

Definition at line 49 of file toolbarsearchctrl.hpp.

References SearchCtrlPopup::EnableColors(), SearchCtrlPopup::EnableDragDrop(), m_mainframe, m_terminal, SearchCtrl::popUp, searchDB, SearchCtrlPopup::SetCallTips(), and SearchCtrlPopup::SetColSizes().

Here is the call graph for this function:

Member Function Documentation

◆ getCandidates()

wxArrayString ToolBarSearchCtrl::getCandidates ( const wxString &  enteredText)
overrideprotectedvirtual

This method returns an array of strings containing possible candidates for the passed search string.

Parameters
enteredTextconst wxString&
Returns
wxArrayString

Reimplemented from SearchCtrl.

Definition at line 97 of file toolbarsearchctrl.cpp.

References NumeRe::DataBase::findRecordsUsingRelevance(), NumeRe::DataBase::getElement(), and searchDB.

Here is the call graph for this function:

◆ getDragDropText()

wxString ToolBarSearchCtrl::getDragDropText ( const wxString &  value)
overrideprotectedvirtual

This member function provides the text to be inserted, when the user drag-drops one of the results. This is different from the inserted text, when the user selects an item in the list.

Parameters
valueconst wxString&
Returns
wxString

Reimplemented from SearchCtrl.

Definition at line 69 of file toolbarsearchctrl.cpp.

References NumeRe::DataBase::findRecord(), NumeRe::DataBase::getElement(), and searchDB.

Here is the call graph for this function:

◆ selectItem()

bool ToolBarSearchCtrl::selectItem ( const wxString &  value)
overrideprotectedvirtual

This member function performs the actions necessary, when the user selects an item in the popup list (e.g. via double click).

Parameters
valueconst wxString&
Returns
bool

Reimplemented from SearchCtrl.

Definition at line 36 of file toolbarsearchctrl.cpp.

References NumeRe::DataBase::findRecord(), NumeReWindow::GetCurrentEditor(), NumeRe::DataBase::getElement(), m_mainframe, searchDB, and NumeReWindow::ShowHelp().

Here is the call graph for this function:

Member Data Documentation

◆ m_mainframe

NumeReWindow* ToolBarSearchCtrl::m_mainframe
private

Definition at line 39 of file toolbarsearchctrl.hpp.

Referenced by selectItem(), and ToolBarSearchCtrl().

◆ m_terminal

NumeReTerminal* ToolBarSearchCtrl::m_terminal
private

Definition at line 40 of file toolbarsearchctrl.hpp.

Referenced by ToolBarSearchCtrl().

◆ searchDB

NumeRe::DataBase ToolBarSearchCtrl::searchDB
private

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