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