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