1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxTopLevelWindow documentation
4 %% Author: Vadim Zeitlin
6 %% Created: 2004-09-07 (partly extracted from frame.tex)
8 %% Copyright: (c) 2004 Vadim Zeitlin
9 %% License: wxWindows license
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
12 \section{\class{wxTopLevelWindow
}}\label{wxtoplevelwindow
}
14 wxTopLevelWindow is a common base class for
\helpref{wxDialog
}{wxdialog
} and
15 \helpref{wxFrame
}{wxframe
}. It is an abstract base class meaning that you never
16 work with objects of this class directly, but all of its methods are also
17 applicable for the two classes above.
19 \wxheading{Derived from
}
21 \helpref{wxWindow
}{wxwindow
}\\
22 \helpref{wxEvtHandler
}{wxevthandler
}\\
23 \helpref{wxObject
}{wxobject
}
25 \wxheading{Include files
}
30 \latexignore{\rtfignore{\wxheading{Members
}}}
32 \membersection{wxTopLevelWindow::CanSetTransparent
}\label{wxtoplevelwindowcansettransparent
}
34 \func{virtual bool
}{CanSetTransparent
}{\void}
36 Returns
\true if the platform supports making the window translucent.
40 \helpref{wxTopLevelWindow::SetTransparent
}{wxtoplevelwindowsettransparent
}
43 \membersection{wxTopLevelWindow::GetDefaultItem
}\label{wxtoplevelwindowgetdefaultitem
}
45 \constfunc{wxWindow *
}{GetDefaultItem
}{\void}
47 Returns a pointer to the button which is the default for this window, or
\NULL.
48 The default button is the one activated by pressing the Enter key.
51 \membersection{wxTopLevelWindow::GetIcon
}\label{wxtoplevelwindowgeticon
}
53 \constfunc{const wxIcon\&
}{GetIcon
}{\void}
55 Returns the standard icon of the window. The icon will be invalid if it hadn't
56 been previously set by
\helpref{SetIcon
}{wxtoplevelwindowseticon
}.
60 \helpref{GetIcons
}{wxtoplevelwindowgeticons
}
63 \membersection{wxTopLevelWindow::GetIcons
}\label{wxtoplevelwindowgeticons
}
65 \constfunc{const wxIconBundle\&
}{GetIcons
}{\void}
67 Returns all icons associated with the window, there will be none of them if
68 neither
\helpref{SetIcon
}{wxtoplevelwindowseticon
} nor
69 \helpref{SetIcons
}{wxtoplevelwindowseticons
} had been called before.
71 Use
\helpref{GetIcon
}{wxtoplevelwindowgeticon
} to get the main icon of the
76 \helpref{wxIconBundle
}{wxiconbundle
}
79 \membersection{wxTopLevelWindow::GetTitle
}\label{wxtoplevelwindowgettitle
}
81 \constfunc{wxString
}{GetTitle
}{\void}
83 Gets a string containing the window title.
87 \helpref{wxTopLevelWindow::SetTitle
}{wxtoplevelwindowsettitle
}
90 \membersection{wxTopLevelWindow::HandleSettingChange
}\label{wxtoplevelwindowhandlesettingchange
}
92 \func{virtual bool
}{HandleSettingChange
}{\param{WXWPARAM
}{ wParam
},
\param{WXLPARAM
}{ lParam
}}
94 Unique to the wxWinCE port. Responds to showing/hiding SIP (soft input panel) area and resize
95 window accordingly. Override this if you want to avoid resizing or do additional
99 \membersection{wxTopLevelWindow::IsActive
}\label{wxtoplevelwindowisactive
}
101 \constfunc{bool
}{IsActive
}{\void}
103 Returns
\true if this window is currently active, i.e. if the user is currently
107 \membersection{wxTopLevelWindow::IsAlwaysMaximized
}\label{wxtoplevelwindowisalwaysmaximized
}
109 \constfunc{virtual bool
}{IsAlwaysMaximized
}{\void}
111 Returns
\true if this window is expected to be always maximized, either due to platform policy
112 or due to local policy regarding particular class.
115 \membersection{wxTopLevelWindow::Iconize
}\label{wxtoplevelwindowiconize
}
117 \func{void
}{Iconize
}{\param{bool
}{ iconize
}}
119 Iconizes or restores the window.
121 \wxheading{Parameters
}
123 \docparam{iconize
}{If
\true, iconizes the window; if
\false, shows and restores it.
}
127 \helpref{wxTopLevelWindow::IsIconized
}{wxtoplevelwindowisiconized
},
\helpref{wxTopLevelWindow::Maximize
}{wxtoplevelwindowmaximize
}.
130 \membersection{wxTopLevelWindow::IsFullScreen
}\label{wxtoplevelwindowisfullscreen
}
132 \func{bool
}{IsFullScreen
}{\void}
134 Returns
\true if the window is in fullscreen mode.
138 \helpref{wxTopLevelWindow::ShowFullScreen
}{wxtoplevelwindowshowfullscreen
}
141 \membersection{wxTopLevelWindow::IsIconized
}\label{wxtoplevelwindowisiconized
}
143 \constfunc{bool
}{IsIconized
}{\void}
145 Returns
\true if the window is iconized.
148 \membersection{wxTopLevelWindow::IsMaximized
}\label{wxtoplevelwindowismaximized
}
150 \constfunc{bool
}{IsMaximized
}{\void}
152 Returns
\true if the window is maximized.
155 \membersection{wxTopLevelWindow::Maximize
}\label{wxtoplevelwindowmaximize
}
157 \func{void
}{Maximize
}{\param{bool
}{maximize
}}
159 Maximizes or restores the window.
161 \wxheading{Parameters
}
163 \docparam{maximize
}{If
\true, maximizes the window, otherwise it restores it.
}
167 \helpref{wxTopLevelWindow::Iconize
}{wxtoplevelwindowiconize
}
170 \membersection{wxTopLevelWindow::RequestUserAttention
}\label{wxtoplevelwindowrequestuserattention
}
172 \func{void
}{RequestUserAttention
}{\param{int
}{flags = wxUSER
\_ATTENTION\_INFO}}
174 Use a system-dependent way to attract users attention to the window when it is
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
179 action. When in doubt, use the default value.
181 Note that this function should normally be only used when the application is
182 not already in foreground.
184 This function is currently implemented for Win32 where it flashes the
185 window icon in the taskbar, and for wxGTK with task bars supporting it.
188 \membersection{wxTopLevelWindow::SetDefaultItem
}\label{wxtoplevelwindowsetdefaultitem
}
190 \func{void
}{SetDefaultItem
}{\param{wxWindow
}{*win
}}
192 Changes the default item for the panel, usually
\arg{win
} is a button.
196 \helpref{GetDefaultItem
}{wxtoplevelwindowgetdefaultitem
}
199 \membersection{wxTopLevelWindow::SetIcon
}\label{wxtoplevelwindowseticon
}
201 \func{void
}{SetIcon
}{\param{const wxIcon\&
}{icon
}}
203 Sets the icon for this window.
205 \wxheading{Parameters
}
207 \docparam{icon
}{The icon to associate with this window.
}
211 The window takes a `copy' of
{\it icon
}, but since it uses reference
212 counting, the copy is very quick. It is safe to delete
{\it icon
} after
213 calling this function.
215 See also
\helpref{wxIcon
}{wxicon
}.
218 \membersection{wxTopLevelWindow::SetIcons
}\label{wxtoplevelwindowseticons
}
220 \func{void
}{SetIcons
}{\param{const wxIconBundle\&
}{icons
}}
222 Sets several icons of different sizes for this window: this allows to use
223 different icons for different situations (e.g. task switching bar, taskbar,
224 window title bar) instead of scaling, with possibly bad looking results, the
225 only icon set by
\helpref{SetIcon
}{wxtoplevelwindowseticon
}.
227 \wxheading{Parameters
}
229 \docparam{icons
}{The icons to associate with this window.
}
233 \helpref{wxIconBundle
}{wxiconbundle
}.
236 \membersection{wxTopLevelWindow::SetLeftMenu
}\label{wxtoplevelwindowsetleftmenu
}
238 \func{void
}{SetLeftMenu
}{\param{int
}{ id = wxID
\_ANY},
\param{const wxString\&
}{ label = wxEmptyString
},
\param{wxMenu *
}{ subMenu = NULL
}}
240 Sets action or menu activated by pressing left hardware button on the smart phones.
241 Unavailable on full keyboard machines.
243 \wxheading{Parameters
}
245 \docparam{id
}{Identifier for this button.
}
247 \docparam{label
}{Text to be displayed on the screen area dedicated to this hardware button.
}
249 \docparam{subMenu
}{The menu to be opened after pressing this hardware button.
}
253 \helpref{wxTopLevelWindow::SetRightMenu
}{wxtoplevelwindowsetrightmenu
}.
256 \membersection{wxTopLevelWindow::SetRightMenu
}\label{wxtoplevelwindowsetrightmenu
}
258 \func{void
}{SetRightMenu
}{\param{int
}{ id = wxID
\_ANY},
\param{const wxString\&
}{ label = wxEmptyString
},
\param{wxMenu *
}{ subMenu = NULL
}}
260 Sets action or menu activated by pressing right hardware button on the smart phones.
261 Unavailable on full keyboard machines.
263 \wxheading{Parameters
}
265 \docparam{id
}{Identifier for this button.
}
267 \docparam{label
}{Text to be displayed on the screen area dedicated to this hardware button.
}
269 \docparam{subMenu
}{The menu to be opened after pressing this hardware button.
}
273 \helpref{wxTopLevelWindow::SetLeftMenu
}{wxtoplevelwindowsetleftmenu
}.
276 \membersection{wxTopLevelWindow::SetShape
}\label{wxtoplevelwindowsetshape
}
278 \func{bool
}{SetShape
}{\param{const wxRegion\&
}{ region
}}
280 If the platform supports it, sets the shape of the window to that
281 depicted by
{\it region
}. The system will not display or
282 respond to any mouse event for the pixels that lie outside of the
283 region. To reset the window to the normal rectangular shape simply
284 call
{\it SetShape
} again with an empty region. Returns true if the
285 operation is successful.
288 \membersection{wxTopLevelWindow::SetTitle
}\label{wxtoplevelwindowsettitle
}
290 \func{virtual void
}{SetTitle
}{\param{const wxString\&
}{ title
}}
292 Sets the window title.
294 \wxheading{Parameters
}
296 \docparam{title
}{The window title.
}
300 \helpref{wxTopLevelWindow::GetTitle
}{wxtoplevelwindowgettitle
}
303 \membersection{wxTopLevelWindow::SetTransparent
}\label{wxtoplevelwindowsettransparent
}
305 \func{virtual bool
}{SetTransparent
}{\param{int
}{ alpha
}}
307 If the platform supports it will set the window to be translucent
309 \wxheading{Parameters
}
311 \docparam{alpha
}{Determines how opaque or transparent the window will
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
316 Returns
\true if the transparency was successfully changed.
320 \membersection{wxTopLevelWindow::ShouldPreventAppExit
}\label{wxtoplevelwindowshouldpreventappexit
}
322 \constfunc{virtual bool
}{ShouldPreventAppExit
}{\void}
324 This virtual function is not meant to be called directly but can be overridden
325 to return
\false (it returns
\true by default) to allow the application to
326 close even if this, presumably not very important, window is still opened.
327 By default, the application stays alive as long as there are any open top level
331 \membersection{wxTopLevelWindow::ShowFullScreen
}\label{wxtoplevelwindowshowfullscreen
}
333 \func{bool
}{ShowFullScreen
}{\param{bool
}{ show
},
\param{long
}{ style = wxFULLSCREEN
\_ALL}}
335 Depending on the value of
{\it show
} parameter the window is either shown full
336 screen or restored to its normal state.
{\it style
} is a bit list containing
337 some or all of the following values, which indicate what elements of the window
338 to hide in full-screen mode:
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)
349 This function has not been tested with MDI frames.
351 Note that showing a window full screen also actually
352 \helpref{Show()s
}{wxwindowshow
} if it hadn't been shown yet.
356 \helpref{wxTopLevelWindow::IsFullScreen
}{wxtoplevelwindowisfullscreen
}