2006-12-11 01:19:27 -05:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxSearchCtrl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
|
|
|
|
\section{\class{wxSearchCtrl}}\label{wxsearchctrl}
|
|
|
|
|
|
|
|
A search control is a composite control with a search button, a text
|
|
|
|
control, and a cancel button.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
2006-12-11 15:32:16 -05:00
|
|
|
\helpref{wxTextCtrl}{wxtextctrl}\\
|
2006-12-11 01:19:27 -05:00
|
|
|
streambuf\\
|
|
|
|
\helpref{wxControl}{wxcontrol}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/srchctrl.h>
|
|
|
|
|
|
|
|
\wxheading{Window styles}
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
|
|
|
\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The control will generate
|
|
|
|
the event wxEVT\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
|
|
|
|
is either processed internally by the control or used for navigation between
|
|
|
|
dialog controls).}
|
|
|
|
\twocolitem{\windowstyle{wxTE\_PROCESS\_TAB}}{The control will receive
|
|
|
|
wxEVT\_CHAR events for TAB pressed - normally, TAB is used for passing to the
|
|
|
|
next control in a dialog instead. For the control created with this style,
|
|
|
|
you can still use Ctrl-Enter to pass to the next control from the keyboard.}
|
|
|
|
\twocolitem{\windowstyle{wxTE\_NOHIDESEL}}{By default, the Windows text control
|
|
|
|
doesn't show the selection when it doesn't have focus - use this style to force
|
|
|
|
it to always show it. It doesn't do anything under other platforms.}
|
|
|
|
\twocolitem{\windowstyle{wxTE\_LEFT}}{The text in the control will be left-justified (default).}
|
|
|
|
\twocolitem{\windowstyle{wxTE\_CENTRE}}{The text in the control will be centered (currently wxMSW and wxGTK2 only).}
|
|
|
|
\twocolitem{\windowstyle{wxTE\_RIGHT}}{The text in the control will be right-justified (currently wxMSW and wxGTK2 only).}
|
|
|
|
\twocolitem{\windowstyle{wxTE\_CAPITALIZE}}{On PocketPC and Smartphone, causes the first letter to be capitalized.}
|
|
|
|
\end{twocollist}
|
|
|
|
|
|
|
|
See also \helpref{window styles overview}{windowstyles} and \helpref{wxSearchCtrl::wxSearchCtrl}{wxsearchctrlctor}.
|
|
|
|
|
|
|
|
\wxheading{Event handling}
|
|
|
|
|
|
|
|
To process input from a search control, use these event handler macros to direct input to member
|
2006-12-11 15:32:16 -05:00
|
|
|
functions that take a \helpref{wxCommandEvent}{wxcommandevent} argument. To retrieve actual search
|
|
|
|
queries, use EVT\_TEXT and EVT\_TEXT\_ENTER events, just as you would with \helpref{wxTextCtrl}{wxtextctrl}.
|
2006-12-11 01:19:27 -05:00
|
|
|
|
|
|
|
\twocolwidtha{9cm}%
|
|
|
|
\begin{twocollist}\itemsep=0pt
|
2006-12-11 15:32:16 -05:00
|
|
|
\twocolitem{{\bf EVT\_SEARCHCTRL\_SEARCH\_BTN(id, func)}}{Respond to a wxEVT\_SEARCHCTRL\_SEARCH\_BTN event,
|
|
|
|
generated when the search button is clicked. Note that this does not initiate a search.}
|
|
|
|
\twocolitem{{\bf EVT\_SEARCHCTRL\_CANCEL\_BTN(id, func)}}{Respond to a wxEVT\_SEARCHCTRL\_CANCEL\_BTN event,
|
2006-12-11 01:19:27 -05:00
|
|
|
generated when the cancel button is clicked.}
|
|
|
|
\end{twocollist}%
|
|
|
|
|
|
|
|
|
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxSearchCtrl::wxSearchCtrl}\label{wxsearchctrlctor}
|
|
|
|
|
|
|
|
\func{}{wxSearchCtrl}{\void}
|
|
|
|
|
|
|
|
Default constructor.
|
|
|
|
|
|
|
|
\func{}{wxSearchCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
|
|
|
|
\param{const wxString\& }{value = ``"}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
|
|
|
|
\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxSearchCtrlNameStr}}
|
|
|
|
|
|
|
|
Constructor, creating and showing a text control.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{Parent window. Should not be NULL.}
|
|
|
|
|
|
|
|
\docparam{id}{Control identifier. A value of -1 denotes a default value.}
|
|
|
|
|
|
|
|
\docparam{value}{Default text value.}
|
|
|
|
|
|
|
|
\docparam{pos}{Text control position.}
|
|
|
|
|
|
|
|
\docparam{size}{Text control size.}
|
|
|
|
|
|
|
|
\docparam{style}{Window style. See \helpref{wxSearchCtrl}{wxsearchctrl}.}
|
|
|
|
|
|
|
|
\docparam{validator}{Window validator.}
|
|
|
|
|
|
|
|
\docparam{name}{Window name.}
|
|
|
|
|
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxTextCtrl::Create}{wxtextctrlcreate}, \helpref{wxValidator}{wxvalidator}
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxSearchCtrl::\destruct{wxSearchCtrl}}\label{wxsearchctrldtor}
|
|
|
|
|
|
|
|
\func{}{\destruct{wxSearchCtrl}}{\void}
|
|
|
|
|
|
|
|
Destructor, destroying the search control.
|
|
|
|
|
|
|
|
|
|
|
|
\membersection{wxSearchCtrl::SetMenu}\label{wxsearchctrlsetmenu}
|
|
|
|
|
|
|
|
\func{virtual void}{SetMenu}{\param{wxMenu* }{ menu}}
|
|
|
|
|
|
|
|
Sets the search control's menu object. If there is already a menu associated with
|
|
|
|
the search control it is deleted.
|
|
|
|
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{menu}{Menu to attach to the search control.}
|
|
|
|
|
|
|
|
\membersection{wxSearchCtrl::GetMenu}\label{wxsearchctrlgetmenu}
|
|
|
|
|
|
|
|
\func{virtual wxMenu*}{GetMenu}{\void}
|
|
|
|
|
|
|
|
Returns a pointer to the search control's menu object or NULL if there is no
|
|
|
|
menu attached.
|
|
|
|
|
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\membersection{wxSearchCtrl::ShowSearchButton}\label{wxsearchctrlshowsearchbutton}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\func{virtual void}{ShowSearchButton}{\param{bool }{ show}}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
|
|
|
Sets the search button visibility value on the search control.
|
|
|
|
If there is a menu attached, the search button will be visible regardless of the search
|
|
|
|
button visibility value.
|
|
|
|
|
|
|
|
This has no effect in Mac OS X v10.3
|
|
|
|
|
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\membersection{wxSearchCtrl::IsSearchButtonVisible}\label{wxsearchctrlissearchbuttonvisible}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\func{virtual bool}{IsSearchButtonVisible}{\void}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
|
|
|
Returns the search button visibility value.
|
|
|
|
If there is a menu attached, the search button will be visible regardless of the search
|
|
|
|
button visibility value.
|
|
|
|
|
|
|
|
This always returns false in Mac OS X v10.3
|
|
|
|
|
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\membersection{wxSearchCtrl::ShowCancelButton}\label{wxsearchctrlshowcancelbutton}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\func{virtual void}{ShowCancelButton}{\param{bool }{ show}}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
|
|
|
Shows or hides the cancel button.
|
|
|
|
|
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\membersection{wxSearchCtrl::IsCancelButtonVisible}\label{wxsearchctrliscancelbuttonvisible}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
2006-12-11 08:48:18 -05:00
|
|
|
\func{virtual bool}{IsCancelButtonVisible}{\void}
|
2006-12-11 01:19:27 -05:00
|
|
|
|
|
|
|
Indicates whether the cancel button is visible.
|