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