]>
Commit | Line | Data |
---|---|---|
1 | \section{\class{wxWindow}}\label{wxwindow} | |
2 | ||
3 | wxWindow is the base class for all windows. Any children of the window will be deleted | |
4 | automatically by the destructor before the window itself is deleted. | |
5 | ||
6 | %Please note that we documented a number of handler functions (OnChar(), OnMouse() etc.) in this | |
7 | %help text. These must not be called by a user program and are documented only for illustration. | |
8 | %On several platforms, only a few of these handlers are actually written (they are not always | |
9 | %needed) and if you are uncertain on how to add a certain behaviour to a window class, intercept | |
10 | %the respective event as usual and call \helpref{wxEvent::Skip}{wxeventskip} so that the native | |
11 | %platform can implement its native behaviour or just ignore the event if nothing needs to be | |
12 | %done. | |
13 | ||
14 | \wxheading{Derived from} | |
15 | ||
16 | \helpref{wxEvtHandler}{wxevthandler}\\ | |
17 | \helpref{wxObject}{wxobject} | |
18 | ||
19 | \wxheading{Include files} | |
20 | ||
21 | <wx/window.h> | |
22 | ||
23 | \wxheading{Window styles} | |
24 | ||
25 | The following styles can apply to all windows, although they will not always make sense for a particular | |
26 | window class or on all platforms. | |
27 | ||
28 | \twocolwidtha{5cm}% | |
29 | \begin{twocollist}\itemsep=0pt | |
30 | \twocolitem{\windowstyle{wxSIMPLE\_BORDER}}{Displays a thin border around the window. wxBORDER is the old name | |
31 | for this style. } | |
32 | \twocolitem{\windowstyle{wxDOUBLE\_BORDER}}{Displays a double border. Windows only.} | |
33 | \twocolitem{\windowstyle{wxSUNKEN\_BORDER}}{Displays a sunken border.} | |
34 | \twocolitem{\windowstyle{wxRAISED\_BORDER}}{Displays a raised border. GTK only. } | |
35 | \twocolitem{\windowstyle{wxSTATIC\_BORDER}}{Displays a border suitable for a static control. Windows only. } | |
36 | \twocolitem{\windowstyle{wxTRANSPARENT\_WINDOW}}{The window is transparent, that is, it will not receive paint | |
37 | events. Windows only.} | |
38 | \twocolitem{\windowstyle{wxTAB\_TRAVERSAL}}{Use this to enable tab traversal for non-dialog windows.} | |
39 | \twocolitem{\windowstyle{wxWANTS\_CHARS}}{Use this to indicate that the window | |
40 | wants to get all char events - even for keys like TAB or ENTER which are | |
41 | usually used for dialog navigation and which wouldn't be generated without | |
42 | this style} | |
43 | \twocolitem{\windowstyle{wxNO\_FULL\_REPAINT\_ON\_RESIZE}}{Disables repainting | |
44 | the window completely when its size is changed - you will have to repaint the | |
45 | new window area manually if you use this style. Currently only has an effect for | |
46 | Windows.} | |
47 | \twocolitem{\windowstyle{wxVSCROLL}}{Use this style to enable a vertical scrollbar.} | |
48 | \twocolitem{\windowstyle{wxHSCROLL}}{Use this style to enable a horizontal scrollbar.} | |
49 | \twocolitem{\windowstyle{wxALWAYS\_SHOW\_SB}}{If a window has scrollbars, | |
50 | disable them instead of hiding them when they are not needed (i.e. when the | |
51 | size of the window is big enough to not require the scrollbars to navigate it). | |
52 | This style is currently only implemented for wxMSW and wxUniversal and does | |
53 | nothing on the other platforms.} | |
54 | \twocolitem{\windowstyle{wxCLIP\_CHILDREN}}{Use this style to eliminate flicker caused by the background being | |
55 | repainted, then children being painted over them. Windows only.} | |
56 | \end{twocollist} | |
57 | ||
58 | See also \helpref{window styles overview}{windowstyles}. | |
59 | ||
60 | \wxheading{Extra window styles} | |
61 | ||
62 | The following are extra styles, set using \helpref{wxWindow::SetExtraStyle}{wxwindowsetextrastyle}. | |
63 | ||
64 | \twocolwidtha{5cm}% | |
65 | \begin{twocollist}\itemsep=0pt | |
66 | \twocolitem{\windowstyle{wxWS\_EX\_VALIDATE\_RECURSIVELY}}{By default, Validate/TransferDataTo/FromWindow() | |
67 | only work on direct children of the window (compatible behaviour). Set this flag to make them recursively | |
68 | descend into all subwindows.} | |
69 | \twocolitem{\windowstyle{wxWS\_EX\_BLOCK\_EVENTS}}{wxCommandEvents and the objects of the derived classes are forwarded to the | |
70 | parent window and so on recursively by default. Using this flag for the | |
71 | given window allows to block this propagation at this window, i.e. prevent | |
72 | the events from being propagated further upwards. Dialogs have this | |
73 | flag on by default.} | |
74 | \twocolitem{\windowstyle{wxWS\_EX\_TRANSIENT}}{Don't use this window as an implicit parent for the other windows: this must | |
75 | be used with transient windows as otherwise there is the risk of creating a | |
76 | dialog/frame with this window as a parent which would lead to a crash if the | |
77 | parent is destroyed before the child.} | |
78 | \twocolitem{\windowstyle{wxWS\_EX\_PROCESS\_IDLE}}{This window should always process idle events, even | |
79 | if the mode set by \helpref{wxIdleEvent::SetMode}{wxidleeventsetmode} is wxIDLE\_PROCESS\_SPECIFIED.} | |
80 | \twocolitem{\windowstyle{wxWS\_EX\_PROCESS\_UI\_UPDATES}}{This window should always process UI update events, | |
81 | even if the mode set by \helpref{wxUpdateUIEvent::SetMode}{wxupdateuieventsetmode} is wxUPDATE\_UI\_PROCESS\_SPECIFIED.} | |
82 | \end{twocollist} | |
83 | ||
84 | \wxheading{See also} | |
85 | ||
86 | \helpref{Event handling overview}{eventhandlingoverview} | |
87 | ||
88 | \latexignore{\rtfignore{\wxheading{Members}}} | |
89 | ||
90 | \membersection{wxWindow::wxWindow}\label{wxwindowctor} | |
91 | ||
92 | \func{}{wxWindow}{\void} | |
93 | ||
94 | Default constructor. | |
95 | ||
96 | \func{}{wxWindow}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id}, | |
97 | \param{const wxPoint\& }{pos = wxDefaultPosition}, | |
98 | \param{const wxSize\& }{size = wxDefaultSize}, | |
99 | \param{long }{style = 0}, | |
100 | \param{const wxString\& }{name = wxPanelNameStr}} | |
101 | ||
102 | Constructs a window, which can be a child of a frame, dialog or any other non-control window. | |
103 | ||
104 | \wxheading{Parameters} | |
105 | ||
106 | \docparam{parent}{Pointer to a parent window.} | |
107 | ||
108 | \docparam{id}{Window identifier. If -1, will automatically create an identifier.} | |
109 | ||
110 | \docparam{pos}{Window position. wxDefaultPosition is (-1, -1) which indicates that wxWindows | |
111 | should generate a default position for the window. If using the wxWindow class directly, supply | |
112 | an actual position.} | |
113 | ||
114 | \docparam{size}{Window size. wxDefaultSize is (-1, -1) which indicates that wxWindows | |
115 | should generate a default size for the window. If no suitable size can be found, the | |
116 | window will be sized to 20x20 pixels so that the window is visible but obviously not | |
117 | correctly sized. } | |
118 | ||
119 | \docparam{style}{Window style. For generic window styles, please see \helpref{wxWindow}{wxwindow}.} | |
120 | ||
121 | \docparam{name}{Window name.} | |
122 | ||
123 | \membersection{wxWindow::\destruct{wxWindow}} | |
124 | ||
125 | \func{}{\destruct{wxWindow}}{\void} | |
126 | ||
127 | Destructor. Deletes all subwindows, then deletes itself. Instead of using | |
128 | the {\bf delete} operator explicitly, you should normally | |
129 | use \helpref{wxWindow::Destroy}{wxwindowdestroy} so that wxWindows | |
130 | can delete a window only when it is safe to do so, in idle time. | |
131 | ||
132 | \wxheading{See also} | |
133 | ||
134 | \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp | |
135 | \helpref{wxWindow::Destroy}{wxwindowdestroy},\rtfsp | |
136 | \helpref{wxCloseEvent}{wxcloseevent} | |
137 | ||
138 | \membersection{wxWindow::AddChild} | |
139 | ||
140 | \func{virtual void}{AddChild}{\param{wxWindow* }{child}} | |
141 | ||
142 | Adds a child window. This is called automatically by window creation | |
143 | functions so should not be required by the application programmer. | |
144 | ||
145 | Notice that this function is mostly internal to wxWindows and shouldn't be | |
146 | called by the user code. | |
147 | ||
148 | \wxheading{Parameters} | |
149 | ||
150 | \docparam{child}{Child window to add.} | |
151 | ||
152 | \membersection{wxWindow::CaptureMouse}\label{wxwindowcapturemouse} | |
153 | ||
154 | \func{virtual void}{CaptureMouse}{\void} | |
155 | ||
156 | Directs all mouse input to this window. Call \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse} to | |
157 | release the capture. | |
158 | ||
159 | Note that wxWindows maintains the stack of windows having captured the mouse | |
160 | and when the mouse is released the capture returns to the window which had had | |
161 | captured it previously and it is only really released if there were no previous | |
162 | window. In particular, this means that you must release the mouse as many times | |
163 | as you capture it. | |
164 | ||
165 | \wxheading{See also} | |
166 | ||
167 | \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse} | |
168 | ||
169 | \membersection{wxWindow::Center}\label{wxwindowcenter} | |
170 | ||
171 | \func{void}{Center}{\param{int}{ direction}} | |
172 | ||
173 | A synonym for \helpref{Centre}{wxwindowcentre}. | |
174 | ||
175 | \membersection{wxWindow::CenterOnParent}\label{wxwindowcenteronparent} | |
176 | ||
177 | \func{void}{CenterOnParent}{\param{int}{ direction}} | |
178 | ||
179 | A synonym for \helpref{CentreOnParent}{wxwindowcentreonparent}. | |
180 | ||
181 | \membersection{wxWindow::CenterOnScreen}\label{wxwindowcenteronscreen} | |
182 | ||
183 | \func{void}{CenterOnScreen}{\param{int}{ direction}} | |
184 | ||
185 | A synonym for \helpref{CentreOnScreen}{wxwindowcentreonscreen}. | |
186 | ||
187 | \membersection{wxWindow::Centre}\label{wxwindowcentre} | |
188 | ||
189 | \func{void}{Centre}{\param{int}{ direction = wxBOTH}} | |
190 | ||
191 | Centres the window. | |
192 | ||
193 | \wxheading{Parameters} | |
194 | ||
195 | \docparam{direction}{Specifies the direction for the centering. May be {\tt wxHORIZONTAL}, {\tt wxVERTICAL}\rtfsp | |
196 | or {\tt wxBOTH}. It may also include {\tt wxCENTRE\_ON\_SCREEN} flag | |
197 | if you want to center the window on the entire screen and not on its | |
198 | parent window.} | |
199 | ||
200 | The flag {\tt wxCENTRE\_FRAME} is obsolete and should not be used any longer | |
201 | (it has no effect). | |
202 | ||
203 | \wxheading{Remarks} | |
204 | ||
205 | If the window is a top level one (i.e. doesn't have a parent), it will be | |
206 | centered relative to the screen anyhow. | |
207 | ||
208 | \wxheading{See also} | |
209 | ||
210 | \helpref{wxWindow::Center}{wxwindowcenter} | |
211 | ||
212 | \membersection{wxWindow::CentreOnParent}\label{wxwindowcentreonparent} | |
213 | ||
214 | \func{void}{CentreOnParent}{\param{int}{ direction = wxBOTH}} | |
215 | ||
216 | Centres the window on its parent. This is a more readable synonym for | |
217 | \helpref{Centre}{wxwindowcentre}. | |
218 | ||
219 | \wxheading{Parameters} | |
220 | ||
221 | \docparam{direction}{Specifies the direction for the centering. May be {\tt wxHORIZONTAL}, {\tt wxVERTICAL}\rtfsp | |
222 | or {\tt wxBOTH}.} | |
223 | ||
224 | \wxheading{Remarks} | |
225 | ||
226 | This methods provides for a way to center top level windows over their | |
227 | parents instead of the entire screen. If there is no parent or if the | |
228 | window is not a top level window, then behaviour is the same as | |
229 | \helpref{wxWindow::Centre}{wxwindowcentre}. | |
230 | ||
231 | \wxheading{See also} | |
232 | ||
233 | \helpref{wxWindow::CentreOnScreen}{wxwindowcenteronscreen} | |
234 | ||
235 | \membersection{wxWindow::CentreOnScreen}\label{wxwindowcentreonscreen} | |
236 | ||
237 | \func{void}{CentreOnScreen}{\param{int}{ direction = wxBOTH}} | |
238 | ||
239 | Centres the window on screen. This only works for top level windows - | |
240 | otherwise, the window will still be centered on its parent. | |
241 | ||
242 | \wxheading{Parameters} | |
243 | ||
244 | \docparam{direction}{Specifies the direction for the centering. May be {\tt wxHORIZONTAL}, {\tt wxVERTICAL}\rtfsp | |
245 | or {\tt wxBOTH}.} | |
246 | ||
247 | \wxheading{See also} | |
248 | ||
249 | \helpref{wxWindow::CentreOnParent}{wxwindowcenteronparent} | |
250 | ||
251 | \membersection{wxWindow::ClearBackground}\label{wxwindowclearbackground} | |
252 | ||
253 | \func{void}{ClearBackground}{\void} | |
254 | ||
255 | Clears the window by filling it with the current background colour. Does not | |
256 | cause an erase background event to be generated. | |
257 | ||
258 | \membersection{wxWindow::ClientToScreen} | |
259 | ||
260 | \constfunc{virtual void}{ClientToScreen}{\param{int* }{x}, \param{int* }{y}} | |
261 | ||
262 | \perlnote{In wxPerl this method returns a 2-element list instead of | |
263 | modifying its parameters.} | |
264 | ||
265 | \constfunc{virtual wxPoint}{ClientToScreen}{\param{const wxPoint\&}{ pt}} | |
266 | ||
267 | Converts to screen coordinates from coordinates relative to this window. | |
268 | ||
269 | \docparam{x}{A pointer to a integer value for the x coordinate. Pass the client coordinate in, and | |
270 | a screen coordinate will be passed out.} | |
271 | ||
272 | \docparam{y}{A pointer to a integer value for the y coordinate. Pass the client coordinate in, and | |
273 | a screen coordinate will be passed out.} | |
274 | ||
275 | \docparam{pt}{The client position for the second form of the function.} | |
276 | ||
277 | \pythonnote{In place of a single overloaded method name, wxPython | |
278 | implements the following methods:\par | |
279 | \indented{2cm}{\begin{twocollist} | |
280 | \twocolitem{{\bf ClientToScreen(point)}}{Accepts and returns a wxPoint} | |
281 | \twocolitem{{\bf ClientToScreenXY(x, y)}}{Returns a 2-tuple, (x, y)} | |
282 | \end{twocollist}} | |
283 | } | |
284 | ||
285 | \membersection{wxWindow::Close}\label{wxwindowclose} | |
286 | ||
287 | \func{bool}{Close}{\param{bool}{ force = {\tt false}}} | |
288 | ||
289 | This function simply generates a \helpref{wxCloseEvent}{wxcloseevent} whose | |
290 | handler usually tries to close the window. It doesn't close the window itself, | |
291 | however. | |
292 | ||
293 | \wxheading{Parameters} | |
294 | ||
295 | \docparam{force}{{\tt false} if the window's close handler should be able to veto the destruction | |
296 | of this window, {\tt true} if it cannot.} | |
297 | ||
298 | \wxheading{Remarks} | |
299 | ||
300 | Close calls the \helpref{close handler}{wxcloseevent} for the window, providing | |
301 | an opportunity for the window to choose whether to destroy the window. | |
302 | Usually it is only used with the top level windows (wxFrame and wxDialog | |
303 | classes) as the others are not supposed to have any special OnClose() logic. | |
304 | ||
305 | The close handler should check whether the window is being deleted forcibly, | |
306 | using \helpref{wxCloseEvent::GetForce}{wxcloseeventgetforce}, in which case it | |
307 | should destroy the window using \helpref{wxWindow::Destroy}{wxwindowdestroy}. | |
308 | ||
309 | {\it Note} that calling Close does not guarantee that the window will be | |
310 | destroyed; but it provides a way to simulate a manual close of a window, which | |
311 | may or may not be implemented by destroying the window. The default | |
312 | implementation of wxDialog::OnCloseWindow does not necessarily delete the | |
313 | dialog, since it will simply simulate an wxID\_CANCEL event which is handled by | |
314 | the appropriate button event handler and may do anything at all. | |
315 | ||
316 | To guarantee that the window will be destroyed, call | |
317 | \helpref{wxWindow::Destroy}{wxwindowdestroy} instead | |
318 | ||
319 | \wxheading{See also} | |
320 | ||
321 | \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp | |
322 | \helpref{wxWindow::Destroy}{wxwindowdestroy},\rtfsp | |
323 | \helpref{wxCloseEvent}{wxcloseevent} | |
324 | ||
325 | \membersection{wxWindow::ConvertDialogToPixels}\label{wxwindowconvertdialogtopixels} | |
326 | ||
327 | \func{wxPoint}{ConvertDialogToPixels}{\param{const wxPoint\&}{ pt}} | |
328 | ||
329 | \func{wxSize}{ConvertDialogToPixels}{\param{const wxSize\&}{ sz}} | |
330 | ||
331 | Converts a point or size from dialog units to pixels. | |
332 | ||
333 | For the x dimension, the dialog units are multiplied by the average character width | |
334 | and then divided by 4. | |
335 | ||
336 | For the y dimension, the dialog units are multiplied by the average character height | |
337 | and then divided by 8. | |
338 | ||
339 | \wxheading{Remarks} | |
340 | ||
341 | Dialog units are used for maintaining a dialog's proportions even if the font changes. | |
342 | Dialogs created using Dialog Editor optionally use dialog units. | |
343 | ||
344 | You can also use these functions programmatically. A convenience macro is defined: | |
345 | ||
346 | {\small | |
347 | \begin{verbatim} | |
348 | #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) | |
349 | \end{verbatim} | |
350 | } | |
351 | ||
352 | \wxheading{See also} | |
353 | ||
354 | \helpref{wxWindow::ConvertPixelsToDialog}{wxwindowconvertpixelstodialog} | |
355 | ||
356 | \pythonnote{In place of a single overloaded method name, wxPython | |
357 | implements the following methods:\par | |
358 | \indented{2cm}{\begin{twocollist} | |
359 | \twocolitem{{\bf ConvertDialogPointToPixels(point)}}{Accepts and returns a wxPoint} | |
360 | \twocolitem{{\bf ConvertDialogSizeToPixels(size)}}{Accepts and returns a wxSize} | |
361 | \end{twocollist}} | |
362 | ||
363 | Additionally, the following helper functions are defined:\par | |
364 | \indented{2cm}{\begin{twocollist} | |
365 | \twocolitem{{\bf wxDLG\_PNT(win, point)}}{Converts a wxPoint from dialog | |
366 | units to pixels} | |
367 | \twocolitem{{\bf wxDLG\_SZE(win, size)}}{Converts a wxSize from dialog | |
368 | units to pixels} | |
369 | \end{twocollist}} | |
370 | } | |
371 | ||
372 | ||
373 | \membersection{wxWindow::ConvertPixelsToDialog}\label{wxwindowconvertpixelstodialog} | |
374 | ||
375 | \func{wxPoint}{ConvertPixelsToDialog}{\param{const wxPoint\&}{ pt}} | |
376 | ||
377 | \func{wxSize}{ConvertPixelsToDialog}{\param{const wxSize\&}{ sz}} | |
378 | ||
379 | Converts a point or size from pixels to dialog units. | |
380 | ||
381 | For the x dimension, the pixels are multiplied by 4 and then divided by the average | |
382 | character width. | |
383 | ||
384 | For the y dimension, the pixels are multiplied by 8 and then divided by the average | |
385 | character height. | |
386 | ||
387 | \wxheading{Remarks} | |
388 | ||
389 | Dialog units are used for maintaining a dialog's proportions even if the font changes. | |
390 | Dialogs created using Dialog Editor optionally use dialog units. | |
391 | ||
392 | \wxheading{See also} | |
393 | ||
394 | \helpref{wxWindow::ConvertDialogToPixels}{wxwindowconvertdialogtopixels} | |
395 | ||
396 | ||
397 | \pythonnote{In place of a single overloaded method name, wxPython | |
398 | implements the following methods:\par | |
399 | \indented{2cm}{\begin{twocollist} | |
400 | \twocolitem{{\bf ConvertDialogPointToPixels(point)}}{Accepts and returns a wxPoint} | |
401 | \twocolitem{{\bf ConvertDialogSizeToPixels(size)}}{Accepts and returns a wxSize} | |
402 | \end{twocollist}} | |
403 | } | |
404 | ||
405 | \membersection{wxWindow::Destroy}\label{wxwindowdestroy} | |
406 | ||
407 | \func{virtual bool}{Destroy}{\void} | |
408 | ||
409 | Destroys the window safely. Use this function instead of the delete operator, since | |
410 | different window classes can be destroyed differently. Frames and dialogs | |
411 | are not destroyed immediately when this function is called -- they are added | |
412 | to a list of windows to be deleted on idle time, when all the window's events | |
413 | have been processed. This prevents problems with events being sent to non-existent | |
414 | windows. | |
415 | ||
416 | \wxheading{Return value} | |
417 | ||
418 | {\tt true} if the window has either been successfully deleted, or it has been added | |
419 | to the list of windows pending real deletion. | |
420 | ||
421 | \membersection{wxWindow::DestroyChildren} | |
422 | ||
423 | \func{virtual void}{DestroyChildren}{\void} | |
424 | ||
425 | Destroys all children of a window. Called automatically by the destructor. | |
426 | ||
427 | \membersection{wxWindow::Disable}\label{wxwindowdisable} | |
428 | ||
429 | \func{bool}{Disable}{\void} | |
430 | ||
431 | Disables the window, same as \helpref{Enable({\tt false})}{wxwindowenable}. | |
432 | ||
433 | \wxheading{Return value} | |
434 | ||
435 | Returns {\tt true} if the window has been disabled, {\tt false} if it had been | |
436 | already disabled before the call to this function. | |
437 | ||
438 | \membersection{wxWindow::DoUpdateWindowUI}\label{wxwindowdoupdatewindowui} | |
439 | ||
440 | \func{virtual void}{DoUpdateWindowUI}{\param{wxUpdateUIEvent\&}{ event}} | |
441 | ||
442 | Does the window-specific updating after processing the update event. | |
443 | This function is called by \helpref{wxWindow::UpdateWindowUI}{wxwindowupdatewindowui} | |
444 | in order to check return values in the \helpref{wxUpdateUIEvent}{wxupdateuievent} and | |
445 | act appropriately. For example, to allow frame and dialog title updating, wxWindows | |
446 | implements this function as follows: | |
447 | ||
448 | \begin{verbatim} | |
449 | // do the window-specific processing after processing the update event | |
450 | void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event) | |
451 | { | |
452 | if ( event.GetSetEnabled() ) | |
453 | Enable(event.GetEnabled()); | |
454 | ||
455 | if ( event.GetSetText() ) | |
456 | { | |
457 | if ( event.GetText() != GetTitle() ) | |
458 | SetTitle(event.GetText()); | |
459 | } | |
460 | } | |
461 | \end{verbatim} | |
462 | ||
463 | \membersection{wxWindow::DragAcceptFiles}\label{wxwindowdragacceptfiles} | |
464 | ||
465 | \func{virtual void}{DragAcceptFiles}{\param{bool}{ accept}} | |
466 | ||
467 | Enables or disables eligibility for drop file events (OnDropFiles). | |
468 | ||
469 | \wxheading{Parameters} | |
470 | ||
471 | \docparam{accept}{If {\tt true}, the window is eligible for drop file events. If {\tt false}, the window | |
472 | will not accept drop file events.} | |
473 | ||
474 | \wxheading{Remarks} | |
475 | ||
476 | Windows only. | |
477 | ||
478 | \membersection{wxWindow::Enable}\label{wxwindowenable} | |
479 | ||
480 | \func{virtual bool}{Enable}{\param{bool}{ enable = {\tt true}}} | |
481 | ||
482 | Enable or disable the window for user input. Note that when a parent window is | |
483 | disabled, all of its children are disabled as well and they are reenabled again | |
484 | when the parent is. | |
485 | ||
486 | \wxheading{Parameters} | |
487 | ||
488 | \docparam{enable}{If {\tt true}, enables the window for input. If {\tt false}, disables the window.} | |
489 | ||
490 | \wxheading{Return value} | |
491 | ||
492 | Returns {\tt true} if the window has been enabled or disabled, {\tt false} if | |
493 | nothing was done, i.e. if the window had already been in the specified state. | |
494 | ||
495 | \wxheading{See also} | |
496 | ||
497 | \helpref{wxWindow::IsEnabled}{wxwindowisenabled},\rtfsp | |
498 | \helpref{wxWindow::Disable}{wxwindowdisable} | |
499 | ||
500 | \membersection{wxWindow::FindFocus}\label{wxwindowfindfocus} | |
501 | ||
502 | \func{static wxWindow*}{FindFocus}{\void} | |
503 | ||
504 | Finds the window or control which currently has the keyboard focus. | |
505 | ||
506 | \wxheading{Remarks} | |
507 | ||
508 | Note that this is a static function, so it can be called without needing a wxWindow pointer. | |
509 | ||
510 | \wxheading{See also} | |
511 | ||
512 | \helpref{wxWindow::SetFocus}{wxwindowsetfocus} | |
513 | ||
514 | \membersection{wxWindow::FindWindow}\label{wxwindowfindwindow} | |
515 | ||
516 | \func{wxWindow*}{FindWindow}{\param{long}{ id}} | |
517 | ||
518 | Find a child of this window, by identifier. | |
519 | ||
520 | \func{wxWindow*}{FindWindow}{\param{const wxString\&}{ name}} | |
521 | ||
522 | Find a child of this window, by name. | |
523 | ||
524 | \pythonnote{In place of a single overloaded method name, wxPython | |
525 | implements the following methods:\par | |
526 | \indented{2cm}{\begin{twocollist} | |
527 | \twocolitem{{\bf FindWindowById(id)}}{Accepts an integer} | |
528 | \twocolitem{{\bf FindWindowByName(name)}}{Accepts a string} | |
529 | \end{twocollist}} | |
530 | } | |
531 | ||
532 | \membersection{wxWindow::FindWindowById}\label{wxwindowfindwindowbyid} | |
533 | ||
534 | \func{static wxWindow*}{FindWindowById}{\param{long}{ id}, \param{wxWindow*}{ parent = NULL}} | |
535 | ||
536 | Find the first window with the given {\it id}. | |
537 | ||
538 | If {\it parent} is NULL, the search will start from all top-level | |
539 | frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. | |
540 | The search is recursive in both cases. | |
541 | ||
542 | \wxheading{See also} | |
543 | ||
544 | \helpref{FindWindow}{wxwindowfindwindow} | |
545 | ||
546 | \membersection{wxWindow::FindWindowByName}\label{wxwindowfindwindowbyname} | |
547 | ||
548 | \func{static wxWindow*}{FindWindowByName}{\param{const wxString\&}{ name}, \param{wxWindow*}{ parent = NULL}} | |
549 | ||
550 | Find a window by its name (as given in a window constructor or {\bf Create} function call). | |
551 | If {\it parent} is NULL, the search will start from all top-level | |
552 | frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. | |
553 | The search is recursive in both cases. | |
554 | ||
555 | If no window with such name is found, | |
556 | \helpref{FindWindowByLabel}{wxwindowfindwindowbylabel} is called. | |
557 | ||
558 | \wxheading{See also} | |
559 | ||
560 | \helpref{FindWindow}{wxwindowfindwindow} | |
561 | ||
562 | \membersection{wxWindow::FindWindowByLabel}\label{wxwindowfindwindowbylabel} | |
563 | ||
564 | \func{static wxWindow*}{FindWindowByLabel}{\param{const wxString\&}{ label}, \param{wxWindow*}{ parent = NULL}} | |
565 | ||
566 | Find a window by its label. Depending on the type of window, the label may be a window title | |
567 | or panel item label. If {\it parent} is NULL, the search will start from all top-level | |
568 | frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. | |
569 | The search is recursive in both cases. | |
570 | ||
571 | \wxheading{See also} | |
572 | ||
573 | \helpref{FindWindow}{wxwindowfindwindow} | |
574 | ||
575 | \membersection{wxWindow::Fit}\label{wxwindowfit} | |
576 | ||
577 | \func{virtual void}{Fit}{\void} | |
578 | ||
579 | Sizes the window so that it fits around its subwindows. This function won't do | |
580 | anything if there are no subwindows and will only really work correctly if the | |
581 | sizers are used for the subwindows layout. Also, if the window has exactly one | |
582 | subwindow it is better (faster and the result is more precise as Fit adds some | |
583 | margin to account for fuzziness of its calculations) to call | |
584 | ||
585 | \begin{verbatim} | |
586 | window->SetClientSize(child->GetSize()); | |
587 | \end{verbatim} | |
588 | ||
589 | instead of calling Fit. | |
590 | ||
591 | \membersection{wxWindow::FitInside}\label{wxwindowfitinside} | |
592 | ||
593 | \func{virtual void}{FitInside}{\void} | |
594 | ||
595 | Similar to \helpref{Fit}{wxwindowfit}, but sizes the interior (virtual) size | |
596 | of a window. Mainly useful with scrolled windows to reset scrollbars after | |
597 | sizing changes that do not trigger a size event, and/or scrolled windows without | |
598 | an interior sizer. This function similarly won't do anything if there are no | |
599 | subwindows. | |
600 | ||
601 | \membersection{wxWindow::Freeze}\label{wxwindowfreeze} | |
602 | ||
603 | \func{virtual void}{Freeze}{\void} | |
604 | ||
605 | Freezes the window or, in other words, prevents any updates from taking place | |
606 | on screen, the window is not redrawn at all. \helpref{Thaw}{wxwindowthaw} must | |
607 | be called to reenable window redrawing. | |
608 | ||
609 | This method is useful for visual appearance optimization (for example, it | |
610 | is a good idea to use it before inserting large amount of text into a | |
611 | wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all | |
612 | controls so it is mostly just a hint to wxWindows and not a mandatory | |
613 | directive. | |
614 | ||
615 | \membersection{wxWindow::GetAccessible}\label{wxwindowgetaccessible} | |
616 | ||
617 | \func{wxAccessibile*}{GetAccessible}{\void} | |
618 | ||
619 | Returns the accessible object for this window, if any. | |
620 | ||
621 | See also \helpref{wxAccessible}{wxaccessible}. | |
622 | ||
623 | \membersection{wxWindow::GetAdjustedBestSize}\label{wxwindowgetadjustedbestsize} | |
624 | ||
625 | \constfunc{wxSize}{GetAdjustedBestSize}{\void} | |
626 | ||
627 | This method is similar to \helpref{GetBestSize}{wxwindowgetbestsize}, except | |
628 | in one thing. GetBestSize should return the minimum untruncated size of the | |
629 | window, while this method will return the largest of BestSize and any user | |
630 | specified minimum size. ie. it is the minimum size the window should currently | |
631 | be drawn at, not the minimal size it can possibly tolerate. | |
632 | ||
633 | \membersection{wxWindow::GetBackgroundColour}\label{wxwindowgetbackgroundcolour} | |
634 | ||
635 | \constfunc{virtual wxColour}{GetBackgroundColour}{\void} | |
636 | ||
637 | Returns the background colour of the window. | |
638 | ||
639 | \wxheading{See also} | |
640 | ||
641 | \helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp | |
642 | \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp | |
643 | \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour} | |
644 | ||
645 | \membersection{wxWindow::GetBestSize}\label{wxwindowgetbestsize} | |
646 | ||
647 | \constfunc{virtual wxSize}{GetBestSize}{\void} | |
648 | ||
649 | This functions returns the best acceptable minimal size for the window. For | |
650 | example, for a static control, it will be the minimal size such that the | |
651 | control label is not truncated. For windows containing subwindows (typically | |
652 | \helpref{wxPanel}{wxpanel}), the size returned by this function will be the | |
653 | same as the size the window would have had after calling | |
654 | \helpref{Fit}{wxwindowfit}. | |
655 | ||
656 | \membersection{wxWindow::GetCaret}\label{wxwindowgetcaret} | |
657 | ||
658 | \constfunc{wxCaret *}{GetCaret}{\void} | |
659 | ||
660 | Returns the \helpref{caret}{wxcaret} associated with the window. | |
661 | ||
662 | \membersection{wxWindow::GetCapture}\label{wxwindowgetcapture} | |
663 | ||
664 | \func{static wxWindow *}{GetCapture}{\void} | |
665 | ||
666 | Returns the currently captured window. | |
667 | ||
668 | \wxheading{See also} | |
669 | ||
670 | \helpref{wxWindow::HasCapture}{wxwindowhascapture}, | |
671 | \helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse}, | |
672 | \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse}, | |
673 | \helpref{wxMouseCaptureChangedEvent}{wxmousecapturechangedevent} | |
674 | ||
675 | \membersection{wxWindow::GetCharHeight} | |
676 | ||
677 | \constfunc{virtual int}{GetCharHeight}{\void} | |
678 | ||
679 | Returns the character height for this window. | |
680 | ||
681 | \membersection{wxWindow::GetCharWidth} | |
682 | ||
683 | \constfunc{virtual int}{GetCharWidth}{\void} | |
684 | ||
685 | Returns the average character width for this window. | |
686 | ||
687 | \membersection{wxWindow::GetChildren} | |
688 | ||
689 | \func{wxList\&}{GetChildren}{\void} | |
690 | ||
691 | Returns a reference to the list of the window's children. | |
692 | ||
693 | \membersection{wxWindow::GetClientSize}\label{wxwindowgetclientsize} | |
694 | ||
695 | \constfunc{virtual void}{GetClientSize}{\param{int* }{width}, \param{int* }{height}} | |
696 | ||
697 | \perlnote{In wxPerl this method takes no parameter and returns | |
698 | a 2-element list {\tt ( width, height )}.} | |
699 | ||
700 | \constfunc{virtual wxSize}{GetClientSize}{\void} | |
701 | ||
702 | This gets the size of the window `client area' in pixels. | |
703 | The client area is the area which may be drawn on by the programmer, | |
704 | excluding title bar, border, scrollbars, etc. | |
705 | ||
706 | \wxheading{Parameters} | |
707 | ||
708 | \docparam{width}{Receives the client width in pixels.} | |
709 | ||
710 | \docparam{height}{Receives the client height in pixels.} | |
711 | ||
712 | \pythonnote{In place of a single overloaded method name, wxPython | |
713 | implements the following methods:\par | |
714 | \indented{2cm}{\begin{twocollist} | |
715 | \twocolitem{{\bf GetClientSizeTuple()}}{Returns a 2-tuple of (width, height)} | |
716 | \twocolitem{{\bf GetClientSize()}}{Returns a wxSize object} | |
717 | \end{twocollist}} | |
718 | } | |
719 | ||
720 | \wxheading{See also} | |
721 | ||
722 | \helpref{GetSize}{wxwindowgetsize} | |
723 | \helpref{GetVirtualSize}{wxwindowgetvirtualsize} | |
724 | ||
725 | \membersection{wxWindow::GetConstraints}\label{wxwindowgetconstraints} | |
726 | ||
727 | \constfunc{wxLayoutConstraints*}{GetConstraints}{\void} | |
728 | ||
729 | Returns a pointer to the window's layout constraints, or NULL if there are none. | |
730 | ||
731 | \membersection{wxWindow::GetContainingSizer}\label{wxwindowgetcontainingsizer} | |
732 | ||
733 | \constfunc{const wxSizer *}{GetContainingSizer}{\void} | |
734 | ||
735 | Return the sizer that this window is a member of, if any, otherwise | |
736 | {\tt NULL}. | |
737 | ||
738 | \membersection{wxWindow::GetDropTarget}\label{wxwindowgetdroptarget} | |
739 | ||
740 | \constfunc{wxDropTarget*}{GetDropTarget}{\void} | |
741 | ||
742 | Returns the associated drop target, which may be NULL. | |
743 | ||
744 | \wxheading{See also} | |
745 | ||
746 | \helpref{wxWindow::SetDropTarget}{wxwindowsetdroptarget}, | |
747 | \helpref{Drag and drop overview}{wxdndoverview} | |
748 | ||
749 | \membersection{wxWindow::GetEventHandler}\label{wxwindowgeteventhandler} | |
750 | ||
751 | \constfunc{wxEvtHandler*}{GetEventHandler}{\void} | |
752 | ||
753 | Returns the event handler for this window. By default, the window is its | |
754 | own event handler. | |
755 | ||
756 | \wxheading{See also} | |
757 | ||
758 | \helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp | |
759 | \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp | |
760 | \helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp | |
761 | \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp | |
762 | \helpref{wxEvtHandler}{wxevthandler}\rtfsp | |
763 | ||
764 | \membersection{wxWindow::GetExtraStyle}\label{wxwindowgetextrastyle} | |
765 | ||
766 | \constfunc{long}{GetExtraStyle}{\void} | |
767 | ||
768 | Returns the extra style bits for the window. | |
769 | ||
770 | \membersection{wxWindow::GetFont}\label{wxwindowgetfont} | |
771 | ||
772 | \constfunc{wxFont\&}{GetFont}{\void} | |
773 | ||
774 | Returns a reference to the font for this window. | |
775 | ||
776 | \wxheading{See also} | |
777 | ||
778 | \helpref{wxWindow::SetFont}{wxwindowsetfont} | |
779 | ||
780 | \membersection{wxWindow::GetForegroundColour}\label{wxwindowgetforegroundcolour} | |
781 | ||
782 | \func{virtual wxColour}{GetForegroundColour}{\void} | |
783 | ||
784 | Returns the foreground colour of the window. | |
785 | ||
786 | \wxheading{Remarks} | |
787 | ||
788 | The interpretation of foreground colour is open to interpretation according | |
789 | to the window class; it may be the text colour or other colour, or it may not | |
790 | be used at all. | |
791 | ||
792 | \wxheading{See also} | |
793 | ||
794 | \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp | |
795 | \helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp | |
796 | \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour} | |
797 | ||
798 | \membersection{wxWindow::GetGrandParent} | |
799 | ||
800 | \constfunc{wxWindow*}{GetGrandParent}{\void} | |
801 | ||
802 | Returns the grandparent of a window, or NULL if there isn't one. | |
803 | ||
804 | \membersection{wxWindow::GetHandle}\label{wxwindowgethandle} | |
805 | ||
806 | \constfunc{void*}{GetHandle}{\void} | |
807 | ||
808 | Returns the platform-specific handle of the physical window. Cast it to an appropriate | |
809 | handle, such as {\bf HWND} for Windows, {\bf Widget} for Motif or {\bf GtkWidget} for GTK. | |
810 | ||
811 | \pythonnote{This method will return an integer in wxPython.} | |
812 | ||
813 | \perlnote{This method will return an integer in wxPerl.} | |
814 | ||
815 | \membersection{wxWindow::GetHelpText}\label{wxwindowgethelptext} | |
816 | ||
817 | \constfunc{virtual wxString}{GetHelpText}{\void} | |
818 | ||
819 | Gets the help text to be used as context-sensitive help for this window. | |
820 | ||
821 | Note that the text is actually stored by the current \helpref{wxHelpProvider}{wxhelpprovider} implementation, | |
822 | and not in the window object itself. | |
823 | ||
824 | \wxheading{See also} | |
825 | ||
826 | \helpref{SetHelpText}{wxwindowsethelptext}, \helpref{wxHelpProvider}{wxhelpprovider} | |
827 | ||
828 | \membersection{wxWindow::GetId}\label{wxwindowgetid} | |
829 | ||
830 | \constfunc{int}{GetId}{\void} | |
831 | ||
832 | Returns the identifier of the window. | |
833 | ||
834 | \wxheading{Remarks} | |
835 | ||
836 | Each window has an integer identifier. If the application has not provided one | |
837 | (or the default Id -1) an unique identifier with a negative value will be generated. | |
838 | ||
839 | \wxheading{See also} | |
840 | ||
841 | \helpref{wxWindow::SetId}{wxwindowsetid},\rtfsp | |
842 | \helpref{Window identifiers}{windowids} | |
843 | ||
844 | \membersection{wxWindow::GetLabel} | |
845 | ||
846 | \constfunc{virtual wxString }{GetLabel}{\void} | |
847 | ||
848 | Generic way of getting a label from any window, for | |
849 | identification purposes. | |
850 | ||
851 | \wxheading{Remarks} | |
852 | ||
853 | The interpretation of this function differs from class to class. | |
854 | For frames and dialogs, the value returned is the title. For buttons or static text controls, it is | |
855 | the button text. This function can be useful for meta-programs (such as testing | |
856 | tools or special-needs access programs) which need to identify windows | |
857 | by name. | |
858 | ||
859 | \membersection{wxWindow::GetName}\label{wxwindowgetname} | |
860 | ||
861 | \constfunc{virtual wxString }{GetName}{\void} | |
862 | ||
863 | Returns the window's name. | |
864 | ||
865 | \wxheading{Remarks} | |
866 | ||
867 | This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate | |
868 | name in the window constructor or via \helpref{wxWindow::SetName}{wxwindowsetname}. | |
869 | ||
870 | \wxheading{See also} | |
871 | ||
872 | \helpref{wxWindow::SetName}{wxwindowsetname} | |
873 | ||
874 | \membersection{wxWindow::GetParent} | |
875 | ||
876 | \constfunc{virtual wxWindow*}{GetParent}{\void} | |
877 | ||
878 | Returns the parent of the window, or NULL if there is no parent. | |
879 | ||
880 | \membersection{wxWindow::GetPosition}\label{wxwindowgetposition} | |
881 | ||
882 | \constfunc{virtual void}{GetPosition}{\param{int* }{x}, \param{int* }{y}} | |
883 | ||
884 | \constfunc{wxPoint}{GetPosition}{\void} | |
885 | ||
886 | This gets the position of the window in pixels, relative to the parent window | |
887 | for the child windows or relative to the display origin for the top level | |
888 | windows. | |
889 | ||
890 | \wxheading{Parameters} | |
891 | ||
892 | \docparam{x}{Receives the x position of the window.} | |
893 | ||
894 | \docparam{y}{Receives the y position of the window.} | |
895 | ||
896 | \pythonnote{In place of a single overloaded method name, wxPython | |
897 | implements the following methods:\par | |
898 | \indented{2cm}{\begin{twocollist} | |
899 | \twocolitem{{\bf GetPosition()}}{Returns a wxPoint} | |
900 | \twocolitem{{\bf GetPositionTuple()}}{Returns a tuple (x, y)} | |
901 | \end{twocollist}} | |
902 | } | |
903 | ||
904 | \perlnote{In wxPerl there are two methods instead of a single overloaded | |
905 | method:\par | |
906 | \indented{2cm}{\begin{twocollist} | |
907 | \twocolitem{{\bf GetPosition()}}{Returns a Wx::Point} | |
908 | \twocolitem{{\bf GetPositionXY()}}{Returns a 2-element list | |
909 | {\tt ( x, y )}} | |
910 | \end{twocollist} | |
911 | }} | |
912 | ||
913 | \membersection{wxWindow::GetRect}\label{wxwindowgetrect} | |
914 | ||
915 | \constfunc{virtual wxRect}{GetRect}{\void} | |
916 | ||
917 | Returns the size and position of the window as a \helpref{wxRect}{wxrect} object. | |
918 | ||
919 | \membersection{wxWindow::GetScrollThumb}\label{wxwindowgetscrollthumb} | |
920 | ||
921 | \func{virtual int}{GetScrollThumb}{\param{int }{orientation}} | |
922 | ||
923 | Returns the built-in scrollbar thumb size. | |
924 | ||
925 | \wxheading{See also} | |
926 | ||
927 | \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar} | |
928 | ||
929 | \membersection{wxWindow::GetScrollPos}\label{wxwindowgetscrollpos} | |
930 | ||
931 | \func{virtual int}{GetScrollPos}{\param{int }{orientation}} | |
932 | ||
933 | Returns the built-in scrollbar position. | |
934 | ||
935 | \wxheading{See also} | |
936 | ||
937 | See \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar} | |
938 | ||
939 | \membersection{wxWindow::GetScrollRange}\label{wxwindowgetscrollrange} | |
940 | ||
941 | \func{virtual int}{GetScrollRange}{\param{int }{orientation}} | |
942 | ||
943 | Returns the built-in scrollbar range. | |
944 | ||
945 | \wxheading{See also} | |
946 | ||
947 | \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar} | |
948 | ||
949 | \membersection{wxWindow::GetSize}\label{wxwindowgetsize} | |
950 | ||
951 | \constfunc{virtual void}{GetSize}{\param{int* }{width}, \param{int* }{height}} | |
952 | ||
953 | \constfunc{virtual wxSize}{GetSize}{\void} | |
954 | ||
955 | This gets the size of the entire window in pixels, | |
956 | including title bar, border, scrollbars, etc. | |
957 | ||
958 | \wxheading{Parameters} | |
959 | ||
960 | \docparam{width}{Receives the window width.} | |
961 | ||
962 | \docparam{height}{Receives the window height.} | |
963 | ||
964 | \pythonnote{In place of a single overloaded method name, wxPython | |
965 | implements the following methods:\par | |
966 | \indented{2cm}{\begin{twocollist} | |
967 | \twocolitem{{\bf GetSize()}}{Returns a wxSize} | |
968 | \twocolitem{{\bf GetSizeTuple()}}{Returns a 2-tuple (width, height)} | |
969 | \end{twocollist}} | |
970 | } | |
971 | ||
972 | \perlnote{In wxPerl there are two methods instead of a single overloaded | |
973 | method:\par | |
974 | \indented{2cm}{\begin{twocollist} | |
975 | \twocolitem{{\bf GetSize()}}{Returns a Wx::Size} | |
976 | \twocolitem{{\bf GetSizeWH()}}{Returns a 2-element list | |
977 | {\tt ( width, height )}} | |
978 | \end{twocollist} | |
979 | }} | |
980 | ||
981 | \wxheading{See also} | |
982 | ||
983 | \helpref{GetClientSize}{wxwindowgetclientsize},\rtfsp | |
984 | \helpref{GetVirtualSize}{wxwindowgetvirtualsize} | |
985 | ||
986 | \membersection{wxWindow::GetSizer}\label{wxwindowgetsizer} | |
987 | ||
988 | \constfunc{wxSizer *}{GetSizer}{\void} | |
989 | ||
990 | Return the sizer associated with the window by a previous call to | |
991 | \helpref{SetSizer()}{wxwindowsetsizer} or {\tt NULL}. | |
992 | ||
993 | \membersection{wxWindow::GetTextExtent}\label{wxwindowgettextextent} | |
994 | ||
995 | \constfunc{virtual void}{GetTextExtent}{\param{const wxString\& }{string}, \param{int* }{x}, \param{int* }{y}, | |
996 | \param{int* }{descent = NULL}, \param{int* }{externalLeading = NULL}, | |
997 | \param{const wxFont* }{font = NULL}, \param{bool}{ use16 = {\tt false}}} | |
998 | ||
999 | Gets the dimensions of the string as it would be drawn on the | |
1000 | window with the currently selected font. | |
1001 | ||
1002 | \wxheading{Parameters} | |
1003 | ||
1004 | \docparam{string}{String whose extent is to be measured.} | |
1005 | ||
1006 | \docparam{x}{Return value for width.} | |
1007 | ||
1008 | \docparam{y}{Return value for height.} | |
1009 | ||
1010 | \docparam{descent}{Return value for descent (optional).} | |
1011 | ||
1012 | \docparam{externalLeading}{Return value for external leading (optional).} | |
1013 | ||
1014 | \docparam{font}{Font to use instead of the current window font (optional).} | |
1015 | ||
1016 | \docparam{use16}{If {\tt true}, {\it string} contains 16-bit characters. The default is {\tt false}.} | |
1017 | ||
1018 | ||
1019 | \pythonnote{In place of a single overloaded method name, wxPython | |
1020 | implements the following methods:\par | |
1021 | \indented{2cm}{\begin{twocollist} | |
1022 | \twocolitem{{\bf GetTextExtent(string)}}{Returns a 2-tuple, (width, height)} | |
1023 | \twocolitem{{\bf GetFullTextExtent(string, font=NULL)}}{Returns a | |
1024 | 4-tuple, (width, height, descent, externalLeading) } | |
1025 | \end{twocollist}} | |
1026 | } | |
1027 | ||
1028 | \perlnote{In wxPerl this method takes only the {\tt string} and optionally | |
1029 | {\tt font} parameters, and returns a 4-element list | |
1030 | {\tt ( x, y, descent, externalLeading )}.} | |
1031 | ||
1032 | \membersection{wxWindow::GetTitle}\label{wxwindowgettitle} | |
1033 | ||
1034 | \func{virtual wxString}{GetTitle}{\void} | |
1035 | ||
1036 | Gets the window's title. Applicable only to frames and dialogs. | |
1037 | ||
1038 | \wxheading{See also} | |
1039 | ||
1040 | \helpref{wxWindow::SetTitle}{wxwindowsettitle} | |
1041 | ||
1042 | \membersection{wxWindow::GetToolTip}\label{wxwindowgettooltip} | |
1043 | ||
1044 | \constfunc{wxToolTip*}{GetToolTip}{\void} | |
1045 | ||
1046 | Get the associated tooltip or NULL if none. | |
1047 | ||
1048 | \membersection{wxWindow::GetUpdateRegion}\label{wxwindowgetupdateregion} | |
1049 | ||
1050 | \constfunc{virtual wxRegion}{GetUpdateRegion}{\void} | |
1051 | ||
1052 | Returns the region specifying which parts of the window have been damaged. Should | |
1053 | only be called within an \helpref{wxPaintEvent}{wxpaintevent} handler. | |
1054 | ||
1055 | \wxheading{See also} | |
1056 | ||
1057 | \helpref{wxRegion}{wxregion},\rtfsp | |
1058 | \helpref{wxRegionIterator}{wxregioniterator} | |
1059 | ||
1060 | \membersection{wxWindow::GetValidator}\label{wxwindowgetvalidator} | |
1061 | ||
1062 | \constfunc{wxValidator*}{GetValidator}{\void} | |
1063 | ||
1064 | Returns a pointer to the current validator for the window, or NULL if there is none. | |
1065 | ||
1066 | \membersection{wxWindow::GetVirtualSize}\label{wxwindowgetvirtualsize} | |
1067 | ||
1068 | \constfunc{void}{GetVirtualSize}{\param{int* }{width}, \param{int* }{height}} | |
1069 | ||
1070 | \constfunc{wxSize}{GetVirtualSize}{\void} | |
1071 | ||
1072 | This gets the virtual size of the window in pixels. | |
1073 | ||
1074 | \wxheading{Parameters} | |
1075 | ||
1076 | \docparam{width}{Receives the window virtual width.} | |
1077 | ||
1078 | \docparam{height}{Receives the window virtual height.} | |
1079 | ||
1080 | \helpref{GetSize}{wxwindowgetsize},\rtfsp | |
1081 | \helpref{GetClientSize}{wxwindowgetclientsize} | |
1082 | ||
1083 | \membersection{wxWindow::GetWindowStyleFlag}\label{wxwindowgetwindowstyleflag} | |
1084 | ||
1085 | \constfunc{long}{GetWindowStyleFlag}{\void} | |
1086 | ||
1087 | Gets the window style that was passed to the constructor or {\bf Create} | |
1088 | method. {\bf GetWindowStyle()} is another name for the same function. | |
1089 | ||
1090 | \membersection{wxWindow::HasCapture}\label{wxwindowhascapture} | |
1091 | ||
1092 | \constfunc{virtual bool}{HasCapture}{\void} | |
1093 | ||
1094 | Returns true if this window has the current mouse capture. | |
1095 | ||
1096 | \wxheading{See also} | |
1097 | ||
1098 | \helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse}, | |
1099 | \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse}, | |
1100 | \helpref{wxMouseCaptureChangedEvent}{wxmousecapturechangedevent} | |
1101 | ||
1102 | \membersection{wxWindow::Hide}\label{wxwindowhide} | |
1103 | ||
1104 | \func{bool}{Hide}{\void} | |
1105 | ||
1106 | Equivalent to calling \helpref{Show}{wxwindowshow}({\tt false}). | |
1107 | ||
1108 | \membersection{wxWindow::InitDialog}\label{wxwindowinitdialog} | |
1109 | ||
1110 | \func{void}{InitDialog}{\void} | |
1111 | ||
1112 | Sends an {\tt wxEVT\_INIT\_DIALOG} event, whose handler usually transfers data | |
1113 | to the dialog via validators. | |
1114 | ||
1115 | \membersection{wxWindow::IsEnabled}\label{wxwindowisenabled} | |
1116 | ||
1117 | \constfunc{virtual bool}{IsEnabled}{\void} | |
1118 | ||
1119 | Returns {\tt true} if the window is enabled for input, {\tt false} otherwise. | |
1120 | ||
1121 | \wxheading{See also} | |
1122 | ||
1123 | \helpref{wxWindow::Enable}{wxwindowenable} | |
1124 | ||
1125 | \membersection{wxWindow::IsExposed}\label{wxwindowisexposed} | |
1126 | ||
1127 | \constfunc{bool}{IsExposed}{\param{int }{x}, \param{int }{y}} | |
1128 | ||
1129 | \constfunc{bool}{IsExposed}{\param{wxPoint }{\&pt}} | |
1130 | ||
1131 | \constfunc{bool}{IsExposed}{\param{int }{x}, \param{int }{y}, \param{int }{w}, \param{int }{h}} | |
1132 | ||
1133 | \constfunc{bool}{IsExposed}{\param{wxRect }{\&rect}} | |
1134 | ||
1135 | Returns {\tt true} if the given point or rectangle area has been exposed since the | |
1136 | last repaint. Call this in an paint event handler to optimize redrawing by | |
1137 | only redrawing those areas, which have been exposed. | |
1138 | ||
1139 | \pythonnote{In place of a single overloaded method name, wxPython | |
1140 | implements the following methods:\par | |
1141 | \indented{2cm}{\begin{twocollist} | |
1142 | \twocolitem{{\bf IsExposed(x,y, w=0,h=0}}{} | |
1143 | \twocolitem{{\bf IsExposedPoint(pt)}}{} | |
1144 | \twocolitem{{\bf IsExposedRect(rect)}}{} | |
1145 | \end{twocollist}}} | |
1146 | ||
1147 | \membersection{wxWindow::IsRetained}\label{wxwindowisretained} | |
1148 | ||
1149 | \constfunc{virtual bool}{IsRetained}{\void} | |
1150 | ||
1151 | Returns {\tt true} if the window is retained, {\tt false} otherwise. | |
1152 | ||
1153 | \wxheading{Remarks} | |
1154 | ||
1155 | Retained windows are only available on X platforms. | |
1156 | ||
1157 | \membersection{wxWindow::IsShown}\label{wxwindowisshown} | |
1158 | ||
1159 | \constfunc{virtual bool}{IsShown}{\void} | |
1160 | ||
1161 | Returns {\tt true} if the window is shown, {\tt false} if it has been hidden. | |
1162 | ||
1163 | \membersection{wxWindow::IsTopLevel}\label{wxwindowistoplevel} | |
1164 | ||
1165 | \constfunc{bool}{IsTopLevel}{\void} | |
1166 | ||
1167 | Returns {\tt true} if the given window is a top-level one. Currently all frames and | |
1168 | dialogs are considered to be top-level windows (even if they have a parent | |
1169 | window). | |
1170 | ||
1171 | \membersection{wxWindow::Layout}\label{wxwindowlayout} | |
1172 | ||
1173 | \func{void}{Layout}{\void} | |
1174 | ||
1175 | Invokes the constraint-based layout algorithm or the sizer-based algorithm | |
1176 | for this window. | |
1177 | ||
1178 | See \helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout}: when auto | |
1179 | layout is on, this function gets called automatically when the window is resized. | |
1180 | ||
1181 | \membersection{wxWindow::LineDown}\label{wxwindowlinedown} | |
1182 | ||
1183 | This is just a wrapper for \helpref{ScrollLines()}{wxwindowscrolllines}$(1)$. | |
1184 | ||
1185 | \membersection{wxWindow::LineUp}\label{wxwindowlineup} | |
1186 | ||
1187 | This is just a wrapper for \helpref{ScrollLines()}{wxwindowscrolllines}$(-1)$. | |
1188 | ||
1189 | \membersection{wxWindow::Lower}\label{wxwindowlower} | |
1190 | ||
1191 | \func{void}{Lower}{\void} | |
1192 | ||
1193 | Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog | |
1194 | or frame). | |
1195 | ||
1196 | \membersection{wxWindow::MakeModal}\label{wxwindowmakemodal} | |
1197 | ||
1198 | \func{virtual void}{MakeModal}{\param{bool }{flag}} | |
1199 | ||
1200 | Disables all other windows in the application so that | |
1201 | the user can only interact with this window. (This function | |
1202 | is not implemented anywhere). | |
1203 | ||
1204 | \wxheading{Parameters} | |
1205 | ||
1206 | \docparam{flag}{If {\tt true}, this call disables all other windows in the application so that | |
1207 | the user can only interact with this window. If {\tt false}, the effect is reversed.} | |
1208 | ||
1209 | \membersection{wxWindow::Move}\label{wxwindowmove} | |
1210 | ||
1211 | \func{void}{Move}{\param{int}{ x}, \param{int}{ y}} | |
1212 | ||
1213 | \func{void}{Move}{\param{const wxPoint\&}{ pt}} | |
1214 | ||
1215 | Moves the window to the given position. | |
1216 | ||
1217 | \wxheading{Parameters} | |
1218 | ||
1219 | \docparam{x}{Required x position.} | |
1220 | ||
1221 | \docparam{y}{Required y position.} | |
1222 | ||
1223 | \docparam{pt}{\helpref{wxPoint}{wxpoint} object representing the position.} | |
1224 | ||
1225 | \wxheading{Remarks} | |
1226 | ||
1227 | Implementations of SetSize can also implicitly implement the | |
1228 | wxWindow::Move function, which is defined in the base wxWindow class | |
1229 | as the call: | |
1230 | ||
1231 | \begin{verbatim} | |
1232 | SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING); | |
1233 | \end{verbatim} | |
1234 | ||
1235 | \wxheading{See also} | |
1236 | ||
1237 | \helpref{wxWindow::SetSize}{wxwindowsetsize} | |
1238 | ||
1239 | \pythonnote{In place of a single overloaded method name, wxPython | |
1240 | implements the following methods:\par | |
1241 | \indented{2cm}{\begin{twocollist} | |
1242 | \twocolitem{{\bf Move(point)}}{Accepts a wxPoint} | |
1243 | \twocolitem{{\bf MoveXY(x, y)}}{Accepts a pair of integers} | |
1244 | \end{twocollist}} | |
1245 | } | |
1246 | ||
1247 | %% VZ: wxWindow::OnXXX() functions should not be documented but I'm leaving | |
1248 | %% the old docs here in case we want to move any still needed bits to | |
1249 | %% the right location (i.e. probably the corresponding events docs) | |
1250 | %% | |
1251 | %% \membersection{wxWindow::OnActivate}\label{wxwindowonactivate} | |
1252 | %% | |
1253 | %% \func{void}{OnActivate}{\param{wxActivateEvent\&}{ event}} | |
1254 | %% | |
1255 | %% Called when a window is activated or deactivated. | |
1256 | %% | |
1257 | %% \wxheading{Parameters} | |
1258 | %% | |
1259 | %% \docparam{event}{Object containing activation information.} | |
1260 | %% | |
1261 | %% \wxheading{Remarks} | |
1262 | %% | |
1263 | %% If the window is being activated, \helpref{wxActivateEvent::GetActive}{wxactivateeventgetactive} returns {\tt true}, | |
1264 | %% otherwise it returns {\tt false} (it is being deactivated). | |
1265 | %% | |
1266 | %% \wxheading{See also} | |
1267 | %% | |
1268 | %% \helpref{wxActivateEvent}{wxactivateevent},\rtfsp | |
1269 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1270 | %% | |
1271 | %% \membersection{wxWindow::OnChar}\label{wxwindowonchar} | |
1272 | %% | |
1273 | %% \func{void}{OnChar}{\param{wxKeyEvent\&}{ event}} | |
1274 | %% | |
1275 | %% Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT). | |
1276 | %% | |
1277 | %% \wxheading{Parameters} | |
1278 | %% | |
1279 | %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for | |
1280 | %% details about this class.} | |
1281 | %% | |
1282 | %% \wxheading{Remarks} | |
1283 | %% | |
1284 | %% This member function is called in response to a keypress. To intercept this event, | |
1285 | %% use the EVT\_CHAR macro in an event table definition. Your {\bf OnChar} handler may call this | |
1286 | %% default function to achieve default keypress functionality. | |
1287 | %% | |
1288 | %% Note that the ASCII values do not have explicit key codes: they are passed as ASCII | |
1289 | %% values. | |
1290 | %% | |
1291 | %% Note that not all keypresses can be intercepted this way. If you wish to intercept modifier | |
1292 | %% keypresses, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or | |
1293 | %% \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}. | |
1294 | %% | |
1295 | %% Most, but not all, windows allow keypresses to be intercepted. | |
1296 | %% | |
1297 | %% {\bf Tip:} be sure to call {\tt event.Skip()} for events that you don't process in this function, | |
1298 | %% otherwise menu shortcuts may cease to work under Windows. | |
1299 | %% | |
1300 | %% \wxheading{See also} | |
1301 | %% | |
1302 | %% \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp | |
1303 | %% \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp | |
1304 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1305 | %% | |
1306 | %% \membersection{wxWindow::OnCharHook}\label{wxwindowoncharhook} | |
1307 | %% | |
1308 | %% \func{void}{OnCharHook}{\param{wxKeyEvent\&}{ event}} | |
1309 | %% | |
1310 | %% This member is called to allow the window to intercept keyboard events | |
1311 | %% before they are processed by child windows. | |
1312 | %% | |
1313 | %% \wxheading{Parameters} | |
1314 | %% | |
1315 | %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for | |
1316 | %% details about this class.} | |
1317 | %% | |
1318 | %% \wxheading{Remarks} | |
1319 | %% | |
1320 | %% This member function is called in response to a keypress, if the window is active. To intercept this event, | |
1321 | %% use the EVT\_CHAR\_HOOK macro in an event table definition. If you do not process a particular | |
1322 | %% keypress, call \helpref{wxEvent::Skip}{wxeventskip} to allow default processing. | |
1323 | %% | |
1324 | %% An example of using this function is in the implementation of escape-character processing for wxDialog, | |
1325 | %% where pressing ESC dismisses the dialog by {\bf OnCharHook} 'forging' a cancel button press event. | |
1326 | %% | |
1327 | %% Note that the ASCII values do not have explicit key codes: they are passed as ASCII | |
1328 | %% values. | |
1329 | %% | |
1330 | %% This function is only relevant to top-level windows (frames and dialogs), and under | |
1331 | %% Windows only. Under GTK the normal EVT\_CHAR\_ event has the functionality, i.e. | |
1332 | %% you can intercepts it and if you don't call \helpref{wxEvent::Skip}{wxeventskip} | |
1333 | %% the window won't get the event. | |
1334 | %% | |
1335 | %% \wxheading{See also} | |
1336 | %% | |
1337 | %% \helpref{wxKeyEvent}{wxkeyevent},\rtfsp | |
1338 | %% \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp | |
1339 | %% %% GD: OnXXX functions are not documented | |
1340 | %% %%\helpref{wxApp::OnCharHook}{wxapponcharhook},\rtfsp | |
1341 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1342 | %% | |
1343 | %% \membersection{wxWindow::OnCommand}\label{wxwindowoncommand} | |
1344 | %% | |
1345 | %% \func{virtual void}{OnCommand}{\param{wxEvtHandler\& }{object}, \param{wxCommandEvent\& }{event}} | |
1346 | %% | |
1347 | %% This virtual member function is called if the control does not handle the command event. | |
1348 | %% | |
1349 | %% \wxheading{Parameters} | |
1350 | %% | |
1351 | %% \docparam{object}{Object receiving the command event.} | |
1352 | %% | |
1353 | %% \docparam{event}{Command event} | |
1354 | %% | |
1355 | %% \wxheading{Remarks} | |
1356 | %% | |
1357 | %% This virtual function is provided mainly for backward compatibility. You can also intercept commands | |
1358 | %% from child controls by using an event table, with identifiers or identifier ranges to identify | |
1359 | %% the control(s) in question. | |
1360 | %% | |
1361 | %% \wxheading{See also} | |
1362 | %% | |
1363 | %% \helpref{wxCommandEvent}{wxcommandevent},\rtfsp | |
1364 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1365 | %% | |
1366 | %% \membersection{wxWindow::OnClose}\label{wxwindowonclose} | |
1367 | %% | |
1368 | %% \func{virtual bool}{OnClose}{\void} | |
1369 | %% | |
1370 | %% Called when the user has tried to close a a frame | |
1371 | %% or dialog box using the window manager (X) or system menu (Windows). | |
1372 | %% | |
1373 | %% {\bf Note:} This is an obsolete function. | |
1374 | %% It is superseded by the \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow} event | |
1375 | %% handler. | |
1376 | %% | |
1377 | %% \wxheading{Return value} | |
1378 | %% | |
1379 | %% If {\tt true} is returned by OnClose, the window will be deleted by the system, otherwise the | |
1380 | %% attempt will be ignored. Do not delete the window from within this handler, although | |
1381 | %% you may delete other windows. | |
1382 | %% | |
1383 | %% \wxheading{See also} | |
1384 | %% | |
1385 | %% \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp | |
1386 | %% \helpref{wxWindow::Close}{wxwindowclose},\rtfsp | |
1387 | %% \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow},\rtfsp | |
1388 | %% \helpref{wxCloseEvent}{wxcloseevent} | |
1389 | %% | |
1390 | %% \membersection{wxWindow::OnKeyDown}\label{wxwindowonkeydown} | |
1391 | %% | |
1392 | %% \func{void}{OnKeyDown}{\param{wxKeyEvent\&}{ event}} | |
1393 | %% | |
1394 | %% Called when the user has pressed a key, before it is translated into an ASCII value using other | |
1395 | %% modifier keys that might be pressed at the same time. | |
1396 | %% | |
1397 | %% \wxheading{Parameters} | |
1398 | %% | |
1399 | %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for | |
1400 | %% details about this class.} | |
1401 | %% | |
1402 | %% \wxheading{Remarks} | |
1403 | %% | |
1404 | %% This member function is called in response to a key down event. To intercept this event, | |
1405 | %% use the EVT\_KEY\_DOWN macro in an event table definition. Your {\bf OnKeyDown} handler may call this | |
1406 | %% default function to achieve default keypress functionality. | |
1407 | %% | |
1408 | %% Note that not all keypresses can be intercepted this way. If you wish to intercept special | |
1409 | %% keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or | |
1410 | %% \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}. | |
1411 | %% | |
1412 | %% Most, but not all, windows allow keypresses to be intercepted. | |
1413 | %% | |
1414 | %% {\bf Tip:} be sure to call {\tt event.Skip()} for events that you don't process in this function, | |
1415 | %% otherwise menu shortcuts may cease to work under Windows. | |
1416 | %% | |
1417 | %% \wxheading{See also} | |
1418 | %% | |
1419 | %% \helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp | |
1420 | %% \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp | |
1421 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1422 | %% | |
1423 | %% \membersection{wxWindow::OnKeyUp}\label{wxwindowonkeyup} | |
1424 | %% | |
1425 | %% \func{void}{OnKeyUp}{\param{wxKeyEvent\&}{ event}} | |
1426 | %% | |
1427 | %% Called when the user has released a key. | |
1428 | %% | |
1429 | %% \wxheading{Parameters} | |
1430 | %% | |
1431 | %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for | |
1432 | %% details about this class.} | |
1433 | %% | |
1434 | %% \wxheading{Remarks} | |
1435 | %% | |
1436 | %% This member function is called in response to a key up event. To intercept this event, | |
1437 | %% use the EVT\_KEY\_UP macro in an event table definition. Your {\bf OnKeyUp} handler may call this | |
1438 | %% default function to achieve default keypress functionality. | |
1439 | %% | |
1440 | %% Note that not all keypresses can be intercepted this way. If you wish to intercept special | |
1441 | %% keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or | |
1442 | %% \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}. | |
1443 | %% | |
1444 | %% Most, but not all, windows allow key up events to be intercepted. | |
1445 | %% | |
1446 | %% \wxheading{See also} | |
1447 | %% | |
1448 | %% \helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},\rtfsp | |
1449 | %% \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp | |
1450 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1451 | %% | |
1452 | %% \membersection{wxWindow::OnInitDialog}\label{wxwindowoninitdialog} | |
1453 | %% | |
1454 | %% \func{void}{OnInitDialog}{\param{wxInitDialogEvent\&}{ event}} | |
1455 | %% | |
1456 | %% Default handler for the wxEVT\_INIT\_DIALOG event. Calls \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow}. | |
1457 | %% | |
1458 | %% \wxheading{Parameters} | |
1459 | %% | |
1460 | %% \docparam{event}{Dialog initialisation event.} | |
1461 | %% | |
1462 | %% \wxheading{Remarks} | |
1463 | %% | |
1464 | %% Gives the window the default behaviour of transferring data to child controls via | |
1465 | %% the validator that each control has. | |
1466 | %% | |
1467 | %% \wxheading{See also} | |
1468 | %% | |
1469 | %% \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow} | |
1470 | %% | |
1471 | %% \membersection{wxWindow::OnMenuCommand}\label{wxwindowonmenucommand} | |
1472 | %% | |
1473 | %% \func{void}{OnMenuCommand}{\param{wxCommandEvent\& }{event}} | |
1474 | %% | |
1475 | %% Called when a menu command is received from a menu bar. | |
1476 | %% | |
1477 | %% \wxheading{Parameters} | |
1478 | %% | |
1479 | %% \docparam{event}{The menu command event. For more information, see \helpref{wxCommandEvent}{wxcommandevent}.} | |
1480 | %% | |
1481 | %% \wxheading{Remarks} | |
1482 | %% | |
1483 | %% A function with this name doesn't actually exist; you can choose any member function to receive | |
1484 | %% menu command events, using the EVT\_COMMAND macro for individual commands or EVT\_COMMAND\_RANGE for | |
1485 | %% a range of commands. | |
1486 | %% | |
1487 | %% \wxheading{See also} | |
1488 | %% | |
1489 | %% \helpref{wxCommandEvent}{wxcommandevent},\rtfsp | |
1490 | %% \helpref{wxWindow::OnMenuHighlight}{wxwindowonmenuhighlight},\rtfsp | |
1491 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1492 | %% | |
1493 | %% \membersection{wxWindow::OnMenuHighlight}\label{wxwindowonmenuhighlight} | |
1494 | %% | |
1495 | %% \func{void}{OnMenuHighlight}{\param{wxMenuEvent\& }{event}} | |
1496 | %% | |
1497 | %% Called when a menu select is received from a menu bar: that is, the | |
1498 | %% mouse cursor is over a menu item, but the left mouse button has not been | |
1499 | %% pressed. | |
1500 | %% | |
1501 | %% \wxheading{Parameters} | |
1502 | %% | |
1503 | %% \docparam{event}{The menu highlight event. For more information, see \helpref{wxMenuEvent}{wxmenuevent}.} | |
1504 | %% | |
1505 | %% \wxheading{Remarks} | |
1506 | %% | |
1507 | %% You can choose any member function to receive | |
1508 | %% menu select events, using the EVT\_MENU\_HIGHLIGHT macro for individual menu items or EVT\_MENU\_HIGHLIGHT\_ALL macro | |
1509 | %% for all menu items. | |
1510 | %% | |
1511 | %% The default implementation for \helpref{wxFrame::OnMenuHighlight}{wxframeonmenuhighlight} displays help | |
1512 | %% text in the first field of the status bar. | |
1513 | %% | |
1514 | %% This function was known as {\bf OnMenuSelect} in earlier versions of wxWindows, but this was confusing | |
1515 | %% since a selection is normally a left-click action. | |
1516 | %% | |
1517 | %% \wxheading{See also} | |
1518 | %% | |
1519 | %% \helpref{wxMenuEvent}{wxmenuevent},\rtfsp | |
1520 | %% \helpref{wxWindow::OnMenuCommand}{wxwindowonmenucommand},\rtfsp | |
1521 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1522 | %% | |
1523 | %% | |
1524 | %% \membersection{wxWindow::OnMouseEvent}\label{wxwindowonmouseevent} | |
1525 | %% | |
1526 | %% \func{void}{OnMouseEvent}{\param{wxMouseEvent\&}{ event}} | |
1527 | %% | |
1528 | %% Called when the user has initiated an event with the | |
1529 | %% mouse. | |
1530 | %% | |
1531 | %% \wxheading{Parameters} | |
1532 | %% | |
1533 | %% \docparam{event}{The mouse event. See \helpref{wxMouseEvent}{wxmouseevent} for | |
1534 | %% more details.} | |
1535 | %% | |
1536 | %% \wxheading{Remarks} | |
1537 | %% | |
1538 | %% Most, but not all, windows respond to this event. | |
1539 | %% | |
1540 | %% To intercept this event, use the EVT\_MOUSE\_EVENTS macro in an event table definition, or individual | |
1541 | %% mouse event macros such as EVT\_LEFT\_DOWN. | |
1542 | %% | |
1543 | %% \wxheading{See also} | |
1544 | %% | |
1545 | %% \helpref{wxMouseEvent}{wxmouseevent},\rtfsp | |
1546 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1547 | %% | |
1548 | %% \membersection{wxWindow::OnMove}\label{wxwindowonmove} | |
1549 | %% | |
1550 | %% \func{void}{OnMove}{\param{wxMoveEvent\& }{event}} | |
1551 | %% | |
1552 | %% Called when a window is moved. | |
1553 | %% | |
1554 | %% \wxheading{Parameters} | |
1555 | %% | |
1556 | %% \docparam{event}{The move event. For more information, see \helpref{wxMoveEvent}{wxmoveevent}.} | |
1557 | %% | |
1558 | %% \wxheading{Remarks} | |
1559 | %% | |
1560 | %% Use the EVT\_MOVE macro to intercept move events. | |
1561 | %% | |
1562 | %% \wxheading{Remarks} | |
1563 | %% | |
1564 | %% Not currently implemented. | |
1565 | %% | |
1566 | %% \wxheading{See also} | |
1567 | %% | |
1568 | %% \helpref{wxMoveEvent}{wxmoveevent},\rtfsp | |
1569 | %% \helpref{wxFrame::OnSize}{wxframeonsize},\rtfsp | |
1570 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1571 | %% | |
1572 | %% \membersection{wxWindow::OnPaint}\label{wxwindowonpaint} | |
1573 | %% | |
1574 | %% \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}} | |
1575 | %% | |
1576 | %% Sent to the event handler when the window must be refreshed. | |
1577 | %% | |
1578 | %% \wxheading{Parameters} | |
1579 | %% | |
1580 | %% \docparam{event}{Paint event. For more information, see \helpref{wxPaintEvent}{wxpaintevent}.} | |
1581 | %% | |
1582 | %% \wxheading{Remarks} | |
1583 | %% | |
1584 | %% Use the EVT\_PAINT macro in an event table definition to intercept paint events. | |
1585 | %% | |
1586 | %% Note that In a paint event handler, the application must {\it always} create a \helpref{wxPaintDC}{wxpaintdc} object, | |
1587 | %% even if you do not use it. Otherwise, under MS Windows, refreshing for this and other windows will go wrong. | |
1588 | %% | |
1589 | %% For example: | |
1590 | %% | |
1591 | %% \small{% | |
1592 | %% \begin{verbatim} | |
1593 | %% void MyWindow::OnPaint(wxPaintEvent\& event) | |
1594 | %% { | |
1595 | %% wxPaintDC dc(this); | |
1596 | %% | |
1597 | %% DrawMyDocument(dc); | |
1598 | %% } | |
1599 | %% \end{verbatim} | |
1600 | %% }% | |
1601 | %% | |
1602 | %% You can optimize painting by retrieving the rectangles | |
1603 | %% that have been damaged and only repainting these. The rectangles are in | |
1604 | %% terms of the client area, and are unscrolled, so you will need to do | |
1605 | %% some calculations using the current view position to obtain logical, | |
1606 | %% scrolled units. | |
1607 | %% | |
1608 | %% Here is an example of using the \helpref{wxRegionIterator}{wxregioniterator} class: | |
1609 | %% | |
1610 | %% {\small% | |
1611 | %% \begin{verbatim} | |
1612 | %% // Called when window needs to be repainted. | |
1613 | %% void MyWindow::OnPaint(wxPaintEvent\& event) | |
1614 | %% { | |
1615 | %% wxPaintDC dc(this); | |
1616 | %% | |
1617 | %% // Find Out where the window is scrolled to | |
1618 | %% int vbX,vbY; // Top left corner of client | |
1619 | %% GetViewStart(&vbX,&vbY); | |
1620 | %% | |
1621 | %% int vX,vY,vW,vH; // Dimensions of client area in pixels | |
1622 | %% wxRegionIterator upd(GetUpdateRegion()); // get the update rect list | |
1623 | %% | |
1624 | %% while (upd) | |
1625 | %% { | |
1626 | %% vX = upd.GetX(); | |
1627 | %% vY = upd.GetY(); | |
1628 | %% vW = upd.GetW(); | |
1629 | %% vH = upd.GetH(); | |
1630 | %% | |
1631 | %% // Alternatively we can do this: | |
1632 | %% // wxRect rect; | |
1633 | %% // upd.GetRect(&rect); | |
1634 | %% | |
1635 | %% // Repaint this rectangle | |
1636 | %% ...some code... | |
1637 | %% | |
1638 | %% upd ++ ; | |
1639 | %% } | |
1640 | %% } | |
1641 | %% \end{verbatim} | |
1642 | %% }% | |
1643 | %% | |
1644 | %% \wxheading{See also} | |
1645 | %% | |
1646 | %% \helpref{wxPaintEvent}{wxpaintevent},\rtfsp | |
1647 | %% \helpref{wxPaintDC}{wxpaintdc},\rtfsp | |
1648 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1649 | %% | |
1650 | %% \membersection{wxWindow::OnScroll}\label{wxwindowonscroll} | |
1651 | %% | |
1652 | %% \func{void}{OnScroll}{\param{wxScrollWinEvent\& }{event}} | |
1653 | %% | |
1654 | %% Called when a scroll window event is received from one of the window's built-in scrollbars. | |
1655 | %% | |
1656 | %% \wxheading{Parameters} | |
1657 | %% | |
1658 | %% \docparam{event}{Command event. Retrieve the new scroll position by | |
1659 | %% calling \helpref{wxScrollEvent::GetPosition}{wxscrolleventgetposition}, and the | |
1660 | %% scrollbar orientation by calling \helpref{wxScrollEvent::GetOrientation}{wxscrolleventgetorientation}.} | |
1661 | %% | |
1662 | %% \wxheading{Remarks} | |
1663 | %% | |
1664 | %% Note that it is not possible to distinguish between horizontal and vertical scrollbars | |
1665 | %% until the function is executing (you can't have one function for vertical, another | |
1666 | %% for horizontal events). | |
1667 | %% | |
1668 | %% \wxheading{See also} | |
1669 | %% | |
1670 | %% \helpref{wxScrollWinEvent}{wxscrollwinevent},\rtfsp | |
1671 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1672 | %% | |
1673 | %% \membersection{wxWindow::OnSetFocus}\label{wxwindowonsetfocus} | |
1674 | %% | |
1675 | %% \func{void}{OnSetFocus}{\param{wxFocusEvent\& }{event}} | |
1676 | %% | |
1677 | %% Called when a window's focus is being set. | |
1678 | %% | |
1679 | %% \wxheading{Parameters} | |
1680 | %% | |
1681 | %% \docparam{event}{The focus event. For more information, see \helpref{wxFocusEvent}{wxfocusevent}.} | |
1682 | %% | |
1683 | %% \wxheading{Remarks} | |
1684 | %% | |
1685 | %% To intercept this event, use the macro EVT\_SET\_FOCUS in an event table definition. | |
1686 | %% | |
1687 | %% Most, but not all, windows respond to this event. | |
1688 | %% | |
1689 | %% \wxheading{See also} | |
1690 | %% | |
1691 | %% \helpref{wxFocusEvent}{wxfocusevent}, \helpref{wxWindow::OnKillFocus}{wxwindowonkillfocus},\rtfsp | |
1692 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1693 | %% | |
1694 | %% \membersection{wxWindow::OnSize}\label{wxwindowonsize} | |
1695 | %% | |
1696 | %% \func{void}{OnSize}{\param{wxSizeEvent\& }{event}} | |
1697 | %% | |
1698 | %% Called when the window has been resized. This is not a virtual function; you should | |
1699 | %% provide your own non-virtual OnSize function and direct size events to it using EVT\_SIZE | |
1700 | %% in an event table definition. | |
1701 | %% | |
1702 | %% \wxheading{Parameters} | |
1703 | %% | |
1704 | %% \docparam{event}{Size event. For more information, see \helpref{wxSizeEvent}{wxsizeevent}.} | |
1705 | %% | |
1706 | %% \wxheading{Remarks} | |
1707 | %% | |
1708 | %% You may wish to use this for frames to resize their child windows as appropriate. | |
1709 | %% | |
1710 | %% Note that the size passed is of | |
1711 | %% the whole window: call \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize} for the area which may be | |
1712 | %% used by the application. | |
1713 | %% | |
1714 | %% When a window is resized, usually only a small part of the window is damaged and you | |
1715 | %% may only need to repaint that area. However, if your drawing depends on the size of the window, | |
1716 | %% you may need to clear the DC explicitly and repaint the whole window. In which case, you | |
1717 | %% may need to call \helpref{wxWindow::Refresh}{wxwindowrefresh} to invalidate the entire window. | |
1718 | %% | |
1719 | %% \wxheading{See also} | |
1720 | %% | |
1721 | %% \helpref{wxSizeEvent}{wxsizeevent},\rtfsp | |
1722 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1723 | %% | |
1724 | %% \membersection{wxWindow::OnSysColourChanged}\label{wxwindowonsyscolourchanged} | |
1725 | %% | |
1726 | %% \func{void}{OnSysColourChanged}{\param{wxOnSysColourChangedEvent\& }{event}} | |
1727 | %% | |
1728 | %% Called when the user has changed the system colours. Windows only. | |
1729 | %% | |
1730 | %% \wxheading{Parameters} | |
1731 | %% | |
1732 | %% \docparam{event}{System colour change event. For more information, see \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent}.} | |
1733 | %% | |
1734 | %% \wxheading{See also} | |
1735 | %% | |
1736 | %% \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent},\rtfsp | |
1737 | %% \helpref{Event handling overview}{eventhandlingoverview} | |
1738 | ||
1739 | \membersection{wxWindow::OnInternalIdle}\label{wxwindowoninternalidle} | |
1740 | ||
1741 | \func{virtual void}{OnInternalIdle}{\void} | |
1742 | ||
1743 | This virtual function is normally only used internally, but | |
1744 | sometimes an application may need it to implement functionality | |
1745 | that should not be disabled by an application defining an OnIdle | |
1746 | handler in a derived class. | |
1747 | ||
1748 | This function may be used to do delayed painting, for example, | |
1749 | and most implementations call \helpref{wxWindow::UpdateWindowUI}{wxwindowupdatewindowui} | |
1750 | in order to send update events to the window in idle time. | |
1751 | ||
1752 | \membersection{wxWindow::PageDown}\label{wxwindowpagedown} | |
1753 | ||
1754 | This is just a wrapper for \helpref{ScrollPages()}{wxwindowscrollpages}$(1)$. | |
1755 | ||
1756 | \membersection{wxWindow::PageUp}\label{wxwindowpageup} | |
1757 | ||
1758 | This is just a wrapper for \helpref{ScrollPages()}{wxwindowscrollpages}$(-1)$. | |
1759 | ||
1760 | \membersection{wxWindow::PopEventHandler}\label{wxwindowpopeventhandler} | |
1761 | ||
1762 | \constfunc{wxEvtHandler*}{PopEventHandler}{\param{bool }{deleteHandler = {\tt false}}} | |
1763 | ||
1764 | Removes and returns the top-most event handler on the event handler stack. | |
1765 | ||
1766 | \wxheading{Parameters} | |
1767 | ||
1768 | \docparam{deleteHandler}{If this is {\tt true}, the handler will be deleted after it is removed. The | |
1769 | default value is {\tt false}.} | |
1770 | ||
1771 | \wxheading{See also} | |
1772 | ||
1773 | \helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp | |
1774 | \helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp | |
1775 | \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp | |
1776 | \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp | |
1777 | \helpref{wxEvtHandler}{wxevthandler}\rtfsp | |
1778 | ||
1779 | \membersection{wxWindow::PopupMenu}\label{wxwindowpopupmenu} | |
1780 | ||
1781 | \func{bool}{PopupMenu}{\param{wxMenu* }{menu}, \param{const wxPoint\& }{pos}} | |
1782 | ||
1783 | \func{bool}{PopupMenu}{\param{wxMenu* }{menu}, \param{int }{x}, \param{int }{y}} | |
1784 | ||
1785 | Pops up the given menu at the specified coordinates, relative to this | |
1786 | window, and returns control when the user has dismissed the menu. If a | |
1787 | menu item is selected, the corresponding menu event is generated and will be | |
1788 | processed as usually. | |
1789 | ||
1790 | \wxheading{Parameters} | |
1791 | ||
1792 | \docparam{menu}{Menu to pop up.} | |
1793 | ||
1794 | \docparam{pos}{The position where the menu will appear.} | |
1795 | ||
1796 | \docparam{x}{Required x position for the menu to appear.} | |
1797 | ||
1798 | \docparam{y}{Required y position for the menu to appear.} | |
1799 | ||
1800 | \wxheading{See also} | |
1801 | ||
1802 | \helpref{wxMenu}{wxmenu} | |
1803 | ||
1804 | \wxheading{Remarks} | |
1805 | ||
1806 | Just before the menu is popped up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called | |
1807 | to ensure that the menu items are in the correct state. The menu does not get deleted | |
1808 | by the window. | |
1809 | ||
1810 | \pythonnote{In place of a single overloaded method name, wxPython | |
1811 | implements the following methods:\par | |
1812 | \indented{2cm}{\begin{twocollist} | |
1813 | \twocolitem{{\bf PopupMenu(menu, point)}}{Specifies position with a wxPoint} | |
1814 | \twocolitem{{\bf PopupMenuXY(menu, x, y)}}{Specifies position with two integers (x, y)} | |
1815 | \end{twocollist}} | |
1816 | } | |
1817 | ||
1818 | \membersection{wxWindow::PushEventHandler}\label{wxwindowpusheventhandler} | |
1819 | ||
1820 | \func{void}{PushEventHandler}{\param{wxEvtHandler* }{handler}} | |
1821 | ||
1822 | Pushes this event handler onto the event stack for the window. | |
1823 | ||
1824 | \wxheading{Parameters} | |
1825 | ||
1826 | \docparam{handler}{Specifies the handler to be pushed.} | |
1827 | ||
1828 | \wxheading{Remarks} | |
1829 | ||
1830 | An event handler is an object that is capable of processing the events | |
1831 | sent to a window. By default, the window is its own event handler, but | |
1832 | an application may wish to substitute another, for example to allow | |
1833 | central implementation of event-handling for a variety of different | |
1834 | window classes. | |
1835 | ||
1836 | \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler} allows | |
1837 | an application to set up a chain of event handlers, where an event not handled by one event handler is | |
1838 | handed to the next one in the chain. Use \helpref{wxWindow::PopEventHandler}{wxwindowpopeventhandler} to | |
1839 | remove the event handler. | |
1840 | ||
1841 | \wxheading{See also} | |
1842 | ||
1843 | \helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp | |
1844 | \helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp | |
1845 | \helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp | |
1846 | \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp | |
1847 | \helpref{wxEvtHandler}{wxevthandler} | |
1848 | ||
1849 | \membersection{wxWindow::Raise}\label{wxwindowraise} | |
1850 | ||
1851 | \func{void}{Raise}{\void} | |
1852 | ||
1853 | Raises the window to the top of the window hierarchy if it is a managed window (dialog | |
1854 | or frame). | |
1855 | ||
1856 | \membersection{wxWindow::Refresh}\label{wxwindowrefresh} | |
1857 | ||
1858 | \func{virtual void}{Refresh}{\param{bool}{ eraseBackground = {\tt true}}, \param{const wxRect* }{rect | |
1859 | = NULL}} | |
1860 | ||
1861 | Causes a message or event to be generated to repaint the | |
1862 | window. | |
1863 | ||
1864 | \wxheading{Parameters} | |
1865 | ||
1866 | \docparam{eraseBackground}{If {\tt true}, the background will be | |
1867 | erased.} | |
1868 | ||
1869 | \docparam{rect}{If non-NULL, only the given rectangle will | |
1870 | be treated as damaged.} | |
1871 | ||
1872 | \wxheading{See also} | |
1873 | ||
1874 | \helpref{wxWindow::RefreshRect}{wxwindowrefreshrect} | |
1875 | ||
1876 | \membersection{wxWindow::RefreshRect}\label{wxwindowrefreshrect} | |
1877 | ||
1878 | \func{virtual void}{Refresh}{\param{const wxRect\& }{rect}} | |
1879 | ||
1880 | Redraws the contents of the given rectangle: the area inside it will be | |
1881 | repainted. | |
1882 | ||
1883 | This is the same as \helpref{Refresh}{wxwindowrefresh} but has a nicer syntax. | |
1884 | ||
1885 | \membersection{wxWindow::RegisterHotKey}\label{wxwindowregisterhotkey} | |
1886 | ||
1887 | \func{bool}{RegisterHotKey}{\param{int}{ hotkeyId}, \param{int}{ modifiers}, \param{int}{ virtualKeyCode}} | |
1888 | ||
1889 | Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window | |
1890 | will receive a hotkey event. It will receive the event even if the application is in the background | |
1891 | and does not have the input focus because the user is working with some other application. | |
1892 | ||
1893 | \wxheading{Parameters} | |
1894 | ||
1895 | \docparam{hotkeyId}{Numeric identifier of the hotkey. For applications this must be between 0 and 0xBFFF. If | |
1896 | this function is called from a shared DLL, it must be a system wide unique identifier between 0xC000 and 0xFFFF. | |
1897 | This is a MSW specific detail.} | |
1898 | ||
1899 | \docparam{modifiers}{A bitwise combination of {\tt wxMOD\_SHIFT}, {\tt wxMOD\_CONTROL}, {\tt wxMOD\_ALT} | |
1900 | or {\tt wxMOD\_WIN} specifying the modifier keys that have to be pressed along with the key.} | |
1901 | ||
1902 | \docparam{virtualKeyCode}{The virtual key code of the hotkey.} | |
1903 | ||
1904 | \wxheading{Return value} | |
1905 | ||
1906 | {\tt true} if the hotkey was registered successfully. {\tt false} if some other application already registered a | |
1907 | hotkey with this modifier/virtualKeyCode combination. | |
1908 | ||
1909 | \wxheading{Remarks} | |
1910 | ||
1911 | Use EVT\_HOTKEY(hotkeyId, fnc) in the event table to capture the event. | |
1912 | This function is currently only implemented under MSW. | |
1913 | ||
1914 | \wxheading{See also} | |
1915 | ||
1916 | \helpref{wxWindow::UnregisterHotKey}{wxwindowunregisterhotkey} | |
1917 | ||
1918 | \membersection{wxWindow::ReleaseMouse}\label{wxwindowreleasemouse} | |
1919 | ||
1920 | \func{virtual void}{ReleaseMouse}{\void} | |
1921 | ||
1922 | Releases mouse input captured with \helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse}. | |
1923 | ||
1924 | \wxheading{See also} | |
1925 | ||
1926 | \helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse}, | |
1927 | \helpref{wxWindow::HasCapture}{wxwindowhascapture}, | |
1928 | \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse}, | |
1929 | \helpref{wxMouseCaptureChangedEvent}{wxmousecapturechangedevent} | |
1930 | ||
1931 | \membersection{wxWindow::RemoveChild}\label{wxwindowremovechild} | |
1932 | ||
1933 | \func{virtual void}{RemoveChild}{\param{wxWindow* }{child}} | |
1934 | ||
1935 | Removes a child window. This is called automatically by window deletion | |
1936 | functions so should not be required by the application programmer. | |
1937 | ||
1938 | Notice that this function is mostly internal to wxWindows and shouldn't be | |
1939 | called by the user code. | |
1940 | ||
1941 | \wxheading{Parameters} | |
1942 | ||
1943 | \docparam{child}{Child window to remove.} | |
1944 | ||
1945 | \membersection{wxWindow::RemoveEventHandler}\label{wxwindowremoveeventhandler} | |
1946 | ||
1947 | \func{bool}{RemoveEventHandler}{\param{wxEvtHandler *}{handler}} | |
1948 | ||
1949 | Find the given {\it handler} in the windows event handler chain and remove (but | |
1950 | not delete) it from it. | |
1951 | ||
1952 | \wxheading{Parameters} | |
1953 | ||
1954 | \docparam{handler}{The event handler to remove, must be non {\tt NULL} and | |
1955 | must be present in this windows event handlers chain} | |
1956 | ||
1957 | \wxheading{Return value} | |
1958 | ||
1959 | Returns {\tt true} if it was found and {\tt false} otherwise (this also results | |
1960 | in an assert failure so this function should only be called when the | |
1961 | handler is supposed to be there). | |
1962 | ||
1963 | \wxheading{See also} | |
1964 | ||
1965 | \helpref{PushEventHandler}{wxwindowpusheventhandler},\rtfsp | |
1966 | \helpref{PopEventHandler}{wxwindowpopeventhandler} | |
1967 | ||
1968 | \membersection{wxWindow::Reparent}\label{wxwindowreparent} | |
1969 | ||
1970 | \func{virtual bool}{Reparent}{\param{wxWindow* }{newParent}} | |
1971 | ||
1972 | Reparents the window, i.e the window will be removed from its | |
1973 | current parent window (e.g. a non-standard toolbar in a wxFrame) | |
1974 | and then re-inserted into another. Available on Windows and GTK. | |
1975 | ||
1976 | \wxheading{Parameters} | |
1977 | ||
1978 | \docparam{newParent}{New parent.} | |
1979 | ||
1980 | \membersection{wxWindow::ScreenToClient}\label{wxwindowscreentoclient} | |
1981 | ||
1982 | \constfunc{virtual void}{ScreenToClient}{\param{int* }{x}, \param{int* }{y}} | |
1983 | ||
1984 | \constfunc{virtual wxPoint}{ScreenToClient}{\param{const wxPoint\& }{pt}} | |
1985 | ||
1986 | Converts from screen to client window coordinates. | |
1987 | ||
1988 | \wxheading{Parameters} | |
1989 | ||
1990 | \docparam{x}{Stores the screen x coordinate and receives the client x coordinate.} | |
1991 | ||
1992 | \docparam{y}{Stores the screen x coordinate and receives the client x coordinate.} | |
1993 | ||
1994 | \docparam{pt}{The screen position for the second form of the function.} | |
1995 | ||
1996 | \pythonnote{In place of a single overloaded method name, wxPython | |
1997 | implements the following methods:\par | |
1998 | \indented{2cm}{\begin{twocollist} | |
1999 | \twocolitem{{\bf ScreenToClient(point)}}{Accepts and returns a wxPoint} | |
2000 | \twocolitem{{\bf ScreenToClientXY(x, y)}}{Returns a 2-tuple, (x, y)} | |
2001 | \end{twocollist}} | |
2002 | } | |
2003 | ||
2004 | \membersection{wxWindow::ScrollLines}\label{wxwindowscrolllines} | |
2005 | ||
2006 | \func{virtual bool}{ScrollLines}{\param{int }{lines}} | |
2007 | ||
2008 | Scrolls the window by the given number of lines down (if {\it lines} is | |
2009 | positive) or up. | |
2010 | ||
2011 | \wxheading{Return value} | |
2012 | ||
2013 | Returns {\tt true} if the window was scrolled, {\tt false} if it was already | |
2014 | on top/bottom and nothing was done. | |
2015 | ||
2016 | \wxheading{Remarks} | |
2017 | ||
2018 | This function is currently only implemented under MSW and wxTextCtrl under | |
2019 | wxGTK (it also works for wxScrolledWindow derived classes under all | |
2020 | platforms). | |
2021 | ||
2022 | \wxheading{See also} | |
2023 | ||
2024 | \helpref{ScrollPages}{wxwindowscrollpages} | |
2025 | ||
2026 | \membersection{wxWindow::ScrollPages}\label{wxwindowscrollpages} | |
2027 | ||
2028 | \func{virtual bool}{ScrollPages}{\param{int }{pages}} | |
2029 | ||
2030 | Scrolls the window by the given number of pages down (if {\it pages} is | |
2031 | positive) or up. | |
2032 | ||
2033 | \wxheading{Return value} | |
2034 | ||
2035 | Returns {\tt true} if the window was scrolled, {\tt false} if it was already | |
2036 | on top/bottom and nothing was done. | |
2037 | ||
2038 | \wxheading{Remarks} | |
2039 | ||
2040 | This function is currently only implemented under MSW and wxTextCtrl under | |
2041 | wxGTK (it also works for wxScrolledWindow derived classes under all | |
2042 | platforms). | |
2043 | ||
2044 | \wxheading{See also} | |
2045 | ||
2046 | \helpref{ScrollLines}{wxwindowscrolllines} | |
2047 | ||
2048 | \membersection{wxWindow::ScrollWindow}\label{wxwindowscrollwindow} | |
2049 | ||
2050 | \func{virtual void}{ScrollWindow}{\param{int }{dx}, \param{int }{dy}, \param{const wxRect*}{ rect = NULL}} | |
2051 | ||
2052 | Physically scrolls the pixels in the window and move child windows accordingly. | |
2053 | ||
2054 | \wxheading{Parameters} | |
2055 | ||
2056 | \docparam{dx}{Amount to scroll horizontally.} | |
2057 | ||
2058 | \docparam{dy}{Amount to scroll vertically.} | |
2059 | ||
2060 | \docparam{rect}{Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you | |
2061 | pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler | |
2062 | can optimize painting by checking for the invalidated region. This parameter is ignored under GTK.} | |
2063 | ||
2064 | \wxheading{Remarks} | |
2065 | ||
2066 | Use this function to optimise your scrolling implementations, to minimise the area that must be | |
2067 | redrawn. Note that it is rarely required to call this function from a user program. | |
2068 | ||
2069 | \membersection{wxWindow::SetAcceleratorTable}\label{wxwindowsetacceleratortable} | |
2070 | ||
2071 | \func{virtual void}{SetAcceleratorTable}{\param{const wxAcceleratorTable\&}{ accel}} | |
2072 | ||
2073 | Sets the accelerator table for this window. See \helpref{wxAcceleratorTable}{wxacceleratortable}. | |
2074 | ||
2075 | \membersection{wxWindow::SetAccessible}\label{wxwindowsetaccessible} | |
2076 | ||
2077 | \func{void}{SetAccessible}{\param{wxAccessibile*}{ accessible}} | |
2078 | ||
2079 | Sets the accessible for this window. Any existing accessible for this window | |
2080 | will be deleted first, if not identical to {\it accessible}. | |
2081 | ||
2082 | See also \helpref{wxAccessible}{wxaccessible}. | |
2083 | ||
2084 | \membersection{wxWindow::SetAutoLayout}\label{wxwindowsetautolayout} | |
2085 | ||
2086 | \func{void}{SetAutoLayout}{\param{bool}{ autoLayout}} | |
2087 | ||
2088 | Determines whether the \helpref{wxWindow::Layout}{wxwindowlayout} function will | |
2089 | be called automatically when the window is resized. It is called implicitly by | |
2090 | \helpref{wxWindow::SetSizer}{wxwindowsetsizer} but if you use | |
2091 | \helpref{wxWindow::SetConstraints}{wxwindowsetconstraints} you should call it | |
2092 | manually or otherwise the window layout won't be correctly updated when its | |
2093 | size changes. | |
2094 | ||
2095 | \wxheading{Parameters} | |
2096 | ||
2097 | \docparam{autoLayout}{Set this to {\tt true} if you wish the Layout function to be called | |
2098 | from within wxWindow::OnSize functions.} | |
2099 | ||
2100 | \wxheading{See also} | |
2101 | ||
2102 | \helpref{wxWindow::SetConstraints}{wxwindowsetconstraints} | |
2103 | ||
2104 | \membersection{wxWindow::SetBackgroundColour}\label{wxwindowsetbackgroundcolour} | |
2105 | ||
2106 | \func{virtual void}{SetBackgroundColour}{\param{const wxColour\& }{colour}} | |
2107 | ||
2108 | Sets the background colour of the window. | |
2109 | ||
2110 | \wxheading{Parameters} | |
2111 | ||
2112 | \docparam{colour}{The colour to be used as the background colour.} | |
2113 | ||
2114 | \wxheading{Remarks} | |
2115 | ||
2116 | The background colour is usually painted by the default\rtfsp | |
2117 | \helpref{wxEraseEvent}{wxeraseevent} event handler function | |
2118 | under Windows and automatically under GTK. | |
2119 | ||
2120 | Note that setting the background colour does not cause an immediate refresh, so you | |
2121 | may wish to call \helpref{wxWindow::ClearBackground}{wxwindowclearbackground} or \helpref{wxWindow::Refresh}{wxwindowrefresh} after | |
2122 | calling this function. | |
2123 | ||
2124 | Use this function with care under GTK+ as the new appearance of the window might | |
2125 | not look equally well when used with "Themes", i.e GTK+'s ability to change its | |
2126 | look as the user wishes with run-time loadable modules. | |
2127 | ||
2128 | \wxheading{See also} | |
2129 | ||
2130 | \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour},\rtfsp | |
2131 | \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp | |
2132 | \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp | |
2133 | \helpref{wxWindow::ClearBackground}{wxwindowclearbackground},\rtfsp | |
2134 | \helpref{wxWindow::Refresh}{wxwindowrefresh},\rtfsp | |
2135 | \helpref{wxEraseEvent}{wxeraseevent} | |
2136 | ||
2137 | \membersection{wxWindow::SetCaret}\label{wxwindowsetcaret} | |
2138 | ||
2139 | \constfunc{void}{SetCaret}{\param{wxCaret *}{caret}} | |
2140 | ||
2141 | Sets the \helpref{caret}{wxcaret} associated with the window. | |
2142 | ||
2143 | \membersection{wxWindow::SetClientSize}\label{wxwindowsetclientsize} | |
2144 | ||
2145 | \func{virtual void}{SetClientSize}{\param{int}{ width}, \param{int}{ height}} | |
2146 | ||
2147 | \func{virtual void}{SetClientSize}{\param{const wxSize\&}{ size}} | |
2148 | ||
2149 | This sets the size of the window client area in pixels. Using this function to size a window | |
2150 | tends to be more device-independent than \helpref{wxWindow::SetSize}{wxwindowsetsize}, since the application need not | |
2151 | worry about what dimensions the border or title bar have when trying to fit the window | |
2152 | around panel items, for example. | |
2153 | ||
2154 | \wxheading{Parameters} | |
2155 | ||
2156 | \docparam{width}{The required client area width.} | |
2157 | ||
2158 | \docparam{height}{The required client area height.} | |
2159 | ||
2160 | \docparam{size}{The required client size.} | |
2161 | ||
2162 | \pythonnote{In place of a single overloaded method name, wxPython | |
2163 | implements the following methods:\par | |
2164 | \indented{2cm}{\begin{twocollist} | |
2165 | \twocolitem{{\bf SetClientSize(size)}}{Accepts a wxSize} | |
2166 | \twocolitem{{\bf SetClientSizeWH(width, height)}}{} | |
2167 | \end{twocollist}} | |
2168 | } | |
2169 | ||
2170 | \membersection{wxWindow::SetContainingSizer}\label{wxwindowsetcontainingsizer} | |
2171 | ||
2172 | \func{void}{SetContainingSizer}{\param{wxSizer* }{sizer}} | |
2173 | ||
2174 | This normally does not need to be called by user code. It is called | |
2175 | when a window is added to a sizer, and is used so the window can | |
2176 | remove itself from the sizer when it is destroyed. | |
2177 | ||
2178 | \membersection{wxWindow::SetCursor}\label{wxwindowsetcursor} | |
2179 | ||
2180 | \func{virtual void}{SetCursor}{\param{const wxCursor\&}{cursor}} | |
2181 | ||
2182 | % VZ: the docs are correct, if the code doesn't behave like this, it must be | |
2183 | % changed | |
2184 | Sets the window's cursor. Notice that the window cursor also sets it for the | |
2185 | children of the window implicitly. | |
2186 | ||
2187 | The {\it cursor} may be {\tt wxNullCursor} in which case the window cursor will | |
2188 | be reset back to default. | |
2189 | ||
2190 | \wxheading{Parameters} | |
2191 | ||
2192 | \docparam{cursor}{Specifies the cursor that the window should normally display.} | |
2193 | ||
2194 | \wxheading{See also} | |
2195 | ||
2196 | \helpref{::wxSetCursor}{wxsetcursor}, \helpref{wxCursor}{wxcursor} | |
2197 | ||
2198 | \membersection{wxWindow::SetConstraints}\label{wxwindowsetconstraints} | |
2199 | ||
2200 | \func{void}{SetConstraints}{\param{wxLayoutConstraints* }{constraints}} | |
2201 | ||
2202 | Sets the window to have the given layout constraints. The window | |
2203 | will then own the object, and will take care of its deletion. | |
2204 | If an existing layout constraints object is already owned by the | |
2205 | window, it will be deleted. | |
2206 | ||
2207 | \wxheading{Parameters} | |
2208 | ||
2209 | \docparam{constraints}{The constraints to set. Pass NULL to disassociate and delete the window's | |
2210 | constraints.} | |
2211 | ||
2212 | \wxheading{Remarks} | |
2213 | ||
2214 | You must call \helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout} to tell a window to use | |
2215 | the constraints automatically in OnSize; otherwise, you must override OnSize and call Layout() | |
2216 | explicitly. When setting both a wxLayoutConstraints and a \helpref{wxSizer}{wxsizer}, only the | |
2217 | sizer will have effect. | |
2218 | ||
2219 | \membersection{wxWindow::SetDropTarget}\label{wxwindowsetdroptarget} | |
2220 | ||
2221 | \func{void}{SetDropTarget}{\param{wxDropTarget*}{ target}} | |
2222 | ||
2223 | Associates a drop target with this window. | |
2224 | ||
2225 | If the window already has a drop target, it is deleted. | |
2226 | ||
2227 | \wxheading{See also} | |
2228 | ||
2229 | \helpref{wxWindow::GetDropTarget}{wxwindowgetdroptarget}, | |
2230 | \helpref{Drag and drop overview}{wxdndoverview} | |
2231 | ||
2232 | \membersection{wxWindow::SetEventHandler}\label{wxwindowseteventhandler} | |
2233 | ||
2234 | \func{void}{SetEventHandler}{\param{wxEvtHandler* }{handler}} | |
2235 | ||
2236 | Sets the event handler for this window. | |
2237 | ||
2238 | \wxheading{Parameters} | |
2239 | ||
2240 | \docparam{handler}{Specifies the handler to be set.} | |
2241 | ||
2242 | \wxheading{Remarks} | |
2243 | ||
2244 | An event handler is an object that is capable of processing the events | |
2245 | sent to a window. By default, the window is its own event handler, but | |
2246 | an application may wish to substitute another, for example to allow | |
2247 | central implementation of event-handling for a variety of different | |
2248 | window classes. | |
2249 | ||
2250 | It is usually better to use \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler} since | |
2251 | this sets up a chain of event handlers, where an event not handled by one event handler is | |
2252 | handed to the next one in the chain. | |
2253 | ||
2254 | \wxheading{See also} | |
2255 | ||
2256 | \helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp | |
2257 | \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp | |
2258 | \helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp | |
2259 | \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp | |
2260 | \helpref{wxEvtHandler}{wxevthandler} | |
2261 | ||
2262 | \membersection{wxWindow::SetExtraStyle}\label{wxwindowsetextrastyle} | |
2263 | ||
2264 | \func{void}{SetExtraStyle}{\param{long }{exStyle}} | |
2265 | ||
2266 | Sets the extra style bits for the window. The currently defined extra style | |
2267 | bits are: | |
2268 | ||
2269 | \twocolwidtha{5cm}% | |
2270 | \begin{twocollist}\itemsep=0pt | |
2271 | \twocolitem{\windowstyle{wxWS\_EX\_VALIDATE\_RECURSIVELY}}{TransferDataTo/FromWindow() | |
2272 | and Validate() methods will recursively descend into all children of the | |
2273 | window if it has this style flag set.} | |
2274 | \twocolitem{\windowstyle{wxWS\_EX\_BLOCK\_EVENTS}}{Normally, the command | |
2275 | events are propagated upwards to the window parent recursively until a handler | |
2276 | for them is found. Using this style allows to prevent them from being | |
2277 | propagated beyond this window. Notice that wxDialog has this style on by | |
2278 | default for the reasons explained in the | |
2279 | \helpref{event processing overview}{eventprocessing}.} | |
2280 | \twocolitem{\windowstyle{wxWS\_EX\_TRANSIENT}}{This can be used to prevent a | |
2281 | window from being used as an implicit parent for the dialogs which were | |
2282 | created without a parent. It is useful for the windows which can disappear at | |
2283 | any moment as creating children of such windows results in fatal problems.} | |
2284 | \twocolitem{\windowstyle{wxFRAME\_EX\_CONTEXTHELP}}{Under Windows, puts a query button on the | |
2285 | caption. When pressed, Windows will go into a context-sensitive help mode and wxWindows will send | |
2286 | a wxEVT\_HELP event if the user clicked on an application window. | |
2287 | This style cannot be used together with wxMAXIMIZE\_BOX or wxMINIMIZE\_BOX, so | |
2288 | you should use the style of | |
2289 | {\tt wxDEFAULT\_FRAME\_STYLE \& \textasciitilde(wxMINIMIZE\_BOX | wxMAXIMIZE\_BOX)} for the | |
2290 | frames having this style (the dialogs don't have minimize nor maximize box by | |
2291 | default)} | |
2292 | \end{twocollist} | |
2293 | ||
2294 | \membersection{wxWindow::SetFocus}\label{wxwindowsetfocus} | |
2295 | ||
2296 | \func{virtual void}{SetFocus}{\void} | |
2297 | ||
2298 | This sets the window to receive keyboard input. | |
2299 | ||
2300 | \wxheading{See also} | |
2301 | ||
2302 | \helpref{wxFocusEvent}{wxfocusevent} | |
2303 | ||
2304 | \membersection{wxWindow::SetFocusFromKbd}\label{wxwindowsetfocusfromkbd} | |
2305 | ||
2306 | \func{virtual void}{SetFocusFromKbd}{\void} | |
2307 | ||
2308 | This function is called by wxWindows keyboard navigation code when the user | |
2309 | gives the focus to this window from keyboard (e.g. using {\tt TAB} key). | |
2310 | By default this method simply calls \helpref{SetFocus}{wxwindowsetfocus} but | |
2311 | can be overridden to do something in addition to this in the derived classes. | |
2312 | ||
2313 | \membersection{wxWindow::SetFont}\label{wxwindowsetfont} | |
2314 | ||
2315 | \func{void}{SetFont}{\param{const wxFont\& }{font}} | |
2316 | ||
2317 | Sets the font for this window. | |
2318 | ||
2319 | \wxheading{Parameters} | |
2320 | ||
2321 | \docparam{font}{Font to associate with this window.} | |
2322 | ||
2323 | \wxheading{See also} | |
2324 | ||
2325 | \helpref{wxWindow::GetFont}{wxwindowgetfont} | |
2326 | ||
2327 | \membersection{wxWindow::SetForegroundColour}\label{wxwindowsetforegroundcolour} | |
2328 | ||
2329 | \func{virtual void}{SetForegroundColour}{\param{const wxColour\& }{colour}} | |
2330 | ||
2331 | Sets the foreground colour of the window. | |
2332 | ||
2333 | \wxheading{Parameters} | |
2334 | ||
2335 | \docparam{colour}{The colour to be used as the foreground colour.} | |
2336 | ||
2337 | \wxheading{Remarks} | |
2338 | ||
2339 | The interpretation of foreground colour is open to interpretation according | |
2340 | to the window class; it may be the text colour or other colour, or it may not | |
2341 | be used at all. | |
2342 | ||
2343 | Note that when using this functions under GTK, you will disable the so called "themes", | |
2344 | i.e. the user chosen appearance of windows and controls, including the themes of | |
2345 | their parent windows. | |
2346 | ||
2347 | \wxheading{See also} | |
2348 | ||
2349 | \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp | |
2350 | \helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp | |
2351 | \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour} | |
2352 | ||
2353 | \membersection{wxWindow::SetHelpText}\label{wxwindowsethelptext} | |
2354 | ||
2355 | \func{virtual void}{SetHelpText}{\param{const wxString\& }{helpText}} | |
2356 | ||
2357 | Sets the help text to be used as context-sensitive help for this window. | |
2358 | ||
2359 | Note that the text is actually stored by the current \helpref{wxHelpProvider}{wxhelpprovider} implementation, | |
2360 | and not in the window object itself. | |
2361 | ||
2362 | \wxheading{See also} | |
2363 | ||
2364 | \helpref{GetHelpText}{wxwindowgethelptext}, \helpref{wxHelpProvider}{wxhelpprovider} | |
2365 | ||
2366 | \membersection{wxWindow::SetId}\label{wxwindowsetid} | |
2367 | ||
2368 | \func{void}{SetId}{\param{int}{ id}} | |
2369 | ||
2370 | Sets the identifier of the window. | |
2371 | ||
2372 | \wxheading{Remarks} | |
2373 | ||
2374 | Each window has an integer identifier. If the application has not provided one, | |
2375 | an identifier will be generated. Normally, the identifier should be provided | |
2376 | on creation and should not be modified subsequently. | |
2377 | ||
2378 | \wxheading{See also} | |
2379 | ||
2380 | \helpref{wxWindow::GetId}{wxwindowgetid},\rtfsp | |
2381 | \helpref{Window identifiers}{windowids} | |
2382 | ||
2383 | \membersection{wxWindow::SetName}\label{wxwindowsetname} | |
2384 | ||
2385 | \func{virtual void}{SetName}{\param{const wxString\& }{name}} | |
2386 | ||
2387 | Sets the window's name. | |
2388 | ||
2389 | \wxheading{Parameters} | |
2390 | ||
2391 | \docparam{name}{A name to set for the window.} | |
2392 | ||
2393 | \wxheading{See also} | |
2394 | ||
2395 | \helpref{wxWindow::GetName}{wxwindowgetname} | |
2396 | ||
2397 | \membersection{wxWindow::SetPalette}\label{wxwindowsetpalette} | |
2398 | ||
2399 | \func{virtual void}{SetPalette}{\param{wxPalette* }{palette}} | |
2400 | ||
2401 | Obsolete - use \helpref{wxDC::SetPalette}{wxdcsetpalette} instead. | |
2402 | ||
2403 | \membersection{wxWindow::SetScrollbar}\label{wxwindowsetscrollbar} | |
2404 | ||
2405 | \func{virtual void}{SetScrollbar}{\param{int }{orientation}, \param{int }{position},\rtfsp | |
2406 | \param{int }{thumbSize}, \param{int }{range},\rtfsp | |
2407 | \param{bool }{refresh = {\tt true}}} | |
2408 | ||
2409 | Sets the scrollbar properties of a built-in scrollbar. | |
2410 | ||
2411 | \wxheading{Parameters} | |
2412 | ||
2413 | \docparam{orientation}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.} | |
2414 | ||
2415 | \docparam{position}{The position of the scrollbar in scroll units.} | |
2416 | ||
2417 | \docparam{thumbSize}{The size of the thumb, or visible portion of the scrollbar, in scroll units.} | |
2418 | ||
2419 | \docparam{range}{The maximum position of the scrollbar.} | |
2420 | ||
2421 | \docparam{refresh}{{\tt true} to redraw the scrollbar, {\tt false} otherwise.} | |
2422 | ||
2423 | \wxheading{Remarks} | |
2424 | ||
2425 | Let's say you wish to display 50 lines of text, using the same font. | |
2426 | The window is sized so that you can only see 16 lines at a time. | |
2427 | ||
2428 | You would use: | |
2429 | ||
2430 | {\small% | |
2431 | \begin{verbatim} | |
2432 | SetScrollbar(wxVERTICAL, 0, 16, 50); | |
2433 | \end{verbatim} | |
2434 | } | |
2435 | ||
2436 | Note that with the window at this size, the thumb position can never go | |
2437 | above 50 minus 16, or 34. | |
2438 | ||
2439 | You can determine how many lines are currently visible by dividing the current view | |
2440 | size by the character height in pixels. | |
2441 | ||
2442 | When defining your own scrollbar behaviour, you will always need to recalculate | |
2443 | the scrollbar settings when the window size changes. You could therefore put your | |
2444 | scrollbar calculations and SetScrollbar | |
2445 | call into a function named AdjustScrollbars, which can be called initially and also | |
2446 | from your \helpref{wxSizeEvent}{wxsizeevent} handler function. | |
2447 | ||
2448 | \wxheading{See also} | |
2449 | ||
2450 | \helpref{Scrolling overview}{scrollingoverview},\rtfsp | |
2451 | \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow} | |
2452 | ||
2453 | \begin{comment} | |
2454 | \membersection{wxWindow::SetScrollPage}\label{wxwindowsetscrollpage} | |
2455 | ||
2456 | \func{virtual void}{SetScrollPage}{\param{int }{orientation}, \param{int }{pageSize}, \param{bool }{refresh = {\tt true}}} | |
2457 | ||
2458 | Sets the page size of one of the built-in scrollbars. | |
2459 | ||
2460 | \wxheading{Parameters} | |
2461 | ||
2462 | \docparam{orientation}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.} | |
2463 | ||
2464 | \docparam{pageSize}{Page size in scroll units.} | |
2465 | ||
2466 | \docparam{refresh}{{\tt true} to redraw the scrollbar, {\tt false} otherwise.} | |
2467 | ||
2468 | \wxheading{Remarks} | |
2469 | ||
2470 | The page size of a scrollbar is the number of scroll units that the scroll thumb travels when you | |
2471 | click on the area above/left of or below/right of the thumb. Normally you will want a whole visible | |
2472 | page to be scrolled, i.e. the size of the current view (perhaps the window client size). This | |
2473 | value has to be adjusted when the window is resized, since the page size will have changed. | |
2474 | ||
2475 | In addition to specifying how far the scroll thumb travels when paging, in Motif and some versions of Windows | |
2476 | the thumb changes size to reflect the page size relative to the length of the document. When the | |
2477 | document size is only slightly bigger than the current view (window) size, almost all of the scrollbar | |
2478 | will be taken up by the thumb. When the two values become the same, the scrollbar will (on some systems) | |
2479 | disappear. | |
2480 | ||
2481 | Currently, this function should be called before SetPageRange, because of a quirk in the Windows | |
2482 | handling of pages and ranges. | |
2483 | ||
2484 | \wxheading{See also} | |
2485 | ||
2486 | \helpref{wxWindow::SetScrollPos}{wxwindowsetscrollpos},\rtfsp | |
2487 | \helpref{wxWindow::GetScrollPos}{wxwindowsetscrollpos},\rtfsp | |
2488 | \helpref{wxWindow::GetScrollPage}{wxwindowsetscrollpage},\rtfsp | |
2489 | \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow} | |
2490 | \end{comment} | |
2491 | ||
2492 | \membersection{wxWindow::SetScrollPos}\label{wxwindowsetscrollpos} | |
2493 | ||
2494 | \func{virtual void}{SetScrollPos}{\param{int }{orientation}, \param{int }{pos}, \param{bool }{refresh = {\tt true}}} | |
2495 | ||
2496 | Sets the position of one of the built-in scrollbars. | |
2497 | ||
2498 | \wxheading{Parameters} | |
2499 | ||
2500 | \docparam{orientation}{Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.} | |
2501 | ||
2502 | \docparam{pos}{Position in scroll units.} | |
2503 | ||
2504 | \docparam{refresh}{{\tt true} to redraw the scrollbar, {\tt false} otherwise.} | |
2505 | ||
2506 | \wxheading{Remarks} | |
2507 | ||
2508 | This function does not directly affect the contents of the window: it is up to the | |
2509 | application to take note of scrollbar attributes and redraw contents accordingly. | |
2510 | ||
2511 | \wxheading{See also} | |
2512 | ||
2513 | \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar},\rtfsp | |
2514 | \helpref{wxWindow::GetScrollPos}{wxwindowsetscrollpos},\rtfsp | |
2515 | \helpref{wxWindow::GetScrollThumb}{wxwindowgetscrollthumb},\rtfsp | |
2516 | \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow} | |
2517 | ||
2518 | \begin{comment} | |
2519 | \membersection{wxWindow::SetScrollRange}\label{wxwindowsetscrollrange} | |
2520 | ||
2521 | \func{virtual void}{SetScrollRange}{\param{int }{orientation}, \param{int }{range}, \param{bool }{refresh = {\tt true}}} | |
2522 | ||
2523 | Sets the range of one of the built-in scrollbars. | |
2524 | ||
2525 | \wxheading{Parameters} | |
2526 | ||
2527 | \docparam{orientation}{Determines the scrollbar whose range is to be set. May be wxHORIZONTAL or wxVERTICAL.} | |
2528 | ||
2529 | \docparam{range}{Scroll range.} | |
2530 | ||
2531 | \docparam{refresh}{{\tt true} to redraw the scrollbar, {\tt false} otherwise.} | |
2532 | ||
2533 | \wxheading{Remarks} | |
2534 | ||
2535 | The range of a scrollbar is the number of steps that the thumb may travel, rather than the total | |
2536 | object length of the scrollbar. If you are implementing a scrolling window, for example, you | |
2537 | would adjust the scroll range when the window is resized, by subtracting the window view size from the | |
2538 | total virtual window size. When the two sizes are the same (all the window is visible), the range goes to zero | |
2539 | and usually the scrollbar will be automatically hidden. | |
2540 | ||
2541 | \wxheading{See also} | |
2542 | ||
2543 | \helpref{wxWindow::SetScrollPos}{wxwindowsetscrollpos},\rtfsp | |
2544 | \helpref{wxWindow::SetScrollPage}{wxwindowsetscrollpage},\rtfsp | |
2545 | \helpref{wxWindow::GetScrollPos}{wxwindowsetscrollpos},\rtfsp | |
2546 | \helpref{wxWindow::GetScrollPage}{wxwindowsetscrollpage},\rtfsp | |
2547 | \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow} | |
2548 | \end{comment} | |
2549 | ||
2550 | \membersection{wxWindow::SetSize}\label{wxwindowsetsize} | |
2551 | ||
2552 | \func{virtual void}{SetSize}{\param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height}, | |
2553 | \param{int}{ sizeFlags = wxSIZE\_AUTO}} | |
2554 | ||
2555 | \func{virtual void}{SetSize}{\param{const wxRect\&}{ rect}} | |
2556 | ||
2557 | Sets the size and position of the window in pixels. | |
2558 | ||
2559 | \func{virtual void}{SetSize}{\param{int}{ width}, \param{int}{ height}} | |
2560 | ||
2561 | \func{virtual void}{SetSize}{\param{const wxSize\&}{ size}} | |
2562 | ||
2563 | Sets the size of the window in pixels. | |
2564 | ||
2565 | \wxheading{Parameters} | |
2566 | ||
2567 | \docparam{x}{Required x position in pixels, or -1 to indicate that the existing | |
2568 | value should be used.} | |
2569 | ||
2570 | \docparam{y}{Required y position in pixels, or -1 to indicate that the existing | |
2571 | value should be used.} | |
2572 | ||
2573 | \docparam{width}{Required width in pixels, or -1 to indicate that the existing | |
2574 | value should be used.} | |
2575 | ||
2576 | \docparam{height}{Required height position in pixels, or -1 to indicate that the existing | |
2577 | value should be used.} | |
2578 | ||
2579 | \docparam{size}{\helpref{wxSize}{wxsize} object for setting the size.} | |
2580 | ||
2581 | \docparam{rect}{\helpref{wxRect}{wxrect} object for setting the position and size.} | |
2582 | ||
2583 | \docparam{sizeFlags}{Indicates the interpretation of other parameters. It is a bit list of the following: | |
2584 | ||
2585 | {\bf wxSIZE\_AUTO\_WIDTH}: a -1 width value is taken to indicate | |
2586 | a wxWindows-supplied default width.\\ | |
2587 | {\bf wxSIZE\_AUTO\_HEIGHT}: a -1 height value is taken to indicate | |
2588 | a wxWindows-supplied default width.\\ | |
2589 | {\bf wxSIZE\_AUTO}: -1 size values are taken to indicate | |
2590 | a wxWindows-supplied default size.\\ | |
2591 | {\bf wxSIZE\_USE\_EXISTING}: existing dimensions should be used | |
2592 | if -1 values are supplied.\\ | |
2593 | {\bf wxSIZE\_ALLOW\_MINUS\_ONE}: allow dimensions of -1 and less to be interpreted | |
2594 | as real dimensions, not default values. | |
2595 | } | |
2596 | ||
2597 | \wxheading{Remarks} | |
2598 | ||
2599 | The second form is a convenience for calling the first form with default | |
2600 | x and y parameters, and must be used with non-default width and height values. | |
2601 | ||
2602 | The first form sets the position and optionally size, of the window. | |
2603 | Parameters may be -1 to indicate either that a default should be supplied | |
2604 | by wxWindows, or that the current value of the dimension should be used. | |
2605 | ||
2606 | \wxheading{See also} | |
2607 | ||
2608 | \helpref{wxWindow::Move}{wxwindowmove} | |
2609 | ||
2610 | \pythonnote{In place of a single overloaded method name, wxPython | |
2611 | implements the following methods:\par | |
2612 | \indented{2cm}{\begin{twocollist} | |
2613 | \twocolitem{{\bf SetDimensions(x, y, width, height, sizeFlags=wxSIZE\_AUTO)}}{} | |
2614 | \twocolitem{{\bf SetSize(size)}}{} | |
2615 | \twocolitem{{\bf SetPosition(point)}}{} | |
2616 | \end{twocollist}} | |
2617 | } | |
2618 | ||
2619 | \membersection{wxWindow::SetSizeHints}\label{wxwindowsetsizehints} | |
2620 | ||
2621 | \func{virtual void}{SetSizeHints}{\param{int}{ minW=-1}, \param{int}{ minH=-1}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1}, | |
2622 | \param{int}{ incW=-1}, \param{int}{ incH=-1}} | |
2623 | ||
2624 | Allows specification of minimum and maximum window sizes, and window size increments. | |
2625 | If a pair of values is not set (or set to -1), the default values will be used. | |
2626 | ||
2627 | \wxheading{Parameters} | |
2628 | ||
2629 | \docparam{minW}{Specifies the minimum width allowable.} | |
2630 | ||
2631 | \docparam{minH}{Specifies the minimum height allowable.} | |
2632 | ||
2633 | \docparam{maxW}{Specifies the maximum width allowable.} | |
2634 | ||
2635 | \docparam{maxH}{Specifies the maximum height allowable.} | |
2636 | ||
2637 | \docparam{incW}{Specifies the increment for sizing the width (Motif/Xt only).} | |
2638 | ||
2639 | \docparam{incH}{Specifies the increment for sizing the height (Motif/Xt only).} | |
2640 | ||
2641 | \wxheading{Remarks} | |
2642 | ||
2643 | If this function is called, the user will not be able to size the window outside the | |
2644 | given bounds. | |
2645 | ||
2646 | The resizing increments are only significant under Motif or Xt. | |
2647 | ||
2648 | \membersection{wxWindow::SetSizer}\label{wxwindowsetsizer} | |
2649 | ||
2650 | \func{void}{SetSizer}{\param{wxSizer* }{sizer}, \param{bool }{deleteOld=true}} | |
2651 | ||
2652 | Sets the window to have the given layout sizer. The window | |
2653 | will then own the object, and will take care of its deletion. | |
2654 | If an existing layout constraints object is already owned by the | |
2655 | window, it will be deleted if the deleteOld parameter is true. | |
2656 | ||
2657 | Note that this function will also call | |
2658 | \helpref{SetAutoLayout}{wxwindowsetautolayout} implicitly with {\tt true} | |
2659 | parameter if the {\it sizer}\/ is non-NULL and {\tt false} otherwise. | |
2660 | ||
2661 | \wxheading{Parameters} | |
2662 | ||
2663 | \docparam{sizer}{The sizer to set. Pass NULL to disassociate and conditionally delete | |
2664 | the window's sizer. See below.} | |
2665 | ||
2666 | \docparam{deleteOld}{If true (the default), this will delete any prexisting sizer. | |
2667 | Pass false if you wish to handle deleting the old sizer yourself.} | |
2668 | ||
2669 | \wxheading{Remarks} | |
2670 | ||
2671 | SetSizer now enables and disables Layout automatically, but prior to wxWindows 2.3.3 | |
2672 | the following applied: | |
2673 | ||
2674 | You must call \helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout} to tell a window to use | |
2675 | the sizer automatically in OnSize; otherwise, you must override OnSize and call Layout() | |
2676 | explicitly. When setting both a wxSizer and a \helpref{wxLayoutConstraints}{wxlayoutconstraints}, | |
2677 | only the sizer will have effect. | |
2678 | ||
2679 | \membersection{wxWindow::SetSizerAndFit}\label{wxwindowsetsizerandfit} | |
2680 | ||
2681 | \func{void}{SetSizerAndFit}{\param{wxSizer* }{sizer}, \param{bool }{deleteOld=true}} | |
2682 | ||
2683 | The same as \helpref{SetSizer}{wxwindowsetsizer}, except it also sets the size hints | |
2684 | for the window based on the sizer's minimum size. | |
2685 | ||
2686 | \membersection{wxWindow::SetTitle}\label{wxwindowsettitle} | |
2687 | ||
2688 | \func{virtual void}{SetTitle}{\param{const wxString\& }{title}} | |
2689 | ||
2690 | Sets the window's title. Applicable only to frames and dialogs. | |
2691 | ||
2692 | \wxheading{Parameters} | |
2693 | ||
2694 | \docparam{title}{The window's title.} | |
2695 | ||
2696 | \wxheading{See also} | |
2697 | ||
2698 | \helpref{wxWindow::GetTitle}{wxwindowgettitle} | |
2699 | ||
2700 | \membersection{wxWindow::SetThemeEnabled}\label{wxwindowsetthemeenabled} | |
2701 | ||
2702 | \func{virtual void}{SetThemeEnabled}{\param{bool }{enable}} | |
2703 | ||
2704 | This function tells a window if it should use the system's "theme" code | |
2705 | to draw the windows' background instead if its own background drawing | |
2706 | code. This does not always have any effect since the underlying platform | |
2707 | obviously needs to support the notion of themes in user defined windows. | |
2708 | One such platform is GTK+ where windows can have (very colourful) backgrounds | |
2709 | defined by a user's selected theme. | |
2710 | ||
2711 | Dialogs, notebook pages and the status bar have this flag set to true | |
2712 | by default so that the default look and feel is simulated best. | |
2713 | ||
2714 | \membersection{wxWindow::SetToolTip}\label{wxwindowsettooltip} | |
2715 | ||
2716 | \func{void}{SetToolTip}{\param{const wxString\& }{tip}} | |
2717 | ||
2718 | \func{void}{SetToolTip}{\param{wxToolTip* }{tip}} | |
2719 | ||
2720 | Attach a tooltip to the window. | |
2721 | ||
2722 | See also: \helpref{GetToolTip}{wxwindowgettooltip}, | |
2723 | \helpref{wxToolTip}{wxtooltip} | |
2724 | ||
2725 | \membersection{wxWindow::SetValidator}\label{wxwindowsetvalidator} | |
2726 | ||
2727 | \func{virtual void}{SetValidator}{\param{const wxValidator\&}{ validator}} | |
2728 | ||
2729 | Deletes the current validator (if any) and sets the window validator, having called wxValidator::Clone to | |
2730 | create a new validator of this type. | |
2731 | ||
2732 | \membersection{wxWindow::SetVirtualSize}\label{wxwindowsetvirtualsize} | |
2733 | ||
2734 | \func{void}{SetVirtualSize}{\param{int}{ width}, \param{int}{ height}} | |
2735 | ||
2736 | \func{void}{SetVirtualSize}{\param{const wxSize\&}{ size}} | |
2737 | ||
2738 | Sets the virtual size of the window in pixels. | |
2739 | ||
2740 | \membersection{wxWindow::SetVirtualSizeHints}\label{wxwindowsetvirtualsizehints} | |
2741 | ||
2742 | \func{virtual void}{SetVirtualSizeHints}{\param{int}{ minW},\param{int}{ minH}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1}} | |
2743 | ||
2744 | Allows specification of minimum and maximum virtual window sizes. | |
2745 | If a pair of values is not set (or set to -1), the default values | |
2746 | will be used. | |
2747 | ||
2748 | \wxheading{Parameters} | |
2749 | ||
2750 | \docparam{minW}{Specifies the minimum width allowable.} | |
2751 | ||
2752 | \docparam{minH}{Specifies the minimum height allowable.} | |
2753 | ||
2754 | \docparam{maxW}{Specifies the maximum width allowable.} | |
2755 | ||
2756 | \docparam{maxH}{Specifies the maximum height allowable.} | |
2757 | ||
2758 | \wxheading{Remarks} | |
2759 | ||
2760 | If this function is called, the user will not be able to size the virtual area | |
2761 | of the window outside the given bounds. | |
2762 | ||
2763 | \membersection{wxWindow::SetWindowStyle}\label{wxwindowsetwindowstyle} | |
2764 | ||
2765 | \func{void}{SetWindowStyle}{\param{long}{ style}} | |
2766 | ||
2767 | Identical to \helpref{SetWindowStyleFlag}{wxwindowsetwindowstyleflag}. | |
2768 | ||
2769 | \membersection{wxWindow::SetWindowStyleFlag}\label{wxwindowsetwindowstyleflag} | |
2770 | ||
2771 | \func{virtual void}{SetWindowStyleFlag}{\param{long}{ style}} | |
2772 | ||
2773 | Sets the style of the window. Please note that some styles cannot be changed | |
2774 | after the window creation and that \helpref{Refresh()}{wxwindowrefresh} might | |
2775 | be called after changing the others for the change to take place immediately. | |
2776 | ||
2777 | See \helpref{Window styles}{windowstyles} for more information about flags. | |
2778 | ||
2779 | \wxheading{See also} | |
2780 | ||
2781 | \helpref{GetWindowStyleFlag}{wxwindowgetwindowstyleflag} | |
2782 | ||
2783 | \membersection{wxWindow::Show}\label{wxwindowshow} | |
2784 | ||
2785 | \func{virtual bool}{Show}{\param{bool}{ show = {\tt true}}} | |
2786 | ||
2787 | Shows or hides the window. You may need to call \helpref{Raise}{wxwindowraise} | |
2788 | for a top level window if you want to bring it to top, although this is not | |
2789 | needed if Show() is called immediately after the frame creation. | |
2790 | ||
2791 | \wxheading{Parameters} | |
2792 | ||
2793 | \docparam{show}{If {\tt true} displays the window. Otherwise, hides it.} | |
2794 | ||
2795 | \wxheading{Return value} | |
2796 | ||
2797 | {\tt true} if the window has been shown or hidden or {\tt false} if nothing was | |
2798 | done because it already was in the requested state. | |
2799 | ||
2800 | \wxheading{See also} | |
2801 | ||
2802 | \helpref{wxWindow::IsShown}{wxwindowisshown} | |
2803 | ||
2804 | \membersection{wxWindow::Thaw}\label{wxwindowthaw} | |
2805 | ||
2806 | \func{virtual void}{Thaw}{\void} | |
2807 | ||
2808 | Reenables window updating after a previous call to | |
2809 | \helpref{Freeze}{wxwindowfreeze}. | |
2810 | ||
2811 | \membersection{wxWindow::TransferDataFromWindow}\label{wxwindowtransferdatafromwindow} | |
2812 | ||
2813 | \func{virtual bool}{TransferDataFromWindow}{\void} | |
2814 | ||
2815 | Transfers values from child controls to data areas specified by their validators. Returns | |
2816 | {\tt false} if a transfer failed. | |
2817 | ||
2818 | If the window has {\tt wxWS\_EX\_VALIDATE\_RECURSIVELY} extra style flag set, | |
2819 | the method will also call TransferDataFromWindow() of all child windows. | |
2820 | ||
2821 | \wxheading{See also} | |
2822 | ||
2823 | \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow},\rtfsp | |
2824 | \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::Validate}{wxwindowvalidate} | |
2825 | ||
2826 | \membersection{wxWindow::TransferDataToWindow}\label{wxwindowtransferdatatowindow} | |
2827 | ||
2828 | \func{virtual bool}{TransferDataToWindow}{\void} | |
2829 | ||
2830 | Transfers values to child controls from data areas specified by their validators. | |
2831 | ||
2832 | If the window has {\tt wxWS\_EX\_VALIDATE\_RECURSIVELY} extra style flag set, | |
2833 | the method will also call TransferDataToWindow() of all child windows. | |
2834 | ||
2835 | \wxheading{Return value} | |
2836 | ||
2837 | Returns {\tt false} if a transfer failed. | |
2838 | ||
2839 | \wxheading{See also} | |
2840 | ||
2841 | \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow},\rtfsp | |
2842 | \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::Validate}{wxwindowvalidate} | |
2843 | ||
2844 | \membersection{wxWindow::UnregisterHotKey}\label{wxwindowunregisterhotkey} | |
2845 | ||
2846 | \func{bool}{UnregisterHotKey}{\param{int}{ hotkeyId}} | |
2847 | ||
2848 | Unregisters a system wide hotkey. | |
2849 | ||
2850 | \wxheading{Parameters} | |
2851 | ||
2852 | \docparam{hotkeyId}{Numeric identifier of the hotkey. Must be the same id that was passed to RegisterHotKey.} | |
2853 | ||
2854 | \wxheading{Return value} | |
2855 | ||
2856 | {\tt true} if the hotkey was unregistered successfully, {\tt false} if the id was invalid. | |
2857 | ||
2858 | \wxheading{Remarks} | |
2859 | ||
2860 | This function is currently only implemented under MSW. | |
2861 | ||
2862 | \wxheading{See also} | |
2863 | ||
2864 | \helpref{wxWindow::RegisterHotKey}{wxwindowregisterhotkey} | |
2865 | ||
2866 | \membersection{wxWindow::Update}\label{wxwindowupdate} | |
2867 | ||
2868 | \func{virtual void}{Update}{\void} | |
2869 | ||
2870 | Calling this method immediately repaints the invalidated area of the window | |
2871 | while this would usually only happen when the flow of control returns to the | |
2872 | event loop. Notice that this function doesn't refresh the window and does | |
2873 | nothing if the window hadn't been already repainted. Use | |
2874 | \helpref{Refresh}{wxwindowrefresh} first if you want to immediately redraw the | |
2875 | window unconditionally. | |
2876 | ||
2877 | \membersection{wxWindow::UpdateWindowUI}\label{wxwindowupdatewindowui} | |
2878 | ||
2879 | \func{virtual void}{UpdateWindowUI}{\param{long}{ flags = wxUPDATE_UI_NONE}} | |
2880 | ||
2881 | This function sends \helpref{wxUpdateUIEvents}{wxupdateuievent} to | |
2882 | the window. The particular implementation depends on the window; for | |
2883 | example a wxToolBar will send an update UI event for each toolbar button, | |
2884 | and a wxFrame will send an update UI event for each menubar menu item. | |
2885 | You can call this function from your application to ensure that your | |
2886 | UI is up-to-date at this point (as far as your wxUpdateUIEvent handlers | |
2887 | are concerned). This may be necessary if you have called | |
2888 | \helpref{wxUpdateUIEvent::SetMode}{wxupdateuieventsetmode} or | |
2889 | \helpref{wxUpdateUIEvent::SetUpdateInterval}{wxupdateuieventsetupdateinterval} to | |
2890 | limit the overhead that wxWindows incurs by sending update UI events in idle time. | |
2891 | ||
2892 | {\it flags} should be a bitlist of one or more of the following values. | |
2893 | ||
2894 | \begin{verbatim} | |
2895 | enum wxUpdateUI | |
2896 | { | |
2897 | wxUPDATE_UI_NONE = 0x0000, // No particular value | |
2898 | wxUPDATE_UI_RECURSE = 0x0001, // Call the function for descendants | |
2899 | wxUPDATE_UI_FROMIDLE = 0x0002 // Invoked from On(Internal)Idle | |
2900 | }; | |
2901 | \end{verbatim} | |
2902 | ||
2903 | If you are calling this function from an OnInternalIdle or OnIdle | |
2904 | function, make sure you pass the wxUPDATE\_UI\_FROMIDLE flag, since | |
2905 | this tells the window to only update the UI elements that need | |
2906 | to be updated in idle time. Some windows update their elements | |
2907 | only when necessary, for example when a menu is about to be shown. | |
2908 | The following is an example of how to call UpdateWindowUI from | |
2909 | an idle function. | |
2910 | ||
2911 | \begin{verbatim} | |
2912 | void MyWindow::OnInternalIdle() | |
2913 | { | |
2914 | if (wxUpdateUIEvent::CanUpdate(this)) | |
2915 | UpdateWindowUI(wxUPDATE_UI_FROMIDLE); | |
2916 | } | |
2917 | \end{verbatim} | |
2918 | ||
2919 | \wxheading{See also} | |
2920 | ||
2921 | \helpref{wxUpdateUIEvent}{wxupdateuievent}, | |
2922 | \helpref{wxWindow::DoUpdateWindowUI}{wxwindowdoupdatewindowui}, | |
2923 | \helpref{wxWindow::OnInternalIdle}{wxwindowoninternalidle} | |
2924 | ||
2925 | \membersection{wxWindow::Validate}\label{wxwindowvalidate} | |
2926 | ||
2927 | \func{virtual bool}{Validate}{\void} | |
2928 | ||
2929 | Validates the current values of the child controls using their validators. | |
2930 | ||
2931 | If the window has {\tt wxWS\_EX\_VALIDATE\_RECURSIVELY} extra style flag set, | |
2932 | the method will also call Validate() of all child windows. | |
2933 | ||
2934 | \wxheading{Return value} | |
2935 | ||
2936 | Returns {\tt false} if any of the validations failed. | |
2937 | ||
2938 | \wxheading{See also} | |
2939 | ||
2940 | \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow},\rtfsp | |
2941 | \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow},\rtfsp | |
2942 | \helpref{wxValidator}{wxvalidator} | |
2943 | ||
2944 | \membersection{wxWindow::WarpPointer}\label{wxwindowwarppointer} | |
2945 | ||
2946 | \func{void}{WarpPointer}{\param{int}{ x}, \param{int}{ y}} | |
2947 | ||
2948 | Moves the pointer to the given position on the window. | |
2949 | ||
2950 | {\bf NB: } This function is not supported under Mac because Apple Human | |
2951 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
2952 | ||
2953 | \wxheading{Parameters} | |
2954 | ||
2955 | \docparam{x}{The new x position for the cursor.} | |
2956 | ||
2957 | \docparam{y}{The new y position for the cursor.} | |
2958 |