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