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

This class specializes the generic search control to interact with a wxTreeCtrl. More...

#include <treesearchctrl.hpp>

Inheritance diagram for TreeSearchCtrl:
Collaboration diagram for TreeSearchCtrl:

Public Member Functions

 TreeSearchCtrl (wxWindow *parent, wxWindowID id, const wxString &hint=wxEmptyString, const wxString &calltip=wxEmptyString, wxTreeCtrl *associatedCtrl=nullptr, bool searchToolTip=false)
 
- 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 method searches and selects the item with the passed label in the associated tree. More...
 
wxTreeItemId findItem (const wxString &value, wxTreeItemId node)
 This method searches for the tree item, whose label corresponds to the passed string. More...
 
virtual wxArrayString getCandidates (const wxString &enteredText) override
 This method returns an array of strings containing possible candidates for the passed search string. More...
 
wxArrayString getChildCandidates (const wxString &enteredText, wxTreeItemId node)
 This method returns an array of strings containing possible candiates for the passed search string, which correspond to the current tree node, its siblings and its childs. More...
 
- Protected Member Functions inherited from SearchCtrl
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

wxTreeCtrl * m_associatedCtrl
 
bool m_searchToolTip
 

Additional Inherited Members

- Protected Attributes inherited from SearchCtrl
SearchCtrlPopuppopUp
 

Detailed Description

This class specializes the generic search control to interact with a wxTreeCtrl.

Definition at line 32 of file treesearchctrl.hpp.

Constructor & Destructor Documentation

◆ TreeSearchCtrl()

TreeSearchCtrl::TreeSearchCtrl ( wxWindow *  parent,
wxWindowID  id,
const wxString &  hint = wxEmptyString,
const wxString &  calltip = wxEmptyString,
wxTreeCtrl *  associatedCtrl = nullptr,
bool  searchToolTip = false 
)
inline

Definition at line 46 of file treesearchctrl.hpp.

References SearchCtrl::popUp, and SearchCtrlPopup::SetCallTips().

Here is the call graph for this function:

Member Function Documentation

◆ findItem()

wxTreeItemId TreeSearchCtrl::findItem ( const wxString &  value,
wxTreeItemId  node 
)
protected

This method searches for the tree item, whose label corresponds to the passed string.

Parameters
valueconst wxString&
nodewxTreeItemId
Returns
wxTreeItemId

Definition at line 74 of file treesearchctrl.cpp.

References findItem(), and m_associatedCtrl.

Referenced by findItem(), and selectItem().

Here is the call graph for this function:

◆ getCandidates()

wxArrayString TreeSearchCtrl::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 117 of file treesearchctrl.cpp.

References getChildCandidates(), and m_associatedCtrl.

Here is the call graph for this function:

◆ getChildCandidates()

wxArrayString TreeSearchCtrl::getChildCandidates ( const wxString &  enteredText,
wxTreeItemId  node 
)
protected

This method returns an array of strings containing possible candiates for the passed search string, which correspond to the current tree node, its siblings and its childs.

Parameters
enteredTextconst wxString&
nodewxTreeItemId
Returns
wxArrayString

Definition at line 151 of file treesearchctrl.cpp.

References getChildCandidates(), m_associatedCtrl, m_searchToolTip, and ToolTipTreeData::tooltip.

Referenced by getCandidates(), and getChildCandidates().

Here is the call graph for this function:

◆ selectItem()

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

This method searches and selects the item with the passed label in the associated tree.

Parameters
valueconst wxString&
Returns
bool

Reimplemented from SearchCtrl.

Definition at line 32 of file treesearchctrl.cpp.

References findItem(), and m_associatedCtrl.

Here is the call graph for this function:

Member Data Documentation

◆ m_associatedCtrl

wxTreeCtrl* TreeSearchCtrl::m_associatedCtrl
private

Definition at line 35 of file treesearchctrl.hpp.

Referenced by findItem(), getCandidates(), getChildCandidates(), and selectItem().

◆ m_searchToolTip

bool TreeSearchCtrl::m_searchToolTip
private

Definition at line 36 of file treesearchctrl.hpp.

Referenced by getChildCandidates().


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