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