]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: window.h | |
e54c96f1 | 3 | // Purpose: interface of wxWindow |
23324ae1 FM |
4 | // Author: wxWidgets team |
5 | // RCS-ID: $Id$ | |
6 | // Licence: wxWindows license | |
7 | ///////////////////////////////////////////////////////////////////////////// | |
8 | ||
9 | /** | |
10 | @class wxWindow | |
11 | @wxheader{window.h} | |
7c913512 | 12 | |
23324ae1 FM |
13 | wxWindow is the base class for all windows and represents any visible object on |
14 | screen. All controls, top level windows and so on are windows. Sizers and | |
15 | device contexts are not, however, as they don't appear on screen themselves. | |
7c913512 | 16 | |
23324ae1 FM |
17 | Please note that all children of the window will be deleted automatically by |
18 | the destructor before the window itself is deleted which means that you don't | |
19 | have to worry about deleting them manually. Please see the @ref | |
20 | overview_windowdeletionoverview "window | |
21 | deletion overview" for more information. | |
7c913512 | 22 | |
23324ae1 FM |
23 | Also note that in this, and many others, wxWidgets classes some |
24 | @c GetXXX() methods may be overloaded (as, for example, | |
25 | wxWindow::GetSize or | |
26 | wxWindow::GetClientSize). In this case, the overloads | |
27 | are non-virtual because having multiple virtual functions with the same name | |
28 | results in a virtual function name hiding at the derived class level (in | |
29 | English, this means that the derived class has to override all overloaded | |
30 | variants if it overrides any of them). To allow overriding them in the derived | |
31 | class, wxWidgets uses a unique protected virtual @c DoGetXXX() method | |
32 | and all @c GetXXX() ones are forwarded to it, so overriding the former | |
33 | changes the behaviour of the latter. | |
7c913512 | 34 | |
23324ae1 FM |
35 | @beginStyleTable |
36 | @style{wxBORDER_DEFAULT}: | |
37 | The window class will decide the kind of border to show, if any. | |
38 | @style{wxBORDER_SIMPLE}: | |
39 | Displays a thin border around the window. wxSIMPLE_BORDER is the | |
40 | old name for this style. | |
41 | @style{wxBORDER_SUNKEN}: | |
42 | Displays a sunken border. wxSUNKEN_BORDER is the old name for this | |
43 | style. | |
44 | @style{wxBORDER_RAISED}: | |
45 | Displays a raised border. wxRAISED_BORDER is the old name for this | |
46 | style. | |
47 | @style{wxBORDER_STATIC}: | |
48 | Displays a border suitable for a static control. wxSTATIC_BORDER | |
49 | is the old name for this style. Windows only. | |
50 | @style{wxBORDER_THEME}: | |
51 | Displays a native border suitable for a control, on the current | |
52 | platform. On Windows XP or Vista, this will be a themed border; on | |
53 | most other platforms a sunken border will be used. For more | |
54 | information for themed borders on Windows, please see Themed | |
55 | borders on Windows. | |
56 | @style{wxBORDER_NONE}: | |
57 | Displays no border, overriding the default border style for the | |
58 | window. wxNO_BORDER is the old name for this style. | |
59 | @style{wxBORDER_DOUBLE}: | |
60 | This style is obsolete and should not be used. | |
61 | @style{wxTRANSPARENT_WINDOW}: | |
62 | The window is transparent, that is, it will not receive paint | |
63 | events. Windows only. | |
64 | @style{wxTAB_TRAVERSAL}: | |
65 | Use this to enable tab traversal for non-dialog windows. | |
66 | @style{wxWANTS_CHARS}: | |
67 | Use this to indicate that the window wants to get all char/key | |
68 | events for all keys - even for keys like TAB or ENTER which are | |
69 | usually used for dialog navigation and which wouldn't be generated | |
70 | without this style. If you need to use this style in order to get | |
71 | the arrows or etc., but would still like to have normal keyboard | |
72 | navigation take place, you should call Navigate in response to the | |
73 | key events for Tab and Shift-Tab. | |
74 | @style{wxNO_FULL_REPAINT_ON_RESIZE}: | |
75 | On Windows, this style used to disable repainting the window | |
76 | completely when its size is changed. Since this behaviour is now | |
77 | the default, the style is now obsolete and no longer has an effect. | |
78 | @style{wxVSCROLL}: | |
79 | Use this style to enable a vertical scrollbar. Notice that this | |
80 | style cannot be used with native controls which don't support | |
81 | scrollbars nor with top-level windows in most ports. | |
82 | @style{wxHSCROLL}: | |
83 | Use this style to enable a horizontal scrollbar. The same | |
84 | limitations as for wxVSCROLL apply to this style. | |
85 | @style{wxALWAYS_SHOW_SB}: | |
86 | If a window has scrollbars, disable them instead of hiding them | |
87 | when they are not needed (i.e. when the size of the window is big | |
88 | enough to not require the scrollbars to navigate it). This style is | |
89 | currently implemented for wxMSW, wxGTK and wxUniversal and does | |
90 | nothing on the other platforms. | |
91 | @style{wxCLIP_CHILDREN}: | |
92 | Use this style to eliminate flicker caused by the background being | |
93 | repainted, then children being painted over them. Windows only. | |
94 | @style{wxFULL_REPAINT_ON_RESIZE}: | |
95 | Use this style to force a complete redraw of the window whenever it | |
96 | is resized instead of redrawing just the part of the window | |
97 | affected by resizing. Note that this was the behaviour by default | |
98 | before 2.5.1 release and that if you experience redraw problems | |
99 | with code which previously used to work you may want to try this. | |
100 | Currently this style applies on GTK+ 2 and Windows only, and full | |
101 | repainting is always done on other platforms. | |
102 | @endStyleTable | |
7c913512 | 103 | |
23324ae1 FM |
104 | @beginExtraStyleTable |
105 | @style{wxWS_EX_VALIDATE_RECURSIVELY}: | |
106 | By default, Validate/TransferDataTo/FromWindow() only work on | |
107 | direct children of the window (compatible behaviour). Set this flag | |
108 | to make them recursively descend into all subwindows. | |
109 | @style{wxWS_EX_BLOCK_EVENTS}: | |
110 | wxCommandEvents and the objects of the derived classes are | |
111 | forwarded to the parent window and so on recursively by default. | |
112 | Using this flag for the given window allows to block this | |
113 | propagation at this window, i.e. prevent the events from being | |
114 | propagated further upwards. Dialogs have this flag on by default. | |
115 | @style{wxWS_EX_TRANSIENT}: | |
116 | Don't use this window as an implicit parent for the other windows: | |
117 | this must be used with transient windows as otherwise there is the | |
118 | risk of creating a dialog/frame with this window as a parent which | |
119 | would lead to a crash if the parent is destroyed before the child. | |
120 | @style{wxWS_EX_PROCESS_IDLE}: | |
121 | This window should always process idle events, even if the mode set | |
122 | by wxIdleEvent::SetMode is wxIDLE_PROCESS_SPECIFIED. | |
123 | @style{wxWS_EX_PROCESS_UI_UPDATES}: | |
124 | This window should always process UI update events, even if the | |
125 | mode set by wxUpdateUIEvent::SetMode is | |
126 | wxUPDATE_UI_PROCESS_SPECIFIED. | |
127 | @endExtraStyleTable | |
7c913512 | 128 | |
23324ae1 FM |
129 | @library{wxcore} |
130 | @category{FIXME} | |
7c913512 | 131 | |
e54c96f1 FM |
132 | @see @ref overview_eventhandlingoverview, @ref overview_windowsizingoverview |
133 | "Window sizing overview" | |
23324ae1 FM |
134 | */ |
135 | class wxWindow : public wxEvtHandler | |
136 | { | |
137 | public: | |
138 | //@{ | |
139 | /** | |
140 | Constructs a window, which can be a child of a frame, dialog or any other | |
141 | non-control window. | |
142 | ||
7c913512 | 143 | @param parent |
4cc4bfaf | 144 | Pointer to a parent window. |
7c913512 | 145 | @param id |
4cc4bfaf | 146 | Window identifier. If wxID_ANY, will automatically create an identifier. |
7c913512 | 147 | @param pos |
4cc4bfaf FM |
148 | Window position. wxDefaultPosition indicates that wxWidgets |
149 | should generate a default position for the window. If using the wxWindow | |
150 | class directly, supply | |
151 | an actual position. | |
7c913512 | 152 | @param size |
4cc4bfaf FM |
153 | Window size. wxDefaultSize indicates that wxWidgets |
154 | should generate a default size for the window. If no suitable size can be | |
23324ae1 | 155 | found, the |
4cc4bfaf | 156 | window will be sized to 20x20 pixels so that the window is visible but |
23324ae1 | 157 | obviously not |
4cc4bfaf | 158 | correctly sized. |
7c913512 | 159 | @param style |
4cc4bfaf | 160 | Window style. For generic window styles, please see wxWindow. |
7c913512 | 161 | @param name |
4cc4bfaf | 162 | Window name. |
23324ae1 FM |
163 | */ |
164 | wxWindow(); | |
7c913512 FM |
165 | wxWindow(wxWindow* parent, wxWindowID id, |
166 | const wxPoint& pos = wxDefaultPosition, | |
167 | const wxSize& size = wxDefaultSize, | |
168 | long style = 0, | |
169 | const wxString& name = wxPanelNameStr); | |
23324ae1 FM |
170 | //@} |
171 | ||
172 | /** | |
173 | Destructor. Deletes all sub-windows, then deletes itself. Instead of using | |
174 | the @b delete operator explicitly, you should normally | |
175 | use Destroy() so that wxWidgets | |
176 | can delete a window only when it is safe to do so, in idle time. | |
177 | ||
4cc4bfaf FM |
178 | @see @ref overview_windowdeletionoverview "Window deletion overview", |
179 | Destroy(), wxCloseEvent | |
23324ae1 FM |
180 | */ |
181 | ~wxWindow(); | |
182 | ||
183 | /** | |
184 | This method may be overridden in the derived classes to return @false to | |
185 | indicate that this control doesn't accept input at all (i.e. behaves like e.g. | |
186 | wxStaticText) and so doesn't need focus. | |
187 | ||
4cc4bfaf | 188 | @see AcceptsFocusFromKeyboard() |
23324ae1 | 189 | */ |
328f5751 | 190 | bool AcceptsFocus() const; |
23324ae1 FM |
191 | |
192 | /** | |
193 | This method may be overridden in the derived classes to return @false to | |
194 | indicate that while this control can, in principle, have focus if the user | |
195 | clicks it with the mouse, it shouldn't be included in the TAB traversal chain | |
196 | when using the keyboard. | |
197 | */ | |
328f5751 | 198 | bool AcceptsFocusFromKeyboard() const; |
23324ae1 FM |
199 | |
200 | /** | |
201 | Adds a child window. This is called automatically by window creation | |
202 | functions so should not be required by the application programmer. | |
23324ae1 FM |
203 | Notice that this function is mostly internal to wxWidgets and shouldn't be |
204 | called by the user code. | |
205 | ||
7c913512 | 206 | @param child |
4cc4bfaf | 207 | Child window to add. |
23324ae1 FM |
208 | */ |
209 | virtual void AddChild(wxWindow* child); | |
210 | ||
211 | /** | |
212 | Call this function to force one or both scrollbars to be always shown, even if | |
213 | the window is big enough to show its entire contents without scrolling. | |
e54c96f1 FM |
214 | |
215 | @wxsince{2.9.0} | |
23324ae1 | 216 | |
7c913512 | 217 | @param hflag |
4cc4bfaf | 218 | Whether the horizontal scroll bar should always be visible. |
7c913512 | 219 | @param vflag |
4cc4bfaf | 220 | Whether the vertical scroll bar should always be visible. |
23324ae1 FM |
221 | |
222 | @remarks This function is currently only implemented under Mac/Carbon. | |
223 | */ | |
224 | void AlwaysShowScrollbars(bool hflag, bool vflag); | |
225 | ||
226 | /** | |
227 | Sets the cached best size value. | |
228 | */ | |
328f5751 | 229 | void CacheBestSize(const wxSize& size) const; |
23324ae1 FM |
230 | |
231 | /** | |
7c913512 | 232 | Returns @true if the system supports transparent windows and calling |
23324ae1 FM |
233 | SetTransparent() may succeed. If this function |
234 | returns @false, transparent windows are definitely not supported by the | |
235 | current | |
236 | system. | |
237 | */ | |
238 | bool CanSetTransparent(); | |
239 | ||
240 | /** | |
241 | Directs all mouse input to this window. Call ReleaseMouse() to | |
242 | release the capture. | |
23324ae1 FM |
243 | Note that wxWidgets maintains the stack of windows having captured the mouse |
244 | and when the mouse is released the capture returns to the window which had had | |
245 | captured it previously and it is only really released if there were no previous | |
246 | window. In particular, this means that you must release the mouse as many times | |
247 | as you capture it, unless the window receives | |
248 | the wxMouseCaptureLostEvent event. | |
23324ae1 FM |
249 | Any application which captures the mouse in the beginning of some operation |
250 | must handle wxMouseCaptureLostEvent | |
251 | and cancel this operation when it receives the event. The event handler must | |
252 | not recapture mouse. | |
253 | ||
4cc4bfaf | 254 | @see ReleaseMouse(), wxMouseCaptureLostEvent |
23324ae1 FM |
255 | */ |
256 | virtual void CaptureMouse(); | |
257 | ||
258 | /** | |
259 | A synonym for Centre(). | |
260 | */ | |
261 | void Center(int direction); | |
262 | ||
263 | /** | |
264 | A synonym for CentreOnParent(). | |
265 | */ | |
266 | void CenterOnParent(int direction); | |
267 | ||
268 | /** | |
269 | Centres the window. | |
270 | ||
7c913512 | 271 | @param direction |
4cc4bfaf FM |
272 | Specifies the direction for the centering. May be wxHORIZONTAL, wxVERTICAL |
273 | or wxBOTH. It may also include wxCENTRE_ON_SCREEN flag | |
274 | if you want to center the window on the entire screen and not on its | |
275 | parent window. | |
23324ae1 FM |
276 | |
277 | @remarks If the window is a top level one (i.e. doesn't have a parent), | |
4cc4bfaf | 278 | it will be centered relative to the screen anyhow. |
23324ae1 | 279 | |
4cc4bfaf | 280 | @see Center() |
23324ae1 FM |
281 | */ |
282 | void Centre(int direction = wxBOTH); | |
283 | ||
284 | /** | |
285 | Centres the window on its parent. This is a more readable synonym for | |
286 | Centre(). | |
287 | ||
7c913512 | 288 | @param direction |
4cc4bfaf FM |
289 | Specifies the direction for the centering. May be wxHORIZONTAL, wxVERTICAL |
290 | or wxBOTH. | |
23324ae1 FM |
291 | |
292 | @remarks This methods provides for a way to center top level windows over | |
4cc4bfaf FM |
293 | their parents instead of the entire screen. If there |
294 | is no parent or if the window is not a top level | |
295 | window, then behaviour is the same as Centre(). | |
23324ae1 | 296 | |
4cc4bfaf | 297 | @see wxTopLevelWindow::CentreOnScreen |
23324ae1 FM |
298 | */ |
299 | void CentreOnParent(int direction = wxBOTH); | |
300 | ||
301 | /** | |
302 | Clears the window by filling it with the current background colour. Does not | |
303 | cause an erase background event to be generated. | |
304 | */ | |
305 | void ClearBackground(); | |
306 | ||
307 | //@{ | |
308 | /** | |
309 | Converts to screen coordinates from coordinates relative to this window. | |
310 | ||
7c913512 | 311 | @param x |
4cc4bfaf FM |
312 | A pointer to a integer value for the x coordinate. Pass the client |
313 | coordinate in, and | |
314 | a screen coordinate will be passed out. | |
7c913512 | 315 | @param y |
4cc4bfaf FM |
316 | A pointer to a integer value for the y coordinate. Pass the client |
317 | coordinate in, and | |
318 | a screen coordinate will be passed out. | |
7c913512 | 319 | @param pt |
4cc4bfaf | 320 | The client position for the second form of the function. |
23324ae1 | 321 | */ |
328f5751 FM |
322 | virtual void ClientToScreen(int* x, int* y) const; |
323 | const virtual wxPoint ClientToScreen(const wxPoint& pt) const; | |
23324ae1 FM |
324 | //@} |
325 | ||
326 | /** | |
4cc4bfaf | 327 | Converts client area size @a size to corresponding window size. In other |
23324ae1 FM |
328 | words, the returned value is what would GetSize() |
329 | return if this window had client area of given size. | |
330 | Components with wxDefaultCoord value are left unchanged. | |
23324ae1 FM |
331 | Note that the conversion is not always exact, it assumes that non-client area |
332 | doesn't change and so doesn't take into account things like menu bar | |
333 | (un)wrapping or (dis)appearance of the scrollbars. | |
334 | ||
4cc4bfaf | 335 | @see WindowToClientSize() |
23324ae1 FM |
336 | */ |
337 | virtual wxSize ClientToWindowSize(const wxSize& size); | |
338 | ||
339 | /** | |
340 | This function simply generates a wxCloseEvent whose | |
341 | handler usually tries to close the window. It doesn't close the window itself, | |
342 | however. | |
343 | ||
7c913512 | 344 | @param force |
4cc4bfaf FM |
345 | @false if the window's close handler should be able to veto the destruction |
346 | of this window, @true if it cannot. | |
23324ae1 FM |
347 | |
348 | @remarks Close calls the close handler for the window, providing an | |
4cc4bfaf FM |
349 | opportunity for the window to choose whether to destroy |
350 | the window. Usually it is only used with the top level | |
351 | windows (wxFrame and wxDialog classes) as the others | |
352 | are not supposed to have any special OnClose() logic. | |
23324ae1 | 353 | |
4cc4bfaf FM |
354 | @see @ref overview_windowdeletionoverview "Window deletion overview", |
355 | Destroy(), wxCloseEvent | |
23324ae1 | 356 | */ |
4cc4bfaf | 357 | bool Close(bool force = false); |
23324ae1 FM |
358 | |
359 | //@{ | |
360 | /** | |
361 | Converts a point or size from dialog units to pixels. | |
23324ae1 FM |
362 | For the x dimension, the dialog units are multiplied by the average character |
363 | width | |
364 | and then divided by 4. | |
23324ae1 FM |
365 | For the y dimension, the dialog units are multiplied by the average character |
366 | height | |
367 | and then divided by 8. | |
368 | ||
369 | @remarks Dialog units are used for maintaining a dialog's proportions | |
4cc4bfaf | 370 | even if the font changes. |
23324ae1 | 371 | |
4cc4bfaf | 372 | @see ConvertPixelsToDialog() |
23324ae1 FM |
373 | */ |
374 | wxPoint ConvertDialogToPixels(const wxPoint& pt); | |
7c913512 | 375 | wxSize ConvertDialogToPixels(const wxSize& sz); |
23324ae1 FM |
376 | //@} |
377 | ||
378 | //@{ | |
379 | /** | |
380 | Converts a point or size from pixels to dialog units. | |
23324ae1 FM |
381 | For the x dimension, the pixels are multiplied by 4 and then divided by the |
382 | average | |
383 | character width. | |
23324ae1 FM |
384 | For the y dimension, the pixels are multiplied by 8 and then divided by the |
385 | average | |
386 | character height. | |
387 | ||
388 | @remarks Dialog units are used for maintaining a dialog's proportions | |
4cc4bfaf | 389 | even if the font changes. |
23324ae1 | 390 | |
4cc4bfaf | 391 | @see ConvertDialogToPixels() |
23324ae1 FM |
392 | */ |
393 | wxPoint ConvertPixelsToDialog(const wxPoint& pt); | |
7c913512 | 394 | wxSize ConvertPixelsToDialog(const wxSize& sz); |
23324ae1 FM |
395 | //@} |
396 | ||
397 | /** | |
398 | Destroys the window safely. Use this function instead of the delete operator, | |
399 | since | |
400 | different window classes can be destroyed differently. Frames and dialogs | |
401 | are not destroyed immediately when this function is called -- they are added | |
402 | to a list of windows to be deleted on idle time, when all the window's events | |
403 | have been processed. This prevents problems with events being sent to | |
404 | non-existent | |
405 | windows. | |
406 | ||
407 | @returns @true if the window has either been successfully deleted, or it | |
4cc4bfaf FM |
408 | has been added to the list of windows pending real |
409 | deletion. | |
23324ae1 FM |
410 | */ |
411 | virtual bool Destroy(); | |
412 | ||
413 | /** | |
414 | Destroys all children of a window. Called automatically by the destructor. | |
415 | */ | |
416 | virtual void DestroyChildren(); | |
417 | ||
418 | /** | |
419 | Disables the window, same as @ref enable() Enable(@false). | |
420 | ||
421 | @returns Returns @true if the window has been disabled, @false if it had | |
4cc4bfaf | 422 | been already disabled before the call to this function. |
23324ae1 FM |
423 | */ |
424 | bool Disable(); | |
425 | ||
426 | /** | |
427 | Gets the size which best suits the window: for a control, it would be | |
428 | the minimal size which doesn't truncate the control, for a panel - the | |
429 | same size as it would have after a call to Fit(). | |
430 | */ | |
328f5751 | 431 | virtual wxSize DoGetBestSize() const; |
23324ae1 FM |
432 | |
433 | /** | |
434 | Does the window-specific updating after processing the update event. | |
435 | This function is called by UpdateWindowUI() | |
436 | in order to check return values in the wxUpdateUIEvent and | |
437 | act appropriately. For example, to allow frame and dialog title updating, | |
438 | wxWidgets | |
439 | implements this function as follows: | |
440 | */ | |
441 | virtual void DoUpdateWindowUI(wxUpdateUIEvent& event); | |
442 | ||
443 | /** | |
444 | Enables or disables eligibility for drop file events (OnDropFiles). | |
445 | ||
7c913512 | 446 | @param accept |
4cc4bfaf FM |
447 | If @true, the window is eligible for drop file events. If @false, the window |
448 | will not accept drop file events. | |
23324ae1 FM |
449 | |
450 | @remarks Windows only. | |
451 | */ | |
452 | virtual void DragAcceptFiles(bool accept); | |
453 | ||
454 | /** | |
455 | Enable or disable the window for user input. Note that when a parent window is | |
456 | disabled, all of its children are disabled as well and they are reenabled again | |
457 | when the parent is. | |
458 | ||
7c913512 | 459 | @param enable |
4cc4bfaf | 460 | If @true, enables the window for input. If @false, disables the window. |
23324ae1 FM |
461 | |
462 | @returns Returns @true if the window has been enabled or disabled, @false | |
4cc4bfaf FM |
463 | if nothing was done, i.e. if the window had already |
464 | been in the specified state. | |
23324ae1 | 465 | |
4cc4bfaf | 466 | @see IsEnabled(), Disable(), wxRadioBox::Enable |
23324ae1 | 467 | */ |
4cc4bfaf | 468 | virtual bool Enable(bool enable = true); |
23324ae1 FM |
469 | |
470 | /** | |
471 | Finds the window or control which currently has the keyboard focus. | |
472 | ||
473 | @remarks Note that this is a static function, so it can be called without | |
4cc4bfaf | 474 | needing a wxWindow pointer. |
23324ae1 | 475 | |
4cc4bfaf | 476 | @see SetFocus(), HasFocus() |
23324ae1 FM |
477 | */ |
478 | static wxWindow* FindFocus(); | |
479 | ||
480 | //@{ | |
481 | /** | |
482 | Find a child of this window, by name. | |
483 | */ | |
328f5751 FM |
484 | wxWindow* FindWindow(long id) const; |
485 | const wxWindow* FindWindow(const wxString& name) const; | |
23324ae1 FM |
486 | //@} |
487 | ||
488 | /** | |
489 | Find the first window with the given @e id. | |
4cc4bfaf | 490 | If @a parent is @NULL, the search will start from all top-level |
23324ae1 FM |
491 | frames and dialog boxes; if non-@NULL, the search will be limited to the given |
492 | window hierarchy. | |
493 | The search is recursive in both cases. | |
494 | ||
4cc4bfaf | 495 | @see FindWindow() |
23324ae1 | 496 | */ |
4cc4bfaf | 497 | static wxWindow* FindWindowById(long id, wxWindow* parent = NULL); |
23324ae1 FM |
498 | |
499 | /** | |
500 | Find a window by its label. Depending on the type of window, the label may be a | |
501 | window title | |
4cc4bfaf | 502 | or panel item label. If @a parent is @NULL, the search will start from all |
23324ae1 FM |
503 | top-level |
504 | frames and dialog boxes; if non-@NULL, the search will be limited to the given | |
505 | window hierarchy. | |
506 | The search is recursive in both cases. | |
507 | ||
4cc4bfaf | 508 | @see FindWindow() |
23324ae1 FM |
509 | */ |
510 | static wxWindow* FindWindowByLabel(const wxString& label, | |
4cc4bfaf | 511 | wxWindow* parent = NULL); |
23324ae1 FM |
512 | |
513 | /** | |
514 | Find a window by its name (as given in a window constructor or @b Create | |
515 | function call). | |
4cc4bfaf | 516 | If @a parent is @NULL, the search will start from all top-level |
23324ae1 FM |
517 | frames and dialog boxes; if non-@NULL, the search will be limited to the given |
518 | window hierarchy. | |
519 | The search is recursive in both cases. | |
23324ae1 FM |
520 | If no window with such name is found, |
521 | FindWindowByLabel() is called. | |
522 | ||
4cc4bfaf | 523 | @see FindWindow() |
23324ae1 FM |
524 | */ |
525 | static wxWindow* FindWindowByName(const wxString& name, | |
4cc4bfaf | 526 | wxWindow* parent = NULL); |
23324ae1 FM |
527 | |
528 | /** | |
529 | Sizes the window so that it fits around its subwindows. This function won't do | |
530 | anything if there are no subwindows and will only really work correctly if | |
531 | sizers are used for the subwindows layout. Also, if the window has exactly one | |
532 | subwindow it is better (faster and the result is more precise as Fit adds some | |
533 | margin to account for fuzziness of its calculations) to call | |
4cc4bfaf | 534 | |
23324ae1 FM |
535 | instead of calling Fit. |
536 | */ | |
4cc4bfaf | 537 | virtual void Fit(); |
23324ae1 FM |
538 | |
539 | /** | |
540 | Similar to Fit(), but sizes the interior (virtual) size | |
541 | of a window. Mainly useful with scrolled windows to reset scrollbars after | |
542 | sizing changes that do not trigger a size event, and/or scrolled windows without | |
543 | an interior sizer. This function similarly won't do anything if there are no | |
544 | subwindows. | |
545 | */ | |
546 | virtual void FitInside(); | |
547 | ||
548 | /** | |
549 | Freezes the window or, in other words, prevents any updates from taking place | |
550 | on screen, the window is not redrawn at all. Thaw() must | |
551 | be called to reenable window redrawing. Calls to these two functions may be | |
552 | nested but to ensure that the window is properly repainted again, you must thaw | |
553 | it exactly as many times as you froze it. | |
23324ae1 FM |
554 | This method is useful for visual appearance optimization (for example, it |
555 | is a good idea to use it before doing many large text insertions in a row into | |
556 | a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all | |
557 | controls so it is mostly just a hint to wxWidgets and not a mandatory | |
558 | directive. | |
559 | ||
4cc4bfaf | 560 | @see wxWindowUpdateLocker |
23324ae1 FM |
561 | */ |
562 | virtual void Freeze(); | |
563 | ||
564 | /** | |
565 | Gets the accelerator table for this window. See wxAcceleratorTable. | |
566 | */ | |
328f5751 | 567 | wxAcceleratorTable* GetAcceleratorTable() const; |
23324ae1 FM |
568 | |
569 | /** | |
570 | Returns the accessible object for this window, if any. | |
23324ae1 FM |
571 | See also wxAccessible. |
572 | */ | |
573 | wxAccessible* GetAccessible(); | |
574 | ||
575 | /** | |
576 | This method is deprecated, use GetEffectiveMinSize() | |
577 | instead. | |
578 | */ | |
328f5751 | 579 | wxSize GetAdjustedBestSize() const; |
23324ae1 FM |
580 | |
581 | /** | |
582 | Returns the background colour of the window. | |
583 | ||
4cc4bfaf FM |
584 | @see SetBackgroundColour(), SetForegroundColour(), |
585 | GetForegroundColour() | |
23324ae1 | 586 | */ |
328f5751 | 587 | virtual wxColour GetBackgroundColour() const; |
23324ae1 FM |
588 | |
589 | /** | |
590 | Returns the background style of the window. The background style can be one of: | |
591 | ||
23324ae1 FM |
592 | wxBG_STYLE_SYSTEM |
593 | ||
23324ae1 FM |
594 | Use the default background, as determined by |
595 | the system or the current theme. | |
596 | ||
597 | wxBG_STYLE_COLOUR | |
598 | ||
23324ae1 | 599 | Use a solid colour for the background, this |
7c913512 | 600 | style is set automatically if you call |
23324ae1 FM |
601 | SetBackgroundColour() so you only need to |
602 | set it explicitly if you had changed the background style to something else | |
603 | before. | |
604 | ||
605 | wxBG_STYLE_CUSTOM | |
606 | ||
23324ae1 FM |
607 | Don't draw the background at all, it's |
608 | supposed that it is drawn by the user-defined erase background event handler. | |
609 | This style should be used to avoid flicker when the background is entirely | |
610 | custom-drawn. | |
611 | ||
612 | wxBG_STYLE_TRANSPARET | |
613 | ||
23324ae1 | 614 | The background is (partially) transparent, |
7c913512 | 615 | this style is automatically set if you call |
23324ae1 FM |
616 | SetTransparent() which is used to set the |
617 | transparency level. | |
618 | ||
4cc4bfaf FM |
619 | @see SetBackgroundColour(), GetForegroundColour(), |
620 | SetBackgroundStyle(), SetTransparent() | |
23324ae1 | 621 | */ |
328f5751 | 622 | virtual wxBackgroundStyle GetBackgroundStyle() const; |
23324ae1 FM |
623 | |
624 | /** | |
625 | This functions returns the best acceptable minimal size for the window. For | |
626 | example, for a static control, it will be the minimal size such that the | |
627 | control label is not truncated. For windows containing subwindows (typically | |
628 | wxPanel), the size returned by this function will be the | |
629 | same as the size the window would have had after calling | |
630 | Fit(). | |
631 | */ | |
328f5751 | 632 | wxSize GetBestSize() const; |
23324ae1 FM |
633 | |
634 | /** | |
635 | Returns the currently captured window. | |
636 | ||
4cc4bfaf FM |
637 | @see HasCapture(), CaptureMouse(), ReleaseMouse(), |
638 | wxMouseCaptureLostEvent, wxMouseCaptureChangedEvent | |
23324ae1 | 639 | */ |
4cc4bfaf | 640 | static wxWindow* GetCapture(); |
23324ae1 FM |
641 | |
642 | /** | |
e54c96f1 | 643 | Returns the caret() associated with the window. |
23324ae1 | 644 | */ |
328f5751 | 645 | wxCaret* GetCaret() const; |
23324ae1 FM |
646 | |
647 | /** | |
648 | Returns the character height for this window. | |
649 | */ | |
328f5751 | 650 | virtual int GetCharHeight() const; |
23324ae1 FM |
651 | |
652 | /** | |
653 | Returns the average character width for this window. | |
654 | */ | |
328f5751 | 655 | virtual int GetCharWidth() const; |
23324ae1 FM |
656 | |
657 | //@{ | |
658 | /** | |
7c913512 | 659 | Returns a reference to the list of the window's children. @c wxWindowList |
23324ae1 FM |
660 | is a type-safe wxList-like class whose elements are of type |
661 | @c wxWindow *. | |
662 | */ | |
328f5751 FM |
663 | wxWindowList GetChildren() const; |
664 | const wxWindowList GetChildren() const; | |
23324ae1 FM |
665 | //@} |
666 | ||
667 | /** | |
668 | Returns the default font and colours which are used by the control. This is | |
669 | useful if you want to use the same font or colour in your own control as in a | |
670 | standard control -- which is a much better idea than hard coding specific | |
671 | colours or fonts which might look completely out of place on the users | |
672 | system, especially if it uses themes. | |
4cc4bfaf | 673 | The @a variant parameter is only relevant under Mac currently and is |
23324ae1 FM |
674 | ignore under other platforms. Under Mac, it will change the size of the |
675 | returned font. See SetWindowVariant() | |
676 | for more about this. | |
23324ae1 FM |
677 | This static method is "overridden'' in many derived classes and so calling, |
678 | for example, wxButton::GetClassDefaultAttributes() will typically | |
679 | return the values appropriate for a button which will be normally different | |
680 | from those returned by, say, wxListCtrl::GetClassDefaultAttributes(). | |
23324ae1 FM |
681 | The @c wxVisualAttributes structure has at least the fields |
682 | @c font, @c colFg and @c colBg. All of them may be invalid | |
683 | if it was not possible to determine the default control appearance or, | |
684 | especially for the background colour, if the field doesn't make sense as is | |
685 | the case for @c colBg for the controls with themed background. | |
686 | ||
4cc4bfaf | 687 | @see InheritAttributes() |
23324ae1 FM |
688 | */ |
689 | static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); | |
690 | ||
691 | //@{ | |
692 | /** | |
693 | Returns the size of the window 'client area' in pixels. The client area is the | |
694 | area which may be drawn on by the programmer, excluding title bar, border, | |
695 | scrollbars, etc. | |
23324ae1 FM |
696 | Note that if this window is a top-level one and it is currently minimized, the |
697 | return size is empty (both width and height are 0). | |
698 | ||
7c913512 | 699 | @param width |
4cc4bfaf | 700 | Receives the client width in pixels. |
7c913512 | 701 | @param height |
4cc4bfaf | 702 | Receives the client height in pixels. |
23324ae1 | 703 | |
4cc4bfaf | 704 | @see GetSize(), GetVirtualSize() |
23324ae1 | 705 | */ |
328f5751 FM |
706 | void GetClientSize(int* width, int* height) const; |
707 | const wxSize GetClientSize() const; | |
23324ae1 FM |
708 | //@} |
709 | ||
710 | /** | |
711 | Returns a pointer to the window's layout constraints, or @NULL if there are none. | |
712 | */ | |
328f5751 | 713 | wxLayoutConstraints* GetConstraints() const; |
23324ae1 FM |
714 | |
715 | /** | |
716 | Return the sizer that this window is a member of, if any, otherwise | |
717 | @NULL. | |
718 | */ | |
328f5751 | 719 | const wxSizer* GetContainingSizer() const; |
23324ae1 FM |
720 | |
721 | /** | |
722 | Return the cursor associated with this window. | |
723 | ||
4cc4bfaf | 724 | @see SetCursor() |
23324ae1 | 725 | */ |
328f5751 | 726 | const wxCursor GetCursor() const; |
23324ae1 FM |
727 | |
728 | /** | |
729 | Currently this is the same as calling | |
730 | wxWindow::GetClassDefaultAttributes(wxWindow::GetWindowVariant()). | |
23324ae1 FM |
731 | One advantage of using this function compared to the static version is that |
732 | the call is automatically dispatched to the correct class (as usual with | |
733 | virtual functions) and you don't have to specify the class name explicitly. | |
23324ae1 FM |
734 | The other one is that in the future this function could return different |
735 | results, for example it might return a different font for an "Ok'' button | |
736 | than for a generic button if the users GUI is configured to show such buttons | |
737 | in bold font. Of course, the down side is that it is impossible to call this | |
738 | function without actually having an object to apply it to whereas the static | |
739 | version can be used without having to create an object first. | |
740 | */ | |
328f5751 | 741 | virtual wxVisualAttributes GetDefaultAttributes() const; |
23324ae1 FM |
742 | |
743 | /** | |
744 | Returns the associated drop target, which may be @NULL. | |
745 | ||
4cc4bfaf | 746 | @see SetDropTarget(), @ref overview_wxdndoverview |
23324ae1 | 747 | */ |
328f5751 | 748 | wxDropTarget* GetDropTarget() const; |
23324ae1 FM |
749 | |
750 | /** | |
751 | Merges the window's best size into the min size and returns the | |
752 | result. This is the value used by sizers to determine the appropriate | |
753 | ammount of space to allocate for the widget. | |
754 | ||
4cc4bfaf | 755 | @see GetBestSize(), SetInitialSize() |
23324ae1 | 756 | */ |
328f5751 | 757 | wxSize GetEffectiveMinSize() const; |
23324ae1 FM |
758 | |
759 | /** | |
760 | Returns the event handler for this window. By default, the window is its | |
761 | own event handler. | |
762 | ||
4cc4bfaf FM |
763 | @see SetEventHandler(), PushEventHandler(), |
764 | PopEventHandler(), wxEvtHandler::ProcessEvent, wxEvtHandler | |
23324ae1 | 765 | */ |
328f5751 | 766 | wxEvtHandler* GetEventHandler() const; |
23324ae1 FM |
767 | |
768 | /** | |
769 | Returns the extra style bits for the window. | |
770 | */ | |
328f5751 | 771 | long GetExtraStyle() const; |
23324ae1 FM |
772 | |
773 | /** | |
774 | Returns the font for this window. | |
775 | ||
4cc4bfaf | 776 | @see SetFont() |
23324ae1 | 777 | */ |
328f5751 | 778 | wxFont GetFont() const; |
23324ae1 FM |
779 | |
780 | /** | |
781 | Returns the foreground colour of the window. | |
782 | ||
783 | @remarks The interpretation of foreground colour is open to | |
4cc4bfaf FM |
784 | interpretation according to the window class; it may be |
785 | the text colour or other colour, or it may not be used | |
786 | at all. | |
23324ae1 | 787 | |
4cc4bfaf FM |
788 | @see SetForegroundColour(), SetBackgroundColour(), |
789 | GetBackgroundColour() | |
23324ae1 FM |
790 | */ |
791 | virtual wxColour GetForegroundColour(); | |
792 | ||
793 | /** | |
794 | Returns the grandparent of a window, or @NULL if there isn't one. | |
795 | */ | |
328f5751 | 796 | wxWindow* GetGrandParent() const; |
23324ae1 FM |
797 | |
798 | /** | |
799 | Returns the platform-specific handle of the physical window. Cast it to an | |
800 | appropriate | |
801 | handle, such as @b HWND for Windows, @b Widget for Motif, @b GtkWidget for GTK | |
802 | or @b WinHandle for PalmOS. | |
803 | */ | |
328f5751 | 804 | void* GetHandle() const; |
23324ae1 FM |
805 | |
806 | /** | |
807 | Gets the help text to be used as context-sensitive help for this window. | |
23324ae1 FM |
808 | Note that the text is actually stored by the current wxHelpProvider |
809 | implementation, | |
810 | and not in the window object itself. | |
811 | ||
4cc4bfaf | 812 | @see SetHelpText(), GetHelpTextAtPoint(), wxHelpProvider |
23324ae1 | 813 | */ |
328f5751 | 814 | virtual wxString GetHelpText() const; |
23324ae1 FM |
815 | |
816 | /** | |
817 | Gets the help text to be used as context-sensitive help for this window. This | |
818 | method should be overridden if the help message depends on the position inside | |
819 | the window, otherwise GetHelpText() can be used. | |
820 | ||
7c913512 | 821 | @param point |
4cc4bfaf | 822 | Coordinates of the mouse at the moment of help event emission. |
7c913512 | 823 | @param origin |
4cc4bfaf | 824 | Help event origin, see also wxHelpEvent::GetOrigin. |
23324ae1 FM |
825 | */ |
826 | virtual wxString GetHelpTextAtPoint(const wxPoint point, | |
328f5751 | 827 | wxHelpEvent::Origin origin) const; |
23324ae1 FM |
828 | |
829 | /** | |
830 | Returns the identifier of the window. | |
831 | ||
832 | @remarks Each window has an integer identifier. If the application has | |
4cc4bfaf FM |
833 | not provided one (or the default wxID_ANY) an unique |
834 | identifier with a negative value will be generated. | |
23324ae1 | 835 | |
4cc4bfaf | 836 | @see SetId(), @ref overview_windowids "Window identifiers" |
23324ae1 | 837 | */ |
328f5751 | 838 | int GetId() const; |
23324ae1 FM |
839 | |
840 | /** | |
841 | Generic way of getting a label from any window, for | |
842 | identification purposes. | |
843 | ||
844 | @remarks The interpretation of this function differs from class to class. | |
4cc4bfaf FM |
845 | For frames and dialogs, the value returned is the |
846 | title. For buttons or static text controls, it is the | |
847 | button text. This function can be useful for | |
848 | meta-programs (such as testing tools or special-needs | |
849 | access programs) which need to identify windows by name. | |
23324ae1 | 850 | */ |
328f5751 | 851 | virtual wxString GetLabel() const; |
23324ae1 FM |
852 | |
853 | /** | |
7c913512 | 854 | Returns the maximum size of window's client area. |
23324ae1 FM |
855 | This is an indication to the sizer layout mechanism that this is the maximum |
856 | possible size as well as the upper bound on window's size settable using | |
7c913512 | 857 | SetClientSize(). |
23324ae1 | 858 | |
4cc4bfaf | 859 | @see GetMaxSize() |
23324ae1 | 860 | */ |
328f5751 | 861 | wxSize GetMaxClientSize() const; |
23324ae1 FM |
862 | |
863 | /** | |
864 | Returns the maximum size of the window. This is an indication to the sizer | |
865 | layout mechanism that this is the maximum possible size as well as the upper | |
7c913512 | 866 | bound on window's size settable using SetSize(). |
23324ae1 | 867 | |
4cc4bfaf | 868 | @see GetMaxClientSize() |
23324ae1 | 869 | */ |
328f5751 | 870 | wxSize GetMaxSize() const; |
23324ae1 FM |
871 | |
872 | /** | |
873 | Returns the minimum size of window's client area, an indication to the sizer | |
874 | layout mechanism that this is the minimum required size of its client area. It | |
875 | normally just returns the value set by | |
876 | SetMinClientSize(), but it can be overridden | |
877 | to do the calculation on demand. | |
878 | ||
4cc4bfaf | 879 | @see GetMinSize() |
23324ae1 | 880 | */ |
328f5751 | 881 | virtual wxSize GetMinClientSize() const; |
23324ae1 FM |
882 | |
883 | /** | |
884 | Returns the minimum size of the window, an indication to the sizer layout | |
885 | mechanism | |
886 | that this is the minimum required size. It normally just returns the value set | |
887 | by SetMinSize(), but it can be overridden to do the | |
888 | calculation on demand. | |
889 | ||
4cc4bfaf | 890 | @see GetMinClientSize() |
23324ae1 | 891 | */ |
328f5751 | 892 | virtual wxSize GetMinSize() const; |
23324ae1 FM |
893 | |
894 | /** | |
895 | Returns the window's name. | |
896 | ||
897 | @remarks This name is not guaranteed to be unique; it is up to the | |
4cc4bfaf FM |
898 | programmer to supply an appropriate name in the window |
899 | constructor or via SetName(). | |
23324ae1 | 900 | |
4cc4bfaf | 901 | @see SetName() |
23324ae1 | 902 | */ |
328f5751 | 903 | virtual wxString GetName() const; |
23324ae1 FM |
904 | |
905 | /** | |
906 | Returns the next window after this one among the parent children or @NULL if | |
907 | this window is the last child. | |
e54c96f1 FM |
908 | |
909 | @wxsince{2.8.8} | |
23324ae1 | 910 | |
4cc4bfaf | 911 | @see GetPrevSibling() |
23324ae1 | 912 | */ |
328f5751 | 913 | wxWindow* GetNextSibling() const; |
23324ae1 FM |
914 | |
915 | /** | |
916 | Returns the parent of the window, or @NULL if there is no parent. | |
917 | */ | |
328f5751 | 918 | virtual wxWindow* GetParent() const; |
23324ae1 FM |
919 | |
920 | //@{ | |
921 | /** | |
922 | This function shows a popup menu at the given position in this window and | |
923 | returns the selected id. It can be more convenient than the general purpose | |
924 | PopupMenu() function for simple menus proposing a | |
925 | choice in a list of strings to the user. | |
926 | ||
7c913512 | 927 | @param menu |
4cc4bfaf | 928 | The menu to show |
7c913512 | 929 | @param pos |
4cc4bfaf | 930 | The position at which to show the menu in client coordinates |
7c913512 | 931 | @param x |
4cc4bfaf | 932 | The horizontal position of the menu |
7c913512 | 933 | @param y |
4cc4bfaf | 934 | The vertical position of the menu |
23324ae1 FM |
935 | |
936 | @returns The selected menu item id or wxID_NONE if none selected or an | |
4cc4bfaf | 937 | error occurred. |
23324ae1 FM |
938 | */ |
939 | int GetPopupMenuSelectionFromUser(wxMenu& menu, | |
940 | const wxPoint& pos); | |
7c913512 | 941 | int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y); |
23324ae1 FM |
942 | //@} |
943 | ||
944 | //@{ | |
945 | /** | |
946 | This gets the position of the window in pixels, relative to the parent window | |
947 | for the child windows or relative to the display origin for the top level | |
948 | windows. | |
949 | ||
7c913512 | 950 | @param x |
4cc4bfaf | 951 | Receives the x position of the window if non-@NULL. |
7c913512 | 952 | @param y |
4cc4bfaf | 953 | Receives the y position of the window if non-@NULL. |
23324ae1 | 954 | |
4cc4bfaf | 955 | @see GetScreenPosition() |
23324ae1 | 956 | */ |
328f5751 FM |
957 | virtual void GetPosition(int* x, int* y) const; |
958 | const wxPoint GetPosition() const; | |
23324ae1 FM |
959 | //@} |
960 | ||
961 | /** | |
962 | Returns the previous window before this one among the parent children or @c | |
963 | @NULL if | |
964 | this window is the first child. | |
e54c96f1 FM |
965 | |
966 | @wxsince{2.8.8} | |
23324ae1 | 967 | |
4cc4bfaf | 968 | @see GetNextSibling() |
23324ae1 | 969 | */ |
328f5751 | 970 | wxWindow* GetPrevSibling() const; |
23324ae1 FM |
971 | |
972 | /** | |
973 | Returns the position and size of the window as a wxRect object. | |
974 | ||
4cc4bfaf | 975 | @see GetScreenRect() |
23324ae1 | 976 | */ |
328f5751 | 977 | virtual wxRect GetRect() const; |
23324ae1 FM |
978 | |
979 | //@{ | |
980 | /** | |
981 | Returns the window position in screen coordinates, whether the window is a | |
982 | child window or a top level one. | |
983 | ||
7c913512 | 984 | @param x |
4cc4bfaf | 985 | Receives the x position of the window on the screen if non-@NULL. |
7c913512 | 986 | @param y |
4cc4bfaf | 987 | Receives the y position of the window on the screen if non-@NULL. |
23324ae1 | 988 | |
4cc4bfaf | 989 | @see GetPosition() |
23324ae1 | 990 | */ |
328f5751 FM |
991 | virtual void GetScreenPosition(int* x, int* y) const; |
992 | const wxPoint GetScreenPosition() const; | |
23324ae1 FM |
993 | //@} |
994 | ||
995 | /** | |
7c913512 | 996 | Returns the position and size of the window on the screen as a |
23324ae1 FM |
997 | wxRect object. |
998 | ||
4cc4bfaf | 999 | @see GetRect() |
23324ae1 | 1000 | */ |
328f5751 | 1001 | virtual wxRect GetScreenRect() const; |
23324ae1 FM |
1002 | |
1003 | /** | |
1004 | Returns the built-in scrollbar position. | |
1005 | ||
4cc4bfaf | 1006 | @see See SetScrollbar() |
23324ae1 FM |
1007 | */ |
1008 | virtual int GetScrollPos(int orientation); | |
1009 | ||
1010 | /** | |
1011 | Returns the built-in scrollbar range. | |
1012 | ||
4cc4bfaf | 1013 | @see SetScrollbar() |
23324ae1 FM |
1014 | */ |
1015 | virtual int GetScrollRange(int orientation); | |
1016 | ||
1017 | /** | |
1018 | Returns the built-in scrollbar thumb size. | |
1019 | ||
4cc4bfaf | 1020 | @see SetScrollbar() |
23324ae1 FM |
1021 | */ |
1022 | virtual int GetScrollThumb(int orientation); | |
1023 | ||
1024 | //@{ | |
1025 | /** | |
1026 | Returns the size of the entire window in pixels, including title bar, border, | |
1027 | scrollbars, etc. | |
23324ae1 FM |
1028 | Note that if this window is a top-level one and it is currently minimized, the |
1029 | returned size is the restored window size, not the size of the window icon. | |
1030 | ||
7c913512 | 1031 | @param width |
4cc4bfaf | 1032 | Receives the window width. |
7c913512 | 1033 | @param height |
4cc4bfaf | 1034 | Receives the window height. |
23324ae1 | 1035 | |
4cc4bfaf | 1036 | @see GetClientSize(), GetVirtualSize() |
23324ae1 | 1037 | */ |
328f5751 FM |
1038 | void GetSize(int* width, int* height) const; |
1039 | const wxSize GetSize() const; | |
23324ae1 FM |
1040 | //@} |
1041 | ||
1042 | /** | |
1043 | Return the sizer associated with the window by a previous call to | |
1044 | SetSizer() or @NULL. | |
1045 | */ | |
328f5751 | 1046 | wxSizer* GetSizer() const; |
23324ae1 FM |
1047 | |
1048 | //@{ | |
1049 | /** | |
1050 | Gets the dimensions of the string as it would be drawn on the | |
1051 | window with the currently selected font. | |
4cc4bfaf | 1052 | The text extent is returned in @a w and @a h pointers (first form) or as a |
23324ae1 FM |
1053 | wxSize object (second form). |
1054 | ||
7c913512 | 1055 | @param string |
4cc4bfaf | 1056 | String whose extent is to be measured. |
7c913512 | 1057 | @param w |
4cc4bfaf | 1058 | Return value for width. |
7c913512 | 1059 | @param h |
4cc4bfaf | 1060 | Return value for height. |
7c913512 | 1061 | @param descent |
4cc4bfaf | 1062 | Return value for descent (optional). |
7c913512 | 1063 | @param externalLeading |
4cc4bfaf | 1064 | Return value for external leading (optional). |
7c913512 | 1065 | @param font |
4cc4bfaf | 1066 | Font to use instead of the current window font (optional). |
7c913512 | 1067 | @param use16 |
4cc4bfaf | 1068 | If @true, string contains 16-bit characters. The default is @false. |
23324ae1 FM |
1069 | */ |
1070 | virtual void GetTextExtent(const wxString& string, int* w, | |
1071 | int* h, | |
4cc4bfaf FM |
1072 | int* descent = NULL, |
1073 | int* externalLeading = NULL, | |
1074 | const wxFont* font = NULL, | |
328f5751 FM |
1075 | bool use16 = false) const; |
1076 | const wxSize GetTextExtent(const wxString& string) const; | |
23324ae1 FM |
1077 | //@} |
1078 | ||
1079 | /** | |
1080 | Get the associated tooltip or @NULL if none. | |
1081 | */ | |
328f5751 | 1082 | wxToolTip* GetToolTip() const; |
23324ae1 FM |
1083 | |
1084 | /** | |
1085 | Returns the region specifying which parts of the window have been damaged. | |
1086 | Should | |
1087 | only be called within an wxPaintEvent handler. | |
1088 | ||
4cc4bfaf | 1089 | @see wxRegion, wxRegionIterator |
23324ae1 | 1090 | */ |
328f5751 | 1091 | virtual wxRegion GetUpdateRegion() const; |
23324ae1 FM |
1092 | |
1093 | /** | |
1094 | Returns a pointer to the current validator for the window, or @NULL if there is | |
1095 | none. | |
1096 | */ | |
328f5751 | 1097 | wxValidator* GetValidator() const; |
23324ae1 FM |
1098 | |
1099 | //@{ | |
1100 | /** | |
1101 | This gets the virtual size of the window in pixels. By default it | |
1102 | returns the client size of the window, but after a call to | |
1103 | SetVirtualSize() it will return | |
1104 | that size. | |
1105 | ||
7c913512 | 1106 | @param width |
4cc4bfaf | 1107 | Receives the window virtual width. |
7c913512 | 1108 | @param height |
4cc4bfaf | 1109 | Receives the window virtual height. |
23324ae1 | 1110 | */ |
328f5751 FM |
1111 | void GetVirtualSize(int* width, int* height) const; |
1112 | const wxSize GetVirtualSize() const; | |
23324ae1 FM |
1113 | //@} |
1114 | ||
1115 | /** | |
1116 | Returns the size of the left/right and top/bottom borders of this window in x | |
1117 | and y components of the result respectively. | |
1118 | */ | |
328f5751 | 1119 | wxSize GetWindowBorderSize() const; |
23324ae1 FM |
1120 | |
1121 | /** | |
1122 | Gets the window style that was passed to the constructor or @b Create | |
1123 | method. @b GetWindowStyle() is another name for the same function. | |
1124 | */ | |
328f5751 | 1125 | long GetWindowStyleFlag() const; |
23324ae1 FM |
1126 | |
1127 | /** | |
1128 | Returns the value previously passed to | |
1129 | SetWindowVariant(). | |
1130 | */ | |
328f5751 | 1131 | wxWindowVariant GetWindowVariant() const; |
23324ae1 FM |
1132 | |
1133 | /** | |
1134 | This function will generate the appropriate call to | |
1135 | Navigate() if the key event is one normally used for | |
1136 | keyboard navigation and return @true in this case. | |
1137 | ||
1138 | @returns Returns @true if the key pressed was for navigation and was | |
4cc4bfaf | 1139 | handled, @false otherwise. |
23324ae1 | 1140 | |
4cc4bfaf | 1141 | @see Navigate() |
23324ae1 FM |
1142 | */ |
1143 | bool HandleAsNavigationKey(const wxKeyEvent& event); | |
1144 | ||
1145 | /** | |
1146 | Shorthand for @c | |
1147 | wxWindow::GetEventHandler()-wxEvtHandler::SafelyProcessEvent(event). | |
1148 | */ | |
1149 | bool HandleWindowEvent(wxEvent& event); | |
1150 | ||
1151 | /** | |
1152 | Returns @true if this window has the current mouse capture. | |
1153 | ||
4cc4bfaf FM |
1154 | @see CaptureMouse(), ReleaseMouse(), wxMouseCaptureLostEvent, |
1155 | wxMouseCaptureChangedEvent | |
23324ae1 | 1156 | */ |
328f5751 | 1157 | virtual bool HasCapture() const; |
23324ae1 FM |
1158 | |
1159 | /** | |
4cc4bfaf | 1160 | Returns @true if the window has the given @a exFlag bit set in its |
23324ae1 FM |
1161 | extra styles. |
1162 | ||
4cc4bfaf | 1163 | @see SetExtraStyle() |
23324ae1 | 1164 | */ |
328f5751 | 1165 | bool HasExtraStyle(int exFlag) const; |
23324ae1 FM |
1166 | |
1167 | /** | |
4cc4bfaf | 1168 | Returns @true if the window has the given @a flag bit set. |
23324ae1 | 1169 | */ |
328f5751 | 1170 | bool HasFlag(int flag) const; |
23324ae1 FM |
1171 | |
1172 | /** | |
1173 | Returns @true if the window (or in case of composite controls, its main | |
1174 | child window) has focus. | |
1175 | ||
4cc4bfaf | 1176 | @see FindFocus() |
23324ae1 | 1177 | */ |
328f5751 | 1178 | virtual bool HasFocus() const; |
23324ae1 FM |
1179 | |
1180 | /** | |
1181 | This method should be overridden to return @true if this window has | |
7c913512 FM |
1182 | multiple pages. All standard class with multiple pages such as |
1183 | wxNotebook, wxListbook and | |
23324ae1 FM |
1184 | wxTreebook already override it to return @true |
1185 | and user-defined classes with similar behaviour should do it as well to allow | |
1186 | the library to handle such windows appropriately. | |
1187 | */ | |
328f5751 | 1188 | virtual bool HasMultiplePages() const; |
23324ae1 FM |
1189 | |
1190 | /** | |
1191 | Returns @true if this window has a scroll bar for this orientation. | |
1192 | ||
7c913512 | 1193 | @param orient |
4cc4bfaf | 1194 | Orientation to check, either wxHORIZONTAL or wxVERTICAL. |
23324ae1 | 1195 | */ |
328f5751 | 1196 | virtual bool HasScrollbar(int orient) const; |
23324ae1 FM |
1197 | |
1198 | /** | |
1199 | Returns @true if this window background is transparent (as, for example, for | |
1200 | wxStaticText) and should show the parent window background. | |
23324ae1 FM |
1201 | This method is mostly used internally by the library itself and you normally |
1202 | shouldn't have to call it. You may, however, have to override it in your | |
1203 | wxWindow-derived class to ensure that background is painted correctly. | |
1204 | */ | |
328f5751 | 1205 | virtual bool HasTransparentBackground() const; |
23324ae1 FM |
1206 | |
1207 | /** | |
1208 | Equivalent to calling wxWindow::Show(@false). | |
1209 | */ | |
1210 | bool Hide(); | |
1211 | ||
1212 | /** | |
1213 | This function hides a window, like Hide(), but using a | |
1214 | special visual effect if possible. | |
7c913512 | 1215 | The parameters of this function are the same as for |
23324ae1 FM |
1216 | ShowWithEffect(), please see their |
1217 | description there. | |
e54c96f1 FM |
1218 | |
1219 | @wxsince{2.9.0} | |
23324ae1 FM |
1220 | */ |
1221 | virtual bool HideWithEffect(wxShowEffect effect, | |
1222 | unsigned timeout = 0, | |
1223 | wxDirection dir = wxBOTTOM); | |
1224 | ||
1225 | /** | |
1226 | This function is (or should be, in case of custom controls) called during | |
1227 | window creation to intelligently set up the window visual attributes, that is | |
1228 | the font and the foreground and background colours. | |
23324ae1 FM |
1229 | By "intelligently'' the following is meant: by default, all windows use their |
1230 | own @ref getclassdefaultattributes() default attributes. However | |
1231 | if some of the parents attributes are explicitly (that is, using | |
1232 | SetFont() and not | |
1233 | wxWindow::SetOwnFont) changed and if the | |
1234 | corresponding attribute hadn't been explicitly set for this window itself, | |
1235 | then this window takes the same value as used by the parent. In addition, if | |
1236 | the window overrides ShouldInheritColours() | |
1237 | to return @false, the colours will not be changed no matter what and only the | |
1238 | font might. | |
23324ae1 FM |
1239 | This rather complicated logic is necessary in order to accommodate the |
1240 | different usage scenarios. The most common one is when all default attributes | |
1241 | are used and in this case, nothing should be inherited as in modern GUIs | |
1242 | different controls use different fonts (and colours) than their siblings so | |
1243 | they can't inherit the same value from the parent. However it was also deemed | |
1244 | desirable to allow to simply change the attributes of all children at once by | |
1245 | just changing the font or colour of their common parent, hence in this case we | |
1246 | do inherit the parents attributes. | |
1247 | */ | |
1248 | void InheritAttributes(); | |
1249 | ||
1250 | /** | |
1251 | Sends an @c wxEVT_INIT_DIALOG event, whose handler usually transfers data | |
1252 | to the dialog via validators. | |
1253 | */ | |
1254 | void InitDialog(); | |
1255 | ||
1256 | /** | |
1257 | Resets the cached best size value so it will be recalculated the next time it | |
1258 | is needed. | |
1259 | */ | |
1260 | void InvalidateBestSize(); | |
1261 | ||
1262 | /** | |
1263 | Returns @true if the window contents is double-buffered by the system, i.e. if | |
1264 | any drawing done on the window is really done on a temporary backing surface | |
1265 | and transferred to the screen all at once later. | |
1266 | ||
4cc4bfaf | 1267 | @see wxBufferedDC |
23324ae1 | 1268 | */ |
328f5751 | 1269 | virtual bool IsDoubleBuffered() const; |
23324ae1 FM |
1270 | |
1271 | /** | |
1272 | Returns @true if the window is enabled, i.e. if it accepts user input, @c | |
7c913512 | 1273 | @false |
23324ae1 | 1274 | otherwise. |
23324ae1 FM |
1275 | Notice that this method can return @false even if this window itself hadn't |
1276 | been explicitly disabled when one of its parent windows is disabled. To get the | |
7c913512 | 1277 | intrinsic status of this window, use |
23324ae1 FM |
1278 | IsThisEnabled() |
1279 | ||
4cc4bfaf | 1280 | @see Enable() |
23324ae1 | 1281 | */ |
328f5751 | 1282 | virtual bool IsEnabled() const; |
23324ae1 FM |
1283 | |
1284 | //@{ | |
1285 | /** | |
1286 | Returns @true if the given point or rectangle area has been exposed since the | |
1287 | last repaint. Call this in an paint event handler to optimize redrawing by | |
1288 | only redrawing those areas, which have been exposed. | |
1289 | */ | |
328f5751 FM |
1290 | bool IsExposed(int x, int y) const; |
1291 | const bool IsExposed(wxPoint amp;pt) const; | |
1292 | const bool IsExposed(int x, int y, int w, int h) const; | |
1293 | const bool IsExposed(wxRect amp;rect) const; | |
23324ae1 FM |
1294 | //@} |
1295 | ||
1296 | /** | |
7c913512 | 1297 | Returns @true if the window is currently frozen by a call to |
23324ae1 FM |
1298 | Freeze(). |
1299 | ||
4cc4bfaf | 1300 | @see Thaw() |
23324ae1 | 1301 | */ |
328f5751 | 1302 | virtual bool IsFrozen() const; |
23324ae1 FM |
1303 | |
1304 | /** | |
1305 | Returns @true if the window is retained, @false otherwise. | |
1306 | ||
1307 | @remarks Retained windows are only available on X platforms. | |
1308 | */ | |
328f5751 | 1309 | virtual bool IsRetained() const; |
23324ae1 FM |
1310 | |
1311 | /** | |
1312 | Return whether a scrollbar is always shown. | |
1313 | ||
7c913512 | 1314 | @param orient |
4cc4bfaf | 1315 | Orientation to check, either wxHORIZONTAL or wxVERTICAL. |
23324ae1 | 1316 | |
4cc4bfaf | 1317 | @see AlwaysShowScrollbars() |
23324ae1 FM |
1318 | */ |
1319 | bool IsScrollbarAlwaysShown(int orient); | |
1320 | ||
1321 | /** | |
1322 | Returns @true if the window is shown, @false if it has been hidden. | |
1323 | ||
4cc4bfaf | 1324 | @see IsShownOnScreen() |
23324ae1 | 1325 | */ |
328f5751 | 1326 | virtual bool IsShown() const; |
23324ae1 FM |
1327 | |
1328 | /** | |
1329 | Returns @true if the window is physically visible on the screen, i.e. it | |
1330 | is shown and all its parents up to the toplevel window are shown as well. | |
1331 | ||
4cc4bfaf | 1332 | @see IsShown() |
23324ae1 | 1333 | */ |
328f5751 | 1334 | virtual bool IsShownOnScreen() const; |
23324ae1 FM |
1335 | |
1336 | /** | |
1337 | Returns @true if this window is intrinsically enabled, @false otherwise, | |
1338 | i.e. | |
1339 | if @ref enable() Enable(@false) had been called. This method is | |
7c913512 | 1340 | mostly used for wxWidgets itself, user code should normally use |
23324ae1 FM |
1341 | IsEnabled() instead. |
1342 | */ | |
328f5751 | 1343 | bool IsThisEnabled() const; |
23324ae1 FM |
1344 | |
1345 | /** | |
1346 | Returns @true if the given window is a top-level one. Currently all frames and | |
1347 | dialogs are considered to be top-level windows (even if they have a parent | |
1348 | window). | |
1349 | */ | |
328f5751 | 1350 | bool IsTopLevel() const; |
23324ae1 FM |
1351 | |
1352 | /** | |
1353 | Invokes the constraint-based layout algorithm or the sizer-based algorithm | |
1354 | for this window. | |
23324ae1 FM |
1355 | See SetAutoLayout(): when auto |
1356 | layout is on, this function gets called automatically when the window is | |
1357 | resized. | |
1358 | */ | |
1359 | void Layout(); | |
1360 | ||
1361 | /** | |
1362 | This is just a wrapper for wxWindow::ScrollLines(1). | |
1363 | */ | |
1364 | ||
1365 | ||
1366 | /** | |
1367 | This is just a wrapper for wxWindow::ScrollLines(-1). | |
1368 | */ | |
1369 | ||
1370 | ||
1371 | /** | |
1372 | Lowers the window to the bottom of the window hierarchy (Z-order). | |
1373 | ||
4cc4bfaf | 1374 | @see Raise() |
23324ae1 FM |
1375 | */ |
1376 | void Lower(); | |
1377 | ||
1378 | /** | |
1379 | Disables all other windows in the application so that | |
1380 | the user can only interact with this window. | |
1381 | ||
7c913512 | 1382 | @param flag |
4cc4bfaf FM |
1383 | If @true, this call disables all other windows in the application so that |
1384 | the user can only interact with this window. If @false, the effect is | |
1385 | reversed. | |
23324ae1 FM |
1386 | */ |
1387 | virtual void MakeModal(bool flag); | |
1388 | ||
1389 | //@{ | |
1390 | /** | |
1391 | Moves the window to the given position. | |
1392 | ||
7c913512 | 1393 | @param x |
4cc4bfaf | 1394 | Required x position. |
7c913512 | 1395 | @param y |
4cc4bfaf | 1396 | Required y position. |
7c913512 | 1397 | @param pt |
4cc4bfaf | 1398 | wxPoint object representing the position. |
23324ae1 FM |
1399 | |
1400 | @remarks Implementations of SetSize can also implicitly implement the | |
4cc4bfaf FM |
1401 | Move() function, which is defined in the base |
1402 | wxWindow class as the call: | |
23324ae1 | 1403 | |
4cc4bfaf | 1404 | @see SetSize() |
23324ae1 FM |
1405 | */ |
1406 | void Move(int x, int y); | |
7c913512 | 1407 | void Move(const wxPoint& pt); |
23324ae1 FM |
1408 | //@} |
1409 | ||
1410 | /** | |
1411 | Moves this window in the tab navigation order after the specified @e win. | |
1412 | This means that when the user presses @c TAB key on that other window, | |
1413 | the focus switches to this window. | |
23324ae1 FM |
1414 | Default tab order is the same as creation order, this function and |
1415 | MoveBeforeInTabOrder() allow to change | |
1416 | it after creating all the windows. | |
1417 | ||
7c913512 | 1418 | @param win |
4cc4bfaf FM |
1419 | A sibling of this window which should precede it in tab order, |
1420 | must not be @NULL | |
23324ae1 | 1421 | */ |
4cc4bfaf | 1422 | void MoveAfterInTabOrder(wxWindow* win); |
23324ae1 FM |
1423 | |
1424 | /** | |
1425 | Same as MoveAfterInTabOrder() except that | |
4cc4bfaf | 1426 | it inserts this window just before @a win instead of putting it right after |
23324ae1 FM |
1427 | it. |
1428 | */ | |
4cc4bfaf | 1429 | void MoveBeforeInTabOrder(wxWindow* win); |
23324ae1 FM |
1430 | |
1431 | /** | |
1432 | Performs a keyboard navigation action starting from this window. This method is | |
1433 | equivalent to calling NavigateIn() method on the | |
1434 | parent window. | |
1435 | ||
7c913512 | 1436 | @param flags |
4cc4bfaf | 1437 | A combination of wxNavigationKeyEvent::IsForward and |
23324ae1 FM |
1438 | wxNavigationKeyEvent::WinChange. |
1439 | ||
1440 | @returns Returns @true if the focus was moved to another window or @false | |
4cc4bfaf | 1441 | if nothing changed. |
23324ae1 FM |
1442 | |
1443 | @remarks You may wish to call this from a text control custom keypress | |
4cc4bfaf FM |
1444 | handler to do the default navigation behaviour for the |
1445 | tab key, since the standard default behaviour for a | |
1446 | multiline text control with the wxTE_PROCESS_TAB style | |
1447 | is to insert a tab and not navigate to the next | |
1448 | control. See also wxNavigationKeyEvent and | |
1449 | HandleAsNavigationKey. | |
23324ae1 FM |
1450 | */ |
1451 | bool Navigate(int flags = wxNavigationKeyEvent::IsForward); | |
1452 | ||
1453 | /** | |
1454 | Performs a keyboard navigation action inside this window. | |
23324ae1 FM |
1455 | See Navigate() for more information. |
1456 | */ | |
1457 | bool NavigateIn(int flags = wxNavigationKeyEvent::IsForward); | |
1458 | ||
1459 | /** | |
1460 | Create a new ID or range of IDs that are not currently in use. The | |
e54c96f1 | 1461 | IDs will be reserved until assigned to a wxWindowIDRef() |
23324ae1 | 1462 | or unreserved with UnreserveControlId(). |
23324ae1 FM |
1463 | See @ref overview_windowidsoverview "Window IDs overview" for more information. |
1464 | ||
7c913512 | 1465 | @param count |
4cc4bfaf | 1466 | The number of sequential IDs to reserve. |
23324ae1 FM |
1467 | |
1468 | @returns Returns the ID or the first ID of the range, or wxID_NONE if the | |
4cc4bfaf | 1469 | specified number of identifiers couldn't be allocated. |
23324ae1 | 1470 | |
4cc4bfaf FM |
1471 | @see UnreserveControlId(), wxIdManager, @ref overview_windowidsoverview |
1472 | "Window IDs overview" | |
23324ae1 FM |
1473 | */ |
1474 | static wxWindowID NewControlId(int count = 1); | |
1475 | ||
1476 | /** | |
1477 | This virtual function is normally only used internally, but | |
1478 | sometimes an application may need it to implement functionality | |
1479 | that should not be disabled by an application defining an OnIdle | |
1480 | handler in a derived class. | |
23324ae1 FM |
1481 | This function may be used to do delayed painting, for example, |
1482 | and most implementations call UpdateWindowUI() | |
1483 | in order to send update events to the window in idle time. | |
1484 | */ | |
1485 | virtual void OnInternalIdle(); | |
1486 | ||
1487 | /** | |
1488 | This is just a wrapper for wxWindow::ScrollPages(1). | |
1489 | */ | |
1490 | ||
1491 | ||
1492 | /** | |
1493 | This is just a wrapper for wxWindow::ScrollPages(-1). | |
1494 | */ | |
1495 | ||
1496 | ||
1497 | /** | |
1498 | Removes and returns the top-most event handler on the event handler stack. | |
1499 | ||
7c913512 | 1500 | @param deleteHandler |
4cc4bfaf FM |
1501 | If this is @true, the handler will be deleted after it is removed. The |
1502 | default value is @false. | |
23324ae1 | 1503 | |
4cc4bfaf FM |
1504 | @see SetEventHandler(), GetEventHandler(), |
1505 | PushEventHandler(), wxEvtHandler::ProcessEvent, wxEvtHandler | |
23324ae1 | 1506 | */ |
328f5751 | 1507 | wxEvtHandler* PopEventHandler(bool deleteHandler = false) const; |
23324ae1 FM |
1508 | |
1509 | //@{ | |
1510 | /** | |
1511 | Pops up the given menu at the specified coordinates, relative to this | |
1512 | window, and returns control when the user has dismissed the menu. If a | |
1513 | menu item is selected, the corresponding menu event is generated and will be | |
1514 | processed as usually. If the coordinates are not specified, current mouse | |
1515 | cursor position is used. | |
1516 | ||
7c913512 | 1517 | @param menu |
4cc4bfaf | 1518 | Menu to pop up. |
7c913512 | 1519 | @param pos |
4cc4bfaf | 1520 | The position where the menu will appear. |
7c913512 | 1521 | @param x |
4cc4bfaf | 1522 | Required x position for the menu to appear. |
7c913512 | 1523 | @param y |
4cc4bfaf | 1524 | Required y position for the menu to appear. |
23324ae1 FM |
1525 | |
1526 | @remarks Just before the menu is popped up, wxMenu::UpdateUI is called to | |
4cc4bfaf FM |
1527 | ensure that the menu items are in the correct state. |
1528 | The menu does not get deleted by the window. | |
23324ae1 | 1529 | |
4cc4bfaf | 1530 | @see wxMenu |
23324ae1 FM |
1531 | */ |
1532 | bool PopupMenu(wxMenu* menu, | |
1533 | const wxPoint& pos = wxDefaultPosition); | |
7c913512 | 1534 | bool PopupMenu(wxMenu* menu, int x, int y); |
23324ae1 FM |
1535 | //@} |
1536 | ||
1537 | /** | |
1538 | Pushes this event handler onto the event stack for the window. | |
1539 | ||
7c913512 | 1540 | @param handler |
4cc4bfaf | 1541 | Specifies the handler to be pushed. |
23324ae1 FM |
1542 | |
1543 | @remarks An event handler is an object that is capable of processing the | |
4cc4bfaf FM |
1544 | events sent to a window. By default, the window is its |
1545 | own event handler, but an application may wish to | |
1546 | substitute another, for example to allow central | |
1547 | implementation of event-handling for a variety of | |
1548 | different window classes. | |
23324ae1 | 1549 | |
4cc4bfaf FM |
1550 | @see SetEventHandler(), GetEventHandler(), |
1551 | PopEventHandler(), wxEvtHandler::ProcessEvent, wxEvtHandler | |
23324ae1 FM |
1552 | */ |
1553 | void PushEventHandler(wxEvtHandler* handler); | |
1554 | ||
1555 | /** | |
1556 | Raises the window to the top of the window hierarchy (Z-order). | |
23324ae1 FM |
1557 | In current version of wxWidgets this works both for managed and child windows. |
1558 | ||
4cc4bfaf | 1559 | @see Lower() |
23324ae1 FM |
1560 | */ |
1561 | void Raise(); | |
1562 | ||
1563 | /** | |
1564 | Causes this window, and all of its children recursively (except under wxGTK1 | |
1565 | where this is not implemented), to be repainted. Note that repainting doesn't | |
1566 | happen immediately but only during the next event loop iteration, if you need | |
1567 | to update the window immediately you should use Update() | |
1568 | instead. | |
1569 | ||
7c913512 | 1570 | @param eraseBackground |
4cc4bfaf FM |
1571 | If @true, the background will be |
1572 | erased. | |
7c913512 | 1573 | @param rect |
4cc4bfaf FM |
1574 | If non-@NULL, only the given rectangle will |
1575 | be treated as damaged. | |
23324ae1 | 1576 | |
4cc4bfaf | 1577 | @see RefreshRect() |
23324ae1 | 1578 | */ |
4cc4bfaf FM |
1579 | virtual void Refresh(bool eraseBackground = true, |
1580 | const wxRect* rect = NULL); | |
23324ae1 FM |
1581 | |
1582 | /** | |
1583 | Redraws the contents of the given rectangle: only the area inside it will be | |
1584 | repainted. | |
23324ae1 FM |
1585 | This is the same as Refresh() but has a nicer syntax |
1586 | as it can be called with a temporary wxRect object as argument like this | |
1587 | @c RefreshRect(wxRect(x, y, w, h)). | |
1588 | */ | |
4cc4bfaf | 1589 | void RefreshRect(const wxRect& rect, bool eraseBackground = true); |
23324ae1 FM |
1590 | |
1591 | /** | |
1592 | Registers a system wide hotkey. Every time the user presses the hotkey | |
1593 | registered here, this window | |
1594 | will receive a hotkey event. It will receive the event even if the application | |
1595 | is in the background | |
1596 | and does not have the input focus because the user is working with some other | |
1597 | application. | |
1598 | ||
7c913512 | 1599 | @param hotkeyId |
4cc4bfaf FM |
1600 | Numeric identifier of the hotkey. For applications this must be between 0 |
1601 | and 0xBFFF. If | |
1602 | this function is called from a shared DLL, it must be a system wide unique | |
23324ae1 | 1603 | identifier between 0xC000 and 0xFFFF. |
4cc4bfaf | 1604 | This is a MSW specific detail. |
7c913512 | 1605 | @param modifiers |
4cc4bfaf FM |
1606 | A bitwise combination of wxMOD_SHIFT, wxMOD_CONTROL, wxMOD_ALT |
1607 | or wxMOD_WIN specifying the modifier keys that have to be pressed along | |
1608 | with the key. | |
7c913512 | 1609 | @param virtualKeyCode |
4cc4bfaf | 1610 | The virtual key code of the hotkey. |
23324ae1 FM |
1611 | |
1612 | @returns @true if the hotkey was registered successfully. @false if some | |
4cc4bfaf FM |
1613 | other application already registered a hotkey with this |
1614 | modifier/virtualKeyCode combination. | |
23324ae1 FM |
1615 | |
1616 | @remarks Use EVT_HOTKEY(hotkeyId, fnc) in the event table to capture the | |
4cc4bfaf FM |
1617 | event. This function is currently only implemented |
1618 | under Windows. It is used in the Windows CE port for | |
1619 | detecting hardware button presses. | |
23324ae1 | 1620 | |
4cc4bfaf | 1621 | @see UnregisterHotKey() |
23324ae1 FM |
1622 | */ |
1623 | bool RegisterHotKey(int hotkeyId, int modifiers, | |
1624 | int virtualKeyCode); | |
1625 | ||
1626 | /** | |
1627 | Releases mouse input captured with CaptureMouse(). | |
1628 | ||
4cc4bfaf FM |
1629 | @see CaptureMouse(), HasCapture(), ReleaseMouse(), |
1630 | wxMouseCaptureLostEvent, wxMouseCaptureChangedEvent | |
23324ae1 FM |
1631 | */ |
1632 | virtual void ReleaseMouse(); | |
1633 | ||
1634 | /** | |
1635 | Removes a child window. This is called automatically by window deletion | |
1636 | functions so should not be required by the application programmer. | |
23324ae1 FM |
1637 | Notice that this function is mostly internal to wxWidgets and shouldn't be |
1638 | called by the user code. | |
1639 | ||
7c913512 | 1640 | @param child |
4cc4bfaf | 1641 | Child window to remove. |
23324ae1 FM |
1642 | */ |
1643 | virtual void RemoveChild(wxWindow* child); | |
1644 | ||
1645 | /** | |
4cc4bfaf | 1646 | Find the given @a handler in the windows event handler chain and remove (but |
23324ae1 FM |
1647 | not delete) it from it. |
1648 | ||
7c913512 | 1649 | @param handler |
4cc4bfaf FM |
1650 | The event handler to remove, must be non-@NULL and |
1651 | must be present in this windows event handlers chain | |
23324ae1 FM |
1652 | |
1653 | @returns Returns @true if it was found and @false otherwise (this also | |
4cc4bfaf FM |
1654 | results in an assert failure so this function should |
1655 | only be called when the handler is supposed to be | |
1656 | there). | |
23324ae1 | 1657 | |
4cc4bfaf | 1658 | @see PushEventHandler(), PopEventHandler() |
23324ae1 | 1659 | */ |
4cc4bfaf | 1660 | bool RemoveEventHandler(wxEvtHandler* handler); |
23324ae1 FM |
1661 | |
1662 | /** | |
1663 | Reparents the window, i.e the window will be removed from its | |
1664 | current parent window (e.g. a non-standard toolbar in a wxFrame) | |
1665 | and then re-inserted into another. | |
1666 | ||
7c913512 | 1667 | @param newParent |
4cc4bfaf | 1668 | New parent. |
23324ae1 FM |
1669 | */ |
1670 | virtual bool Reparent(wxWindow* newParent); | |
1671 | ||
1672 | //@{ | |
1673 | /** | |
1674 | Converts from screen to client window coordinates. | |
1675 | ||
7c913512 | 1676 | @param x |
4cc4bfaf | 1677 | Stores the screen x coordinate and receives the client x coordinate. |
7c913512 | 1678 | @param y |
4cc4bfaf | 1679 | Stores the screen x coordinate and receives the client x coordinate. |
7c913512 | 1680 | @param pt |
4cc4bfaf | 1681 | The screen position for the second form of the function. |
23324ae1 | 1682 | */ |
328f5751 FM |
1683 | virtual void ScreenToClient(int* x, int* y) const; |
1684 | const virtual wxPoint ScreenToClient(const wxPoint& pt) const; | |
23324ae1 FM |
1685 | //@} |
1686 | ||
1687 | /** | |
4cc4bfaf | 1688 | Scrolls the window by the given number of lines down (if @a lines is |
23324ae1 FM |
1689 | positive) or up. |
1690 | ||
1691 | @returns Returns @true if the window was scrolled, @false if it was already | |
4cc4bfaf | 1692 | on top/bottom and nothing was done. |
23324ae1 FM |
1693 | |
1694 | @remarks This function is currently only implemented under MSW and | |
4cc4bfaf FM |
1695 | wxTextCtrl under wxGTK (it also works for |
1696 | wxScrolledWindow derived classes under all platforms). | |
23324ae1 | 1697 | |
4cc4bfaf | 1698 | @see ScrollPages() |
23324ae1 FM |
1699 | */ |
1700 | virtual bool ScrollLines(int lines); | |
1701 | ||
1702 | /** | |
4cc4bfaf | 1703 | Scrolls the window by the given number of pages down (if @a pages is |
23324ae1 FM |
1704 | positive) or up. |
1705 | ||
1706 | @returns Returns @true if the window was scrolled, @false if it was already | |
4cc4bfaf | 1707 | on top/bottom and nothing was done. |
23324ae1 FM |
1708 | |
1709 | @remarks This function is currently only implemented under MSW and wxGTK. | |
1710 | ||
4cc4bfaf | 1711 | @see ScrollLines() |
23324ae1 FM |
1712 | */ |
1713 | virtual bool ScrollPages(int pages); | |
1714 | ||
1715 | /** | |
1716 | Physically scrolls the pixels in the window and move child windows accordingly. | |
1717 | ||
7c913512 | 1718 | @param dx |
4cc4bfaf | 1719 | Amount to scroll horizontally. |
7c913512 | 1720 | @param dy |
4cc4bfaf | 1721 | Amount to scroll vertically. |
7c913512 | 1722 | @param rect |
4cc4bfaf FM |
1723 | Rectangle to scroll, if it is @NULL, the whole window is |
1724 | scrolled (this is always the case under wxGTK which doesn't support this | |
1725 | parameter) | |
23324ae1 FM |
1726 | |
1727 | @remarks Note that you can often use wxScrolledWindow instead of using | |
4cc4bfaf | 1728 | this function directly. |
23324ae1 FM |
1729 | */ |
1730 | virtual void ScrollWindow(int dx, int dy, | |
4cc4bfaf | 1731 | const wxRect* rect = NULL); |
23324ae1 FM |
1732 | |
1733 | /** | |
1734 | Sets the accelerator table for this window. See wxAcceleratorTable. | |
1735 | */ | |
1736 | virtual void SetAcceleratorTable(const wxAcceleratorTable& accel); | |
1737 | ||
1738 | /** | |
1739 | Sets the accessible for this window. Any existing accessible for this window | |
1740 | will be deleted first, if not identical to @e accessible. | |
23324ae1 FM |
1741 | See also wxAccessible. |
1742 | */ | |
1743 | void SetAccessible(wxAccessible* accessible); | |
1744 | ||
1745 | /** | |
1746 | Determines whether the Layout() function will | |
1747 | be called automatically when the window is resized. Please note that this only | |
7c913512 FM |
1748 | happens for the windows usually used to contain children, namely |
1749 | wxPanel and wxTopLevelWindow | |
23324ae1 | 1750 | (and the classes deriving from them). |
7c913512 FM |
1751 | This method is called implicitly by |
1752 | SetSizer() but if you use | |
23324ae1 FM |
1753 | SetConstraints() you should call it |
1754 | manually or otherwise the window layout won't be correctly updated when its | |
1755 | size changes. | |
1756 | ||
7c913512 | 1757 | @param autoLayout |
4cc4bfaf FM |
1758 | Set this to @true if you wish the Layout function to be |
1759 | called automatically when the window is resized. | |
23324ae1 | 1760 | |
4cc4bfaf | 1761 | @see SetConstraints() |
23324ae1 FM |
1762 | */ |
1763 | void SetAutoLayout(bool autoLayout); | |
1764 | ||
1765 | /** | |
1766 | Sets the background colour of the window. | |
23324ae1 FM |
1767 | Please see InheritAttributes() for |
1768 | explanation of the difference between this method and | |
1769 | SetOwnBackgroundColour(). | |
1770 | ||
7c913512 | 1771 | @param colour |
4cc4bfaf FM |
1772 | The colour to be used as the background colour, pass |
1773 | wxNullColour to reset to the default colour. | |
23324ae1 FM |
1774 | |
1775 | @remarks The background colour is usually painted by the default | |
4cc4bfaf FM |
1776 | wxEraseEvent event handler function under Windows and |
1777 | automatically under GTK. | |
23324ae1 | 1778 | |
4cc4bfaf FM |
1779 | @see GetBackgroundColour(), SetForegroundColour(), |
1780 | GetForegroundColour(), ClearBackground(), | |
1781 | Refresh(), wxEraseEvent | |
23324ae1 FM |
1782 | */ |
1783 | virtual bool SetBackgroundColour(const wxColour& colour); | |
1784 | ||
1785 | /** | |
7c913512 | 1786 | Sets the background style of the window. see |
23324ae1 FM |
1787 | GetBackgroundStyle() for the description |
1788 | of the possible style values. | |
1789 | ||
4cc4bfaf FM |
1790 | @see SetBackgroundColour(), GetForegroundColour(), |
1791 | SetTransparent() | |
23324ae1 FM |
1792 | */ |
1793 | virtual void SetBackgroundStyle(wxBackgroundStyle style); | |
1794 | ||
1795 | /** | |
1796 | This method is only implemented by ports which have support for | |
1797 | native TAB traversal (such as GTK+ 2.0). It is called by wxWidgets' | |
1798 | container control code to give the native system a hint when | |
1799 | doing TAB traversal. A call to this does not disable or change | |
7c913512 | 1800 | the effect of programmatically calling |
23324ae1 FM |
1801 | SetFocus(). |
1802 | ||
4cc4bfaf | 1803 | @see wxFocusEvent, wxPanel::SetFocus, wxPanel::SetFocusIgnoringChildren |
23324ae1 FM |
1804 | */ |
1805 | virtual void SetCanFocus(bool canFocus); | |
1806 | ||
1807 | /** | |
e54c96f1 | 1808 | Sets the caret() associated with the window. |
23324ae1 | 1809 | */ |
328f5751 | 1810 | void SetCaret(wxCaret* caret) const; |
23324ae1 FM |
1811 | |
1812 | //@{ | |
1813 | /** | |
1814 | This sets the size of the window client area in pixels. Using this function to | |
1815 | size a window | |
1816 | tends to be more device-independent than SetSize(), since the application need | |
1817 | not | |
1818 | worry about what dimensions the border or title bar have when trying to fit the | |
1819 | window | |
1820 | around panel items, for example. | |
1821 | ||
7c913512 | 1822 | @param width |
4cc4bfaf | 1823 | The required client area width. |
7c913512 | 1824 | @param height |
4cc4bfaf | 1825 | The required client area height. |
7c913512 | 1826 | @param size |
4cc4bfaf | 1827 | The required client size. |
23324ae1 FM |
1828 | */ |
1829 | virtual void SetClientSize(int width, int height); | |
7c913512 | 1830 | virtual void SetClientSize(const wxSize& size); |
23324ae1 FM |
1831 | //@} |
1832 | ||
1833 | /** | |
1834 | Sets the window to have the given layout constraints. The window | |
1835 | will then own the object, and will take care of its deletion. | |
1836 | If an existing layout constraints object is already owned by the | |
1837 | window, it will be deleted. | |
1838 | ||
7c913512 | 1839 | @param constraints |
4cc4bfaf FM |
1840 | The constraints to set. Pass @NULL to disassociate and delete the window's |
1841 | constraints. | |
23324ae1 FM |
1842 | |
1843 | @remarks You must call SetAutoLayout() to tell a window to use | |
4cc4bfaf FM |
1844 | the constraints automatically in OnSize; otherwise, you |
1845 | must override OnSize and call Layout() explicitly. When | |
1846 | setting both a wxLayoutConstraints and a wxSizer, only | |
1847 | the sizer will have effect. | |
23324ae1 FM |
1848 | */ |
1849 | void SetConstraints(wxLayoutConstraints* constraints); | |
1850 | ||
1851 | /** | |
1852 | This normally does not need to be called by user code. It is called | |
1853 | when a window is added to a sizer, and is used so the window can | |
1854 | remove itself from the sizer when it is destroyed. | |
1855 | */ | |
1856 | void SetContainingSizer(wxSizer* sizer); | |
1857 | ||
1858 | /** | |
1859 | Sets the window's cursor. Notice that the window cursor also sets it for the | |
1860 | children of the window implicitly. | |
4cc4bfaf | 1861 | The @a cursor may be @c wxNullCursor in which case the window cursor will |
23324ae1 FM |
1862 | be reset back to default. |
1863 | ||
7c913512 | 1864 | @param cursor |
4cc4bfaf | 1865 | Specifies the cursor that the window should normally display. |
23324ae1 | 1866 | |
4cc4bfaf | 1867 | @see ::wxSetCursor, wxCursor |
23324ae1 FM |
1868 | */ |
1869 | virtual void SetCursor(const wxCursor& cursor); | |
1870 | ||
1871 | /** | |
1872 | Associates a drop target with this window. | |
23324ae1 FM |
1873 | If the window already has a drop target, it is deleted. |
1874 | ||
4cc4bfaf | 1875 | @see GetDropTarget(), @ref overview_wxdndoverview |
23324ae1 FM |
1876 | */ |
1877 | void SetDropTarget(wxDropTarget* target); | |
1878 | ||
1879 | /** | |
1880 | Sets the event handler for this window. | |
1881 | ||
7c913512 | 1882 | @param handler |
4cc4bfaf | 1883 | Specifies the handler to be set. |
23324ae1 FM |
1884 | |
1885 | @remarks An event handler is an object that is capable of processing the | |
4cc4bfaf FM |
1886 | events sent to a window. By default, the window is its |
1887 | own event handler, but an application may wish to | |
1888 | substitute another, for example to allow central | |
1889 | implementation of event-handling for a variety of | |
1890 | different window classes. | |
23324ae1 | 1891 | |
4cc4bfaf FM |
1892 | @see GetEventHandler(), PushEventHandler(), |
1893 | PopEventHandler(), wxEvtHandler::ProcessEvent, wxEvtHandler | |
23324ae1 FM |
1894 | */ |
1895 | void SetEventHandler(wxEvtHandler* handler); | |
1896 | ||
1897 | /** | |
1898 | Sets the extra style bits for the window. The currently defined extra style | |
1899 | bits are: | |
1900 | ||
1901 | @b wxWS_EX_VALIDATE_RECURSIVELY | |
1902 | ||
23324ae1 FM |
1903 | TransferDataTo/FromWindow() |
1904 | and Validate() methods will recursively descend into all children of the | |
1905 | window if it has this style flag set. | |
1906 | ||
1907 | @b wxWS_EX_BLOCK_EVENTS | |
1908 | ||
23324ae1 FM |
1909 | Normally, the command |
1910 | events are propagated upwards to the window parent recursively until a handler | |
1911 | for them is found. Using this style allows to prevent them from being | |
1912 | propagated beyond this window. Notice that wxDialog has this style on by | |
1913 | default for the reasons explained in the | |
1914 | @ref overview_eventprocessing "event processing overview". | |
1915 | ||
1916 | @b wxWS_EX_TRANSIENT | |
1917 | ||
23324ae1 FM |
1918 | This can be used to prevent a |
1919 | window from being used as an implicit parent for the dialogs which were | |
1920 | created without a parent. It is useful for the windows which can disappear at | |
1921 | any moment as creating children of such windows results in fatal problems. | |
1922 | ||
1923 | @b wxWS_EX_CONTEXTHELP | |
1924 | ||
23324ae1 FM |
1925 | Under Windows, puts a query |
1926 | button on the caption. When pressed, Windows will go into a context-sensitive | |
1927 | help mode and wxWidgets will send a wxEVT_HELP event if the user clicked on an | |
1928 | application window. | |
1929 | This style cannot be used together with wxMAXIMIZE_BOX or wxMINIMIZE_BOX, so | |
1930 | these two styles are automatically turned of if this one is used. | |
1931 | ||
1932 | @b wxWS_EX_PROCESS_IDLE | |
1933 | ||
23324ae1 FM |
1934 | This window should always process idle events, even |
1935 | if the mode set by wxIdleEvent::SetMode is wxIDLE_PROCESS_SPECIFIED. | |
1936 | ||
1937 | @b wxWS_EX_PROCESS_UI_UPDATES | |
1938 | ||
23324ae1 FM |
1939 | This window should always process UI update events, |
1940 | even if the mode set by wxUpdateUIEvent::SetMode is | |
1941 | wxUPDATE_UI_PROCESS_SPECIFIED. | |
1942 | */ | |
1943 | void SetExtraStyle(long exStyle); | |
1944 | ||
1945 | /** | |
1946 | This sets the window to receive keyboard input. | |
1947 | ||
4cc4bfaf FM |
1948 | @see HasFocus(), wxFocusEvent, wxPanel::SetFocus, |
1949 | wxPanel::SetFocusIgnoringChildren | |
23324ae1 FM |
1950 | */ |
1951 | virtual void SetFocus(); | |
1952 | ||
1953 | /** | |
1954 | This function is called by wxWidgets keyboard navigation code when the user | |
1955 | gives the focus to this window from keyboard (e.g. using @c TAB key). | |
1956 | By default this method simply calls SetFocus() but | |
1957 | can be overridden to do something in addition to this in the derived classes. | |
1958 | */ | |
1959 | virtual void SetFocusFromKbd(); | |
1960 | ||
1961 | /** | |
1962 | Sets the font for this window. This function should not be called for the | |
1963 | parent window if you don't want its font to be inherited by its children, | |
1964 | use SetOwnFont() instead in this case and | |
1965 | see InheritAttributes() for more | |
1966 | explanations. | |
7c913512 | 1967 | Please notice that the given font is not automatically used for |
23324ae1 FM |
1968 | wxPaintDC objects associated with this window, you need to |
1969 | call wxDC::SetFont too. However this font is used by | |
7c913512 | 1970 | any standard controls for drawing their text as well as by |
23324ae1 FM |
1971 | GetTextExtent(). |
1972 | ||
7c913512 | 1973 | @param font |
4cc4bfaf FM |
1974 | Font to associate with this window, pass |
1975 | wxNullFont to reset to the default font. | |
23324ae1 FM |
1976 | |
1977 | @returns @true if the want was really changed, @false if it was already set | |
4cc4bfaf | 1978 | to this font and so nothing was done. |
23324ae1 | 1979 | |
4cc4bfaf | 1980 | @see GetFont(), InheritAttributes() |
23324ae1 FM |
1981 | */ |
1982 | bool SetFont(const wxFont& font); | |
1983 | ||
1984 | /** | |
1985 | Sets the foreground colour of the window. | |
23324ae1 FM |
1986 | Please see InheritAttributes() for |
1987 | explanation of the difference between this method and | |
1988 | SetOwnForegroundColour(). | |
1989 | ||
7c913512 | 1990 | @param colour |
4cc4bfaf FM |
1991 | The colour to be used as the foreground colour, pass |
1992 | wxNullColour to reset to the default colour. | |
23324ae1 FM |
1993 | |
1994 | @remarks The interpretation of foreground colour is open to | |
4cc4bfaf FM |
1995 | interpretation according to the window class; it may be |
1996 | the text colour or other colour, or it may not be used | |
1997 | at all. | |
23324ae1 | 1998 | |
4cc4bfaf FM |
1999 | @see GetForegroundColour(), SetBackgroundColour(), |
2000 | GetBackgroundColour(), ShouldInheritColours() | |
23324ae1 FM |
2001 | */ |
2002 | virtual void SetForegroundColour(const wxColour& colour); | |
2003 | ||
2004 | /** | |
2005 | Sets the help text to be used as context-sensitive help for this window. | |
23324ae1 FM |
2006 | Note that the text is actually stored by the current wxHelpProvider |
2007 | implementation, | |
2008 | and not in the window object itself. | |
2009 | ||
4cc4bfaf | 2010 | @see GetHelpText(), wxHelpProvider |
23324ae1 FM |
2011 | */ |
2012 | virtual void SetHelpText(const wxString& helpText); | |
2013 | ||
2014 | /** | |
2015 | Sets the identifier of the window. | |
2016 | ||
2017 | @remarks Each window has an integer identifier. If the application has | |
4cc4bfaf FM |
2018 | not provided one, an identifier will be generated. |
2019 | Normally, the identifier should be provided on creation | |
2020 | and should not be modified subsequently. | |
23324ae1 | 2021 | |
4cc4bfaf | 2022 | @see GetId(), @ref overview_windowids "Window identifiers" |
23324ae1 FM |
2023 | */ |
2024 | void SetId(int id); | |
2025 | ||
2026 | /** | |
2027 | Sets the initial window size if none is given (i.e. at least one of the | |
2028 | components of the size passed to ctor/Create() is wxDefaultCoord). | |
2029 | */ | |
2030 | virtual void SetInitialBestSize(const wxSize& size); | |
2031 | ||
2032 | /** | |
2033 | A @e smart SetSize that will fill in default size components with the | |
2034 | window's @e best size values. Also sets the window's minsize to | |
2035 | the value passed in for use with sizers. This means that if a full or | |
2036 | partial size is passed to this function then the sizers will use that | |
2037 | size instead of the results of GetBestSize to determine the minimum | |
2038 | needs of the window for layout. | |
23324ae1 FM |
2039 | Most controls will use this to set their initial size, and their min |
2040 | size to the passed in value (if any.) | |
2041 | ||
4cc4bfaf | 2042 | @see SetSize(), GetBestSize(), GetEffectiveMinSize() |
23324ae1 FM |
2043 | */ |
2044 | void SetInitialSize(const wxSize& size = wxDefaultSize); | |
2045 | ||
2046 | /** | |
2047 | Sets the window's label. | |
2048 | ||
7c913512 | 2049 | @param label |
4cc4bfaf | 2050 | The window label. |
23324ae1 | 2051 | |
4cc4bfaf | 2052 | @see GetLabel() |
23324ae1 FM |
2053 | */ |
2054 | virtual void SetLabel(const wxString& label); | |
2055 | ||
2056 | /** | |
2057 | Sets the maximum client size of the window, to indicate to the sizer | |
2058 | layout mechanism that this is the maximum possible size of its client area. | |
2059 | ||
4cc4bfaf | 2060 | @see SetMaxSize() |
23324ae1 FM |
2061 | */ |
2062 | void SetMaxClientSize(const wxSize& size); | |
2063 | ||
2064 | /** | |
2065 | Sets the maximum size of the window, to indicate to the sizer layout mechanism | |
2066 | that this is the maximum possible size. | |
2067 | ||
4cc4bfaf | 2068 | @see SetMaxClientSize() |
23324ae1 FM |
2069 | */ |
2070 | void SetMaxSize(const wxSize& size); | |
2071 | ||
2072 | /** | |
2073 | Sets the minimum client size of the window, to indicate to the sizer | |
2074 | layout mechanism that this is the minimum required size of window's client | |
2075 | area. You may need to call this if you change the window size after | |
2076 | construction and before adding to its parent sizer. | |
2077 | ||
4cc4bfaf | 2078 | @see SetMinSize() |
23324ae1 FM |
2079 | */ |
2080 | void SetMinClientSize(const wxSize& size); | |
2081 | ||
2082 | /** | |
2083 | Sets the minimum size of the window, to indicate to the sizer layout mechanism | |
2084 | that this is the minimum required size. You may need to call this | |
2085 | if you change the window size after construction and before adding | |
2086 | to its parent sizer. | |
2087 | ||
4cc4bfaf | 2088 | @see SetMinClientSize() |
23324ae1 FM |
2089 | */ |
2090 | void SetMinSize(const wxSize& size); | |
2091 | ||
2092 | /** | |
2093 | Sets the window's name. | |
2094 | ||
7c913512 | 2095 | @param name |
4cc4bfaf | 2096 | A name to set for the window. |
23324ae1 | 2097 | |
4cc4bfaf | 2098 | @see GetName() |
23324ae1 FM |
2099 | */ |
2100 | virtual void SetName(const wxString& name); | |
2101 | ||
2102 | /** | |
2103 | Sets the background colour of the window but prevents it from being inherited | |
2104 | by the children of this window. | |
2105 | ||
4cc4bfaf | 2106 | @see SetBackgroundColour(), InheritAttributes() |
23324ae1 FM |
2107 | */ |
2108 | void SetOwnBackgroundColour(const wxColour& colour); | |
2109 | ||
2110 | /** | |
2111 | Sets the font of the window but prevents it from being inherited by the | |
2112 | children of this window. | |
2113 | ||
4cc4bfaf | 2114 | @see SetFont(), InheritAttributes() |
23324ae1 FM |
2115 | */ |
2116 | void SetOwnFont(const wxFont& font); | |
2117 | ||
2118 | /** | |
2119 | Sets the foreground colour of the window but prevents it from being inherited | |
2120 | by the children of this window. | |
2121 | ||
4cc4bfaf | 2122 | @see SetForegroundColour(), InheritAttributes() |
23324ae1 FM |
2123 | */ |
2124 | void SetOwnForegroundColour(const wxColour& colour); | |
2125 | ||
2126 | /** | |
2127 | Obsolete - use wxDC::SetPalette instead. | |
2128 | */ | |
2129 | virtual void SetPalette(wxPalette* palette); | |
2130 | ||
2131 | /** | |
2132 | Sets the position of one of the built-in scrollbars. | |
2133 | ||
7c913512 | 2134 | @param orientation |
4cc4bfaf FM |
2135 | Determines the scrollbar whose position is to be set. May be wxHORIZONTAL |
2136 | or wxVERTICAL. | |
7c913512 | 2137 | @param pos |
4cc4bfaf | 2138 | Position in scroll units. |
7c913512 | 2139 | @param refresh |
4cc4bfaf | 2140 | @true to redraw the scrollbar, @false otherwise. |
23324ae1 FM |
2141 | |
2142 | @remarks This function does not directly affect the contents of the | |
4cc4bfaf FM |
2143 | window: it is up to the application to take note of |
2144 | scrollbar attributes and redraw contents accordingly. | |
23324ae1 | 2145 | |
4cc4bfaf FM |
2146 | @see SetScrollbar(), GetScrollPos(), GetScrollThumb(), |
2147 | wxScrollBar, wxScrolledWindow | |
23324ae1 FM |
2148 | */ |
2149 | virtual void SetScrollPos(int orientation, int pos, | |
4cc4bfaf | 2150 | bool refresh = true); |
23324ae1 FM |
2151 | |
2152 | /** | |
2153 | Sets the scrollbar properties of a built-in scrollbar. | |
2154 | ||
7c913512 | 2155 | @param orientation |
4cc4bfaf FM |
2156 | Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL |
2157 | or wxVERTICAL. | |
7c913512 | 2158 | @param position |
4cc4bfaf | 2159 | The position of the scrollbar in scroll units. |
7c913512 | 2160 | @param thumbSize |
4cc4bfaf | 2161 | The size of the thumb, or visible portion of the scrollbar, in scroll units. |
7c913512 | 2162 | @param range |
4cc4bfaf | 2163 | The maximum position of the scrollbar. |
7c913512 | 2164 | @param refresh |
4cc4bfaf | 2165 | @true to redraw the scrollbar, @false otherwise. |
23324ae1 FM |
2166 | |
2167 | @remarks Let's say you wish to display 50 lines of text, using the same | |
4cc4bfaf FM |
2168 | font. The window is sized so that you can only see 16 |
2169 | lines at a time. | |
23324ae1 | 2170 | |
4cc4bfaf FM |
2171 | @see @ref overview_scrollingoverview "Scrolling overview", wxScrollBar, |
2172 | wxScrolledWindow, wxScrollWinEvent | |
23324ae1 FM |
2173 | */ |
2174 | virtual void SetScrollbar(int orientation, int position, | |
2175 | int thumbSize, | |
2176 | int range, | |
4cc4bfaf | 2177 | bool refresh = true); |
23324ae1 FM |
2178 | |
2179 | //@{ | |
2180 | /** | |
2181 | Sets the size of the window in pixels. | |
2182 | ||
7c913512 | 2183 | @param x |
4cc4bfaf FM |
2184 | Required x position in pixels, or wxDefaultCoord to indicate that the |
2185 | existing | |
2186 | value should be used. | |
7c913512 | 2187 | @param y |
4cc4bfaf FM |
2188 | Required y position in pixels, or wxDefaultCoord to indicate that the |
2189 | existing | |
2190 | value should be used. | |
7c913512 | 2191 | @param width |
4cc4bfaf FM |
2192 | Required width in pixels, or wxDefaultCoord to indicate that the existing |
2193 | value should be used. | |
7c913512 | 2194 | @param height |
4cc4bfaf | 2195 | Required height position in pixels, or wxDefaultCoord to indicate that the |
23324ae1 | 2196 | existing |
4cc4bfaf | 2197 | value should be used. |
7c913512 | 2198 | @param size |
4cc4bfaf | 2199 | wxSize object for setting the size. |
7c913512 | 2200 | @param rect |
4cc4bfaf | 2201 | wxRect object for setting the position and size. |
7c913512 | 2202 | @param sizeFlags |
4cc4bfaf | 2203 | Indicates the interpretation of other parameters. It is a bit list of the |
23324ae1 | 2204 | following: |
4cc4bfaf FM |
2205 | wxSIZE_AUTO_WIDTH: a wxDefaultCoord width value is taken to indicate |
2206 | a wxWidgets-supplied default width. | |
23324ae1 | 2207 | |
4cc4bfaf FM |
2208 | wxSIZE_AUTO_HEIGHT: a wxDefaultCoord height value is taken to indicate |
2209 | a wxWidgets-supplied default height. | |
23324ae1 | 2210 | |
4cc4bfaf FM |
2211 | wxSIZE_AUTO: wxDefaultCoord size values are taken to indicate |
2212 | a wxWidgets-supplied default size. | |
23324ae1 | 2213 | |
4cc4bfaf FM |
2214 | wxSIZE_USE_EXISTING: existing dimensions should be used |
2215 | if wxDefaultCoord values are supplied. | |
23324ae1 | 2216 | |
4cc4bfaf | 2217 | wxSIZE_ALLOW_MINUS_ONE: allow negative dimensions (i.e. value of |
23324ae1 | 2218 | wxDefaultCoord) to be interpreted |
4cc4bfaf FM |
2219 | as real dimensions, not default values. |
2220 | wxSIZE_FORCE: normally, if the position and the size of the window are | |
2221 | already the same as the parameters of this function, nothing is done. but | |
2222 | with | |
2223 | this flag a window resize may be forced even in this case (supported in wx | |
2224 | 2.6.2 and later and only implemented for MSW and ignored elsewhere | |
2225 | currently) | |
23324ae1 FM |
2226 | |
2227 | @remarks The second form is a convenience for calling the first form with | |
4cc4bfaf FM |
2228 | default x and y parameters, and must be used with |
2229 | non-default width and height values. | |
23324ae1 | 2230 | |
4cc4bfaf | 2231 | @see Move() |
23324ae1 FM |
2232 | */ |
2233 | virtual void SetSize(int x, int y, int width, int height, | |
2234 | int sizeFlags = wxSIZE_AUTO); | |
7c913512 FM |
2235 | virtual void SetSize(const wxRect& rect); |
2236 | virtual void SetSize(int width, int height); | |
2237 | virtual void SetSize(const wxSize& size); | |
23324ae1 FM |
2238 | //@} |
2239 | ||
2240 | /** | |
2241 | Use of this function for windows which are not toplevel windows | |
7c913512 | 2242 | (such as wxDialog or wxFrame) is discouraged. Please use |
23324ae1 FM |
2243 | SetMinSize() and SetMaxSize() |
2244 | instead. | |
2245 | ||
4cc4bfaf | 2246 | @see wxTopLevelWindow::SetSizeHints. |
23324ae1 FM |
2247 | */ |
2248 | ||
2249 | ||
2250 | /** | |
2251 | Sets the window to have the given layout sizer. The window | |
2252 | will then own the object, and will take care of its deletion. | |
2253 | If an existing layout constraints object is already owned by the | |
2254 | window, it will be deleted if the deleteOld parameter is @true. | |
23324ae1 FM |
2255 | Note that this function will also call |
2256 | SetAutoLayout() implicitly with @true | |
4cc4bfaf | 2257 | parameter if the @a sizer is non-@NULL and @false otherwise. |
23324ae1 | 2258 | |
7c913512 | 2259 | @param sizer |
4cc4bfaf FM |
2260 | The sizer to set. Pass @NULL to disassociate and conditionally delete |
2261 | the window's sizer. See below. | |
7c913512 | 2262 | @param deleteOld |
4cc4bfaf FM |
2263 | If @true (the default), this will delete any pre-existing sizer. |
2264 | Pass @false if you wish to handle deleting the old sizer yourself. | |
23324ae1 FM |
2265 | |
2266 | @remarks SetSizer now enables and disables Layout automatically, but | |
4cc4bfaf | 2267 | prior to wxWidgets 2.3.3 the following applied: |
23324ae1 | 2268 | */ |
4cc4bfaf | 2269 | void SetSizer(wxSizer* sizer, bool deleteOld = true); |
23324ae1 FM |
2270 | |
2271 | /** | |
7c913512 | 2272 | This method calls SetSizer() and then |
23324ae1 FM |
2273 | wxSizer::SetSizeHints which sets the initial |
2274 | window size to the size needed to accommodate all sizer elements and sets the | |
2275 | size hints which, if this window is a top level one, prevent the user from | |
2276 | resizing it to be less than this minimial size. | |
2277 | */ | |
4cc4bfaf | 2278 | void SetSizerAndFit(wxSizer* sizer, bool deleteOld = true); |
23324ae1 FM |
2279 | |
2280 | /** | |
2281 | This function tells a window if it should use the system's "theme" code | |
2282 | to draw the windows' background instead if its own background drawing | |
2283 | code. This does not always have any effect since the underlying platform | |
2284 | obviously needs to support the notion of themes in user defined windows. | |
2285 | One such platform is GTK+ where windows can have (very colourful) backgrounds | |
2286 | defined by a user's selected theme. | |
23324ae1 FM |
2287 | Dialogs, notebook pages and the status bar have this flag set to @true |
2288 | by default so that the default look and feel is simulated best. | |
2289 | */ | |
2290 | virtual void SetThemeEnabled(bool enable); | |
2291 | ||
2292 | //@{ | |
2293 | /** | |
2294 | Attach a tooltip to the window. | |
23324ae1 FM |
2295 | See also: GetToolTip(), |
2296 | wxToolTip | |
2297 | */ | |
2298 | void SetToolTip(const wxString& tip); | |
7c913512 | 2299 | void SetToolTip(wxToolTip* tip); |
23324ae1 FM |
2300 | //@} |
2301 | ||
2302 | /** | |
2303 | Set the transparency of the window. If the system supports transparent windows, | |
2304 | returns @true, otherwise returns @false and the window remains fully opaque. | |
2305 | See also CanSetTransparent(). | |
4cc4bfaf | 2306 | The parameter @a alpha is in the range 0..255 where 0 corresponds to a |
23324ae1 FM |
2307 | fully transparent window and 255 to the fully opaque one. The constants |
2308 | @c wxIMAGE_ALPHA_TRANSPARENT and @c wxIMAGE_ALPHA_OPAQUE can be | |
2309 | used. | |
2310 | */ | |
2311 | bool SetTransparent(wxByte alpha); | |
2312 | ||
2313 | /** | |
2314 | Deletes the current validator (if any) and sets the window validator, having | |
2315 | called wxValidator::Clone to | |
2316 | create a new validator of this type. | |
2317 | */ | |
2318 | virtual void SetValidator(const wxValidator& validator); | |
2319 | ||
2320 | //@{ | |
2321 | /** | |
2322 | Sets the virtual size of the window in pixels. | |
2323 | */ | |
2324 | void SetVirtualSize(int width, int height); | |
7c913512 | 2325 | void SetVirtualSize(const wxSize& size); |
23324ae1 FM |
2326 | //@} |
2327 | ||
2328 | //@{ | |
2329 | /** | |
2330 | Allows specification of minimum and maximum virtual window sizes. | |
2331 | If a pair of values is not set (or set to -1), the default values | |
2332 | will be used. | |
2333 | ||
7c913512 | 2334 | @param minW |
4cc4bfaf | 2335 | Specifies the minimum width allowable. |
7c913512 | 2336 | @param minH |
4cc4bfaf | 2337 | Specifies the minimum height allowable. |
7c913512 | 2338 | @param maxW |
4cc4bfaf | 2339 | Specifies the maximum width allowable. |
7c913512 | 2340 | @param maxH |
4cc4bfaf | 2341 | Specifies the maximum height allowable. |
7c913512 | 2342 | @param minSize |
4cc4bfaf | 2343 | Minimum size. |
7c913512 | 2344 | @param maxSize |
4cc4bfaf | 2345 | Maximum size. |
23324ae1 FM |
2346 | |
2347 | @remarks If this function is called, the user will not be able to size | |
4cc4bfaf | 2348 | the virtual area of the window outside the given bounds. |
23324ae1 | 2349 | */ |
4cc4bfaf FM |
2350 | virtual void SetVirtualSizeHints(int minW, int minH, int maxW = -1, |
2351 | int maxH = -1); | |
2352 | void SetVirtualSizeHints(const wxSize& minSize = wxDefaultSize, | |
2353 | const wxSize& maxSize = wxDefaultSize); | |
23324ae1 FM |
2354 | //@} |
2355 | ||
2356 | /** | |
2357 | Identical to SetWindowStyleFlag(). | |
2358 | */ | |
2359 | void SetWindowStyle(long style); | |
2360 | ||
2361 | /** | |
2362 | Sets the style of the window. Please note that some styles cannot be changed | |
2363 | after the window creation and that Refresh() might | |
2364 | need to be be called after changing the others for the change to take place | |
2365 | immediately. | |
23324ae1 FM |
2366 | See @ref overview_windowstyles "Window styles" for more information about flags. |
2367 | ||
4cc4bfaf | 2368 | @see GetWindowStyleFlag() |
23324ae1 FM |
2369 | */ |
2370 | virtual void SetWindowStyleFlag(long style); | |
2371 | ||
2372 | /** | |
2373 | This function can be called under all platforms but only does anything under | |
2374 | Mac OS X 10.3+ currently. Under this system, each of the standard control can | |
2375 | exist in several sizes which correspond to the elements of wxWindowVariant | |
2376 | enum: | |
2377 | ||
2378 | By default the controls use the normal size, of course, but this function can | |
2379 | be used to change this. | |
2380 | */ | |
2381 | void SetWindowVariant(wxWindowVariant variant); | |
2382 | ||
2383 | /** | |
2384 | Return @true from here to allow the colours of this window to be changed by | |
2385 | InheritAttributes(), returning @false | |
2386 | forbids inheriting them from the parent window. | |
23324ae1 FM |
2387 | The base class version returns @false, but this method is overridden in |
2388 | wxControl where it returns @true. | |
2389 | */ | |
2390 | virtual bool ShouldInheritColours(); | |
2391 | ||
2392 | /** | |
2393 | Shows or hides the window. You may need to call Raise() | |
2394 | for a top level window if you want to bring it to top, although this is not | |
2395 | needed if Show() is called immediately after the frame creation. | |
2396 | ||
7c913512 | 2397 | @param show |
4cc4bfaf | 2398 | If @true displays the window. Otherwise, hides it. |
23324ae1 FM |
2399 | |
2400 | @returns @true if the window has been shown or hidden or @false if nothing | |
4cc4bfaf | 2401 | was done because it already was in the requested state. |
23324ae1 | 2402 | |
4cc4bfaf | 2403 | @see IsShown(), Hide(), wxRadioBox::Show |
23324ae1 | 2404 | */ |
4cc4bfaf | 2405 | virtual bool Show(bool show = true); |
23324ae1 FM |
2406 | |
2407 | /** | |
2408 | This function shows a window, like Show(), but using a | |
2409 | special visual effect if possible. | |
4cc4bfaf | 2410 | Possible values for @a effect are: |
23324ae1 FM |
2411 | |
2412 | wxSHOW_EFFECT_ROLL | |
2413 | ||
23324ae1 FM |
2414 | Roll window effect |
2415 | ||
2416 | wxSHOW_EFFECT_SLIDE | |
2417 | ||
23324ae1 FM |
2418 | Sliding window effect |
2419 | ||
2420 | wxSHOW_EFFECT_BLEND | |
2421 | ||
23324ae1 FM |
2422 | Fade in or out effect |
2423 | ||
2424 | wxSHOW_EFFECT_EXPAND | |
2425 | ||
23324ae1 FM |
2426 | Expanding or collapsing effect |
2427 | ||
4cc4bfaf | 2428 | For the roll and slide effects the @a dir parameter specifies the animation |
7c913512 | 2429 | direction: it can be one of @c wxTOP, @c wxBOTTOM, @c wxLEFT |
23324ae1 | 2430 | or @c wxRIGHT. For the other effects, this parameter is unused. |
4cc4bfaf | 2431 | The @a timeout parameter specifies the time of the animation, in |
23324ae1 FM |
2432 | milliseconds. If the default value of 0 is used, the default animation time |
2433 | for the current platform is used. | |
23324ae1 FM |
2434 | Currently this function is only implemented in wxMSW and does the same thing as |
2435 | Show() in the other ports. | |
e54c96f1 FM |
2436 | |
2437 | @wxsince{2.9.0} | |
23324ae1 | 2438 | |
4cc4bfaf | 2439 | @see HideWithEffect() |
23324ae1 FM |
2440 | */ |
2441 | virtual bool ShowWithEffect(wxShowEffect effect, | |
2442 | unsigned timeout = 0, | |
2443 | wxDirection dir = wxBOTTOM); | |
2444 | ||
2445 | /** | |
2446 | Reenables window updating after a previous call to | |
2447 | Freeze(). To really thaw the control, it must be called | |
2448 | exactly the same number of times as Freeze(). | |
2449 | ||
4cc4bfaf | 2450 | @see wxWindowUpdateLocker |
23324ae1 FM |
2451 | */ |
2452 | virtual void Thaw(); | |
2453 | ||
2454 | /** | |
4cc4bfaf | 2455 | Turns the given @a flag on if it's currently turned off and vice versa. |
23324ae1 FM |
2456 | This function cannot be used if the value of the flag is 0 (which is often |
2457 | the case for default flags). | |
23324ae1 FM |
2458 | Also, please notice that not all styles can be changed after the control |
2459 | creation. | |
2460 | ||
2461 | @returns Returns @true if the style was turned on by this function, @false | |
4cc4bfaf | 2462 | if it was switched off. |
23324ae1 | 2463 | |
4cc4bfaf | 2464 | @see SetWindowStyleFlag(), HasFlag() |
23324ae1 FM |
2465 | */ |
2466 | bool ToggleWindowStyle(int flag); | |
2467 | ||
2468 | /** | |
2469 | Transfers values from child controls to data areas specified by their | |
2470 | validators. Returns | |
2471 | @false if a transfer failed. | |
23324ae1 FM |
2472 | If the window has @c wxWS_EX_VALIDATE_RECURSIVELY extra style flag set, |
2473 | the method will also call TransferDataFromWindow() of all child windows. | |
2474 | ||
4cc4bfaf | 2475 | @see TransferDataToWindow(), wxValidator, Validate() |
23324ae1 FM |
2476 | */ |
2477 | virtual bool TransferDataFromWindow(); | |
2478 | ||
2479 | /** | |
2480 | Transfers values to child controls from data areas specified by their | |
2481 | validators. | |
23324ae1 FM |
2482 | If the window has @c wxWS_EX_VALIDATE_RECURSIVELY extra style flag set, |
2483 | the method will also call TransferDataToWindow() of all child windows. | |
2484 | ||
2485 | @returns Returns @false if a transfer failed. | |
2486 | ||
4cc4bfaf | 2487 | @see TransferDataFromWindow(), wxValidator, Validate() |
23324ae1 FM |
2488 | */ |
2489 | virtual bool TransferDataToWindow(); | |
2490 | ||
2491 | /** | |
2492 | Unregisters a system wide hotkey. | |
2493 | ||
7c913512 | 2494 | @param hotkeyId |
4cc4bfaf | 2495 | Numeric identifier of the hotkey. Must be the same id that was passed to |
23324ae1 FM |
2496 | RegisterHotKey. |
2497 | ||
2498 | @returns @true if the hotkey was unregistered successfully, @false if the | |
4cc4bfaf | 2499 | id was invalid. |
23324ae1 FM |
2500 | |
2501 | @remarks This function is currently only implemented under MSW. | |
2502 | ||
4cc4bfaf | 2503 | @see RegisterHotKey() |
23324ae1 FM |
2504 | */ |
2505 | bool UnregisterHotKey(int hotkeyId); | |
2506 | ||
2507 | /** | |
2508 | Unreserve an ID or range of IDs that was reserved by NewControlId(). | |
23324ae1 FM |
2509 | See @ref overview_windowidsoverview "Window IDs overview" for more information. |
2510 | ||
7c913512 | 2511 | @param id |
4cc4bfaf | 2512 | The starting ID of the range of IDs to unreserve. |
7c913512 | 2513 | @param count |
4cc4bfaf | 2514 | The number of sequential IDs to unreserve. |
23324ae1 | 2515 | |
4cc4bfaf FM |
2516 | @see NewControlId(), wxIdManager, @ref overview_windowidsoverview |
2517 | "Window IDs overview" | |
23324ae1 FM |
2518 | */ |
2519 | static void UnreserveControlId(wxWindowID id, int count = 1); | |
2520 | ||
2521 | /** | |
2522 | Calling this method immediately repaints the invalidated area of the window and | |
2523 | all of its children recursively while this would usually only happen when the | |
7c913512 | 2524 | flow of control returns to the event loop. |
23324ae1 FM |
2525 | Notice that this function doesn't invalidate any area of the window so |
2526 | nothing happens if nothing has been invalidated (i.e. marked as requiring | |
2527 | a redraw). Use Refresh() first if you want to | |
2528 | immediately redraw the window unconditionally. | |
2529 | */ | |
2530 | virtual void Update(); | |
2531 | ||
2532 | /** | |
e54c96f1 | 2533 | This function sends wxUpdateUIEvents() to |
23324ae1 FM |
2534 | the window. The particular implementation depends on the window; for |
2535 | example a wxToolBar will send an update UI event for each toolbar button, | |
2536 | and a wxFrame will send an update UI event for each menubar menu item. | |
2537 | You can call this function from your application to ensure that your | |
2538 | UI is up-to-date at this point (as far as your wxUpdateUIEvent handlers | |
2539 | are concerned). This may be necessary if you have called | |
2540 | wxUpdateUIEvent::SetMode or | |
2541 | wxUpdateUIEvent::SetUpdateInterval to | |
2542 | limit the overhead that wxWidgets incurs by sending update UI events in idle | |
2543 | time. | |
4cc4bfaf | 2544 | @a flags should be a bitlist of one or more of the following values. |
23324ae1 | 2545 | |
23324ae1 FM |
2546 | If you are calling this function from an OnInternalIdle or OnIdle |
2547 | function, make sure you pass the wxUPDATE_UI_FROMIDLE flag, since | |
2548 | this tells the window to only update the UI elements that need | |
2549 | to be updated in idle time. Some windows update their elements | |
2550 | only when necessary, for example when a menu is about to be shown. | |
2551 | The following is an example of how to call UpdateWindowUI from | |
2552 | an idle function. | |
2553 | ||
4cc4bfaf | 2554 | @see wxUpdateUIEvent, DoUpdateWindowUI(), OnInternalIdle() |
23324ae1 FM |
2555 | */ |
2556 | virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE); | |
2557 | ||
2558 | /** | |
2559 | Validates the current values of the child controls using their validators. | |
23324ae1 FM |
2560 | If the window has @c wxWS_EX_VALIDATE_RECURSIVELY extra style flag set, |
2561 | the method will also call Validate() of all child windows. | |
2562 | ||
2563 | @returns Returns @false if any of the validations failed. | |
2564 | ||
4cc4bfaf FM |
2565 | @see TransferDataFromWindow(), TransferDataToWindow(), |
2566 | wxValidator | |
23324ae1 FM |
2567 | */ |
2568 | virtual bool Validate(); | |
2569 | ||
2570 | /** | |
2571 | Moves the pointer to the given position on the window. | |
23324ae1 FM |
2572 | @b NB: This function is not supported under Mac because Apple Human |
2573 | Interface Guidelines forbid moving the mouse cursor programmatically. | |
2574 | ||
7c913512 | 2575 | @param x |
4cc4bfaf | 2576 | The new x position for the cursor. |
7c913512 | 2577 | @param y |
4cc4bfaf | 2578 | The new y position for the cursor. |
23324ae1 FM |
2579 | */ |
2580 | void WarpPointer(int x, int y); | |
2581 | }; | |
2582 | ||
2583 | ||
e54c96f1 | 2584 | |
23324ae1 FM |
2585 | // ============================================================================ |
2586 | // Global functions/macros | |
2587 | // ============================================================================ | |
2588 | ||
2589 | /** | |
2590 | Find the deepest window at the given mouse position in screen coordinates, | |
2591 | returning the window if found, or @NULL if not. | |
2592 | */ | |
4cc4bfaf | 2593 | wxWindow* wxFindWindowAtPoint(const wxPoint& pt); |
23324ae1 FM |
2594 | |
2595 | /** | |
2596 | Find the deepest window at the mouse pointer position, returning the window | |
2597 | and current pointer position in screen coordinates. | |
2598 | */ | |
4cc4bfaf | 2599 | wxWindow* wxFindWindowAtPointer(wxPoint& pt); |
23324ae1 FM |
2600 | |
2601 | /** | |
2602 | Gets the currently active window (implemented for MSW and GTK only currently, | |
2603 | always returns @NULL in the other ports). | |
2604 | */ | |
4cc4bfaf | 2605 | wxWindow* wxGetActiveWindow(); |
23324ae1 FM |
2606 | |
2607 | /** | |
2608 | Returns the first top level parent of the given window, or in other words, the | |
2609 | frame or dialog containing it, or @NULL. | |
2610 | */ | |
4cc4bfaf | 2611 | wxWindow* wxGetTopLevelParent(wxWindow win); |
23324ae1 | 2612 |