]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/tlw.tex
minor corrections and note about Unicode (patch 1555691)
[wxWidgets.git] / docs / latex / wx / tlw.tex
CommitLineData
834ed994
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: tlw.tex
3%% Purpose: wxTopLevelWindow documentation
4%% Author: Vadim Zeitlin
5%% Modified by:
6%% Created: 2004-09-07 (partly extracted from frame.tex)
7%% RCS-ID: $Id$
8%% Copyright: (c) 2004 Vadim Zeitlin
8795498c 9%% License: wxWindows license
834ed994
VZ
10%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12\section{\class{wxTopLevelWindow}}\label{wxtoplevelwindow}
13
60fef964 14wxTopLevelWindow is a common base class for \helpref{wxDialog}{wxdialog} and
9eace708 15\helpref{wxFrame}{wxframe}. It is an abstract base class meaning that you never
834ed994
VZ
16work with objects of this class directly, but all of its methods are also
17applicable for the two classes above.
18
9eace708
VZ
19\wxheading{Derived from}
20
21\helpref{wxWindow}{wxwindow}\\
22\helpref{wxEvtHandler}{wxevthandler}\\
23\helpref{wxObject}{wxobject}
24
25\wxheading{Include files}
26
27<wx/toplevel.h>
28
834ed994
VZ
29
30\latexignore{\rtfignore{\wxheading{Members}}}
31
07880314 32\membersection{wxTopLevelWindow::CanSetTransparent}\label{wxtoplevelwindowcansettransparent}
50f3c41d 33
07880314 34\func{virtual bool}{CanSetTransparent}{\void}
50f3c41d
RD
35
36Returns \true if the platform supports making the window translucent.
37
38\wxheading{See also}
39
07880314 40\helpref{wxTopLevelWindow::SetTransparent}{wxtoplevelwindowsettransparent}
50f3c41d 41
834ed994 42
4334c3d5
VZ
43\membersection{wxTopLevelWindow::GetDefaultItem}\label{wxtoplevelwindowgetdefaultitem}
44
45\constfunc{wxWindow *}{GetDefaultItem}{\void}
46
47Returns a pointer to the button which is the default for this window, or \NULL.
48The default button is the one activated by pressing the Enter key.
49
50
5a8e93c4
VZ
51\membersection{wxTopLevelWindow::GetIcon}\label{wxtoplevelwindowgeticon}
52
53\constfunc{const wxIcon\&}{GetIcon}{\void}
54
55Returns the standard icon of the window. The icon will be invalid if it hadn't
56been previously set by \helpref{SetIcon}{wxtoplevelwindowseticon}.
57
58\wxheading{See also}
59
60\helpref{GetIcons}{wxtoplevelwindowgeticons}
61
62
63\membersection{wxTopLevelWindow::GetIcons}\label{wxtoplevelwindowgeticons}
64
65\constfunc{const wxIconBundle\&}{GetIcons}{\void}
66
67Returns all icons associated with the window, there will be none of them if
60fef964 68neither \helpref{SetIcon}{wxtoplevelwindowseticon} nor
5a8e93c4
VZ
69\helpref{SetIcons}{wxtoplevelwindowseticons} had been called before.
70
71Use \helpref{GetIcon}{wxtoplevelwindowgeticon} to get the main icon of the
72window.
73
74\wxheading{See also}
75
76\helpref{wxIconBundle}{wxiconbundle}
77
78
834ed994
VZ
79\membersection{wxTopLevelWindow::GetTitle}\label{wxtoplevelwindowgettitle}
80
81\constfunc{wxString}{GetTitle}{\void}
82
83Gets a string containing the window title.
84
60fef964
WS
85\wxheading{See also}
86
87\helpref{wxTopLevelWindow::SetTitle}{wxtoplevelwindowsettitle}
834ed994
VZ
88
89
08b97268
WS
90\membersection{wxTopLevelWindow::HandleSettingChange}\label{wxtoplevelwindowhandlesettingchange}
91
92\func{virtual bool}{HandleSettingChange}{\param{WXWPARAM}{ wParam}, \param{WXLPARAM}{ lParam}}
93
94Unique to the wxWinCE port. Responds to showing/hiding SIP (soft input panel) area and resize
394b206f 95window accordingly. Override this if you want to avoid resizing or do additional
08b97268
WS
96operations.
97
98
6b30a44e
VZ
99\membersection{wxTopLevelWindow::IsActive}\label{wxtoplevelwindowisactive}
100
101\constfunc{bool}{IsActive}{\void}
102
103Returns \true if this window is currently active, i.e. if the user is currently
104working with it.
105
106
979a0320
WS
107\membersection{wxTopLevelWindow::IsAlwaysMaximized}\label{wxtoplevelwindowisalwaysmaximized}
108
109\constfunc{virtual bool}{IsAlwaysMaximized}{\void}
110
111Returns \true if this window is expected to be always maximized, either due to platform policy
112or due to local policy regarding particular class.
113
114
834ed994
VZ
115\membersection{wxTopLevelWindow::Iconize}\label{wxtoplevelwindowiconize}
116
117\func{void}{Iconize}{\param{bool}{ iconize}}
118
119Iconizes or restores the window.
120
121\wxheading{Parameters}
122
123\docparam{iconize}{If \true, iconizes the window; if \false, shows and restores it.}
124
125\wxheading{See also}
126
127\helpref{wxTopLevelWindow::IsIconized}{wxtoplevelwindowisiconized}, \helpref{wxTopLevelWindow::Maximize}{wxtoplevelwindowmaximize}.
128
129
130\membersection{wxTopLevelWindow::IsFullScreen}\label{wxtoplevelwindowisfullscreen}
131
132\func{bool}{IsFullScreen}{\void}
133
134Returns \true if the window is in fullscreen mode.
135
136\wxheading{See also}
137
138\helpref{wxTopLevelWindow::ShowFullScreen}{wxtoplevelwindowshowfullscreen}
139
140
141\membersection{wxTopLevelWindow::IsIconized}\label{wxtoplevelwindowisiconized}
142
143\constfunc{bool}{IsIconized}{\void}
144
145Returns \true if the window is iconized.
146
147
148\membersection{wxTopLevelWindow::IsMaximized}\label{wxtoplevelwindowismaximized}
149
150\constfunc{bool}{IsMaximized}{\void}
151
152Returns \true if the window is maximized.
153
154
155\membersection{wxTopLevelWindow::Maximize}\label{wxtoplevelwindowmaximize}
156
157\func{void}{Maximize}{\param{bool }{maximize}}
158
159Maximizes or restores the window.
160
161\wxheading{Parameters}
162
163\docparam{maximize}{If \true, maximizes the window, otherwise it restores it.}
164
834ed994
VZ
165\wxheading{See also}
166
167\helpref{wxTopLevelWindow::Iconize}{wxtoplevelwindowiconize}
168
169
dc92adaf
VZ
170\membersection{wxTopLevelWindow::RequestUserAttention}\label{wxtoplevelwindowrequestuserattention}
171
172\func{void}{RequestUserAttention}{\param{int }{flags = wxUSER\_ATTENTION\_INFO}}
173
174Use a system-dependent way to attract users attention to the window when it is
175in background.
176
177\arg{flags} may have the value of either \texttt{wxUSER\_ATTENTION\_INFO}
178(default) or \texttt{wxUSER\_ATTENTION\_ERROR} which results in a more drastic
179action. When in doubt, use the default value.
180
181Note that this function should normally be only used when the application is
182not already in foreground.
183
dca92ddf
MR
184This function is currently implemented for Win32 where it flashes the
185window icon in the taskbar, and for wxGTK with task bars supporting it.
dc92adaf
VZ
186
187
4334c3d5
VZ
188\membersection{wxTopLevelWindow::SetDefaultItem}\label{wxtoplevelwindowsetdefaultitem}
189
190\func{void}{SetDefaultItem}{\param{wxWindow }{*win}}
191
192Changes the default item for the panel, usually \arg{win} is a button.
193
194\wxheading{See also}
195
196\helpref{GetDefaultItem}{wxtoplevelwindowgetdefaultitem}
197
198
834ed994
VZ
199\membersection{wxTopLevelWindow::SetIcon}\label{wxtoplevelwindowseticon}
200
201\func{void}{SetIcon}{\param{const wxIcon\& }{icon}}
202
203Sets the icon for this window.
204
205\wxheading{Parameters}
206
207\docparam{icon}{The icon to associate with this window.}
208
209\wxheading{Remarks}
210
211The window takes a `copy' of {\it icon}, but since it uses reference
212counting, the copy is very quick. It is safe to delete {\it icon} after
213calling this function.
214
215See also \helpref{wxIcon}{wxicon}.
216
217
218\membersection{wxTopLevelWindow::SetIcons}\label{wxtoplevelwindowseticons}
219
220\func{void}{SetIcons}{\param{const wxIconBundle\& }{icons}}
221
5a8e93c4
VZ
222Sets several icons of different sizes for this window: this allows to use
223different icons for different situations (e.g. task switching bar, taskbar,
224window title bar) instead of scaling, with possibly bad looking results, the
225only icon set by \helpref{SetIcon}{wxtoplevelwindowseticon}.
834ed994
VZ
226
227\wxheading{Parameters}
228
229\docparam{icons}{The icons to associate with this window.}
230
5a8e93c4
VZ
231\wxheading{See also}
232
233\helpref{wxIconBundle}{wxiconbundle}.
834ed994
VZ
234
235
9ca7505f
WS
236\membersection{wxTopLevelWindow::SetLeftMenu}\label{wxtoplevelwindowsetleftmenu}
237
7c57ddc3 238\func{void}{SetLeftMenu}{\param{int}{ id = wxID\_ANY}, \param{const wxString\&}{ label = wxEmptyString}, \param{wxMenu *}{ subMenu = NULL}}
9ca7505f
WS
239
240Sets action or menu activated by pressing left hardware button on the smart phones.
241Unavailable on full keyboard machines.
242
243\wxheading{Parameters}
244
245\docparam{id}{Identifier for this button.}
246
247\docparam{label}{Text to be displayed on the screen area dedicated to this hardware button.}
248
249\docparam{subMenu}{The menu to be opened after pressing this hardware button.}
250
251\wxheading{See also}
252
253\helpref{wxTopLevelWindow::SetRightMenu}{wxtoplevelwindowsetrightmenu}.
254
255
256\membersection{wxTopLevelWindow::SetRightMenu}\label{wxtoplevelwindowsetrightmenu}
257
7c57ddc3 258\func{void}{SetRightMenu}{\param{int}{ id = wxID\_ANY}, \param{const wxString\&}{ label = wxEmptyString}, \param{wxMenu *}{ subMenu = NULL}}
9ca7505f
WS
259
260Sets action or menu activated by pressing right hardware button on the smart phones.
261Unavailable on full keyboard machines.
262
263\wxheading{Parameters}
264
265\docparam{id}{Identifier for this button.}
266
267\docparam{label}{Text to be displayed on the screen area dedicated to this hardware button.}
268
269\docparam{subMenu}{The menu to be opened after pressing this hardware button.}
270
271\wxheading{See also}
272
273\helpref{wxTopLevelWindow::SetLeftMenu}{wxtoplevelwindowsetleftmenu}.
274
275
834ed994
VZ
276\membersection{wxTopLevelWindow::SetShape}\label{wxtoplevelwindowsetshape}
277
278\func{bool}{SetShape}{\param{const wxRegion\&}{ region}}
279
280If the platform supports it, sets the shape of the window to that
281depicted by {\it region}. The system will not display or
282respond to any mouse event for the pixels that lie outside of the
283region. To reset the window to the normal rectangular shape simply
60fef964 284call {\it SetShape} again with an empty region. Returns true if the
834ed994
VZ
285operation is successful.
286
287
288\membersection{wxTopLevelWindow::SetTitle}\label{wxtoplevelwindowsettitle}
289
290\func{virtual void}{SetTitle}{\param{const wxString\& }{ title}}
291
292Sets the window title.
293
294\wxheading{Parameters}
295
296\docparam{title}{The window title.}
297
298\wxheading{See also}
299
300\helpref{wxTopLevelWindow::GetTitle}{wxtoplevelwindowgettitle}
301
302
07880314 303\membersection{wxTopLevelWindow::SetTransparent}\label{wxtoplevelwindowsettransparent}
50f3c41d 304
07880314 305\func{virtual bool}{SetTransparent}{\param{int }{ alpha}}
50f3c41d
RD
306
307If the platform supports it will set the window to be translucent
308
309\wxheading{Parameters}
310
311\docparam{alpha}{Determines how opaque or transparent the window will
07880314
RD
312 be, if the platform supports the opreration. A value of 0 sets the
313 window to be fully transparent, and a value of 255 sets the window
314 to be fully opaque.}
50f3c41d 315
07880314 316Returns \true if the transparency was successfully changed.
50f3c41d
RD
317
318
319
65afac3f
VZ
320\membersection{wxTopLevelWindow::ShouldPreventAppExit}\label{wxtoplevelwindowshouldpreventappexit}
321
322\constfunc{virtual bool}{ShouldPreventAppExit}{\void}
323
324This virtual function is not meant to be called directly but can be overridden
325to return \false (it returns \true by default) to allow the application to
326close even if this, presumably not very important, window is still opened.
327By default, the application stays alive as long as there are any open top level
328windows.
329
330
834ed994
VZ
331\membersection{wxTopLevelWindow::ShowFullScreen}\label{wxtoplevelwindowshowfullscreen}
332
333\func{bool}{ShowFullScreen}{\param{bool}{ show}, \param{long}{ style = wxFULLSCREEN\_ALL}}
334
335Depending on the value of {\it show} parameter the window is either shown full
336screen or restored to its normal state. {\it style} is a bit list containing
337some or all of the following values, which indicate what elements of the window
338to hide in full-screen mode:
339
340\begin{itemize}\itemsep=0pt
341\item wxFULLSCREEN\_NOMENUBAR
342\item wxFULLSCREEN\_NOTOOLBAR
343\item wxFULLSCREEN\_NOSTATUSBAR
344\item wxFULLSCREEN\_NOBORDER
345\item wxFULLSCREEN\_NOCAPTION
346\item wxFULLSCREEN\_ALL (all of the above)
347\end{itemize}
348
349This function has not been tested with MDI frames.
350
351Note that showing a window full screen also actually
352\helpref{Show()s}{wxwindowshow} if it hadn't been shown yet.
353
354\wxheading{See also}
355
356\helpref{wxTopLevelWindow::IsFullScreen}{wxtoplevelwindowisfullscreen}