]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/window.tex
047981dd63cbcc3d4380a4d38248dfa631e7aa0f
[wxWidgets.git] / docs / latex / wx / window.tex
1 \section{\class{wxWindow}}\label{wxwindow}
2
3 wxWindow is the base class for all windows. Any
4 children of the window will be deleted automatically by the destructor
5 before the window itself is deleted.
6
7 \wxheading{Derived from}
8
9 \helpref{wxEvtHandler}{wxevthandler}\\
10 \helpref{wxObject}{wxobject}
11
12 \wxheading{Window styles}
13
14 The following styles can apply to all windows, although they will not always make sense for a particular
15 window class.
16
17 \twocolwidtha{5cm}%
18 \begin{twocollist}\itemsep=0pt
19 \twocolitem{\windowstyle{wxSIMPLE\_BORDER}}{Displays a thin border around the window. wxBORDER is the old name
20 for this style.}
21 \twocolitem{\windowstyle{wxDOUBLE\_BORDER}}{Displays a double border. Windows only.}
22 \twocolitem{\windowstyle{wxSUNKEN\_BORDER}}{Displays a sunken border.}
23 \twocolitem{\windowstyle{wxRAISED\_BORDER}}{Displays a raised border.}
24 \twocolitem{\windowstyle{wxSTATIC\_BORDER}}{Displays a border suitable for a static control.}
25 \twocolitem{\windowstyle{wxTRANSPARENT\_WINDOW}}{The window is transparent, that is, it will not receive paint
26 events. Windows only.}
27 \twocolitem{\windowstyle{wxNO\_3D}}{Prevents the children of this window taking on 3D styles, even though
28 the application-wide policy is for 3D controls. Windows only.}
29 \twocolitem{\windowstyle{wxTAB\_TRAVERSAL}}{Use this to enable tab traversal for non-dialog windows.}
30 \twocolitem{\windowstyle{wxVSCROLL}}{Use this style to enable a vertical scrollbar.}
31 \twocolitem{\windowstyle{wxHSCROLL}}{Use this style to enable a horizontal scrollbar.}
32 \twocolitem{\windowstyle{wxCLIP\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
33 repainted, then children being painted over them. Windows-only.}
34 \end{twocollist}
35
36 See also \helpref{window styles overview}{windowstyles}.
37
38 \wxheading{See also}
39
40 \helpref{Event handling overview}{eventhandlingoverview}
41
42 \latexignore{\rtfignore{\wxheading{Members}}}
43
44 \membersection{wxWindow::wxWindow}
45
46 \func{}{wxWindow}{\void}
47
48 Default constructor.
49
50 \func{}{wxWindow}{\param{wxWindow*}{ parent}, \param{wxWindowID }{id},
51 \param{const wxPoint\& }{pos = wxDefaultPosition},
52 \param{const wxSize\& }{size = wxDefaultSize},
53 \param{long }{style = 0},
54 \param{const wxString\& }{name = wxPanelNameStr}}
55
56 Constructs a window, which can be a child of a frame, dialog or any other non-control window.
57
58 \wxheading{Parameters}
59
60 \docparam{parent}{Pointer to a parent window.}
61
62 \docparam{id}{Window identifier. If -1, will automatically create an identifier.}
63
64 \docparam{pos}{Window position. wxDefaultPosition is (-1, -1) which indicates that wxWindows
65 should generate a default position for the window. If using the wxWindow class directly, supply
66 an actual position.}
67
68 \docparam{size}{Window size. wxDefaultSize is (-1, -1) which indicates that wxWindows
69 should generate a default size for the window.}
70
71 \docparam{style}{Window style. For generic window styles, please see \helpref{wxWindow}{wxwindow}.}
72
73 \docparam{name}{Window name.}
74
75 \membersection{wxWindow::\destruct{wxWindow}}
76
77 \func{}{\destruct{wxWindow}}{\void}
78
79 Destructor. Deletes all subwindows, then deletes itself. Instead of using
80 the {\bf delete} operator explicitly, you should normally
81 use \helpref{wxWindow::Destroy}{wxwindowdestroy} so that wxWindows
82 can delete a window only when it is safe to do so, in idle time.
83
84 \wxheading{See also}
85
86 \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
87 \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow},\rtfsp
88 \helpref{wxWindow::Destroy}{wxwindowdestroy},\rtfsp
89 \helpref{wxCloseEvent}{wxcloseevent}
90
91 \membersection{wxWindow::AddChild}
92
93 \func{virtual void}{AddChild}{\param{wxWindow* }{child}}
94
95 Adds a child window. This is called automatically by window creation
96 functions so should not be required by the application programmer.
97
98 \wxheading{Parameters}
99
100 \docparam{child}{Child window to add.}
101
102 \membersection{wxWindow::CaptureMouse}\label{wxwindowcapturemouse}
103
104 \func{virtual void}{CaptureMouse}{\void}
105
106 Directs all mouse input to this window. Call \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse} to
107 release the capture.
108
109 \wxheading{See also}
110
111 \helpref{wxWindow::ReleaseMouse}{wxwindowreleasemouse}
112
113 \membersection{wxWindow::Center}\label{wxwindowcenter}
114
115 \func{void}{Center}{\param{int}{ direction}}
116
117 A synonym for \helpref{Centre}{wxwindowcentre}.
118
119 \membersection{wxWindow::Centre}\label{wxwindowcentre}
120
121 \func{virtual void}{Centre}{\param{int}{ direction = wxHORIZONTAL}}
122
123 Centres the window.
124
125 \wxheading{Parameters}
126
127 \docparam{direction}{Specifies the direction for the centering. May be {\tt wxHORIZONTAL}, {\tt wxVERTICAL}\rtfsp
128 or {\tt wxBOTH}.}
129
130 \wxheading{Remarks}
131
132 The actual behaviour depends on the derived window. For a frame or dialog box,
133 centring is relative to the whole display. For a panel item, centring is
134 relative to the panel.
135
136 \wxheading{See also}
137
138 \helpref{wxWindow::Center}{wxwindowcenter}
139
140 \membersection{wxWindow::Clear}\label{wxwindowclear}
141
142 \func{void}{Clear}{\void}
143
144 Clears the window by filling it with the current background colour.
145
146 \membersection{wxWindow::ClientToScreen}
147
148 \constfunc{virtual void}{ClientToScreen}{\param{int* }{x}, \param{int* }{y}}
149
150 \constfunc{virtual wxPoint}{ClientToScreen}{\param{const wxPoint\&}{ pt}}
151
152 Converts to screen coordinates from coordinates relative to this window.
153
154 \docparam{x}{A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
155 a screen coordinate will be passed out.}
156
157 \docparam{y}{A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
158 a screen coordinate will be passed out.}
159
160 \docparam{pt}{The client position for the second form of the function.}
161
162 \membersection{wxWindow::Close}\label{wxwindowclose}
163
164 \func{virtual bool}{Close}{\param{const bool}{ force = FALSE}}
165
166 The purpose of this call is to provide a safer way of destroying a window than using
167 the {\it delete} operator.
168
169 \wxheading{Parameters}
170
171 \docparam{force}{FALSE if the window's close handler should be able to veto the destruction
172 of this window, TRUE if it cannot.}
173
174 \wxheading{Remarks}
175
176 Close calls the \helpref{close handler}{wxcloseevent} for the window, providing an opportunity for the window to
177 choose whether to destroy the window.
178
179 The close handler should check whether the window is being deleted forcibly,
180 using \helpref{wxCloseEvent::GetForce}{wxcloseeventgetforce}, in which case it should
181 destroy the window using \helpref{wxWindow::Destroy}{wxwindowdestroy}.
182
183 Applies to managed windows (wxFrame and wxDialog classes) only.
184
185 \wxheading{See also}
186
187 \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
188 \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow},\rtfsp
189 \helpref{wxWindow::Destroy}{wxwindowdestroy},\rtfsp
190 \helpref{wxCloseEvent}{wxcloseevent}
191
192 \membersection{wxWindow::ConvertDialogToPixels}\label{wxwindowconvertdialogtopixels}
193
194 \func{wxPoint}{ConvertDialogToPixels}{\param{const wxPoint\&}{ pt}}
195
196 \func{wxSize}{ConvertDialogToPixels}{\param{const wxSize\&}{ sz}}
197
198 Converts a point or size from dialog units to pixels.
199
200 For the x dimension, the dialog units are multiplied by the average character width
201 and then divided by 4.
202
203 For the y dimension, the dialog units are multiplied by the average character height
204 and then divided by 8.
205
206 \wxheading{Remarks}
207
208 Dialog units are used for maintaining a dialog's proportions even if the font changes.
209 Dialogs created using Dialog Editor optionally use dialog units.
210
211 You can also use these functions programmatically. A convenience macro is defined:
212
213 {\small
214 \begin{verbatim}
215 #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
216 \end{verbatim}
217 }
218
219 \wxheading{See also}
220
221 \helpref{wxWindow::ConvertPixelsToDialog}{wxwindowconvertpixelstodialog}
222
223 \membersection{wxWindow::ConvertPixelsToDialog}\label{wxwindowconvertpixelstodialog}
224
225 \func{wxPoint}{ConvertPixelsToDialog}{\param{const wxPoint\&}{ pt}}
226
227 \func{wxSize}{ConvertPixelsToDialog}{\param{const wxSize\&}{ sz}}
228
229 Converts a point or size from pixels to dialog units.
230
231 For the x dimension, the pixels are multiplied by 4 and then divided by the average
232 character width.
233
234 For the y dimension, the pixels are multipled by 8 and then divided by the average
235 character height.
236
237 \wxheading{Remarks}
238
239 Dialog units are used for maintaining a dialog's proportions even if the font changes.
240 Dialogs created using Dialog Editor optionally use dialog units.
241
242 \wxheading{See also}
243
244 \helpref{wxWindow::ConvertDialogToPixels}{wxwindowconvertdialogtopixels}
245
246 \membersection{wxWindow::Destroy}\label{wxwindowdestroy}
247
248 \func{virtual bool}{Destroy}{\void}
249
250 Destroys the window safely. Use this function instead of the delete operator, since
251 different window classes can be destroyed differently. Frames and dialogs
252 are not destroyed immediately when this function is called - they are added
253 to a list of windows to be deleted on idle time, when all the window's events
254 have been processed. This prevents problems with events being sent to non-existant
255 windows.
256
257 \wxheading{Return value}
258
259 TRUE if the window has either been successfully deleted, or it has been added
260 to the list of windows pending real deletion.
261
262 \membersection{wxWindow::DestroyChildren}
263
264 \func{virtual void}{DestroyChildren}{\void}
265
266 Destroys all children of a window. Called automatically by the destructor.
267
268 \membersection{wxWindow::DragAcceptFiles}\label{wxwindowdragacceptfiles}
269
270 \func{virtual void}{DragAcceptFiles}{\param{const bool}{ accept}}
271
272 Enables or disables elibility for drop file events (OnDropFiles).
273
274 \wxheading{Parameters}
275
276 \docparam{accept}{If TRUE, the window is eligible for drop file events. If FALSE, the window
277 will not accept drop file events.}
278
279 \wxheading{Remarks}
280
281 Windows only.
282
283 \wxheading{See also}
284
285 \helpref{wxWindow::OnDropFiles}{wxwindowondropfiles}
286
287 \membersection{wxWindow::Enable}\label{wxwindowenable}
288
289 \func{virtual void}{Enable}{\param{const bool}{ enable}}
290
291 Enable or disable the window for user input.
292
293 \wxheading{Parameters}
294
295 \docparam{enable}{If TRUE, enables the window for input. If FALSE, disables the window.}
296
297 \wxheading{See also}
298
299 \helpref{wxWindow::IsEnabled}{wxwindowisenabled}
300
301 \membersection{wxWindow::FindFocus}\label{wxwindowfindfocus}
302
303 \func{static wxWindow*}{FindFocus}{\void}
304
305 Finds the window or control which currently has the keyboard focus.
306
307 \wxheading{Remarks}
308
309 Note that this is a static function, so it can be called without needing a wxWindow pointer.
310
311 \wxheading{See also}
312
313 \helpref{wxWindow::SetFocus}{wxwindowsetfocus}
314
315 \membersection{wxWindow::FindWindow}\label{wxwindowfindwindow}
316
317 \func{wxWindow*}{FindWindow}{\param{long}{ id}}
318
319 Find a child of this window, by identifier.
320
321 \func{wxWindow*}{FindWindow}{\param{const wxString\&}{ name}}
322
323 Find a child of this window, by name.
324
325 \membersection{wxWindow::Fit}\label{wxwindowfit}
326
327 \func{virtual void}{Fit}{\void}
328
329 Sizes the window so that it fits around its subwindows.
330
331 \membersection{wxWindow::GetBackgroundColour}\label{wxwindowgetbackgroundcolour}
332
333 \constfunc{virtual wxColour}{GetBackgroundColour}{\void}
334
335 Returns the background colour of the window.
336
337 \wxheading{See also}
338
339 \helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
340 \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
341 \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
342 \helpref{wxWindow::OnEraseBackground}{wxwindowonerasebackground}
343
344 \membersection{wxWindow::GetCharHeight}
345
346 \constfunc{virtual int}{GetCharHeight}{\void}
347
348 Returns the character height for this window.
349
350 \membersection{wxWindow::GetCharWidth}
351
352 \constfunc{virtual int}{GetCharWidth}{\void}
353
354 Returns the average character width for this window.
355
356 \membersection{wxWindow::GetChildren}
357
358 \func{wxList\&}{GetChildren}{\void}
359
360 Returns a reference to the list of the window's children.
361
362 \membersection{wxWindow::GetClientSize}\label{wxwindowgetclientsize}
363
364 \constfunc{virtual void}{GetClientSize}{\param{int* }{width}, \param{int* }{height}}
365
366 \constfunc{virtual wxSize}{GetClientSize}{\void}
367
368 This gets the size of the window `client area' in pixels. The client area is the
369 area which may be drawn on by the programmer, excluding title bar, border etc.
370
371 \wxheading{Parameters}
372
373 \docparam{width}{Receives the client width in pixels.}
374
375 \docparam{height}{Receives the client height in pixels.}
376
377 \membersection{wxWindow::GetConstraints}\label{wxwindowgetconstraints}
378
379 \constfunc{wxLayoutConstraints*}{GetConstraints}{\void}
380
381 Returns a pointer to the window's layout constraints, or NULL if there are none.
382
383 \membersection{wxWindow::GetDefaultItem}\label{wxwindowgetdefaultitem}
384
385 \constfunc{wxButton*}{GetDefaultItem}{\void}
386
387 Returns a pointer to the button which is the default for this window, or NULL.
388
389 \membersection{wxWindow::GetDropTarget}\label{wxwindowgetdroptarget}
390
391 \constfunc{wxDropTarget*}{GetDropTarget}{\void}
392
393 Returns the associated drop target, which may be NULL.
394
395 \wxheading{See also}
396
397 \helpref{wxWindow::SetDropTarget}{wxwindowsetdroptarget},
398 \helpref{Drag and drop overview}{wxdndoverview}
399
400 \membersection{wxWindow::GetEventHandler}\label{wxwindowgeteventhandler}
401
402 \constfunc{wxEvtHandler*}{GetEventHandler}{\void}
403
404 Returns the event handler for this window. By default, the window is its
405 own event handler.
406
407 \wxheading{See also}
408
409 \helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp
410 \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp
411 \helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp
412 \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
413 \helpref{wxEvtHandler}{wxevthandler}\rtfsp
414
415 \membersection{wxWindow::GetFont}\label{wxwindowgetfont}
416
417 \constfunc{wxFont\&}{GetFont}{\void}
418
419 Returns a reference to the font for this window.
420
421 \wxheading{See also}
422
423 \helpref{wxWindow::SetFont}{wxwindowsetfont}
424
425 \membersection{wxWindow::GetForegroundColour}\label{wxwindowgetforegroundcolour}
426
427 \func{virtual wxColour}{GetForegroundColour}{\void}
428
429 Returns the foreground colour of the window.
430
431 \wxheading{Remarks}
432
433 The interpretation of foreground colour is open to interpretation according
434 to the window class; it may be the text colour or other colour, or it may not
435 be used at all.
436
437 \wxheading{See also}
438
439 \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
440 \helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
441 \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour}
442
443 \membersection{wxWindow::GetGrandParent}
444
445 \constfunc{wxWindow*}{GetGrandParent}{\void}
446
447 Returns the grandparent of a window, or NULL if there isn't one.
448
449 \membersection{wxWindow::GetHandle}
450
451 \constfunc{void*}{GetHandle}{\void}
452
453 Returns the platform-specific handle of the physical window. Cast it to an appropriate
454 handle, such as {\bf HWND} for Windows or {\bf Widget} for Motif.
455
456 \membersection{wxWindow::GetId}\label{wxwindowgetid}
457
458 \constfunc{int}{GetId}{\void}
459
460 Returns the identifier of the window.
461
462 \wxheading{Remarks}
463
464 Each window has an integer identifier. If the application has not provided one,
465 an identifier will be generated.
466
467 TODO: perhaps there should be a default identifier for each class, rather
468 choosing one, which could clash with other ones.
469
470 \wxheading{See also}
471
472 \helpref{wxWindow::SetId}{wxwindowsetid}
473
474 \membersection{wxWindow::GetPosition}
475
476 \constfunc{virtual void}{GetPosition}{\param{int* }{x}, \param{int* }{y}}
477
478 This gets the position of the window in pixels, relative to the parent window or
479 if no parent, relative to the whole display.
480
481 \wxheading{Parameters}
482
483 \docparam{x}{Receives the x position of the window.}
484
485 \docparam{y}{Receives the y position of the window.}
486
487 \membersection{wxWindow::GetLabel}
488
489 \constfunc{virtual wxString\& }{GetLabel}{\void}
490
491 Generic way of getting a label from any window, for
492 identification purposes.
493
494 \wxheading{Remarks}
495
496 The interpretation of this function differs from class to class.
497 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
498 the button text. This function can be useful for meta-programs (such as testing
499 tools or special-needs access programs) which need to identify windows
500 by name.
501
502 \membersection{wxWindow::GetName}\label{wxwindowgetname}
503
504 \constfunc{virtual wxString\& }{GetName}{\void}
505
506 Returns the window's name.
507
508 \wxheading{Remarks}
509
510 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
511 name in the window constructor or via \helpref{wxWindow::SetName}{wxwindowsetname}.
512
513 \wxheading{See also}
514
515 \helpref{wxWindow::SetName}{wxwindowsetname}
516
517 \membersection{wxWindow::GetParent}
518
519 \constfunc{virtual wxWindow*}{GetParent}{\void}
520
521 Returns the parent of the window, or NULL if there is no parent.
522
523 \membersection{wxWindow::GetRect}\label{wxwindowgetrect}
524
525 \constfunc{virtual wxRect}{GetRect}{\void}
526
527 Returns the size and position of the window as a \helpref{wxRect}{wxrect} object.
528
529 \membersection{wxWindow::GetReturnCode}\label{wxwindowgetreturncode}
530
531 \func{int}{GetReturnCode}{\void}
532
533 Gets the return code for this window.
534
535 \wxheading{Remarks}
536
537 A return code is normally associated with a modal dialog, where \helpref{wxDialog::ShowModal}{wxdialogshowmodal} returns
538 a code to the application.
539
540 \wxheading{See also}
541
542 \helpref{wxWindow::SetReturnCode}{wxwindowsetreturncode}, \helpref{wxDialog::ShowModal}{wxdialogshowmodal},\rtfsp
543 \helpref{wxDialog::EndModal}{wxdialogendmodal}
544
545 \membersection{wxWindow::GetScrollThumb}\label{wxwindowgetscrollthumb}
546
547 \func{virtual int}{GetScrollThumb}{\param{int }{orientation}}
548
549 Returns the built-in scrollbar thumb size.
550
551 \wxheading{See also}
552
553 \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar}
554
555 \membersection{wxWindow::GetScrollPos}\label{wxwindowgetscrollpos}
556
557 \func{virtual int}{GetScrollPos}{\param{int }{orientation}}
558
559 Returns the built-in scrollbar position.
560
561 \wxheading{See also}
562
563 See \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar}
564
565 \membersection{wxWindow::GetScrollRange}\label{wxwindowgetscrollrange}
566
567 \func{virtual int}{GetScrollRange}{\param{int }{orientation}}
568
569 Returns the built-in scrollbar range.
570
571 \wxheading{See also}
572
573 \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar}
574
575 \membersection{wxWindow::GetSize}\label{wxwindowgetsize}
576
577 \constfunc{virtual void}{GetSize}{\param{int* }{width}, \param{int* }{height}}
578
579 \constfunc{virtual wxSize}{GetSize}{\void}
580
581 This gets the size of the entire window in pixels.
582
583 \wxheading{Parameters}
584
585 \docparam{width}{Receives the window width.}
586
587 \docparam{height}{Receives the window height.}
588
589 \membersection{wxWindow::GetTextExtent}
590
591 \constfunc{virtual void}{GetTextExtent}{\param{const wxString\& }{string}, \param{int* }{x}, \param{int* }{y},
592 \param{int* }{descent = NULL}, \param{int* }{externalLeading = NULL},
593 \param{const wxFont* }{font = NULL}, \param{const bool}{ use16 = FALSE}}
594
595 Gets the dimensions of the string as it would be drawn on the
596 window with the currently selected font.
597
598 \wxheading{Parameters}
599
600 \docparam{string}{String whose extent is to be measured.}
601
602 \docparam{x}{Return value for width.}
603
604 \docparam{y}{Return value for height.}
605
606 \docparam{descent}{Return value for descent (optional).}
607
608 \docparam{externalLeading}{Return value for external leading (optional).}
609
610 \docparam{font}{Font to use instead of the current window font (optional).}
611
612 \docparam{use16}{If TRUE, {\it string} contains 16-bit characters. The default is FALSE.}
613
614 \membersection{wxWindow::GetTitle}\label{wxwindowgettitle}
615
616 \func{virtual wxString}{GetTitle}{\void}
617
618 Gets the window's title. Applicable only to frames and dialogs.
619
620 \wxheading{See also}
621
622 \helpref{wxWindow::SetTitle}{wxwindowsettitle}
623
624 \membersection{wxWindow::GetUpdateRegion}\label{wxwindowgetupdateregion}
625
626 \constfunc{virtual wxRegion}{GetUpdateRegion}{\void}
627
628 Returns the region specifying which parts of the window have been damaged. Should
629 only be called within an \helpref{OnPaint}{wxwindowonpaint} event handler.
630
631 \wxheading{See also}
632
633 \helpref{wxRegion}{wxregion}, \helpref{wxRegionIterator}{wxregioniterator}, \helpref{wxWindow::OnPaint}{wxwindowonpaint}
634
635 \membersection{wxWindow::GetWindowStyleFlag}
636
637 \constfunc{long}{GetWindowStyleFlag}{\void}
638
639 Gets the window style that was passed to the consructor or {\bf Create} member.
640
641 \membersection{wxWindow::InitDialog}\label{wxwindowinitdialog}
642
643 \func{void}{InitDialog}{\void}
644
645 Sends an \helpref{wxWindow::OnInitDialog}{wxwindowoninitdialog} event, which
646 in turn transfers data to the dialog via validators.
647
648 \wxheading{See also}
649
650 \helpref{wxWindow::OnInitDialog}{wxwindowoninitdialog}
651
652 \membersection{wxWindow::IsEnabled}\label{wxwindowisenabled}
653
654 \constfunc{virtual bool}{IsEnabled}{\void}
655
656 Returns TRUE if the window is enabled for input, FALSE otherwise.
657
658 \wxheading{See also}
659
660 \helpref{wxWindow::Enable}{wxwindowenable}
661
662 \membersection{wxWindow::IsRetained}\label{wxwindowisretained}
663
664 \constfunc{virtual bool}{IsRetained}{\void}
665
666 Returns TRUE if the window is retained, FALSE otherwise.
667
668 \wxheading{Remarks}
669
670 Retained windows are only available on X platforms.
671
672 \membersection{wxWindow::IsShown}\label{wxwindowisshown}
673
674 \constfunc{virtual bool}{IsShown}{\void}
675
676 Returns TRUE if the window is shown, FALSE if it has been hidden.
677
678 \membersection{wxWindow::Layout}\label{wxwindowlayout}
679
680 \func{void}{Layout}{\void}
681
682 Invokes the constraint-based layout algorithm for this window. It is called
683 automatically by the default {\bf wxWindow::OnSize} member.
684
685 \membersection{wxWindow::LoadFromResource}\label{wxwindowloadfromresource}
686
687 \func{virtual bool}{LoadFromResource}{\param{wxWindow* }{parent},\rtfsp
688 \param{const wxString\& }{resourceName}, \param{const wxResourceTable* }{resourceTable = NULL}}
689
690 Loads a panel or dialog from a resource file.
691
692 \wxheading{Parameters}
693
694 \docparam{parent}{Parent window.}
695
696 \docparam{resourceName}{The name of the resource to load.}
697
698 \docparam{resourceTable}{The resource table to load it from. If this is NULL, the
699 default resource table will be used.}
700
701 \wxheading{Return value}
702
703 TRUE if the operation succeeded, otherwise FALSE.
704
705 \wxheading{Remarks}
706
707 TODO
708
709 \wxheading{See also}
710
711 TODO
712
713 \membersection{wxWindow::Lower}\label{wxwindowlower}
714
715 \func{void}{Lower}{\void}
716
717 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
718 or frame).
719
720 \membersection{wxWindow::MakeModal}\label{wxwindowmakemodal}
721
722 \func{virtual void}{MakeModal}{\param{const bool }{flag}}
723
724 Disables all other windows in the application so that
725 the user can only interact with this window.
726
727 \wxheading{Parameters}
728
729 \docparam{flag}{If TRUE, this call disables all other windows in the application so that
730 the user can only interact with this window. If FALSE, the effect is reversed.}
731
732 \membersection{wxWindow::Move}\label{wxwindowmove}
733
734 \func{void}{Move}{\param{int}{ x}, \param{int}{ y}}
735
736 \func{void}{Move}{\param{const wxPoint\&}{ pt}}
737
738 Moves the window to the given position.
739
740 \wxheading{Parameters}
741
742 \docparam{x}{Required x position.}
743
744 \docparam{y}{Required y position.}
745
746 \docparam{pt}{\helpref{wxPoint}{wxpoint} object representing the position.}
747
748 \wxheading{Remarks}
749
750 Implementations of SetSize can also implicitly implement the
751 wxWindow::Move function, which is defined in the base wxWindow class
752 as the call:
753
754 \begin{verbatim}
755 SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING);
756 \end{verbatim}
757
758 \wxheading{See also}
759
760 \helpref{wxWindow::SetSize}{wxwindowsetsize}
761
762 \membersection{wxWindow::OnActivate}\label{wxwindowonactivate}
763
764 \func{void}{OnActivate}{\param{wxActivateEvent\&}{ event}}
765
766 Called when a window is activated or deactivated.
767
768 \wxheading{Parameters}
769
770 \docparam{event}{Object containing activation information.}
771
772 \wxheading{Remarks}
773
774 If the window is being activated, \helpref{wxActivateEvent::GetActive}{wxactivateeventgetactive} returns TRUE,
775 otherwise it returns FALSE (it is being deactivated).
776
777 \wxheading{See also}
778
779 \helpref{wxActivateEvent}{wxactivateevent},\rtfsp
780 \helpref{Event handling overview}{eventhandlingoverview}
781
782 \membersection{wxWindow::OnChar}\label{wxwindowonchar}
783
784 \func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
785
786 Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
787
788 \wxheading{Parameters}
789
790 \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
791 details about this class.}
792
793 \wxheading{Remarks}
794
795 This member function is called in response to a keypress. To intercept this event,
796 use the EVT\_CHAR macro in an event table definition. Your {\bf OnChar} handler may call this
797 default function to achieve default keypress functionality.
798
799 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
800 values.
801
802 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
803 keypresses, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
804 \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
805
806 Most, but not all, windows allow keypresses to be intercepted.
807
808 \wxheading{See also}
809
810 \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp
811 \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
812 \helpref{Event handling overview}{eventhandlingoverview}
813
814 \membersection{wxWindow::OnCharHook}\label{wxwindowoncharhook}
815
816 \func{void}{OnCharHook}{\param{wxKeyEvent\&}{ event}}
817
818 This member is called to allow the window to intercept keyboard events
819 before they are processed by child windows.
820
821 \wxheading{Parameters}
822
823 \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
824 details about this class.}
825
826 \wxheading{Remarks}
827
828 This member function is called in response to a keypress, if the window is active. To intercept this event,
829 use the EVT\_CHAR\_HOOK macro in an event table definition. If you do not process a particular
830 keypress, call \helpref{wxEvent::Skip}{wxeventskip} to allow default processing.
831
832 An example of using this function is in the implementation of escape-character processing for wxDialog,
833 where pressing ESC dismisses the dialog by {\bf OnCharHook} 'forging' a cancel button press event.
834
835 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
836 values.
837
838 This function is only relevant to top-level windows (frames and dialogs), and under
839 Windows only.
840
841 \wxheading{See also}
842
843 \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
844 \helpref{wxApp::OnCharHook}{wxapponcharhook},\rtfsp
845 \helpref{Event handling overview}{eventhandlingoverview}
846
847 \membersection{wxWindow::OnCommand}\label{wxwindowoncommand}
848
849 \func{virtual void}{OnCommand}{\param{wxEvtHandler\& }{object}, \param{wxCommandEvent\& }{event}}
850
851 This virtual member function is called if the control does not handle the command event.
852
853 \wxheading{Parameters}
854
855 \docparam{object}{Object receiving the command event.}
856
857 \docparam{event}{Command event}
858
859 \wxheading{Remarks}
860
861 This virtual function is provided mainly for backward compatibility. You can also intercept commands
862 from child controls by using an event table, with identifiers or identifier ranges to identify
863 the control(s) in question.
864
865 \wxheading{See also}
866
867 \helpref{wxCommandEvent}{wxcommandevent},\rtfsp
868 \helpref{Event handling overview}{eventhandlingoverview}
869
870 \membersection{wxWindow::OnClose}\label{wxwindowonclose}
871
872 \func{virtual bool}{OnClose}{\void}
873
874 Called when the user has tried to close a a frame
875 or dialog box using the window manager (X) or system menu (Windows).
876
877 {\bf Note:} This is an obsolete function.
878 It is superceded by the \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow} event
879 handler.
880
881 \wxheading{Return value}
882
883 If TRUE is returned by OnClose, the window will be deleted by the system, otherwise the
884 attempt will be ignored. Do not delete the window from within this handler, although
885 you may delete other windows.
886
887 \wxheading{See also}
888
889 \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
890 \helpref{wxWindow::Close}{wxwindowclose},\rtfsp
891 \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow},\rtfsp
892 \helpref{wxCloseEvent}{wxcloseevent}
893
894 \membersection{wxWindow::OnCloseWindow}\label{wxwindowonclosewindow}
895
896 \func{void}{OnCloseWindow}{\param{wxCloseEvent\& }{event}}
897
898 This is an event handler function called when the user has tried to close a a frame
899 or dialog box using the window manager (X) or system menu (Windows). It is
900 called via the \helpref{wxWindow::Close}{wxwindowclose} function, so
901 that the application can also invoke the handler programmatically.
902
903 Use the EVT\_CLOSE event table macro to handle close events.
904
905 You should check whether the application is forcing the deletion of the window
906 using \helpref{wxCloseEvent::GetForce}{wxcloseeventgetforce}. If this is TRUE,
907 destroy the window using \helpref{wxWindow::Destroy}{wxwindowdestroy}.
908 If not, it is up to you whether you respond by destroying the window.
909
910 (Note: GetForce is now superceded by CanVeto. So to test whether forced destruction of
911 the window is required, test for the negative of CanVeto. If CanVeto returns FALSE,
912 it is not possible to skip window deletion.)
913
914 If you don't destroy the window, you should call \helpref{wxCloseEvent::Veto}{wxcloseeventveto} to
915 let the calling code know that you did not destroy the window. This allows the \helpref{wxWindow::Close}{wxwindowclose} function
916 to return TRUE or FALSE depending on whether the close instruction was honoured or not.
917
918 \wxheading{Remarks}
919
920 The \helpref{wxWindow::OnClose}{wxwindowonclose} virtual function remains
921 for backward compatibility with earlier versions of wxWindows. The
922 default {\bf OnCloseWindow} handler for wxFrame and wxDialog will call {\bf OnClose},
923 destroying the window if it returns TRUE or if the close is being forced.
924
925 \wxheading{See also}
926
927 \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
928 \helpref{wxWindow::Close}{wxwindowclose},\rtfsp
929 \helpref{wxWindow::OnClose}{wxwindowonclose},\rtfsp
930 \helpref{wxWindow::Destroy}{wxwindowdestroy},\rtfsp
931 \helpref{wxCloseEvent}{wxcloseevent},\rtfsp
932 \helpref{wxApp::OnQueryEndSession}{wxapponqueryendsession},\rtfsp
933 \helpref{wxApp::OnEndSession}{wxapponendsession}
934
935 \membersection{wxWindow::OnDropFiles}\label{wxwindowondropfiles}
936
937 \func{void}{OnDropFiles}{\param{wxDropFilesEvent\&}{ event}}
938
939 Called when files have been dragged from the file manager to the window.
940
941 \wxheading{Parameters}
942
943 \docparam{event}{Drop files event. For more information, see \helpref{wxDropFilesEvent}{wxdropfilesevent}.}
944
945 \wxheading{Remarks}
946
947 The window must have previously been enabled for dropping by calling
948 \rtfsp\helpref{wxWindow::DragAcceptFiles}{wxwindowdragacceptfiles}.
949
950 This event is only generated under Windows.
951
952 To intercept this event, use the EVT\_DROP\_FILES macro in an event table definition.
953
954 \wxheading{See also}
955
956 \helpref{wxDropFilesEvent}{wxdropfilesevent}, \helpref{wxWindow::DragAcceptFiles}{wxwindowdragacceptfiles},\rtfsp
957 \helpref{Event handling overview}{eventhandlingoverview}
958
959 \membersection{wxWindow::OnEraseBackground}\label{wxwindowonerasebackground}
960
961 \func{void}{OnEraseBackground}{\param{wxEraseEvent\&}{ event}}
962
963 Called when the background of the window needs to be erased.
964
965 \wxheading{Parameters}
966
967 \docparam{event}{Erase background event. For more information, see \helpref{wxEraseEvent}{wxeraseevent}.}
968
969 \wxheading{Remarks}
970
971 This event is only generated under Windows.
972
973 To intercept this event, use the EVT\_ERASE\_BACKGROUND macro in an event table definition.
974
975 \wxheading{See also}
976
977 \helpref{wxEraseEvent}{wxeraseevent}, \helpref{Event handling overview}{eventhandlingoverview}
978
979 \membersection{wxWindow::OnKeyDown}\label{wxwindowonkeydown}
980
981 \func{void}{OnKeyDown}{\param{wxKeyEvent\&}{ event}}
982
983 Called when the user has pressed a key, before it is translated into an ASCII value using other
984 modifier keys that might be pressed at the same time.
985
986 \wxheading{Parameters}
987
988 \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
989 details about this class.}
990
991 \wxheading{Remarks}
992
993 This member function is called in response to a key down event. To intercept this event,
994 use the EVT\_KEY\_DOWN macro in an event table definition. Your {\bf OnKeyDown} handler may call this
995 default function to achieve default keypress functionality.
996
997 Note that not all keypresses can be intercepted this way. If you wish to intercept special
998 keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
999 \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
1000
1001 Most, but not all, windows allow keypresses to be intercepted.
1002
1003 \wxheading{See also}
1004
1005 \helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp
1006 \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
1007 \helpref{Event handling overview}{eventhandlingoverview}
1008
1009 \membersection{wxWindow::OnKeyUp}\label{wxwindowonkeyup}
1010
1011 \func{void}{OnKeyUp}{\param{wxKeyEvent\&}{ event}}
1012
1013 Called when the user has released a key.
1014
1015 \wxheading{Parameters}
1016
1017 \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
1018 details about this class.}
1019
1020 \wxheading{Remarks}
1021
1022 This member function is called in response to a key up event. To intercept this event,
1023 use the EVT\_KEY\_UP macro in an event table definition. Your {\bf OnKeyUp} handler may call this
1024 default function to achieve default keypress functionality.
1025
1026 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1027 keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
1028 \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
1029
1030 Most, but not all, windows allow key up events to be intercepted.
1031
1032 \wxheading{See also}
1033
1034 \helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},\rtfsp
1035 \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
1036 \helpref{Event handling overview}{eventhandlingoverview}
1037
1038 \membersection{wxWindow::OnKillFocus}\label{wxwindowonkillfocus}
1039
1040 \func{void}{OnKillFocus}{\param{wxFocusEvent\& }{event}}
1041
1042 Called when a window's focus is being killed.
1043
1044 \wxheading{Parameters}
1045
1046 \docparam{event}{The focus event. For more information, see \helpref{wxFocusEvent}{wxfocusevent}.}
1047
1048 \wxheading{Remarks}
1049
1050 To intercept this event, use the macro EVT\_KILL\_FOCUS in an event table definition.
1051
1052 Most, but not all, windows respond to this event.
1053
1054 \wxheading{See also}
1055
1056 \helpref{wxFocusEvent}{wxfocusevent}, \helpref{wxWindow::OnSetFocus}{wxwindowonsetfocus},\rtfsp
1057 \helpref{Event handling overview}{eventhandlingoverview}
1058
1059 \membersection{wxWindow::OnIdle}\label{wxwindowonidle}
1060
1061 \func{void}{OnIdle}{\param{wxIdleEvent\& }{event}}
1062
1063 Provide this member function for any processing which needs to be done
1064 when the application is idle.
1065
1066 \wxheading{See also}
1067
1068 \helpref{wxApp::OnIdle}{wxapponidle}, \helpref{wxIdleEvent}{wxidleevent}
1069
1070 \membersection{wxWindow::OnInitDialog}\label{wxwindowoninitdialog}
1071
1072 \func{void}{OnInitDialog}{\param{wxInitDialogEvent\&}{ event}}
1073
1074 Default handler for the wxEVT\_INIT\_DIALOG event. Calls \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow}.
1075
1076 \wxheading{Parameters}
1077
1078 \docparam{event}{Dialog initialisation event.}
1079
1080 \wxheading{Remarks}
1081
1082 Gives the window the default behaviour of transferring data to child controls via
1083 the validator that each control has.
1084
1085 \wxheading{See also}
1086
1087 \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow}
1088
1089 \membersection{wxWindow::OnMenuCommand}\label{wxwindowonmenucommand}
1090
1091 \func{void}{OnMenuCommand}{\param{wxCommandEvent\& }{event}}
1092
1093 Called when a menu command is received from a menu bar.
1094
1095 \wxheading{Parameters}
1096
1097 \docparam{event}{The menu command event. For more information, see \helpref{wxCommandEvent}{wxcommandevent}.}
1098
1099 \wxheading{Remarks}
1100
1101 A function with this name doesn't actually exist; you can choose any member function to receive
1102 menu command events, using the EVT\_COMMAND macro for individual commands or EVT\_COMMAND\_RANGE for
1103 a range of commands.
1104
1105 \wxheading{See also}
1106
1107 \helpref{wxCommandEvent}{wxcommandevent},\rtfsp
1108 \helpref{wxWindow::OnMenuHighlight}{wxwindowonmenuhighlight},\rtfsp
1109 \helpref{Event handling overview}{eventhandlingoverview}
1110
1111 \membersection{wxWindow::OnMenuHighlight}\label{wxwindowonmenuhighlight}
1112
1113 \func{void}{OnMenuHighlight}{\param{wxMenuEvent\& }{event}}
1114
1115 Called when a menu select is received from a menu bar: that is, the
1116 mouse cursor is over a menu item, but the left mouse button has not been
1117 pressed.
1118
1119 \wxheading{Parameters}
1120
1121 \docparam{event}{The menu highlight event. For more information, see \helpref{wxMenuEvent}{wxmenuevent}.}
1122
1123 \wxheading{Remarks}
1124
1125 You can choose any member function to receive
1126 menu select events, using the EVT\_MENU\_HIGHLIGHT macro for individual menu items or EVT\_MENU\_HIGHLIGHT\_ALL macro
1127 for all menu items.
1128
1129 The default implementation for \helpref{wxFrame::OnMenuHighlight}{wxframeonmenuhighlight} displays help
1130 text in the first field of the status bar.
1131
1132 This function was known as {\bf OnMenuSelect} in earlier versions of wxWindows, but this was confusing
1133 since a selection is normally a left-click action.
1134
1135 \wxheading{See also}
1136
1137 \helpref{wxMenuEvent}{wxmenuevent},\rtfsp
1138 \helpref{wxWindow::OnMenuCommand}{wxwindowonmenucommand},\rtfsp
1139 \helpref{Event handling overview}{eventhandlingoverview}
1140
1141
1142 \membersection{wxWindow::OnMouseEvent}\label{wxwindowonmouseevent}
1143
1144 \func{void}{OnMouseEvent}{\param{wxMouseEvent\&}{ event}}
1145
1146 Called when the user has initiated an event with the
1147 mouse.
1148
1149 \wxheading{Parameters}
1150
1151 \docparam{event}{The mouse event. See \helpref{wxMouseEvent}{wxmouseevent} for
1152 more details.}
1153
1154 \wxheading{Remarks}
1155
1156 Most, but not all, windows respond to this event.
1157
1158 To intercept this event, use the EVT\_MOUSE\_EVENTS macro in an event table definition, or individual
1159 mouse event macros such as EVT\_LEFT\_DOWN.
1160
1161 \wxheading{See also}
1162
1163 \helpref{wxMouseEvent}{wxmouseevent},\rtfsp
1164 \helpref{Event handling overview}{eventhandlingoverview}
1165
1166 \membersection{wxWindow::OnMove}\label{wxwindowonmove}
1167
1168 \func{void}{OnMove}{\param{wxMoveEvent\& }{event}}
1169
1170 Called when a window is moved.
1171
1172 \wxheading{Parameters}
1173
1174 \docparam{event}{The move event. For more information, see \helpref{wxMoveEvent}{wxmoveevent}.}
1175
1176 \wxheading{Remarks}
1177
1178 Use the EVT\_MOVE macro to intercept move events.
1179
1180 \wxheading{Remarks}
1181
1182 Not currently implemented.
1183
1184 \wxheading{See also}
1185
1186 \helpref{wxMoveEvent}{wxmoveevent},\rtfsp
1187 \helpref{wxFrame::OnSize}{wxframeonsize},\rtfsp
1188 \helpref{Event handling overview}{eventhandlingoverview}
1189
1190 \membersection{wxWindow::OnPaint}\label{wxwindowonpaint}
1191
1192 \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}}
1193
1194 Sent to the event handler when the window must be refreshed.
1195
1196 \wxheading{Parameters}
1197
1198 \docparam{event}{Paint event. For more information, see \helpref{wxPaintEvent}{wxpaintevent}.}
1199
1200 \wxheading{Remarks}
1201
1202 Use the EVT\_PAINT macro in an event table definition to intercept paint events.
1203
1204 In a paint event handler, the application should always create a \helpref{wxPaintDC}{wxpaintdc} object.
1205
1206 For example:
1207
1208 \small{%
1209 \begin{verbatim}
1210 void MyWindow::OnPaint(wxPaintEvent& event)
1211 {
1212 wxPaintDC dc(this);
1213
1214 DrawMyDocument(dc);
1215 }
1216 \end{verbatim}
1217 }%
1218
1219 You can optimize painting by retrieving the rectangles
1220 that have been damaged and only repainting these. The rectangles are in
1221 terms of the client area, and are unscrolled, so you will need to do
1222 some calculations using the current view position to obtain logical,
1223 scrolled units.
1224
1225 Here is an example of using the \helpref{wxRegionIterator}{wxregioniterator} class:
1226
1227 {\small%
1228 \begin{verbatim}
1229 // Called when window needs to be repainted.
1230 void MyWindow::OnPaint(wxPaintEvent& event)
1231 {
1232 wxPaintDC dc(this);
1233
1234 // Find Out where the window is scrolled to
1235 int vbX,vbY; // Top left corner of client
1236 ViewStart(&vbX,&vbY);
1237
1238 int vX,vY,vW,vH; // Dimensions of client area in pixels
1239 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1240
1241 while (upd)
1242 {
1243 vX = upd.GetX();
1244 vY = upd.GetY();
1245 vW = upd.GetW();
1246 vH = upd.GetH();
1247
1248 // Alternatively we can do this:
1249 // wxRect rect;
1250 // upd.GetRect(&rect);
1251
1252 // Repaint this rectangle
1253 ...some code...
1254
1255 upd ++ ;
1256 }
1257 }
1258 \end{verbatim}
1259 }%
1260
1261 \wxheading{See also}
1262
1263 \helpref{wxPaintEvent}{wxpaintevent},\rtfsp
1264 \helpref{wxPaintDC}{wxpaintdc},\rtfsp
1265 \helpref{Event handling overview}{eventhandlingoverview}
1266
1267 \membersection{wxWindow::OnScroll}\label{wxwindowonscroll}
1268
1269 \func{void}{OnScroll}{\param{wxScrollEvent\& }{event}}
1270
1271 Called when a scroll event is received from one of the window's built-in scrollbars.
1272
1273 \wxheading{Parameters}
1274
1275 \docparam{event}{Command event. Retrieve the new scroll position by
1276 calling \helpref{wxScrollEvent::GetPosition}{wxscrolleventgetposition}, and the
1277 scrollbar orientation by calling \helpref{wxScrollEvent::GetOrientation}{wxscrolleventgetorientation}.}
1278
1279 \wxheading{Remarks}
1280
1281 Note that it is not possible to distinguish between horizontal and vertical scrollbars
1282 until the function is executing (you can't have one function for vertical, another
1283 for horizontal events).
1284
1285 \wxheading{See also}
1286
1287 \helpref{wxScrollEvent}{wxscrollevent},\rtfsp
1288 \helpref{Event handling overview}{eventhandlingoverview}
1289
1290 \membersection{wxWindow::OnSetFocus}\label{wxwindowonsetfocus}
1291
1292 \func{void}{OnSetFocus}{\param{wxFocusEvent\& }{event}}
1293
1294 Called when a window's focus is being set.
1295
1296 \wxheading{Parameters}
1297
1298 \docparam{event}{The focus event. For more information, see \helpref{wxFocusEvent}{wxfocusevent}.}
1299
1300 \wxheading{Remarks}
1301
1302 To intercept this event, use the macro EVT\_SET\_FOCUS in an event table definition.
1303
1304 Most, but not all, windows respond to this event.
1305
1306 \wxheading{See also}
1307
1308 \helpref{wxFocusEvent}{wxfocusevent}, \helpref{wxWindow::OnKillFocus}{wxwindowonkillfocus},\rtfsp
1309 \helpref{Event handling overview}{eventhandlingoverview}
1310
1311 \membersection{wxWindow::OnSize}\label{wxwindowonsize}
1312
1313 \func{void}{OnSize}{\param{wxSizeEvent\& }{event}}
1314
1315 Called when the window has been resized.
1316
1317 \wxheading{Parameters}
1318
1319 \docparam{event}{Size event. For more information, see \helpref{wxSizeEvent}{wxsizeevent}.}
1320
1321 \wxheading{Remarks}
1322
1323 You may wish to use this for frames to resize their child windows as appropriate.
1324
1325 Note that the size passed is of
1326 the whole window: call \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize} for the area which may be
1327 used by the application.
1328
1329 \wxheading{See also}
1330
1331 \helpref{wxSizeEvent}{wxsizeevent},\rtfsp
1332 \helpref{Event handling overview}{eventhandlingoverview}
1333
1334 \membersection{wxWindow::OnSysColourChanged}\label{wxwindowonsyscolourchanged}
1335
1336 \func{void}{OnSysColourChanged}{\param{wxOnSysColourChangedEvent\& }{event}}
1337
1338 Called when the user has changed the system colours.
1339
1340 \wxheading{Parameters}
1341
1342 \docparam{event}{System colour change event. For more information, see \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent}.}
1343
1344 \wxheading{See also}
1345
1346 \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent},\rtfsp
1347 \helpref{Event handling overview}{eventhandlingoverview}
1348
1349 \membersection{wxWindow::PopEventHandler}\label{wxwindowpopeventhandler}
1350
1351 \constfunc{wxEvtHandler*}{PopEventHandler}{\param{bool }{deleteHandler = FALSE}}
1352
1353 Removes and returns the top-most event handler on the event handler stack.
1354
1355 \wxheading{Parameters}
1356
1357 \docparam{deleteHandler}{If this is TRUE, the handler will be deleted after it is removed. The
1358 default value is FALSE.}
1359
1360 \wxheading{See also}
1361
1362 \helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp
1363 \helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp
1364 \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp
1365 \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
1366 \helpref{wxEvtHandler}{wxevthandler}\rtfsp
1367
1368 \membersection{wxWindow::PopupMenu}\label{wxwindowpopupmenu}
1369
1370 \func{virtual bool}{PopupMenu}{\param{wxMenu* }{menu}, \param{int }{x}, \param{int }{y}}
1371
1372 Pops up the given menu at the specified coordinates, relative to this
1373 window, and returns control when the user has dismissed the menu. If a
1374 menu item is selected, the callback defined for the menu is called with
1375 wxMenu and wxCommandEvent reference arguments. The callback should access
1376 the commandInt member of the event to check the selected menu identifier.
1377
1378 \wxheading{Parameters}
1379
1380 \docparam{menu}{Menu to pop up.}
1381
1382 \docparam{x}{Required x position for the menu to appear.}
1383
1384 \docparam{y}{Required y position for the menu to appear.}
1385
1386 \wxheading{See also}
1387
1388 \helpref{wxMenu}{wxmenu}
1389
1390 \wxheading{Remarks}
1391
1392 Just before the menu is popped up, \helpref{wxMenu::UpdateUI}{wxmenuupdateui} is called
1393 to ensure that the menu items are in the correct state.
1394
1395 \membersection{wxWindow::PushEventHandler}\label{wxwindowpusheventhandler}
1396
1397 \func{void}{PushEventHandler}{\param{wxEvtHandler* }{handler}}
1398
1399 Pushes this event handler onto the event stack for the window.
1400
1401 \wxheading{Parameters}
1402
1403 \docparam{handler}{Specifies the handler to be pushed.}
1404
1405 \wxheading{Remarks}
1406
1407 An event handler is an object that is capable of processing the events
1408 sent to a window. By default, the window is its own event handler, but
1409 an application may wish to substitute another, for example to allow
1410 central implementation of event-handling for a variety of different
1411 window classes.
1412
1413 \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler} allows
1414 an application to set up a chain of event handlers, where an event not handled by one event handler is
1415 handed to the next one in the chain. Use \helpref{wxWindow::PopEventHandler}{wxwindowpopeventhandler} to
1416 remove the event handler.
1417
1418 \wxheading{See also}
1419
1420 \helpref{wxWindow::SetEventHandler}{wxwindowseteventhandler},\rtfsp
1421 \helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp
1422 \helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp
1423 \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
1424 \helpref{wxEvtHandler}{wxevthandler}
1425
1426 \membersection{wxWindow::Raise}\label{wxwindowraise}
1427
1428 \func{void}{Raise}{\void}
1429
1430 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1431 or frame).
1432
1433 \membersection{wxWindow::Refresh}\label{wxwindowrefresh}
1434
1435 \func{virtual void}{Refresh}{\param{const bool}{ eraseBackground = TRUE}, \param{const wxRect* }{rect
1436 = NULL}}
1437
1438 Causes a message or event to be generated to repaint the
1439 window.
1440
1441 \wxheading{Parameters}
1442
1443 \docparam{eraseBackground}{If TRUE, the background will be
1444 erased.}
1445
1446 \docparam{rect}{If non-NULL, only the given rectangle will
1447 be treated as damaged.}
1448
1449 \membersection{wxWindow::ReleaseMouse}\label{wxwindowreleasemouse}
1450
1451 \func{virtual void}{ReleaseMouse}{\void}
1452
1453 Releases mouse input captured with \helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse}.
1454
1455 \wxheading{See also}
1456
1457 \helpref{wxWindow::CaptureMouse}{wxwindowcapturemouse}
1458
1459 \membersection{wxWindow::RemoveChild}\label{wxwindowremovechild}
1460
1461 \func{virtual void}{RemoveChild}{\param{wxWindow* }{child}}
1462
1463 Removes a child window. This is called automatically by window deletion
1464 functions so should not be required by the application programmer.
1465
1466 \wxheading{Parameters}
1467
1468 \docparam{child}{Child window to remove.}
1469
1470 \membersection{wxWindow::ScreenToClient}\label{wxwindowscreentoclient}
1471
1472 \constfunc{virtual void}{ScreenToClient}{\param{int* }{x}, \param{int* }{y}}
1473
1474 \constfunc{virtual wxPoint}{ScreenToClient}{\param{const wxPoint\& }{pt}}
1475
1476 Converts from screen to client window coordinates.
1477
1478 \wxheading{Parameters}
1479
1480 \docparam{x}{Stores the screen x coordinate and receives the client x coordinate.}
1481
1482 \docparam{y}{Stores the screen x coordinate and receives the client x coordinate.}
1483
1484 \docparam{pt}{The screen position for the second form of the function.}
1485
1486 \membersection{wxWindow::ScrollWindow}\label{wxwindowscrollwindow}
1487
1488 \func{virtual void}{ScrollWindow}{\param{int }{dx}, \param{int }{dy}, \param{const wxRect*}{ rect = NULL}}
1489
1490 Physically scrolls the pixels in the window.
1491
1492 \wxheading{Parameters}
1493
1494 \docparam{dx}{Amount to scroll horizontally.}
1495
1496 \docparam{dy}{Amount to scroll vertically.}
1497
1498 \docparam{rect}{Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
1499 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
1500 can optimise painting by checking for the invalidated region.}
1501
1502 \wxheading{Remarks}
1503
1504 Available only under Windows.
1505
1506 Use this function to optimise your scrolling implementations, to minimise the area that must be
1507 redrawn.
1508
1509 \membersection{wxWindow::SetAcceleratorTable}\label{wxwindowsetacceleratortable}
1510
1511 \func{virtual void}{SetAcceleratorTable}{\param{const wxAcceleratorTable\&}{ accel}}
1512
1513 Sets the accelerator table for this window. See \helpref{wxAcceleratorTable}{wxacceleratortable}.
1514
1515 \membersection{wxWindow::SetAutoLayout}\label{wxwindowsetautolayout}
1516
1517 \func{void}{SetAutoLayout}{\param{const bool}{ autoLayout}}
1518
1519 Determines whether the \helpref{wxWindow::Layout}{wxwindowlayout} function will
1520 be called automatically when the window is resized.
1521
1522 \wxheading{Parameters}
1523
1524 \docparam{autoLayout}{Set this to TRUE if you wish the Layout function to be called
1525 from within wxWindow::OnSize functions.}
1526
1527 \wxheading{See also}
1528
1529 \helpref{wxWindow::SetConstraints}{wxwindowsetconstraints}
1530
1531 \membersection{wxWindow::SetBackgroundColour}\label{wxwindowsetbackgroundcolour}
1532
1533 \func{virtual void}{SetBackgroundColour}{\param{const wxColour\& }{colour}}
1534
1535 Sets the background colour of the window.
1536
1537 \wxheading{Parameters}
1538
1539 \docparam{colour}{The colour to be used as the background colour.}
1540
1541 \wxheading{Remarks}
1542
1543 The background colour is usually painted by the default\rtfsp
1544 \helpref{wxWindow::OnEraseBackground}{wxwindowonerasebackground} event handler function.
1545
1546 \wxheading{See also}
1547
1548 \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour},\rtfsp
1549 \helpref{wxWindow::SetForegroundColour}{wxwindowsetforegroundcolour},\rtfsp
1550 \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
1551 \helpref{wxWindow::OnEraseBackground}{wxwindowonerasebackground}
1552
1553 \membersection{wxWindow::SetConstraints}\label{wxwindowsetconstraints}
1554
1555 \func{void}{SetConstraints}{\param{wxLayoutConstraints* }{constraints}}
1556
1557 Sets the window to have the given layout constraints. The window
1558 will then own the object, and will take care of its deletion.
1559 If an existing layout constraints object is already owned by the
1560 window, it will be deleted.
1561
1562 \wxheading{Parameters}
1563
1564 \docparam{constraints}{The constraints to set. Pass NULL to disassociate and delete the window's
1565 constraints.}
1566
1567 \wxheading{Remarks}
1568
1569 You must call \helpref{wxWindow::SetAutoLayout}{wxwindowsetautolayout} to tell a window to use
1570 the constraints automatically in OnSize; otherwise, you must
1571 override OnSize and call Layout explicitly.
1572
1573 \membersection{wxWindow::SetDropTarget}\label{wxwindowsetdroptarget}
1574
1575 \func{void}{SetDropTarget}{\param{wxDropTarget*}{ target}}
1576
1577 Associates a drop target with this window.
1578
1579 If the window already has a drop target, it is deleted.
1580
1581 \wxheading{See also}
1582
1583 \helpref{wxWindow::GetDropTarget}{wxwindowgetdroptarget},
1584 \helpref{Drag and drop overview}{wxdndoverview}
1585
1586 \membersection{wxWindow::SetFocus}\label{wxwindowsetfocus}
1587
1588 \func{virtual void}{SetFocus}{\void}
1589
1590 This sets the window to receive keyboard input.
1591
1592 \membersection{wxWindow::SetFont}\label{wxwindowsetfont}
1593
1594 \func{void}{SetFont}{\param{const wxFont\& }{font}}
1595
1596 Sets the font for this window.
1597
1598 \wxheading{Parameters}
1599
1600 \docparam{font}{Font to associate with this window.}
1601
1602 \wxheading{See also}
1603
1604 \helpref{wxWindow::GetFont}{wxwindowgetfont}
1605
1606 \membersection{wxWindow::SetForegroundColour}\label{wxwindowsetforegroundcolour}
1607
1608 \func{virtual void}{SetForegroundColour}{\param{const wxColour\& }{colour}}
1609
1610 Sets the foreground colour of the window.
1611
1612 \wxheading{Parameters}
1613
1614 \docparam{colour}{The colour to be used as the foreground colour.}
1615
1616 \wxheading{Remarks}
1617
1618 The interpretation of foreground colour is open to interpretation according
1619 to the window class; it may be the text colour or other colour, or it may not
1620 be used at all.
1621
1622 \wxheading{See also}
1623
1624 \helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour},\rtfsp
1625 \helpref{wxWindow::SetBackgroundColour}{wxwindowsetbackgroundcolour},\rtfsp
1626 \helpref{wxWindow::GetBackgroundColour}{wxwindowgetbackgroundcolour}
1627
1628 \membersection{wxWindow::SetId}\label{wxwindowsetid}
1629
1630 \func{void}{SetId}{\param{int}{ id}}
1631
1632 Sets the identifier of the window.
1633
1634 \wxheading{Remarks}
1635
1636 Each window has an integer identifier. If the application has not provided one,
1637 an identifier will be generated. Normally, the identifier should be provided
1638 on creation and should not be modified subsequently.
1639
1640 TODO: perhaps there should be a default identifier for each class, rather
1641 choosing one, which could clash with other ones.
1642
1643 \wxheading{See also}
1644
1645 \helpref{wxWindow::GetId}{wxwindowgetid}
1646
1647
1648 \membersection{wxWindow::SetName}\label{wxwindowsetname}
1649
1650 \func{virtual void}{SetName}{\param{const wxString\& }{name}}
1651
1652 Sets the window's name.
1653
1654 \wxheading{Parameters}
1655
1656 \docparam{name}{A name to set for the window.}
1657
1658 \wxheading{See also}
1659
1660 \helpref{wxWindow::GetName}{wxwindowgetname}
1661
1662 \membersection{wxWindow::SetReturnCode}\label{wxwindowsetreturncode}
1663
1664 \func{void}{SetReturnCode}{\param{int }{retCode}}
1665
1666 Sets the return code for this window.
1667
1668 \wxheading{Parameters}
1669
1670 \docparam{retCode}{The integer return code, usually a control identifier.}
1671
1672 \wxheading{Remarks}
1673
1674 A return code is normally associated with a modal dialog, where \helpref{wxDialog::ShowModal}{wxdialogshowmodal} returns
1675 a code to the application. The function \helpref{wxDialog::EndModal}{wxdialogendmodal} calls {\bf SetReturnCode}.
1676
1677 \wxheading{See also}
1678
1679 \helpref{wxWindow::GetReturnCode}{wxwindowgetreturncode}, \helpref{wxDialog::ShowModal}{wxdialogshowmodal},\rtfsp
1680 \helpref{wxDialog::EndModal}{wxdialogendmodal}
1681
1682 \membersection{wxWindow::SetScrollbar}\label{wxwindowsetscrollbar}
1683
1684 \func{virtual void}{SetScrollbar}{\param{int }{orientation}, \param{int }{position},\rtfsp
1685 \param{int }{thumbSize}, \param{int }{range},\rtfsp
1686 \param{const bool }{refresh = TRUE}}
1687
1688 Sets the scrollbar properties of a built-in scrollbar.
1689
1690 \wxheading{Parameters}
1691
1692 \docparam{orientation}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.}
1693
1694 \docparam{position}{The position of the scrollbar in scroll units.}
1695
1696 \docparam{thumbSize}{The size of the thumb, or visible portion of the scrollbar, in scroll units.}
1697
1698 \docparam{range}{The maximum position of the scrollbar.}
1699
1700 \docparam{refresh}{TRUE to redraw the scrollbar, FALSE otherwise.}
1701
1702 \wxheading{Remarks}
1703
1704 Let's say you wish to display 50 lines of text, using the same font.
1705 The window is sized so that you can only see 16 lines at a time.
1706
1707 You would use:
1708
1709 {\small%
1710 \begin{verbatim}
1711 SetScrollbar(wxVERTICAL, 0, 16, 50);
1712 \end{verbatim}
1713 }
1714
1715 Note that with the window at this size, the thumb position can never go
1716 above 50 minus 16, or 34.
1717
1718 You can determine how many lines are currently visible by dividing the current view
1719 size by the character height in pixels.
1720
1721 When defining your own scrollbar behaviour, you will always need to recalculate
1722 the scrollbar settings when the window size changes. You could therefore put your
1723 scrollbar calculations and SetScrollbar
1724 call into a function named AdjustScrollbars, which can be called initially and also
1725 from your \helpref{wxWindow::OnSize}{wxwindowonsize} event handler function.
1726
1727 \wxheading{See also}
1728
1729 \helpref{Scrolling overview}{scrollingoverview},\rtfsp
1730 \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow}
1731
1732 \begin{comment}
1733 \membersection{wxWindow::SetScrollPage}\label{wxwindowsetscrollpage}
1734
1735 \func{virtual void}{SetScrollPage}{\param{int }{orientation}, \param{int }{pageSize}, \param{const bool }{refresh = TRUE}}
1736
1737 Sets the page size of one of the built-in scrollbars.
1738
1739 \wxheading{Parameters}
1740
1741 \docparam{orientation}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.}
1742
1743 \docparam{pageSize}{Page size in scroll units.}
1744
1745 \docparam{refresh}{TRUE to redraw the scrollbar, FALSE otherwise.}
1746
1747 \wxheading{Remarks}
1748
1749 The page size of a scrollbar is the number of scroll units that the scroll thumb travels when you
1750 click on the area above/left of or below/right of the thumb. Normally you will want a whole visible
1751 page to be scrolled, i.e. the size of the current view (perhaps the window client size). This
1752 value has to be adjusted when the window is resized, since the page size will have changed.
1753
1754 In addition to specifying how far the scroll thumb travels when paging, in Motif and some versions of Windows
1755 the thumb changes size to reflect the page size relative to the length of the document. When the
1756 document size is only slightly bigger than the current view (window) size, almost all of the scrollbar
1757 will be taken up by the thumb. When the two values become the same, the scrollbar will (on some systems)
1758 disappear.
1759
1760 Currently, this function should be called before SetPageRange, because of a quirk in the Windows
1761 handling of pages and ranges.
1762
1763 \wxheading{See also}
1764
1765 \helpref{wxWindow::SetScrollPos}{wxwindowsetscrollpos},\rtfsp
1766 \helpref{wxWindow::GetScrollPos}{wxwindowsetscrollpos},\rtfsp
1767 \helpref{wxWindow::GetScrollPage}{wxwindowsetscrollpage},\rtfsp
1768 \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow}
1769 \end{comment}
1770
1771 \membersection{wxWindow::SetScrollPos}\label{wxwindowsetscrollpos}
1772
1773 \func{virtual void}{SetScrollPos}{\param{int }{orientation}, \param{int }{pos}, \param{const bool }{refresh = TRUE}}
1774
1775 Sets the position of one of the built-in scrollbars.
1776
1777 \wxheading{Parameters}
1778
1779 \docparam{orientation}{Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.}
1780
1781 \docparam{pos}{Position in scroll units.}
1782
1783 \docparam{refresh}{TRUE to redraw the scrollbar, FALSE otherwise.}
1784
1785 \wxheading{Remarks}
1786
1787 This function does not directly affect the contents of the window: it is up to the
1788 application to take note of scrollbar attributes and redraw contents accordingly.
1789
1790 \wxheading{See also}
1791
1792 \helpref{wxWindow::SetScrollbar}{wxwindowsetscrollbar},\rtfsp
1793 \helpref{wxWindow::GetScrollPos}{wxwindowsetscrollpos},\rtfsp
1794 \helpref{wxWindow::GetScrollThumb}{wxwindowgetscrollthumb},\rtfsp
1795 \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow}
1796
1797 \begin{comment}
1798 \membersection{wxWindow::SetScrollRange}\label{wxwindowsetscrollrange}
1799
1800 \func{virtual void}{SetScrollRange}{\param{int }{orientation}, \param{int }{range}, \param{const bool }{refresh = TRUE}}
1801
1802 Sets the range of one of the built-in scrollbars.
1803
1804 \wxheading{Parameters}
1805
1806 \docparam{orientation}{Determines the scrollbar whose range is to be set. May be wxHORIZONTAL or wxVERTICAL.}
1807
1808 \docparam{range}{Scroll range.}
1809
1810 \docparam{refresh}{TRUE to redraw the scrollbar, FALSE otherwise.}
1811
1812 \wxheading{Remarks}
1813
1814 The range of a scrollbar is the number of steps that the thumb may travel, rather than the total
1815 object length of the scrollbar. If you are implementing a scrolling window, for example, you
1816 would adjust the scroll range when the window is resized, by subtracting the window view size from the
1817 total virtual window size. When the two sizes are the same (all the window is visible), the range goes to zero
1818 and usually the scrollbar will be automatically hidden.
1819
1820 \wxheading{See also}
1821
1822 \helpref{wxWindow::SetScrollPos}{wxwindowsetscrollpos},\rtfsp
1823 \helpref{wxWindow::SetScrollPage}{wxwindowsetscrollpage},\rtfsp
1824 \helpref{wxWindow::GetScrollPos}{wxwindowsetscrollpos},\rtfsp
1825 \helpref{wxWindow::GetScrollPage}{wxwindowsetscrollpage},\rtfsp
1826 \helpref{wxScrollBar}{wxscrollbar}, \helpref{wxScrolledWindow}{wxscrolledwindow}
1827 \end{comment}
1828
1829 \membersection{wxWindow::SetSize}\label{wxwindowsetsize}
1830
1831 \func{virtual void}{SetSize}{\param{int}{ x}, \param{int}{ y}, \param{int}{ width}, \param{int}{ height},
1832 \param{int}{ sizeFlags = wxSIZE\_AUTO}}
1833
1834 \func{virtual void}{SetSize}{\param{const wxRect\&}{ rect}}
1835
1836 Sets the size and position of the window in pixels.
1837
1838 \func{virtual void}{SetSize}{\param{int}{ width}, \param{int}{ height}}
1839
1840 \func{virtual void}{SetSize}{\param{const wxSize\&}{ size}}
1841
1842 Sets the size of the window in pixels.
1843
1844 \wxheading{Parameters}
1845
1846 \docparam{x}{Required x position in pixels, or -1 to indicate that the existing
1847 value should be used.}
1848
1849 \docparam{y}{Required y position in pixels, or -1 to indicate that the existing
1850 value should be used.}
1851
1852 \docparam{width}{Required width in pixels, or -1 to indicate that the existing
1853 value should be used.}
1854
1855 \docparam{height}{Required height position in pixels, or -1 to indicate that the existing
1856 value should be used.}
1857
1858 \docparam{size}{\helpref{wxSize}{wxsize} object for setting the size.}
1859
1860 \docparam{rect}{\helpref{wxRect}{wxrect} object for setting the position and size.}
1861
1862 \docparam{sizeFlags}{Indicates the interpretation of other parameters. It is a bit list of the following:
1863
1864 {\bf wxSIZE\_AUTO\_WIDTH}: a -1 width value is taken to indicate
1865 a wxWindows-supplied default width.\\
1866 {\bf wxSIZE\_AUTO\_HEIGHT}: a -1 height value is taken to indicate
1867 a wxWindows-supplied default width.\\
1868 {\bf wxSIZE\_AUTO}: -1 size values are taken to indicate
1869 a wxWindows-supplied default size.\\
1870 {\bf wxSIZE\_USE\_EXISTING}: existing dimensions should be used
1871 if -1 values are supplied.\\
1872 {\bf wxSIZE\_ALLOW\_MINUS\_ONE}: allow dimensions of -1 and less to be interpreted
1873 as real dimensions, not default values.
1874 }
1875
1876 \wxheading{Remarks}
1877
1878 The second form is a convenience for calling the first form with default
1879 x and y parameters, and must be used with non-default width and height values.
1880
1881 The first form sets the position and optionally size, of the window.
1882 Parameters may be -1 to indicate either that a default should be supplied
1883 by wxWindows, or that the current value of the dimension should be used.
1884
1885 \wxheading{See also}
1886
1887 \helpref{wxWindow::Move}{wxwindowmove}
1888
1889 \membersection{wxWindow::SetSizeHints}\label{wxwindowsetsizehints}
1890
1891 \func{virtual void}{SetSizeHints}{\param{int}{ minW=-1}, \param{int}{ minH=-1}, \param{int}{ maxW=-1}, \param{int}{ maxH=-1},
1892 \param{int}{ incW=-1}, \param{int}{ incH=-1}}
1893
1894 Allows specification of minimum and maximum window sizes, and window size increments.
1895 If a pair of values is not set (or set to -1), the default values will be used.
1896
1897 \wxheading{Parameters}
1898
1899 \docparam{minW}{Specifies the minimum width allowable.}
1900
1901 \docparam{minH}{Specifies the minimum height allowable.}
1902
1903 \docparam{maxW}{Specifies the maximum width allowable.}
1904
1905 \docparam{maxH}{Specifies the maximum height allowable.}
1906
1907 \docparam{incW}{Specifies the increment for sizing the width (Motif/Xt only).}
1908
1909 \docparam{incH}{Specifies the increment for sizing the height (Motif/Xt only).}
1910
1911 \wxheading{Remarks}
1912
1913 If this function is called, the user will not be able to size the window outside the
1914 given bounds.
1915
1916 The resizing increments are only significant under Motif or Xt.
1917
1918 \membersection{wxWindow::SetClientSize}
1919
1920 \func{virtual void}{SetClientSize}{\param{int}{ width}, \param{int}{ height}}
1921
1922 \func{virtual void}{SetClientSize}{\param{const wxSize\&}{ size}}
1923
1924 This sets the size of the window client area in pixels. Using this function to size a window
1925 tends to be more device-independent than \helpref{wxWindow::SetSize}{wxwindowsetsize}, since the application need not
1926 worry about what dimensions the border or title bar have when trying to fit the window
1927 around panel items, for example.
1928
1929 \wxheading{Parameters}
1930
1931 \docparam{width}{The required client area width.}
1932
1933 \docparam{height}{The required client area height.}
1934
1935 \docparam{size}{The required client size.}
1936
1937 \membersection{wxWindow::SetPalette}
1938
1939 \func{virtual void}{SetPalette}{\param{wxPalette* }{palette}}
1940
1941 Obsolete - use \helpref{wxDC::SetPalette}{wxdcsetpalette} instead.
1942
1943 \membersection{wxWindow::SetCursor}\label{wxwindowsetcursor}
1944
1945 \func{virtual void}{SetCursor}{\param{const wxCursor\&}{cursor}}
1946
1947 Sets the window's cursor.
1948
1949 \wxheading{Parameters}
1950
1951 \docparam{cursor}{Specifies the cursor that the window should normally display.}
1952
1953 \wxheading{Remarks}
1954
1955 Under Windows, you sometimes need to call ::wxSetCursor in addition to this
1956 function if you want the cursor to change immediately, because under Windows,
1957 wxWindows only sets the global cursor when it detects mouse movement.
1958
1959 \wxheading{See also}
1960
1961 \helpref{::wxSetCursor}{wxsetcursor}, \helpref{wxCursor}{wxcursor}
1962
1963 \membersection{wxWindow::SetEventHandler}\label{wxwindowseteventhandler}
1964
1965 \func{void}{SetEventHandler}{\param{wxEvtHandler* }{handler}}
1966
1967 Sets the event handler for this window.
1968
1969 \wxheading{Parameters}
1970
1971 \docparam{handler}{Specifies the handler to be set.}
1972
1973 \wxheading{Remarks}
1974
1975 An event handler is an object that is capable of processing the events
1976 sent to a window. By default, the window is its own event handler, but
1977 an application may wish to substitute another, for example to allow
1978 central implementation of event-handling for a variety of different
1979 window classes.
1980
1981 It is usually better to use \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler} since
1982 this sets up a chain of event handlers, where an event not handled by one event handler is
1983 handed to the next one in the chain.
1984
1985 \wxheading{See also}
1986
1987 \helpref{wxWindow::GetEventHandler}{wxwindowgeteventhandler},\rtfsp
1988 \helpref{wxWindow::PushEventHandler}{wxwindowpusheventhandler},\rtfsp
1989 \helpref{wxWindow::PopEventHandler}{wxwindowpusheventhandler},\rtfsp
1990 \helpref{wxEvtHandler::ProcessEvent}{wxevthandlerprocessevent},\rtfsp
1991 \helpref{wxEvtHandler}{wxevthandler}
1992
1993 \membersection{wxWindow::SetTitle}\label{wxwindowsettitle}
1994
1995 \func{virtual void}{SetTitle}{\param{const wxString\& }{title}}
1996
1997 Sets the window's title. Applicable only to frames and dialogs.
1998
1999 \wxheading{Parameters}
2000
2001 \docparam{title}{The window's title.}
2002
2003 \wxheading{See also}
2004
2005 \helpref{wxWindow::GetTitle}{wxwindowgettitle}
2006
2007 \membersection{wxWindow::Show}
2008
2009 \func{virtual bool}{Show}{\param{const bool}{ show}}
2010
2011 Shows or hides the window.
2012
2013 \wxheading{Parameters}
2014
2015 \docparam{show}{If TRUE, displays the window and brings it to the front. Otherwise,
2016 hides the window.}
2017
2018 \wxheading{See also}
2019
2020 \helpref{wxWindow::IsShown}{wxwindowisshown}
2021
2022 \membersection{wxWindow::TransferDataFromWindow}\label{wxwindowtransferdatafromwindow}
2023
2024 \func{virtual bool}{TransferDataFromWindow}{\void}
2025
2026 Transfers values from child controls to data areas specified by their validators. Returns
2027 FALSE if a transfer failed.
2028
2029 \wxheading{See also}
2030
2031 \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow},\rtfsp
2032 \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::Validate}{wxwindowvalidate}
2033
2034 \membersection{wxWindow::TransferDataToWindow}\label{wxwindowtransferdatatowindow}
2035
2036 \func{virtual bool}{TransferDataToWindow}{\void}
2037
2038 Transfers values to child controls from data areas specified by their validators.
2039
2040 \wxheading{Return value}
2041
2042 Returns FALSE if a transfer failed.
2043
2044 \wxheading{See also}
2045
2046 \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow},\rtfsp
2047 \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::Validate}{wxwindowvalidate}
2048
2049 \membersection{wxWindow::Validate}\label{wxwindowvalidate}
2050
2051 \func{virtual bool}{Validate}{\void}
2052
2053 Validates the current values of the child controls using their validators.
2054
2055 \wxheading{Return value}
2056
2057 Returns FALSE if any of the validations failed.
2058
2059 \wxheading{See also}
2060
2061 \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow},\rtfsp
2062 \helpref{wxWindow::TransferDataFromWindow}{wxwindowtransferdatafromwindow},\rtfsp
2063 \helpref{wxValidator}{wxvalidator}
2064
2065 \membersection{wxWindow::WarpPointer}\label{wxwindowwarppointer}
2066
2067 \func{void}{WarpPointer}{\param{int}{ x}, \param{int}{ y}}
2068
2069 Moves the pointer to the given position on the window.
2070
2071 \wxheading{Parameters}
2072
2073 \docparam{x}{The new x position for the cursor.}
2074
2075 \docparam{y}{The new y position for the cursor.}
2076