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::GetIcon
}\label{wxtoplevelwindowgeticon
}
45 \constfunc{const wxIcon\&
}{GetIcon
}{\void}
47 Returns the standard icon of the window. The icon will be invalid if it hadn't
48 been previously set by
\helpref{SetIcon
}{wxtoplevelwindowseticon
}.
52 \helpref{GetIcons
}{wxtoplevelwindowgeticons
}
55 \membersection{wxTopLevelWindow::GetIcons
}\label{wxtoplevelwindowgeticons
}
57 \constfunc{const wxIconBundle\&
}{GetIcons
}{\void}
59 Returns all icons associated with the window, there will be none of them if
60 neither
\helpref{SetIcon
}{wxtoplevelwindowseticon
} nor
61 \helpref{SetIcons
}{wxtoplevelwindowseticons
} had been called before.
63 Use
\helpref{GetIcon
}{wxtoplevelwindowgeticon
} to get the main icon of the
68 \helpref{wxIconBundle
}{wxiconbundle
}
71 \membersection{wxTopLevelWindow::GetTitle
}\label{wxtoplevelwindowgettitle
}
73 \constfunc{wxString
}{GetTitle
}{\void}
75 Gets a string containing the window title.
79 \helpref{wxTopLevelWindow::SetTitle
}{wxtoplevelwindowsettitle
}
82 \membersection{wxTopLevelWindow::HandleSettingChange
}\label{wxtoplevelwindowhandlesettingchange
}
84 \func{virtual bool
}{HandleSettingChange
}{\param{WXWPARAM
}{ wParam
},
\param{WXLPARAM
}{ lParam
}}
86 Unique to the wxWinCE port. Responds to showing/hiding SIP (soft input panel) area and resize
87 window accordingly. Override this if you want to avoid resizing or do additional
91 \membersection{wxTopLevelWindow::IsActive
}\label{wxtoplevelwindowisactive
}
93 \constfunc{bool
}{IsActive
}{\void}
95 Returns
\true if this window is currently active, i.e. if the user is currently
99 \membersection{wxTopLevelWindow::IsAlwaysMaximized
}\label{wxtoplevelwindowisalwaysmaximized
}
101 \constfunc{virtual bool
}{IsAlwaysMaximized
}{\void}
103 Returns
\true if this window is expected to be always maximized, either due to platform policy
104 or due to local policy regarding particular class.
107 \membersection{wxTopLevelWindow::Iconize
}\label{wxtoplevelwindowiconize
}
109 \func{void
}{Iconize
}{\param{bool
}{ iconize
}}
111 Iconizes or restores the window.
113 \wxheading{Parameters
}
115 \docparam{iconize
}{If
\true, iconizes the window; if
\false, shows and restores it.
}
119 \helpref{wxTopLevelWindow::IsIconized
}{wxtoplevelwindowisiconized
},
\helpref{wxTopLevelWindow::Maximize
}{wxtoplevelwindowmaximize
}.
122 \membersection{wxTopLevelWindow::IsFullScreen
}\label{wxtoplevelwindowisfullscreen
}
124 \func{bool
}{IsFullScreen
}{\void}
126 Returns
\true if the window is in fullscreen mode.
130 \helpref{wxTopLevelWindow::ShowFullScreen
}{wxtoplevelwindowshowfullscreen
}
133 \membersection{wxTopLevelWindow::IsIconized
}\label{wxtoplevelwindowisiconized
}
135 \constfunc{bool
}{IsIconized
}{\void}
137 Returns
\true if the window is iconized.
140 \membersection{wxTopLevelWindow::IsMaximized
}\label{wxtoplevelwindowismaximized
}
142 \constfunc{bool
}{IsMaximized
}{\void}
144 Returns
\true if the window is maximized.
147 \membersection{wxTopLevelWindow::Maximize
}\label{wxtoplevelwindowmaximize
}
149 \func{void
}{Maximize
}{\param{bool
}{maximize
}}
151 Maximizes or restores the window.
153 \wxheading{Parameters
}
155 \docparam{maximize
}{If
\true, maximizes the window, otherwise it restores it.
}
159 \helpref{wxTopLevelWindow::Iconize
}{wxtoplevelwindowiconize
}
162 \membersection{wxTopLevelWindow::RequestUserAttention
}\label{wxtoplevelwindowrequestuserattention
}
164 \func{void
}{RequestUserAttention
}{\param{int
}{flags = wxUSER
\_ATTENTION\_INFO}}
166 Use a system-dependent way to attract users attention to the window when it is
169 \arg{flags
} may have the value of either
\texttt{wxUSER
\_ATTENTION\_INFO}
170 (default) or
\texttt{wxUSER
\_ATTENTION\_ERROR} which results in a more drastic
171 action. When in doubt, use the default value.
173 Note that this function should normally be only used when the application is
174 not already in foreground.
176 This function is currently implemented for Win32 where it flashes the
177 window icon in the taskbar, and for wxGTK with task bars supporting it.
180 \membersection{wxTopLevelWindow::SetIcon
}\label{wxtoplevelwindowseticon
}
182 \func{void
}{SetIcon
}{\param{const wxIcon\&
}{icon
}}
184 Sets the icon for this window.
186 \wxheading{Parameters
}
188 \docparam{icon
}{The icon to associate with this window.
}
192 The window takes a `copy' of
{\it icon
}, but since it uses reference
193 counting, the copy is very quick. It is safe to delete
{\it icon
} after
194 calling this function.
196 See also
\helpref{wxIcon
}{wxicon
}.
199 \membersection{wxTopLevelWindow::SetIcons
}\label{wxtoplevelwindowseticons
}
201 \func{void
}{SetIcons
}{\param{const wxIconBundle\&
}{icons
}}
203 Sets several icons of different sizes for this window: this allows to use
204 different icons for different situations (e.g. task switching bar, taskbar,
205 window title bar) instead of scaling, with possibly bad looking results, the
206 only icon set by
\helpref{SetIcon
}{wxtoplevelwindowseticon
}.
208 \wxheading{Parameters
}
210 \docparam{icons
}{The icons to associate with this window.
}
214 \helpref{wxIconBundle
}{wxiconbundle
}.
217 \membersection{wxTopLevelWindow::SetLeftMenu
}\label{wxtoplevelwindowsetleftmenu
}
219 \func{void
}{SetLeftMenu
}{\param{int
}{ id = wxID
\_ANY},
\param{const wxString\&
}{ label = wxEmptyString
},
\param{wxMenu *
}{ subMenu = NULL
}}
221 Sets action or menu activated by pressing left hardware button on the smart phones.
222 Unavailable on full keyboard machines.
224 \wxheading{Parameters
}
226 \docparam{id
}{Identifier for this button.
}
228 \docparam{label
}{Text to be displayed on the screen area dedicated to this hardware button.
}
230 \docparam{subMenu
}{The menu to be opened after pressing this hardware button.
}
234 \helpref{wxTopLevelWindow::SetRightMenu
}{wxtoplevelwindowsetrightmenu
}.
237 \membersection{wxTopLevelWindow::SetRightMenu
}\label{wxtoplevelwindowsetrightmenu
}
239 \func{void
}{SetRightMenu
}{\param{int
}{ id = wxID
\_ANY},
\param{const wxString\&
}{ label = wxEmptyString
},
\param{wxMenu *
}{ subMenu = NULL
}}
241 Sets action or menu activated by pressing right hardware button on the smart phones.
242 Unavailable on full keyboard machines.
244 \wxheading{Parameters
}
246 \docparam{id
}{Identifier for this button.
}
248 \docparam{label
}{Text to be displayed on the screen area dedicated to this hardware button.
}
250 \docparam{subMenu
}{The menu to be opened after pressing this hardware button.
}
254 \helpref{wxTopLevelWindow::SetLeftMenu
}{wxtoplevelwindowsetleftmenu
}.
257 \membersection{wxTopLevelWindow::SetShape
}\label{wxtoplevelwindowsetshape
}
259 \func{bool
}{SetShape
}{\param{const wxRegion\&
}{ region
}}
261 If the platform supports it, sets the shape of the window to that
262 depicted by
{\it region
}. The system will not display or
263 respond to any mouse event for the pixels that lie outside of the
264 region. To reset the window to the normal rectangular shape simply
265 call
{\it SetShape
} again with an empty region. Returns true if the
266 operation is successful.
269 \membersection{wxTopLevelWindow::SetTitle
}\label{wxtoplevelwindowsettitle
}
271 \func{virtual void
}{SetTitle
}{\param{const wxString\&
}{ title
}}
273 Sets the window title.
275 \wxheading{Parameters
}
277 \docparam{title
}{The window title.
}
281 \helpref{wxTopLevelWindow::GetTitle
}{wxtoplevelwindowgettitle
}
284 \membersection{wxTopLevelWindow::SetTransparent
}\label{wxtoplevelwindowsettransparent
}
286 \func{virtual bool
}{SetTransparent
}{\param{int
}{ alpha
}}
288 If the platform supports it will set the window to be translucent
290 \wxheading{Parameters
}
292 \docparam{alpha
}{Determines how opaque or transparent the window will
293 be, if the platform supports the opreration. A value of
0 sets the
294 window to be fully transparent, and a value of
255 sets the window
297 Returns
\true if the transparency was successfully changed.
301 \membersection{wxTopLevelWindow::ShouldPreventAppExit
}\label{wxtoplevelwindowshouldpreventappexit
}
303 \constfunc{virtual bool
}{ShouldPreventAppExit
}{\void}
305 This virtual function is not meant to be called directly but can be overridden
306 to return
\false (it returns
\true by default) to allow the application to
307 close even if this, presumably not very important, window is still opened.
308 By default, the application stays alive as long as there are any open top level
312 \membersection{wxTopLevelWindow::ShowFullScreen
}\label{wxtoplevelwindowshowfullscreen
}
314 \func{bool
}{ShowFullScreen
}{\param{bool
}{ show
},
\param{long
}{ style = wxFULLSCREEN
\_ALL}}
316 Depending on the value of
{\it show
} parameter the window is either shown full
317 screen or restored to its normal state.
{\it style
} is a bit list containing
318 some or all of the following values, which indicate what elements of the window
319 to hide in full-screen mode:
321 \begin{itemize
}\itemsep=
0pt
322 \item wxFULLSCREEN
\_NOMENUBAR
323 \item wxFULLSCREEN
\_NOTOOLBAR
324 \item wxFULLSCREEN
\_NOSTATUSBAR
325 \item wxFULLSCREEN
\_NOBORDER
326 \item wxFULLSCREEN
\_NOCAPTION
327 \item wxFULLSCREEN
\_ALL (all of the above)
330 This function has not been tested with MDI frames.
332 Note that showing a window full screen also actually
333 \helpref{Show()s
}{wxwindowshow
} if it hadn't been shown yet.
337 \helpref{wxTopLevelWindow::IsFullScreen
}{wxtoplevelwindowisfullscreen
}