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