]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/srchctrl.tex
add wxSYS_DCLICK_TIME system metric constant; use it for the generic list control...
[wxWidgets.git] / docs / latex / wx / srchctrl.tex
CommitLineData
3f7f284d
RD
1%%%%%%%%%%%%%%%%%%%%%%%%%%%% wxSearchCtrl %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3\section{\class{wxSearchCtrl}}\label{wxsearchctrl}
4
5A search control is a composite control with a search button, a text
6control, and a cancel button.
7
8\wxheading{Derived from}
9
c60122bf 10\helpref{wxTextCtrl}{wxtextctrl}\\
3f7f284d
RD
11streambuf\\
12\helpref{wxControl}{wxcontrol}\\
13\helpref{wxWindow}{wxwindow}\\
14\helpref{wxEvtHandler}{wxevthandler}\\
15\helpref{wxObject}{wxobject}
16
17\wxheading{Include files}
18
19<wx/srchctrl.h>
20
a7af285d
VZ
21\wxheading{Library}
22
23\helpref{wxCore}{librarieslist}
24
3f7f284d
RD
25\wxheading{Window styles}
26
27\twocolwidtha{5cm}
28\begin{twocollist}\itemsep=0pt
29\twocolitem{\windowstyle{wxTE\_PROCESS\_ENTER}}{The control will generate
30the event wxEVT\_COMMAND\_TEXT\_ENTER (otherwise pressing Enter key
31is either processed internally by the control or used for navigation between
32dialog controls).}
33\twocolitem{\windowstyle{wxTE\_PROCESS\_TAB}}{The control will receive
34wxEVT\_CHAR events for TAB pressed - normally, TAB is used for passing to the
35next control in a dialog instead. For the control created with this style,
36you can still use Ctrl-Enter to pass to the next control from the keyboard.}
37\twocolitem{\windowstyle{wxTE\_NOHIDESEL}}{By default, the Windows text control
38doesn't show the selection when it doesn't have focus - use this style to force
39it to always show it. It doesn't do anything under other platforms.}
40\twocolitem{\windowstyle{wxTE\_LEFT}}{The text in the control will be left-justified (default).}
41\twocolitem{\windowstyle{wxTE\_CENTRE}}{The text in the control will be centered (currently wxMSW and wxGTK2 only).}
42\twocolitem{\windowstyle{wxTE\_RIGHT}}{The text in the control will be right-justified (currently wxMSW and wxGTK2 only).}
43\twocolitem{\windowstyle{wxTE\_CAPITALIZE}}{On PocketPC and Smartphone, causes the first letter to be capitalized.}
44\end{twocollist}
45
46See also \helpref{window styles overview}{windowstyles} and \helpref{wxSearchCtrl::wxSearchCtrl}{wxsearchctrlctor}.
47
48\wxheading{Event handling}
49
50To process input from a search control, use these event handler macros to direct input to member
c60122bf
KO
51functions that take a \helpref{wxCommandEvent}{wxcommandevent} argument. To retrieve actual search
52queries, use EVT\_TEXT and EVT\_TEXT\_ENTER events, just as you would with \helpref{wxTextCtrl}{wxtextctrl}.
3f7f284d
RD
53
54\twocolwidtha{9cm}%
55\begin{twocollist}\itemsep=0pt
c60122bf
KO
56\twocolitem{{\bf EVT\_SEARCHCTRL\_SEARCH\_BTN(id, func)}}{Respond to a wxEVT\_SEARCHCTRL\_SEARCH\_BTN event,
57generated when the search button is clicked. Note that this does not initiate a search.}
58\twocolitem{{\bf EVT\_SEARCHCTRL\_CANCEL\_BTN(id, func)}}{Respond to a wxEVT\_SEARCHCTRL\_CANCEL\_BTN event,
3f7f284d
RD
59generated when the cancel button is clicked.}
60\end{twocollist}%
61
62
63\latexignore{\rtfignore{\wxheading{Members}}}
64
65
66\membersection{wxSearchCtrl::wxSearchCtrl}\label{wxsearchctrlctor}
67
68\func{}{wxSearchCtrl}{\void}
69
70Default constructor.
71
72\func{}{wxSearchCtrl}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},\rtfsp
73\param{const wxString\& }{value = ``"}, \param{const wxPoint\& }{pos = wxDefaultPosition}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
74\param{long}{ style = 0}, \param{const wxValidator\& }{validator = wxDefaultValidator}, \param{const wxString\& }{name = wxSearchCtrlNameStr}}
75
76Constructor, creating and showing a text control.
77
78\wxheading{Parameters}
79
80\docparam{parent}{Parent window. Should not be NULL.}
81
82\docparam{id}{Control identifier. A value of -1 denotes a default value.}
83
84\docparam{value}{Default text value.}
85
86\docparam{pos}{Text control position.}
87
88\docparam{size}{Text control size.}
89
90\docparam{style}{Window style. See \helpref{wxSearchCtrl}{wxsearchctrl}.}
91
92\docparam{validator}{Window validator.}
93
94\docparam{name}{Window name.}
95
96\wxheading{See also}
97
98\helpref{wxTextCtrl::Create}{wxtextctrlcreate}, \helpref{wxValidator}{wxvalidator}
99
100
101\membersection{wxSearchCtrl::\destruct{wxSearchCtrl}}\label{wxsearchctrldtor}
102
103\func{}{\destruct{wxSearchCtrl}}{\void}
104
105Destructor, destroying the search control.
106
107
108\membersection{wxSearchCtrl::SetMenu}\label{wxsearchctrlsetmenu}
109
110\func{virtual void}{SetMenu}{\param{wxMenu* }{ menu}}
111
112Sets the search control's menu object. If there is already a menu associated with
113the search control it is deleted.
114
115
116\wxheading{Parameters}
117
118\docparam{menu}{Menu to attach to the search control.}
119
120\membersection{wxSearchCtrl::GetMenu}\label{wxsearchctrlgetmenu}
121
122\func{virtual wxMenu*}{GetMenu}{\void}
123
124Returns a pointer to the search control's menu object or NULL if there is no
125menu attached.
126
127
ec184e32 128\membersection{wxSearchCtrl::ShowSearchButton}\label{wxsearchctrlshowsearchbutton}
3f7f284d 129
ec184e32 130\func{virtual void}{ShowSearchButton}{\param{bool }{ show}}
3f7f284d
RD
131
132Sets the search button visibility value on the search control.
133If there is a menu attached, the search button will be visible regardless of the search
134button visibility value.
135
136This has no effect in Mac OS X v10.3
137
138
ec184e32 139\membersection{wxSearchCtrl::IsSearchButtonVisible}\label{wxsearchctrlissearchbuttonvisible}
3f7f284d 140
ec184e32 141\func{virtual bool}{IsSearchButtonVisible}{\void}
3f7f284d
RD
142
143Returns the search button visibility value.
144If there is a menu attached, the search button will be visible regardless of the search
145button visibility value.
146
147This always returns false in Mac OS X v10.3
148
149
ec184e32 150\membersection{wxSearchCtrl::ShowCancelButton}\label{wxsearchctrlshowcancelbutton}
3f7f284d 151
ec184e32 152\func{virtual void}{ShowCancelButton}{\param{bool }{ show}}
3f7f284d
RD
153
154Shows or hides the cancel button.
155
156
ec184e32 157\membersection{wxSearchCtrl::IsCancelButtonVisible}\label{wxsearchctrliscancelbuttonvisible}
3f7f284d 158
ec184e32 159\func{virtual bool}{IsCancelButtonVisible}{\void}
3f7f284d
RD
160
161Indicates whether the cancel button is visible.