| Version: 3.3.1

Public Types | Public Member Functions | Public Attributes | List of all members
wxTextSearch Struct Reference

`#include <wx/textctrl.h>`

## Detailed Description

Search options for wxTextCtrl::SearchText().

This is a builder class, where property functions can be called during construction. For example:

wxTextSearchResult result =
textctrl->SearchText(wxTextSearch(L"Institutional Research").
SearchDirection(wxTextSearch::Direction::Down).
MatchCase().
MatchWholeWord());
wxTextSearch::wxTextSearch
wxTextSearch(const wxString &text)
The string to search for.
Definition: textctrl.h:1152
wxTextSearch::SearchDirection
wxTextSearch & SearchDirection(const wxTextSearch::Direction direction)
Whether the search should go up or down in the text control.
Definition: textctrl.h:1202
wxTextSearch::MatchWholeWord
wxTextSearch & MatchWholeWord(const bool matchWholeWord=true)
Whether the search should match the whole word.
Definition: textctrl.h:1191
wxTextSearch::Direction::Down
@ Down
wxTextSearch::MatchCase
wxTextSearch & MatchCase(const bool matchCase=true)
Whether the search should match case (i.e., be case sensitive).
Definition: textctrl.h:1180
wxTextSearchResult
Result from wxTextCtrl::SearchText(), specifying the range of the found text.
Definition: textctrl.h:1232

Since
  3.3.0

## Public Types
enum class | Direction { Down , Up }
| One of the following values can be passed to wxTextSearch::SearchDirection() to control direction when searching a wxTextCtrl. More...

## Public Member Functions
| wxTextSearch (const wxString &text)
| The string to search for. More...
wxTextSearch & | SearchValue (const wxString &value)
| The string to search for. More...
wxTextSearch & | MatchCase (const bool matchCase=true)
| Whether the search should match case (i.e., be case sensitive). More...
wxTextSearch & | MatchWholeWord (const bool matchWholeWord=true)
| Whether the search should match the whole word. More...
wxTextSearch & | SearchDirection (const wxTextSearch::Direction direction)
| Whether the search should go up or down in the text control. More...
wxTextSearch & | Start (const long startPosition)
| Where the search should start from. More...

## Public Attributes
wxString | m_searchValue
long | m_startingPosition = -1
bool | m_matchCase = true
bool | m_wholeWord = false
Direction | m_direction = Direction::Down

## Member Enumeration Documentation

## ◆ Direction

enum wxTextSearch::Direction
| strong

One of the following values can be passed to wxTextSearch::SearchDirection() to control direction when searching a wxTextCtrl.

Since
  3.3.0

Enumerator
Down |
Up |

## Constructor & Destructor Documentation

## ◆ wxTextSearch()

wxTextSearch::wxTextSearch | ( | const wxString & | text | ) |
| inline

The string to search for.

## Member Function Documentation

## ◆ MatchCase()

wxTextSearch& wxTextSearch::MatchCase | ( | const bool | matchCase = `true` | ) |
| inline

Whether the search should match case (i.e., be case sensitive).

By default, this is `false`; search will be case insensitive.

## ◆ MatchWholeWord()

wxTextSearch& wxTextSearch::MatchWholeWord | ( | const bool | matchWholeWord = `true` | ) |
| inline

Whether the search should match the whole word.

By default, this is `false`; searching will not match by whole word.

## ◆ SearchDirection()

wxTextSearch& wxTextSearch::SearchDirection | ( | const wxTextSearch::Direction | direction | ) |
| inline

Whether the search should go up or down in the text control.

By default, search will go downward.

## ◆ SearchValue()

wxTextSearch& wxTextSearch::SearchValue | ( | const wxString & | value | ) |
| inline

The string to search for.

## ◆ Start()

wxTextSearch& wxTextSearch::Start | ( | const long | startPosition | ) |
| inline

Where the search should start from.

By default, if searching down, then the search will start at 0. If searching up, then will start at the end of control.

## Member Data Documentation

## ◆ m_direction

Direction wxTextSearch::m_direction = Direction::Down

## ◆ m_matchCase

bool wxTextSearch::m_matchCase = true

## ◆ m_searchValue

wxString wxTextSearch::m_searchValue

## ◆ m_startingPosition

long wxTextSearch::m_startingPosition = -1

## ◆ m_wholeWord

bool wxTextSearch::m_wholeWord = false