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