1 \section{\class{wxWindow
}}\label{wxwindow
}
3 wxWindow is the base class for all windows. Any children of the window will be deleted
4 automatically by the destructor before the window itself is deleted.
6 %Please note that we documented a number of handler functions (OnChar(), OnMouse() etc.) in this
7 %help text. These must not be called by a user program and are documented only for illustration.
8 %On several platforms, only a few of these handlers are actually written (they are not always
9 %needed) and if you are uncertain on how to add a certain behaviour to a window class, intercept
10 %the respective event as usual and call \helpref{wxEvent::Skip}{wxeventskip} so that the native
11 %platform can implement its native behaviour or just ignore the event if nothing needs to be
14 \wxheading{Derived from
}
16 \helpref{wxEvtHandler
}{wxevthandler
}\\
17 \helpref{wxObject
}{wxobject
}
19 \wxheading{Include files
}
23 \wxheading{Window styles
}
25 The following styles can apply to all windows, although they will not always make sense for a particular
26 window class or on all platforms.
29 \begin{twocollist
}\itemsep=
0pt
30 \twocolitem{\windowstyle{wxSIMPLE
\_BORDER}}{Displays a thin border around the window. wxBORDER is the old name
32 \twocolitem{\windowstyle{wxDOUBLE
\_BORDER}}{Displays a double border. Windows only.
}
33 \twocolitem{\windowstyle{wxSUNKEN
\_BORDER}}{Displays a sunken border.
}
34 \twocolitem{\windowstyle{wxRAISED
\_BORDER}}{Displays a raised border. GTK only.
}
35 \twocolitem{\windowstyle{wxSTATIC
\_BORDER}}{Displays a border suitable for a static control. Windows only.
}
36 \twocolitem{\windowstyle{wxTRANSPARENT
\_WINDOW}}{The window is transparent, that is, it will not receive paint
37 events. Windows only.
}
38 \twocolitem{\windowstyle{wxTAB
\_TRAVERSAL}}{Use this to enable tab traversal for non-dialog windows.
}
39 \twocolitem{\windowstyle{wxWANTS
\_CHARS}}{Use this to indicate that the window
40 wants to get all char events - even for keys like TAB or ENTER which are
41 usually used for dialog navigation and which wouldn't be generated without
43 \twocolitem{\windowstyle{wxNO
\_FULL\_REPAINT\_ON\_RESIZE}}{Disables repainting
44 the window completely when its size is changed - you will have to repaint the
45 new window area manually if you use this style. Currently only has an effect for
47 \twocolitem{\windowstyle{wxVSCROLL
}}{Use this style to enable a vertical scrollbar.
}
48 \twocolitem{\windowstyle{wxHSCROLL
}}{Use this style to enable a horizontal scrollbar.
}
49 \twocolitem{\windowstyle{wxALWAYS
\_SHOW\_SB}}{If a window has scrollbars,
50 disable them instead of hiding them when they are not needed (i.e. when the
51 size of the window is big enough to not require the scrollbars to navigate it).
52 This style is currently only implemented for wxMSW and wxUniversal and does
53 nothing on the other platforms.
}
54 \twocolitem{\windowstyle{wxCLIP
\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
55 repainted, then children being painted over them. Windows only.
}
58 See also
\helpref{window styles overview
}{windowstyles
}.
60 \wxheading{Extra window styles
}
62 The following are extra styles, set using
\helpref{wxWindow::SetExtraStyle
}{wxwindowsetextrastyle
}.
65 \begin{twocollist
}\itemsep=
0pt
66 \twocolitem{\windowstyle{wxWS
\_EX\_VALIDATE\_RECURSIVELY}}{By default, Validate/TransferDataTo/FromWindow()
67 only work on direct children of the window (compatible behaviour). Set this flag to make them recursively
68 descend into all subwindows.
}
69 \twocolitem{\windowstyle{wxWS
\_EX\_BLOCK\_EVENTS}}{wxCommandEvents and the objects of the derived classes are forwarded to the
70 parent window and so on recursively by default. Using this flag for the
71 given window allows to block this propagation at this window, i.e. prevent
72 the events from being propagated further upwards. Dialogs have this
74 \twocolitem{\windowstyle{wxWS
\_EX\_TRANSIENT}}{Don't use this window as an implicit parent for the other windows: this must
75 be used with transient windows as otherwise there is the risk of creating a
76 dialog/frame with this window as a parent which would lead to a crash if the
77 parent is destroyed before the child.
}
78 \twocolitem{\windowstyle{wxWS
\_EX\_PROCESS\_IDLE}}{This window should always process idle events, even
79 if the mode set by
\helpref{wxIdleEvent::SetMode
}{wxidleeventsetmode
} is wxIDLE
\_PROCESS\_SPECIFIED.
}
80 \twocolitem{\windowstyle{wxWS
\_EX\_PROCESS\_UI\_UPDATES}}{This window should always process UI update events,
81 even if the mode set by
\helpref{wxUpdateUIEvent::SetMode
}{wxupdateuieventsetmode
} is wxUPDATE
\_UI\_PROCESS\_SPECIFIED.
}
86 \helpref{Event handling overview
}{eventhandlingoverview
}
88 \latexignore{\rtfignore{\wxheading{Members
}}}
90 \membersection{wxWindow::wxWindow
}\label{wxwindowctor
}
92 \func{}{wxWindow
}{\void}
96 \func{}{wxWindow
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
97 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
98 \param{const wxSize\&
}{size = wxDefaultSize
},
99 \param{long
}{style =
0},
100 \param{const wxString\&
}{name = wxPanelNameStr
}}
102 Constructs a window, which can be a child of a frame, dialog or any other non-control window.
104 \wxheading{Parameters
}
106 \docparam{parent
}{Pointer to a parent window.
}
108 \docparam{id
}{Window identifier. If -
1, will automatically create an identifier.
}
110 \docparam{pos
}{Window position. wxDefaultPosition is (-
1, -
1) which indicates that wxWindows
111 should generate a default position for the window. If using the wxWindow class directly, supply
114 \docparam{size
}{Window size. wxDefaultSize is (-
1, -
1) which indicates that wxWindows
115 should generate a default size for the window. If no suitable size can be found, the
116 window will be sized to
20x20 pixels so that the window is visible but obviously not
119 \docparam{style
}{Window style. For generic window styles, please see
\helpref{wxWindow
}{wxwindow
}.
}
121 \docparam{name
}{Window name.
}
123 \membersection{wxWindow::
\destruct{wxWindow
}}
125 \func{}{\destruct{wxWindow
}}{\void}
127 Destructor. Deletes all subwindows, then deletes itself. Instead of using
128 the
{\bf delete
} operator explicitly, you should normally
129 use
\helpref{wxWindow::Destroy
}{wxwindowdestroy
} so that wxWindows
130 can delete a window only when it is safe to do so, in idle time.
134 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
135 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
136 \helpref{wxCloseEvent
}{wxcloseevent
}
138 \membersection{wxWindow::AddChild
}
140 \func{virtual void
}{AddChild
}{\param{wxWindow*
}{child
}}
142 Adds a child window. This is called automatically by window creation
143 functions so should not be required by the application programmer.
145 Notice that this function is mostly internal to wxWindows and shouldn't be
146 called by the user code.
148 \wxheading{Parameters
}
150 \docparam{child
}{Child window to add.
}
152 \membersection{wxWindow::CaptureMouse
}\label{wxwindowcapturemouse
}
154 \func{virtual void
}{CaptureMouse
}{\void}
156 Directs all mouse input to this window. Call
\helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
} to
159 Note that wxWindows maintains the stack of windows having captured the mouse
160 and when the mouse is released the capture returns to the window which had had
161 captured it previously and it is only really released if there were no previous
162 window. In particular, this means that you must release the mouse as many times
167 \helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
}
169 \membersection{wxWindow::Center
}\label{wxwindowcenter
}
171 \func{void
}{Center
}{\param{int
}{ direction
}}
173 A synonym for
\helpref{Centre
}{wxwindowcentre
}.
175 \membersection{wxWindow::CenterOnParent
}\label{wxwindowcenteronparent
}
177 \func{void
}{CenterOnParent
}{\param{int
}{ direction
}}
179 A synonym for
\helpref{CentreOnParent
}{wxwindowcentreonparent
}.
181 \membersection{wxWindow::CenterOnScreen
}\label{wxwindowcenteronscreen
}
183 \func{void
}{CenterOnScreen
}{\param{int
}{ direction
}}
185 A synonym for
\helpref{CentreOnScreen
}{wxwindowcentreonscreen
}.
187 \membersection{wxWindow::Centre
}\label{wxwindowcentre
}
189 \func{void
}{Centre
}{\param{int
}{ direction = wxBOTH
}}
193 \wxheading{Parameters
}
195 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
196 or
{\tt wxBOTH
}. It may also include
{\tt wxCENTRE
\_ON\_SCREEN} flag
197 if you want to center the window on the entire screen and not on its
200 The flag
{\tt wxCENTRE
\_FRAME} is obsolete and should not be used any longer
205 If the window is a top level one (i.e. doesn't have a parent), it will be
206 centered relative to the screen anyhow.
210 \helpref{wxWindow::Center
}{wxwindowcenter
}
212 \membersection{wxWindow::CentreOnParent
}\label{wxwindowcentreonparent
}
214 \func{void
}{CentreOnParent
}{\param{int
}{ direction = wxBOTH
}}
216 Centres the window on its parent. This is a more readable synonym for
217 \helpref{Centre
}{wxwindowcentre
}.
219 \wxheading{Parameters
}
221 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
226 This methods provides for a way to center top level windows over their
227 parents instead of the entire screen. If there is no parent or if the
228 window is not a top level window, then behaviour is the same as
229 \helpref{wxWindow::Centre
}{wxwindowcentre
}.
233 \helpref{wxWindow::CentreOnScreen
}{wxwindowcenteronscreen
}
235 \membersection{wxWindow::CentreOnScreen
}\label{wxwindowcentreonscreen
}
237 \func{void
}{CentreOnScreen
}{\param{int
}{ direction = wxBOTH
}}
239 Centres the window on screen. This only works for top level windows -
240 otherwise, the window will still be centered on its parent.
242 \wxheading{Parameters
}
244 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
249 \helpref{wxWindow::CentreOnParent
}{wxwindowcenteronparent
}
251 \membersection{wxWindow::ClearBackground
}\label{wxwindowclearbackground
}
253 \func{void
}{ClearBackground
}{\void}
255 Clears the window by filling it with the current background colour. Does not
256 cause an erase background event to be generated.
258 \membersection{wxWindow::ClientToScreen
}
260 \constfunc{virtual void
}{ClientToScreen
}{\param{int*
}{x
},
\param{int*
}{y
}}
262 \perlnote{In wxPerl this method returns a
2-element list instead of
263 modifying its parameters.
}
265 \constfunc{virtual wxPoint
}{ClientToScreen
}{\param{const wxPoint\&
}{ pt
}}
267 Converts to screen coordinates from coordinates relative to this window.
269 \docparam{x
}{A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
270 a screen coordinate will be passed out.
}
272 \docparam{y
}{A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
273 a screen coordinate will be passed out.
}
275 \docparam{pt
}{The client position for the second form of the function.
}
277 \pythonnote{In place of a single overloaded method name, wxPython
278 implements the following methods:
\par
279 \indented{2cm
}{\begin{twocollist
}
280 \twocolitem{{\bf ClientToScreen(point)
}}{Accepts and returns a wxPoint
}
281 \twocolitem{{\bf ClientToScreenXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
285 \membersection{wxWindow::Close
}\label{wxwindowclose
}
287 \func{bool
}{Close
}{\param{bool
}{ force =
{\tt false
}}}
289 This function simply generates a
\helpref{wxCloseEvent
}{wxcloseevent
} whose
290 handler usually tries to close the window. It doesn't close the window itself,
293 \wxheading{Parameters
}
295 \docparam{force
}{{\tt false
} if the window's close handler should be able to veto the destruction
296 of this window,
{\tt true
} if it cannot.
}
300 Close calls the
\helpref{close handler
}{wxcloseevent
} for the window, providing
301 an opportunity for the window to choose whether to destroy the window.
302 Usually it is only used with the top level windows (wxFrame and wxDialog
303 classes) as the others are not supposed to have any special OnClose() logic.
305 The close handler should check whether the window is being deleted forcibly,
306 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}, in which case it
307 should destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
309 {\it Note
} that calling Close does not guarantee that the window will be
310 destroyed; but it provides a way to simulate a manual close of a window, which
311 may or may not be implemented by destroying the window. The default
312 implementation of wxDialog::OnCloseWindow does not necessarily delete the
313 dialog, since it will simply simulate an wxID
\_CANCEL event which is handled by
314 the appropriate button event handler and may do anything at all.
316 To guarantee that the window will be destroyed, call
317 \helpref{wxWindow::Destroy
}{wxwindowdestroy
} instead
321 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
322 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
323 \helpref{wxCloseEvent
}{wxcloseevent
}
325 \membersection{wxWindow::ConvertDialogToPixels
}\label{wxwindowconvertdialogtopixels
}
327 \func{wxPoint
}{ConvertDialogToPixels
}{\param{const wxPoint\&
}{ pt
}}
329 \func{wxSize
}{ConvertDialogToPixels
}{\param{const wxSize\&
}{ sz
}}
331 Converts a point or size from dialog units to pixels.
333 For the x dimension, the dialog units are multiplied by the average character width
334 and then divided by
4.
336 For the y dimension, the dialog units are multiplied by the average character height
337 and then divided by
8.
341 Dialog units are used for maintaining a dialog's proportions even if the font changes.
342 Dialogs created using Dialog Editor optionally use dialog units.
344 You can also use these functions programmatically. A convenience macro is defined:
348 #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
354 \helpref{wxWindow::ConvertPixelsToDialog
}{wxwindowconvertpixelstodialog
}
356 \pythonnote{In place of a single overloaded method name, wxPython
357 implements the following methods:
\par
358 \indented{2cm
}{\begin{twocollist
}
359 \twocolitem{{\bf ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
360 \twocolitem{{\bf ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
363 Additionally, the following helper functions are defined:
\par
364 \indented{2cm
}{\begin{twocollist
}
365 \twocolitem{{\bf wxDLG
\_PNT(win, point)
}}{Converts a wxPoint from dialog
367 \twocolitem{{\bf wxDLG
\_SZE(win, size)
}}{Converts a wxSize from dialog
373 \membersection{wxWindow::ConvertPixelsToDialog
}\label{wxwindowconvertpixelstodialog
}
375 \func{wxPoint
}{ConvertPixelsToDialog
}{\param{const wxPoint\&
}{ pt
}}
377 \func{wxSize
}{ConvertPixelsToDialog
}{\param{const wxSize\&
}{ sz
}}
379 Converts a point or size from pixels to dialog units.
381 For the x dimension, the pixels are multiplied by
4 and then divided by the average
384 For the y dimension, the pixels are multiplied by
8 and then divided by the average
389 Dialog units are used for maintaining a dialog's proportions even if the font changes.
390 Dialogs created using Dialog Editor optionally use dialog units.
394 \helpref{wxWindow::ConvertDialogToPixels
}{wxwindowconvertdialogtopixels
}
397 \pythonnote{In place of a single overloaded method name, wxPython
398 implements the following methods:
\par
399 \indented{2cm
}{\begin{twocollist
}
400 \twocolitem{{\bf ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
401 \twocolitem{{\bf ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
405 \membersection{wxWindow::Destroy
}\label{wxwindowdestroy
}
407 \func{virtual bool
}{Destroy
}{\void}
409 Destroys the window safely. Use this function instead of the delete operator, since
410 different window classes can be destroyed differently. Frames and dialogs
411 are not destroyed immediately when this function is called -- they are added
412 to a list of windows to be deleted on idle time, when all the window's events
413 have been processed. This prevents problems with events being sent to non-existent
416 \wxheading{Return value
}
418 {\tt true
} if the window has either been successfully deleted, or it has been added
419 to the list of windows pending real deletion.
421 \membersection{wxWindow::DestroyChildren
}
423 \func{virtual void
}{DestroyChildren
}{\void}
425 Destroys all children of a window. Called automatically by the destructor.
427 \membersection{wxWindow::Disable
}\label{wxwindowdisable
}
429 \func{bool
}{Disable
}{\void}
431 Disables the window, same as
\helpref{Enable(
{\tt false
})
}{wxwindowenable
}.
433 \wxheading{Return value
}
435 Returns
{\tt true
} if the window has been disabled,
{\tt false
} if it had been
436 already disabled before the call to this function.
438 \membersection{wxWindow::DoUpdateWindowUI
}\label{wxwindowdoupdatewindowui
}
440 \func{virtual void
}{DoUpdateWindowUI
}{\param{wxUpdateUIEvent\&
}{ event
}}
442 Does the window-specific updating after processing the update event.
443 This function is called by
\helpref{wxWindow::UpdateWindowUI
}{wxwindowupdatewindowui
}
444 in order to check return values in the
\helpref{wxUpdateUIEvent
}{wxupdateuievent
} and
445 act appropriately. For example, to allow frame and dialog title updating, wxWindows
446 implements this function as follows:
449 // do the window-specific processing after processing the update event
450 void wxTopLevelWindowBase::DoUpdateWindowUI(wxUpdateUIEvent& event)
452 if ( event.GetSetEnabled() )
453 Enable(event.GetEnabled());
455 if ( event.GetSetText() )
457 if ( event.GetText() != GetTitle() )
458 SetTitle(event.GetText());
463 \membersection{wxWindow::DragAcceptFiles
}\label{wxwindowdragacceptfiles
}
465 \func{virtual void
}{DragAcceptFiles
}{\param{bool
}{ accept
}}
467 Enables or disables eligibility for drop file events (OnDropFiles).
469 \wxheading{Parameters
}
471 \docparam{accept
}{If
{\tt true
}, the window is eligible for drop file events. If
{\tt false
}, the window
472 will not accept drop file events.
}
478 \membersection{wxWindow::Enable
}\label{wxwindowenable
}
480 \func{virtual bool
}{Enable
}{\param{bool
}{ enable =
{\tt true
}}}
482 Enable or disable the window for user input. Note that when a parent window is
483 disabled, all of its children are disabled as well and they are reenabled again
486 \wxheading{Parameters
}
488 \docparam{enable
}{If
{\tt true
}, enables the window for input. If
{\tt false
}, disables the window.
}
490 \wxheading{Return value
}
492 Returns
{\tt true
} if the window has been enabled or disabled,
{\tt false
} if
493 nothing was done, i.e. if the window had already been in the specified state.
497 \helpref{wxWindow::IsEnabled
}{wxwindowisenabled
},
\rtfsp
498 \helpref{wxWindow::Disable
}{wxwindowdisable
}
500 \membersection{wxWindow::FindFocus
}\label{wxwindowfindfocus
}
502 \func{static wxWindow*
}{FindFocus
}{\void}
504 Finds the window or control which currently has the keyboard focus.
508 Note that this is a static function, so it can be called without needing a wxWindow pointer.
512 \helpref{wxWindow::SetFocus
}{wxwindowsetfocus
}
514 \membersection{wxWindow::FindWindow
}\label{wxwindowfindwindow
}
516 \func{wxWindow*
}{FindWindow
}{\param{long
}{ id
}}
518 Find a child of this window, by identifier.
520 \func{wxWindow*
}{FindWindow
}{\param{const wxString\&
}{ name
}}
522 Find a child of this window, by name.
524 \pythonnote{In place of a single overloaded method name, wxPython
525 implements the following methods:
\par
526 \indented{2cm
}{\begin{twocollist
}
527 \twocolitem{{\bf FindWindowById(id)
}}{Accepts an integer
}
528 \twocolitem{{\bf FindWindowByName(name)
}}{Accepts a string
}
532 \membersection{wxWindow::FindWindowById
}\label{wxwindowfindwindowbyid
}
534 \func{static wxWindow*
}{FindWindowById
}{\param{long
}{ id
},
\param{wxWindow*
}{ parent = NULL
}}
536 Find the first window with the given
{\it id
}.
538 If
{\it parent
} is NULL, the search will start from all top-level
539 frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
540 The search is recursive in both cases.
544 \helpref{FindWindow
}{wxwindowfindwindow
}
546 \membersection{wxWindow::FindWindowByName
}\label{wxwindowfindwindowbyname
}
548 \func{static wxWindow*
}{FindWindowByName
}{\param{const wxString\&
}{ name
},
\param{wxWindow*
}{ parent = NULL
}}
550 Find a window by its name (as given in a window constructor or
{\bf Create
} function call).
551 If
{\it parent
} is NULL, the search will start from all top-level
552 frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
553 The search is recursive in both cases.
555 If no window with such name is found,
556 \helpref{FindWindowByLabel
}{wxwindowfindwindowbylabel
} is called.
560 \helpref{FindWindow
}{wxwindowfindwindow
}
562 \membersection{wxWindow::FindWindowByLabel
}\label{wxwindowfindwindowbylabel
}
564 \func{static wxWindow*
}{FindWindowByLabel
}{\param{const wxString\&
}{ label
},
\param{wxWindow*
}{ parent = NULL
}}
566 Find a window by its label. Depending on the type of window, the label may be a window title
567 or panel item label. If
{\it parent
} is NULL, the search will start from all top-level
568 frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy.
569 The search is recursive in both cases.
573 \helpref{FindWindow
}{wxwindowfindwindow
}
575 \membersection{wxWindow::Fit
}\label{wxwindowfit
}
577 \func{virtual void
}{Fit
}{\void}
579 Sizes the window so that it fits around its subwindows. This function won't do
580 anything if there are no subwindows and will only really work correctly if the
581 sizers are used for the subwindows layout. Also, if the window has exactly one
582 subwindow it is better (faster and the result is more precise as Fit adds some
583 margin to account for fuzziness of its calculations) to call
586 window->SetClientSize(child->GetSize());
589 instead of calling Fit.
591 \membersection{wxWindow::FitInside
}\label{wxwindowfitinside
}
593 \func{virtual void
}{FitInside
}{\void}
595 Similar to
\helpref{Fit
}{wxwindowfit
}, but sizes the interior (virtual) size
596 of a window. Mainly useful with scrolled windows to reset scrollbars after
597 sizing changes that do not trigger a size event, and/or scrolled windows without
598 an interior sizer. This function similarly won't do anything if there are no
601 \membersection{wxWindow::Freeze
}\label{wxwindowfreeze
}
603 \func{virtual void
}{Freeze
}{\void}
605 Freezes the window or, in other words, prevents any updates from taking place
606 on screen, the window is not redrawn at all.
\helpref{Thaw
}{wxwindowthaw
} must
607 be called to reenable window redrawing.
609 This method is useful for visual appearance optimization (for example, it
610 is a good idea to use it before inserting large amount of text into a
611 wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all
612 controls so it is mostly just a hint to wxWindows and not a mandatory
615 \membersection{wxWindow::GetAccessible
}\label{wxwindowgetaccessible
}
617 \func{wxAccessibile*
}{GetAccessible
}{\void}
619 Returns the accessible object for this window, if any.
621 See also
\helpref{wxAccessible
}{wxaccessible
}.
623 \membersection{wxWindow::GetAdjustedBestSize
}\label{wxwindowgetadjustedbestsize
}
625 \constfunc{wxSize
}{GetAdjustedBestSize
}{\void}
627 This method is similar to
\helpref{GetBestSize
}{wxwindowgetbestsize
}, except
628 in one thing. GetBestSize should return the minimum untruncated size of the
629 window, while this method will return the largest of BestSize and any user
630 specified minimum size. ie. it is the minimum size the window should currently
631 be drawn at, not the minimal size it can possibly tolerate.
633 \membersection{wxWindow::GetBackgroundColour
}\label{wxwindowgetbackgroundcolour
}
635 \constfunc{virtual wxColour
}{GetBackgroundColour
}{\void}
637 Returns the background colour of the window.
641 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
642 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
643 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
}
645 \membersection{wxWindow::GetBestSize
}\label{wxwindowgetbestsize
}
647 \constfunc{virtual wxSize
}{GetBestSize
}{\void}
649 This functions returns the best acceptable minimal size for the window. For
650 example, for a static control, it will be the minimal size such that the
651 control label is not truncated. For windows containing subwindows (typically
652 \helpref{wxPanel
}{wxpanel
}), the size returned by this function will be the
653 same as the size the window would have had after calling
654 \helpref{Fit
}{wxwindowfit
}.
656 \membersection{wxWindow::GetCaret
}\label{wxwindowgetcaret
}
658 \constfunc{wxCaret *
}{GetCaret
}{\void}
660 Returns the
\helpref{caret
}{wxcaret
} associated with the window.
662 \membersection{wxWindow::GetCapture
}\label{wxwindowgetcapture
}
664 \func{static wxWindow *
}{GetCapture
}{\void}
666 Returns the currently captured window.
670 \helpref{wxWindow::HasCapture
}{wxwindowhascapture
},
671 \helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
},
672 \helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
},
673 \helpref{wxMouseCaptureChangedEvent
}{wxmousecapturechangedevent
}
675 \membersection{wxWindow::GetCharHeight
}
677 \constfunc{virtual int
}{GetCharHeight
}{\void}
679 Returns the character height for this window.
681 \membersection{wxWindow::GetCharWidth
}
683 \constfunc{virtual int
}{GetCharWidth
}{\void}
685 Returns the average character width for this window.
687 \membersection{wxWindow::GetChildren
}
689 \func{wxList\&
}{GetChildren
}{\void}
691 Returns a reference to the list of the window's children.
693 \membersection{wxWindow::GetClientSize
}\label{wxwindowgetclientsize
}
695 \constfunc{virtual void
}{GetClientSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
697 \perlnote{In wxPerl this method takes no parameter and returns
698 a
2-element list
{\tt ( width, height )
}.
}
700 \constfunc{virtual wxSize
}{GetClientSize
}{\void}
702 This gets the size of the window `client area' in pixels.
703 The client area is the area which may be drawn on by the programmer,
704 excluding title bar, border, scrollbars, etc.
706 \wxheading{Parameters
}
708 \docparam{width
}{Receives the client width in pixels.
}
710 \docparam{height
}{Receives the client height in pixels.
}
712 \pythonnote{In place of a single overloaded method name, wxPython
713 implements the following methods:
\par
714 \indented{2cm
}{\begin{twocollist
}
715 \twocolitem{{\bf GetClientSizeTuple()
}}{Returns a
2-tuple of (width, height)
}
716 \twocolitem{{\bf GetClientSize()
}}{Returns a wxSize object
}
722 \helpref{GetSize
}{wxwindowgetsize
}
723 \helpref{GetVirtualSize
}{wxwindowgetvirtualsize
}
725 \membersection{wxWindow::GetConstraints
}\label{wxwindowgetconstraints
}
727 \constfunc{wxLayoutConstraints*
}{GetConstraints
}{\void}
729 Returns a pointer to the window's layout constraints, or NULL if there are none.
731 \membersection{wxWindow::GetContainingSizer
}\label{wxwindowgetcontainingsizer
}
733 \constfunc{const wxSizer *
}{GetContainingSizer
}{\void}
735 Return the sizer that this window is a member of, if any, otherwise
738 \membersection{wxWindow::GetDropTarget
}\label{wxwindowgetdroptarget
}
740 \constfunc{wxDropTarget*
}{GetDropTarget
}{\void}
742 Returns the associated drop target, which may be NULL.
746 \helpref{wxWindow::SetDropTarget
}{wxwindowsetdroptarget
},
747 \helpref{Drag and drop overview
}{wxdndoverview
}
749 \membersection{wxWindow::GetEventHandler
}\label{wxwindowgeteventhandler
}
751 \constfunc{wxEvtHandler*
}{GetEventHandler
}{\void}
753 Returns the event handler for this window. By default, the window is its
758 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
759 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
760 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
761 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
762 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
764 \membersection{wxWindow::GetExtraStyle
}\label{wxwindowgetextrastyle
}
766 \constfunc{long
}{GetExtraStyle
}{\void}
768 Returns the extra style bits for the window.
770 \membersection{wxWindow::GetFont
}\label{wxwindowgetfont
}
772 \constfunc{wxFont\&
}{GetFont
}{\void}
774 Returns a reference to the font for this window.
778 \helpref{wxWindow::SetFont
}{wxwindowsetfont
}
780 \membersection{wxWindow::GetForegroundColour
}\label{wxwindowgetforegroundcolour
}
782 \func{virtual wxColour
}{GetForegroundColour
}{\void}
784 Returns the foreground colour of the window.
788 The interpretation of foreground colour is open to interpretation according
789 to the window class; it may be the text colour or other colour, or it may not
794 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
795 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
796 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
798 \membersection{wxWindow::GetGrandParent
}
800 \constfunc{wxWindow*
}{GetGrandParent
}{\void}
802 Returns the grandparent of a window, or NULL if there isn't one.
804 \membersection{wxWindow::GetHandle
}\label{wxwindowgethandle
}
806 \constfunc{void*
}{GetHandle
}{\void}
808 Returns the platform-specific handle of the physical window. Cast it to an appropriate
809 handle, such as
{\bf HWND
} for Windows,
{\bf Widget
} for Motif or
{\bf GtkWidget
} for GTK.
811 \pythonnote{This method will return an integer in wxPython.
}
813 \perlnote{This method will return an integer in wxPerl.
}
815 \membersection{wxWindow::GetHelpText
}\label{wxwindowgethelptext
}
817 \constfunc{virtual wxString
}{GetHelpText
}{\void}
819 Gets the help text to be used as context-sensitive help for this window.
821 Note that the text is actually stored by the current
\helpref{wxHelpProvider
}{wxhelpprovider
} implementation,
822 and not in the window object itself.
826 \helpref{SetHelpText
}{wxwindowsethelptext
},
\helpref{wxHelpProvider
}{wxhelpprovider
}
828 \membersection{wxWindow::GetId
}\label{wxwindowgetid
}
830 \constfunc{int
}{GetId
}{\void}
832 Returns the identifier of the window.
836 Each window has an integer identifier. If the application has not provided one
837 (or the default Id -
1) an unique identifier with a negative value will be generated.
841 \helpref{wxWindow::SetId
}{wxwindowsetid
},
\rtfsp
842 \helpref{Window identifiers
}{windowids
}
844 \membersection{wxWindow::GetLabel
}
846 \constfunc{virtual wxString
}{GetLabel
}{\void}
848 Generic way of getting a label from any window, for
849 identification purposes.
853 The interpretation of this function differs from class to class.
854 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
855 the button text. This function can be useful for meta-programs (such as testing
856 tools or special-needs access programs) which need to identify windows
859 \membersection{wxWindow::GetName
}\label{wxwindowgetname
}
861 \constfunc{virtual wxString
}{GetName
}{\void}
863 Returns the window's name.
867 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
868 name in the window constructor or via
\helpref{wxWindow::SetName
}{wxwindowsetname
}.
872 \helpref{wxWindow::SetName
}{wxwindowsetname
}
874 \membersection{wxWindow::GetParent
}
876 \constfunc{virtual wxWindow*
}{GetParent
}{\void}
878 Returns the parent of the window, or NULL if there is no parent.
880 \membersection{wxWindow::GetPosition
}\label{wxwindowgetposition
}
882 \constfunc{virtual void
}{GetPosition
}{\param{int*
}{x
},
\param{int*
}{y
}}
884 \constfunc{wxPoint
}{GetPosition
}{\void}
886 This gets the position of the window in pixels, relative to the parent window
887 for the child windows or relative to the display origin for the top level
890 \wxheading{Parameters
}
892 \docparam{x
}{Receives the x position of the window.
}
894 \docparam{y
}{Receives the y position of the window.
}
896 \pythonnote{In place of a single overloaded method name, wxPython
897 implements the following methods:
\par
898 \indented{2cm
}{\begin{twocollist
}
899 \twocolitem{{\bf GetPosition()
}}{Returns a wxPoint
}
900 \twocolitem{{\bf GetPositionTuple()
}}{Returns a tuple (x, y)
}
904 \perlnote{In wxPerl there are two methods instead of a single overloaded
906 \indented{2cm
}{\begin{twocollist
}
907 \twocolitem{{\bf GetPosition()
}}{Returns a Wx::Point
}
908 \twocolitem{{\bf GetPositionXY()
}}{Returns a
2-element list
913 \membersection{wxWindow::GetRect
}\label{wxwindowgetrect
}
915 \constfunc{virtual wxRect
}{GetRect
}{\void}
917 Returns the size and position of the window as a
\helpref{wxRect
}{wxrect
} object.
919 \membersection{wxWindow::GetScrollThumb
}\label{wxwindowgetscrollthumb
}
921 \func{virtual int
}{GetScrollThumb
}{\param{int
}{orientation
}}
923 Returns the built-in scrollbar thumb size.
927 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
929 \membersection{wxWindow::GetScrollPos
}\label{wxwindowgetscrollpos
}
931 \func{virtual int
}{GetScrollPos
}{\param{int
}{orientation
}}
933 Returns the built-in scrollbar position.
937 See
\helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
939 \membersection{wxWindow::GetScrollRange
}\label{wxwindowgetscrollrange
}
941 \func{virtual int
}{GetScrollRange
}{\param{int
}{orientation
}}
943 Returns the built-in scrollbar range.
947 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
949 \membersection{wxWindow::GetSize
}\label{wxwindowgetsize
}
951 \constfunc{virtual void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
953 \constfunc{virtual wxSize
}{GetSize
}{\void}
955 This gets the size of the entire window in pixels,
956 including title bar, border, scrollbars, etc.
958 \wxheading{Parameters
}
960 \docparam{width
}{Receives the window width.
}
962 \docparam{height
}{Receives the window height.
}
964 \pythonnote{In place of a single overloaded method name, wxPython
965 implements the following methods:
\par
966 \indented{2cm
}{\begin{twocollist
}
967 \twocolitem{{\bf GetSize()
}}{Returns a wxSize
}
968 \twocolitem{{\bf GetSizeTuple()
}}{Returns a
2-tuple (width, height)
}
972 \perlnote{In wxPerl there are two methods instead of a single overloaded
974 \indented{2cm
}{\begin{twocollist
}
975 \twocolitem{{\bf GetSize()
}}{Returns a Wx::Size
}
976 \twocolitem{{\bf GetSizeWH()
}}{Returns a
2-element list
977 {\tt ( width, height )
}}
983 \helpref{GetClientSize
}{wxwindowgetclientsize
},
\rtfsp
984 \helpref{GetVirtualSize
}{wxwindowgetvirtualsize
}
986 \membersection{wxWindow::GetSizer
}\label{wxwindowgetsizer
}
988 \constfunc{wxSizer *
}{GetSizer
}{\void}
990 Return the sizer associated with the window by a previous call to
991 \helpref{SetSizer()
}{wxwindowsetsizer
} or
{\tt NULL
}.
993 \membersection{wxWindow::GetTextExtent
}\label{wxwindowgettextextent
}
995 \constfunc{virtual void
}{GetTextExtent
}{\param{const wxString\&
}{string
},
\param{int*
}{x
},
\param{int*
}{y
},
996 \param{int*
}{descent = NULL
},
\param{int*
}{externalLeading = NULL
},
997 \param{const wxFont*
}{font = NULL
},
\param{bool
}{ use16 =
{\tt false
}}}
999 Gets the dimensions of the string as it would be drawn on the
1000 window with the currently selected font.
1002 \wxheading{Parameters
}
1004 \docparam{string
}{String whose extent is to be measured.
}
1006 \docparam{x
}{Return value for width.
}
1008 \docparam{y
}{Return value for height.
}
1010 \docparam{descent
}{Return value for descent (optional).
}
1012 \docparam{externalLeading
}{Return value for external leading (optional).
}
1014 \docparam{font
}{Font to use instead of the current window font (optional).
}
1016 \docparam{use16
}{If
{\tt true
},
{\it string
} contains
16-bit characters. The default is
{\tt false
}.
}
1019 \pythonnote{In place of a single overloaded method name, wxPython
1020 implements the following methods:
\par
1021 \indented{2cm
}{\begin{twocollist
}
1022 \twocolitem{{\bf GetTextExtent(string)
}}{Returns a
2-tuple, (width, height)
}
1023 \twocolitem{{\bf GetFullTextExtent(string, font=NULL)
}}{Returns a
1024 4-tuple, (width, height, descent, externalLeading)
}
1028 \perlnote{In wxPerl this method takes only the
{\tt string
} and optionally
1029 {\tt font
} parameters, and returns a
4-element list
1030 {\tt ( x, y, descent, externalLeading )
}.
}
1032 \membersection{wxWindow::GetTitle
}\label{wxwindowgettitle
}
1034 \func{virtual wxString
}{GetTitle
}{\void}
1036 Gets the window's title. Applicable only to frames and dialogs.
1038 \wxheading{See also
}
1040 \helpref{wxWindow::SetTitle
}{wxwindowsettitle
}
1042 \membersection{wxWindow::GetToolTip
}\label{wxwindowgettooltip
}
1044 \constfunc{wxToolTip*
}{GetToolTip
}{\void}
1046 Get the associated tooltip or NULL if none.
1048 \membersection{wxWindow::GetUpdateRegion
}\label{wxwindowgetupdateregion
}
1050 \constfunc{virtual wxRegion
}{GetUpdateRegion
}{\void}
1052 Returns the region specifying which parts of the window have been damaged. Should
1053 only be called within an
\helpref{wxPaintEvent
}{wxpaintevent
} handler.
1055 \wxheading{See also
}
1057 \helpref{wxRegion
}{wxregion
},
\rtfsp
1058 \helpref{wxRegionIterator
}{wxregioniterator
}
1060 \membersection{wxWindow::GetValidator
}\label{wxwindowgetvalidator
}
1062 \constfunc{wxValidator*
}{GetValidator
}{\void}
1064 Returns a pointer to the current validator for the window, or NULL if there is none.
1066 \membersection{wxWindow::GetVirtualSize
}\label{wxwindowgetvirtualsize
}
1068 \constfunc{void
}{GetVirtualSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
1070 \constfunc{wxSize
}{GetVirtualSize
}{\void}
1072 This gets the virtual size of the window in pixels.
1074 \wxheading{Parameters
}
1076 \docparam{width
}{Receives the window virtual width.
}
1078 \docparam{height
}{Receives the window virtual height.
}
1080 \helpref{GetSize
}{wxwindowgetsize
},
\rtfsp
1081 \helpref{GetClientSize
}{wxwindowgetclientsize
}
1083 \membersection{wxWindow::GetWindowStyleFlag
}\label{wxwindowgetwindowstyleflag
}
1085 \constfunc{long
}{GetWindowStyleFlag
}{\void}
1087 Gets the window style that was passed to the constructor or
{\bf Create
}
1088 method.
{\bf GetWindowStyle()
} is another name for the same function.
1090 \membersection{wxWindow::HasCapture
}\label{wxwindowhascapture
}
1092 \constfunc{virtual bool
}{HasCapture
}{\void}
1094 Returns true if this window has the current mouse capture.
1096 \wxheading{See also
}
1098 \helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
},
1099 \helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
},
1100 \helpref{wxMouseCaptureChangedEvent
}{wxmousecapturechangedevent
}
1102 \membersection{wxWindow::Hide
}\label{wxwindowhide
}
1104 \func{bool
}{Hide
}{\void}
1106 Equivalent to calling
\helpref{Show
}{wxwindowshow
}(
{\tt false
}).
1108 \membersection{wxWindow::InitDialog
}\label{wxwindowinitdialog
}
1110 \func{void
}{InitDialog
}{\void}
1112 Sends an
{\tt wxEVT
\_INIT\_DIALOG} event, whose handler usually transfers data
1113 to the dialog via validators.
1115 \membersection{wxWindow::IsEnabled
}\label{wxwindowisenabled
}
1117 \constfunc{virtual bool
}{IsEnabled
}{\void}
1119 Returns
{\tt true
} if the window is enabled for input,
{\tt false
} otherwise.
1121 \wxheading{See also
}
1123 \helpref{wxWindow::Enable
}{wxwindowenable
}
1125 \membersection{wxWindow::IsExposed
}\label{wxwindowisexposed
}
1127 \constfunc{bool
}{IsExposed
}{\param{int
}{x
},
\param{int
}{y
}}
1129 \constfunc{bool
}{IsExposed
}{\param{wxPoint
}{\&pt
}}
1131 \constfunc{bool
}{IsExposed
}{\param{int
}{x
},
\param{int
}{y
},
\param{int
}{w
},
\param{int
}{h
}}
1133 \constfunc{bool
}{IsExposed
}{\param{wxRect
}{\&rect
}}
1135 Returns
{\tt true
} if the given point or rectangle area has been exposed since the
1136 last repaint. Call this in an paint event handler to optimize redrawing by
1137 only redrawing those areas, which have been exposed.
1139 \pythonnote{In place of a single overloaded method name, wxPython
1140 implements the following methods:
\par
1141 \indented{2cm
}{\begin{twocollist
}
1142 \twocolitem{{\bf IsExposed(x,y, w=
0,h=
0}}{}
1143 \twocolitem{{\bf IsExposedPoint(pt)
}}{}
1144 \twocolitem{{\bf IsExposedRect(rect)
}}{}
1147 \membersection{wxWindow::IsRetained
}\label{wxwindowisretained
}
1149 \constfunc{virtual bool
}{IsRetained
}{\void}
1151 Returns
{\tt true
} if the window is retained,
{\tt false
} otherwise.
1155 Retained windows are only available on X platforms.
1157 \membersection{wxWindow::IsShown
}\label{wxwindowisshown
}
1159 \constfunc{virtual bool
}{IsShown
}{\void}
1161 Returns
{\tt true
} if the window is shown,
{\tt false
} if it has been hidden.
1163 \membersection{wxWindow::IsTopLevel
}\label{wxwindowistoplevel
}
1165 \constfunc{bool
}{IsTopLevel
}{\void}
1167 Returns
{\tt true
} if the given window is a top-level one. Currently all frames and
1168 dialogs are considered to be top-level windows (even if they have a parent
1171 \membersection{wxWindow::Layout
}\label{wxwindowlayout
}
1173 \func{void
}{Layout
}{\void}
1175 Invokes the constraint-based layout algorithm or the sizer-based algorithm
1178 See
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
}: when auto
1179 layout is on, this function gets called automatically when the window is resized.
1181 \membersection{wxWindow::LineDown
}\label{wxwindowlinedown
}
1183 This is just a wrapper for
\helpref{ScrollLines()
}{wxwindowscrolllines
}$(
1)$.
1185 \membersection{wxWindow::LineUp
}\label{wxwindowlineup
}
1187 This is just a wrapper for
\helpref{ScrollLines()
}{wxwindowscrolllines
}$(-
1)$.
1189 \membersection{wxWindow::Lower
}\label{wxwindowlower
}
1191 \func{void
}{Lower
}{\void}
1193 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
1196 \membersection{wxWindow::MakeModal
}\label{wxwindowmakemodal
}
1198 \func{virtual void
}{MakeModal
}{\param{bool
}{flag
}}
1200 Disables all other windows in the application so that
1201 the user can only interact with this window. (This function
1202 is not implemented anywhere).
1204 \wxheading{Parameters
}
1206 \docparam{flag
}{If
{\tt true
}, this call disables all other windows in the application so that
1207 the user can only interact with this window. If
{\tt false
}, the effect is reversed.
}
1209 \membersection{wxWindow::Move
}\label{wxwindowmove
}
1211 \func{void
}{Move
}{\param{int
}{ x
},
\param{int
}{ y
}}
1213 \func{void
}{Move
}{\param{const wxPoint\&
}{ pt
}}
1215 Moves the window to the given position.
1217 \wxheading{Parameters
}
1219 \docparam{x
}{Required x position.
}
1221 \docparam{y
}{Required y position.
}
1223 \docparam{pt
}{\helpref{wxPoint
}{wxpoint
} object representing the position.
}
1227 Implementations of SetSize can also implicitly implement the
1228 wxWindow::Move function, which is defined in the base wxWindow class
1232 SetSize(x, y, -
1, -
1, wxSIZE_USE_EXISTING);
1235 \wxheading{See also
}
1237 \helpref{wxWindow::SetSize
}{wxwindowsetsize
}
1239 \pythonnote{In place of a single overloaded method name, wxPython
1240 implements the following methods:
\par
1241 \indented{2cm
}{\begin{twocollist
}
1242 \twocolitem{{\bf Move(point)
}}{Accepts a wxPoint
}
1243 \twocolitem{{\bf MoveXY(x, y)
}}{Accepts a pair of integers
}
1247 %% VZ: wxWindow::OnXXX() functions should not be documented but I'm leaving
1248 %% the old docs here in case we want to move any still needed bits to
1249 %% the right location (i.e. probably the corresponding events docs)
1251 %% \membersection{wxWindow::OnActivate}\label{wxwindowonactivate}
1253 %% \func{void}{OnActivate}{\param{wxActivateEvent\&}{ event}}
1255 %% Called when a window is activated or deactivated.
1257 %% \wxheading{Parameters}
1259 %% \docparam{event}{Object containing activation information.}
1261 %% \wxheading{Remarks}
1263 %% If the window is being activated, \helpref{wxActivateEvent::GetActive}{wxactivateeventgetactive} returns {\tt true},
1264 %% otherwise it returns {\tt false} (it is being deactivated).
1266 %% \wxheading{See also}
1268 %% \helpref{wxActivateEvent}{wxactivateevent},\rtfsp
1269 %% \helpref{Event handling overview}{eventhandlingoverview}
1271 %% \membersection{wxWindow::OnChar}\label{wxwindowonchar}
1273 %% \func{void}{OnChar}{\param{wxKeyEvent\&}{ event}}
1275 %% Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
1277 %% \wxheading{Parameters}
1279 %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
1280 %% details about this class.}
1282 %% \wxheading{Remarks}
1284 %% This member function is called in response to a keypress. To intercept this event,
1285 %% use the EVT\_CHAR macro in an event table definition. Your {\bf OnChar} handler may call this
1286 %% default function to achieve default keypress functionality.
1288 %% Note that the ASCII values do not have explicit key codes: they are passed as ASCII
1291 %% Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
1292 %% keypresses, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
1293 %% \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
1295 %% Most, but not all, windows allow keypresses to be intercepted.
1297 %% {\bf Tip:} be sure to call {\tt event.Skip()} for events that you don't process in this function,
1298 %% otherwise menu shortcuts may cease to work under Windows.
1300 %% \wxheading{See also}
1302 %% \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp
1303 %% \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
1304 %% \helpref{Event handling overview}{eventhandlingoverview}
1306 %% \membersection{wxWindow::OnCharHook}\label{wxwindowoncharhook}
1308 %% \func{void}{OnCharHook}{\param{wxKeyEvent\&}{ event}}
1310 %% This member is called to allow the window to intercept keyboard events
1311 %% before they are processed by child windows.
1313 %% \wxheading{Parameters}
1315 %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
1316 %% details about this class.}
1318 %% \wxheading{Remarks}
1320 %% This member function is called in response to a keypress, if the window is active. To intercept this event,
1321 %% use the EVT\_CHAR\_HOOK macro in an event table definition. If you do not process a particular
1322 %% keypress, call \helpref{wxEvent::Skip}{wxeventskip} to allow default processing.
1324 %% An example of using this function is in the implementation of escape-character processing for wxDialog,
1325 %% where pressing ESC dismisses the dialog by {\bf OnCharHook} 'forging' a cancel button press event.
1327 %% Note that the ASCII values do not have explicit key codes: they are passed as ASCII
1330 %% This function is only relevant to top-level windows (frames and dialogs), and under
1331 %% Windows only. Under GTK the normal EVT\_CHAR\_ event has the functionality, i.e.
1332 %% you can intercepts it and if you don't call \helpref{wxEvent::Skip}{wxeventskip}
1333 %% the window won't get the event.
1335 %% \wxheading{See also}
1337 %% \helpref{wxKeyEvent}{wxkeyevent},\rtfsp
1338 %% \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
1339 %% %% GD: OnXXX functions are not documented
1340 %% %%\helpref{wxApp::OnCharHook}{wxapponcharhook},\rtfsp
1341 %% \helpref{Event handling overview}{eventhandlingoverview}
1343 %% \membersection{wxWindow::OnCommand}\label{wxwindowoncommand}
1345 %% \func{virtual void}{OnCommand}{\param{wxEvtHandler\& }{object}, \param{wxCommandEvent\& }{event}}
1347 %% This virtual member function is called if the control does not handle the command event.
1349 %% \wxheading{Parameters}
1351 %% \docparam{object}{Object receiving the command event.}
1353 %% \docparam{event}{Command event}
1355 %% \wxheading{Remarks}
1357 %% This virtual function is provided mainly for backward compatibility. You can also intercept commands
1358 %% from child controls by using an event table, with identifiers or identifier ranges to identify
1359 %% the control(s) in question.
1361 %% \wxheading{See also}
1363 %% \helpref{wxCommandEvent}{wxcommandevent},\rtfsp
1364 %% \helpref{Event handling overview}{eventhandlingoverview}
1366 %% \membersection{wxWindow::OnClose}\label{wxwindowonclose}
1368 %% \func{virtual bool}{OnClose}{\void}
1370 %% Called when the user has tried to close a a frame
1371 %% or dialog box using the window manager (X) or system menu (Windows).
1373 %% {\bf Note:} This is an obsolete function.
1374 %% It is superseded by the \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow} event
1377 %% \wxheading{Return value}
1379 %% If {\tt true} is returned by OnClose, the window will be deleted by the system, otherwise the
1380 %% attempt will be ignored. Do not delete the window from within this handler, although
1381 %% you may delete other windows.
1383 %% \wxheading{See also}
1385 %% \helpref{Window deletion overview}{windowdeletionoverview},\rtfsp
1386 %% \helpref{wxWindow::Close}{wxwindowclose},\rtfsp
1387 %% \helpref{wxWindow::OnCloseWindow}{wxwindowonclosewindow},\rtfsp
1388 %% \helpref{wxCloseEvent}{wxcloseevent}
1390 %% \membersection{wxWindow::OnKeyDown}\label{wxwindowonkeydown}
1392 %% \func{void}{OnKeyDown}{\param{wxKeyEvent\&}{ event}}
1394 %% Called when the user has pressed a key, before it is translated into an ASCII value using other
1395 %% modifier keys that might be pressed at the same time.
1397 %% \wxheading{Parameters}
1399 %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
1400 %% details about this class.}
1402 %% \wxheading{Remarks}
1404 %% This member function is called in response to a key down event. To intercept this event,
1405 %% use the EVT\_KEY\_DOWN macro in an event table definition. Your {\bf OnKeyDown} handler may call this
1406 %% default function to achieve default keypress functionality.
1408 %% Note that not all keypresses can be intercepted this way. If you wish to intercept special
1409 %% keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
1410 %% \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
1412 %% Most, but not all, windows allow keypresses to be intercepted.
1414 %% {\bf Tip:} be sure to call {\tt event.Skip()} for events that you don't process in this function,
1415 %% otherwise menu shortcuts may cease to work under Windows.
1417 %% \wxheading{See also}
1419 %% \helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup},\rtfsp
1420 %% \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
1421 %% \helpref{Event handling overview}{eventhandlingoverview}
1423 %% \membersection{wxWindow::OnKeyUp}\label{wxwindowonkeyup}
1425 %% \func{void}{OnKeyUp}{\param{wxKeyEvent\&}{ event}}
1427 %% Called when the user has released a key.
1429 %% \wxheading{Parameters}
1431 %% \docparam{event}{Object containing keypress information. See \helpref{wxKeyEvent}{wxkeyevent} for
1432 %% details about this class.}
1434 %% \wxheading{Remarks}
1436 %% This member function is called in response to a key up event. To intercept this event,
1437 %% use the EVT\_KEY\_UP macro in an event table definition. Your {\bf OnKeyUp} handler may call this
1438 %% default function to achieve default keypress functionality.
1440 %% Note that not all keypresses can be intercepted this way. If you wish to intercept special
1441 %% keys, such as shift, control, and function keys, then you will need to use \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown} or
1442 %% \helpref{wxWindow::OnKeyUp}{wxwindowonkeyup}.
1444 %% Most, but not all, windows allow key up events to be intercepted.
1446 %% \wxheading{See also}
1448 %% \helpref{wxWindow::OnChar}{wxwindowonchar}, \helpref{wxWindow::OnKeyDown}{wxwindowonkeydown},\rtfsp
1449 %% \helpref{wxKeyEvent}{wxkeyevent}, \helpref{wxWindow::OnCharHook}{wxwindowoncharhook},\rtfsp
1450 %% \helpref{Event handling overview}{eventhandlingoverview}
1452 %% \membersection{wxWindow::OnInitDialog}\label{wxwindowoninitdialog}
1454 %% \func{void}{OnInitDialog}{\param{wxInitDialogEvent\&}{ event}}
1456 %% Default handler for the wxEVT\_INIT\_DIALOG event. Calls \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow}.
1458 %% \wxheading{Parameters}
1460 %% \docparam{event}{Dialog initialisation event.}
1462 %% \wxheading{Remarks}
1464 %% Gives the window the default behaviour of transferring data to child controls via
1465 %% the validator that each control has.
1467 %% \wxheading{See also}
1469 %% \helpref{wxValidator}{wxvalidator}, \helpref{wxWindow::TransferDataToWindow}{wxwindowtransferdatatowindow}
1471 %% \membersection{wxWindow::OnMenuCommand}\label{wxwindowonmenucommand}
1473 %% \func{void}{OnMenuCommand}{\param{wxCommandEvent\& }{event}}
1475 %% Called when a menu command is received from a menu bar.
1477 %% \wxheading{Parameters}
1479 %% \docparam{event}{The menu command event. For more information, see \helpref{wxCommandEvent}{wxcommandevent}.}
1481 %% \wxheading{Remarks}
1483 %% A function with this name doesn't actually exist; you can choose any member function to receive
1484 %% menu command events, using the EVT\_COMMAND macro for individual commands or EVT\_COMMAND\_RANGE for
1485 %% a range of commands.
1487 %% \wxheading{See also}
1489 %% \helpref{wxCommandEvent}{wxcommandevent},\rtfsp
1490 %% \helpref{wxWindow::OnMenuHighlight}{wxwindowonmenuhighlight},\rtfsp
1491 %% \helpref{Event handling overview}{eventhandlingoverview}
1493 %% \membersection{wxWindow::OnMenuHighlight}\label{wxwindowonmenuhighlight}
1495 %% \func{void}{OnMenuHighlight}{\param{wxMenuEvent\& }{event}}
1497 %% Called when a menu select is received from a menu bar: that is, the
1498 %% mouse cursor is over a menu item, but the left mouse button has not been
1501 %% \wxheading{Parameters}
1503 %% \docparam{event}{The menu highlight event. For more information, see \helpref{wxMenuEvent}{wxmenuevent}.}
1505 %% \wxheading{Remarks}
1507 %% You can choose any member function to receive
1508 %% menu select events, using the EVT\_MENU\_HIGHLIGHT macro for individual menu items or EVT\_MENU\_HIGHLIGHT\_ALL macro
1509 %% for all menu items.
1511 %% The default implementation for \helpref{wxFrame::OnMenuHighlight}{wxframeonmenuhighlight} displays help
1512 %% text in the first field of the status bar.
1514 %% This function was known as {\bf OnMenuSelect} in earlier versions of wxWindows, but this was confusing
1515 %% since a selection is normally a left-click action.
1517 %% \wxheading{See also}
1519 %% \helpref{wxMenuEvent}{wxmenuevent},\rtfsp
1520 %% \helpref{wxWindow::OnMenuCommand}{wxwindowonmenucommand},\rtfsp
1521 %% \helpref{Event handling overview}{eventhandlingoverview}
1524 %% \membersection{wxWindow::OnMouseEvent}\label{wxwindowonmouseevent}
1526 %% \func{void}{OnMouseEvent}{\param{wxMouseEvent\&}{ event}}
1528 %% Called when the user has initiated an event with the
1531 %% \wxheading{Parameters}
1533 %% \docparam{event}{The mouse event. See \helpref{wxMouseEvent}{wxmouseevent} for
1536 %% \wxheading{Remarks}
1538 %% Most, but not all, windows respond to this event.
1540 %% To intercept this event, use the EVT\_MOUSE\_EVENTS macro in an event table definition, or individual
1541 %% mouse event macros such as EVT\_LEFT\_DOWN.
1543 %% \wxheading{See also}
1545 %% \helpref{wxMouseEvent}{wxmouseevent},\rtfsp
1546 %% \helpref{Event handling overview}{eventhandlingoverview}
1548 %% \membersection{wxWindow::OnMove}\label{wxwindowonmove}
1550 %% \func{void}{OnMove}{\param{wxMoveEvent\& }{event}}
1552 %% Called when a window is moved.
1554 %% \wxheading{Parameters}
1556 %% \docparam{event}{The move event. For more information, see \helpref{wxMoveEvent}{wxmoveevent}.}
1558 %% \wxheading{Remarks}
1560 %% Use the EVT\_MOVE macro to intercept move events.
1562 %% \wxheading{Remarks}
1564 %% Not currently implemented.
1566 %% \wxheading{See also}
1568 %% \helpref{wxMoveEvent}{wxmoveevent},\rtfsp
1569 %% \helpref{wxFrame::OnSize}{wxframeonsize},\rtfsp
1570 %% \helpref{Event handling overview}{eventhandlingoverview}
1572 %% \membersection{wxWindow::OnPaint}\label{wxwindowonpaint}
1574 %% \func{void}{OnPaint}{\param{wxPaintEvent\& }{event}}
1576 %% Sent to the event handler when the window must be refreshed.
1578 %% \wxheading{Parameters}
1580 %% \docparam{event}{Paint event. For more information, see \helpref{wxPaintEvent}{wxpaintevent}.}
1582 %% \wxheading{Remarks}
1584 %% Use the EVT\_PAINT macro in an event table definition to intercept paint events.
1586 %% Note that In a paint event handler, the application must {\it always} create a \helpref{wxPaintDC}{wxpaintdc} object,
1587 %% even if you do not use it. Otherwise, under MS Windows, refreshing for this and other windows will go wrong.
1593 %% void MyWindow::OnPaint(wxPaintEvent\& event)
1595 %% wxPaintDC dc(this);
1597 %% DrawMyDocument(dc);
1602 %% You can optimize painting by retrieving the rectangles
1603 %% that have been damaged and only repainting these. The rectangles are in
1604 %% terms of the client area, and are unscrolled, so you will need to do
1605 %% some calculations using the current view position to obtain logical,
1608 %% Here is an example of using the \helpref{wxRegionIterator}{wxregioniterator} class:
1612 %% // Called when window needs to be repainted.
1613 %% void MyWindow::OnPaint(wxPaintEvent\& event)
1615 %% wxPaintDC dc(this);
1617 %% // Find Out where the window is scrolled to
1618 %% int vbX,vbY; // Top left corner of client
1619 %% GetViewStart(&vbX,&vbY);
1621 %% int vX,vY,vW,vH; // Dimensions of client area in pixels
1622 %% wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1631 %% // Alternatively we can do this:
1633 %% // upd.GetRect(&rect);
1635 %% // Repaint this rectangle
1644 %% \wxheading{See also}
1646 %% \helpref{wxPaintEvent}{wxpaintevent},\rtfsp
1647 %% \helpref{wxPaintDC}{wxpaintdc},\rtfsp
1648 %% \helpref{Event handling overview}{eventhandlingoverview}
1650 %% \membersection{wxWindow::OnScroll}\label{wxwindowonscroll}
1652 %% \func{void}{OnScroll}{\param{wxScrollWinEvent\& }{event}}
1654 %% Called when a scroll window event is received from one of the window's built-in scrollbars.
1656 %% \wxheading{Parameters}
1658 %% \docparam{event}{Command event. Retrieve the new scroll position by
1659 %% calling \helpref{wxScrollEvent::GetPosition}{wxscrolleventgetposition}, and the
1660 %% scrollbar orientation by calling \helpref{wxScrollEvent::GetOrientation}{wxscrolleventgetorientation}.}
1662 %% \wxheading{Remarks}
1664 %% Note that it is not possible to distinguish between horizontal and vertical scrollbars
1665 %% until the function is executing (you can't have one function for vertical, another
1666 %% for horizontal events).
1668 %% \wxheading{See also}
1670 %% \helpref{wxScrollWinEvent}{wxscrollwinevent},\rtfsp
1671 %% \helpref{Event handling overview}{eventhandlingoverview}
1673 %% \membersection{wxWindow::OnSetFocus}\label{wxwindowonsetfocus}
1675 %% \func{void}{OnSetFocus}{\param{wxFocusEvent\& }{event}}
1677 %% Called when a window's focus is being set.
1679 %% \wxheading{Parameters}
1681 %% \docparam{event}{The focus event. For more information, see \helpref{wxFocusEvent}{wxfocusevent}.}
1683 %% \wxheading{Remarks}
1685 %% To intercept this event, use the macro EVT\_SET\_FOCUS in an event table definition.
1687 %% Most, but not all, windows respond to this event.
1689 %% \wxheading{See also}
1691 %% \helpref{wxFocusEvent}{wxfocusevent}, \helpref{wxWindow::OnKillFocus}{wxwindowonkillfocus},\rtfsp
1692 %% \helpref{Event handling overview}{eventhandlingoverview}
1694 %% \membersection{wxWindow::OnSize}\label{wxwindowonsize}
1696 %% \func{void}{OnSize}{\param{wxSizeEvent\& }{event}}
1698 %% Called when the window has been resized. This is not a virtual function; you should
1699 %% provide your own non-virtual OnSize function and direct size events to it using EVT\_SIZE
1700 %% in an event table definition.
1702 %% \wxheading{Parameters}
1704 %% \docparam{event}{Size event. For more information, see \helpref{wxSizeEvent}{wxsizeevent}.}
1706 %% \wxheading{Remarks}
1708 %% You may wish to use this for frames to resize their child windows as appropriate.
1710 %% Note that the size passed is of
1711 %% the whole window: call \helpref{wxWindow::GetClientSize}{wxwindowgetclientsize} for the area which may be
1712 %% used by the application.
1714 %% When a window is resized, usually only a small part of the window is damaged and you
1715 %% may only need to repaint that area. However, if your drawing depends on the size of the window,
1716 %% you may need to clear the DC explicitly and repaint the whole window. In which case, you
1717 %% may need to call \helpref{wxWindow::Refresh}{wxwindowrefresh} to invalidate the entire window.
1719 %% \wxheading{See also}
1721 %% \helpref{wxSizeEvent}{wxsizeevent},\rtfsp
1722 %% \helpref{Event handling overview}{eventhandlingoverview}
1724 %% \membersection{wxWindow::OnSysColourChanged}\label{wxwindowonsyscolourchanged}
1726 %% \func{void}{OnSysColourChanged}{\param{wxOnSysColourChangedEvent\& }{event}}
1728 %% Called when the user has changed the system colours. Windows only.
1730 %% \wxheading{Parameters}
1732 %% \docparam{event}{System colour change event. For more information, see \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent}.}
1734 %% \wxheading{See also}
1736 %% \helpref{wxSysColourChangedEvent}{wxsyscolourchangedevent},\rtfsp
1737 %% \helpref{Event handling overview}{eventhandlingoverview}
1739 \membersection{wxWindow::OnInternalIdle
}\label{wxwindowoninternalidle
}
1741 \func{virtual void
}{OnInternalIdle
}{\void}
1743 This virtual function is normally only used internally, but
1744 sometimes an application may need it to implement functionality
1745 that should not be disabled by an application defining an OnIdle
1746 handler in a derived class.
1748 This function may be used to do delayed painting, for example,
1749 and most implementations call
\helpref{wxWindow::UpdateWindowUI
}{wxwindowupdatewindowui
}
1750 in order to send update events to the window in idle time.
1752 \membersection{wxWindow::PageDown
}\label{wxwindowpagedown
}
1754 This is just a wrapper for
\helpref{ScrollPages()
}{wxwindowscrollpages
}$(
1)$.
1756 \membersection{wxWindow::PageUp
}\label{wxwindowpageup
}
1758 This is just a wrapper for
\helpref{ScrollPages()
}{wxwindowscrollpages
}$(-
1)$.
1760 \membersection{wxWindow::PopEventHandler
}\label{wxwindowpopeventhandler
}
1762 \constfunc{wxEvtHandler*
}{PopEventHandler
}{\param{bool
}{deleteHandler =
{\tt false
}}}
1764 Removes and returns the top-most event handler on the event handler stack.
1766 \wxheading{Parameters
}
1768 \docparam{deleteHandler
}{If this is
{\tt true
}, the handler will be deleted after it is removed. The
1769 default value is
{\tt false
}.
}
1771 \wxheading{See also
}
1773 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1774 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1775 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1776 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1777 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
1779 \membersection{wxWindow::PopupMenu
}\label{wxwindowpopupmenu
}
1781 \func{bool
}{PopupMenu
}{\param{wxMenu*
}{menu
},
\param{const wxPoint\&
}{pos
}}
1783 \func{bool
}{PopupMenu
}{\param{wxMenu*
}{menu
},
\param{int
}{x
},
\param{int
}{y
}}
1785 Pops up the given menu at the specified coordinates, relative to this
1786 window, and returns control when the user has dismissed the menu. If a
1787 menu item is selected, the corresponding menu event is generated and will be
1788 processed as usually.
1790 \wxheading{Parameters
}
1792 \docparam{menu
}{Menu to pop up.
}
1794 \docparam{pos
}{The position where the menu will appear.
}
1796 \docparam{x
}{Required x position for the menu to appear.
}
1798 \docparam{y
}{Required y position for the menu to appear.
}
1800 \wxheading{See also
}
1802 \helpref{wxMenu
}{wxmenu
}
1806 Just before the menu is popped up,
\helpref{wxMenu::UpdateUI
}{wxmenuupdateui
} is called
1807 to ensure that the menu items are in the correct state. The menu does not get deleted
1810 \pythonnote{In place of a single overloaded method name, wxPython
1811 implements the following methods:
\par
1812 \indented{2cm
}{\begin{twocollist
}
1813 \twocolitem{{\bf PopupMenu(menu, point)
}}{Specifies position with a wxPoint
}
1814 \twocolitem{{\bf PopupMenuXY(menu, x, y)
}}{Specifies position with two integers (x, y)
}
1818 \membersection{wxWindow::PushEventHandler
}\label{wxwindowpusheventhandler
}
1820 \func{void
}{PushEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1822 Pushes this event handler onto the event stack for the window.
1824 \wxheading{Parameters
}
1826 \docparam{handler
}{Specifies the handler to be pushed.
}
1830 An event handler is an object that is capable of processing the events
1831 sent to a window. By default, the window is its own event handler, but
1832 an application may wish to substitute another, for example to allow
1833 central implementation of event-handling for a variety of different
1836 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} allows
1837 an application to set up a chain of event handlers, where an event not handled by one event handler is
1838 handed to the next one in the chain. Use
\helpref{wxWindow::PopEventHandler
}{wxwindowpopeventhandler
} to
1839 remove the event handler.
1841 \wxheading{See also
}
1843 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1844 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1845 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1846 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1847 \helpref{wxEvtHandler
}{wxevthandler
}
1849 \membersection{wxWindow::Raise
}\label{wxwindowraise
}
1851 \func{void
}{Raise
}{\void}
1853 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1856 \membersection{wxWindow::Refresh
}\label{wxwindowrefresh
}
1858 \func{virtual void
}{Refresh
}{\param{bool
}{ eraseBackground =
{\tt true
}},
\param{const wxRect*
}{rect
1861 Causes a message or event to be generated to repaint the
1864 \wxheading{Parameters
}
1866 \docparam{eraseBackground
}{If
{\tt true
}, the background will be
1869 \docparam{rect
}{If non-NULL, only the given rectangle will
1870 be treated as damaged.
}
1872 \wxheading{See also
}
1874 \helpref{wxWindow::RefreshRect
}{wxwindowrefreshrect
}
1876 \membersection{wxWindow::RefreshRect
}\label{wxwindowrefreshrect
}
1878 \func{virtual void
}{Refresh
}{\param{const wxRect\&
}{rect
}}
1880 Redraws the contents of the given rectangle: the area inside it will be
1883 This is the same as
\helpref{Refresh
}{wxwindowrefresh
} but has a nicer syntax.
1885 \membersection{wxWindow::RegisterHotKey
}\label{wxwindowregisterhotkey
}
1887 \func{bool
}{RegisterHotKey
}{\param{int
}{ hotkeyId
},
\param{int
}{ modifiers
},
\param{int
}{ virtualKeyCode
}}
1889 Registers a system wide hotkey. Every time the user presses the hotkey registered here, this window
1890 will receive a hotkey event. It will receive the event even if the application is in the background
1891 and does not have the input focus because the user is working with some other application.
1893 \wxheading{Parameters
}
1895 \docparam{hotkeyId
}{Numeric identifier of the hotkey. For applications this must be between
0 and
0xBFFF. If
1896 this function is called from a shared DLL, it must be a system wide unique identifier between
0xC000 and
0xFFFF.
1897 This is a MSW specific detail.
}
1899 \docparam{modifiers
}{A bitwise combination of
{\tt wxMOD
\_SHIFT},
{\tt wxMOD
\_CONTROL},
{\tt wxMOD
\_ALT}
1900 or
{\tt wxMOD
\_WIN} specifying the modifier keys that have to be pressed along with the key.
}
1902 \docparam{virtualKeyCode
}{The virtual key code of the hotkey.
}
1904 \wxheading{Return value
}
1906 {\tt true
} if the hotkey was registered successfully.
{\tt false
} if some other application already registered a
1907 hotkey with this modifier/virtualKeyCode combination.
1911 Use EVT
\_HOTKEY(hotkeyId, fnc) in the event table to capture the event.
1912 This function is currently only implemented under MSW.
1914 \wxheading{See also
}
1916 \helpref{wxWindow::UnregisterHotKey
}{wxwindowunregisterhotkey
}
1918 \membersection{wxWindow::ReleaseMouse
}\label{wxwindowreleasemouse
}
1920 \func{virtual void
}{ReleaseMouse
}{\void}
1922 Releases mouse input captured with
\helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}.
1924 \wxheading{See also
}
1926 \helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
},
1927 \helpref{wxWindow::HasCapture
}{wxwindowhascapture
},
1928 \helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
},
1929 \helpref{wxMouseCaptureChangedEvent
}{wxmousecapturechangedevent
}
1931 \membersection{wxWindow::RemoveChild
}\label{wxwindowremovechild
}
1933 \func{virtual void
}{RemoveChild
}{\param{wxWindow*
}{child
}}
1935 Removes a child window. This is called automatically by window deletion
1936 functions so should not be required by the application programmer.
1938 Notice that this function is mostly internal to wxWindows and shouldn't be
1939 called by the user code.
1941 \wxheading{Parameters
}
1943 \docparam{child
}{Child window to remove.
}
1945 \membersection{wxWindow::RemoveEventHandler
}\label{wxwindowremoveeventhandler
}
1947 \func{bool
}{RemoveEventHandler
}{\param{wxEvtHandler *
}{handler
}}
1949 Find the given
{\it handler
} in the windows event handler chain and remove (but
1950 not delete) it from it.
1952 \wxheading{Parameters
}
1954 \docparam{handler
}{The event handler to remove, must be non
{\tt NULL
} and
1955 must be present in this windows event handlers chain
}
1957 \wxheading{Return value
}
1959 Returns
{\tt true
} if it was found and
{\tt false
} otherwise (this also results
1960 in an assert failure so this function should only be called when the
1961 handler is supposed to be there).
1963 \wxheading{See also
}
1965 \helpref{PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1966 \helpref{PopEventHandler
}{wxwindowpopeventhandler
}
1968 \membersection{wxWindow::Reparent
}\label{wxwindowreparent
}
1970 \func{virtual bool
}{Reparent
}{\param{wxWindow*
}{newParent
}}
1972 Reparents the window, i.e the window will be removed from its
1973 current parent window (e.g. a non-standard toolbar in a wxFrame)
1974 and then re-inserted into another. Available on Windows and GTK.
1976 \wxheading{Parameters
}
1978 \docparam{newParent
}{New parent.
}
1980 \membersection{wxWindow::ScreenToClient
}\label{wxwindowscreentoclient
}
1982 \constfunc{virtual void
}{ScreenToClient
}{\param{int*
}{x
},
\param{int*
}{y
}}
1984 \constfunc{virtual wxPoint
}{ScreenToClient
}{\param{const wxPoint\&
}{pt
}}
1986 Converts from screen to client window coordinates.
1988 \wxheading{Parameters
}
1990 \docparam{x
}{Stores the screen x coordinate and receives the client x coordinate.
}
1992 \docparam{y
}{Stores the screen x coordinate and receives the client x coordinate.
}
1994 \docparam{pt
}{The screen position for the second form of the function.
}
1996 \pythonnote{In place of a single overloaded method name, wxPython
1997 implements the following methods:
\par
1998 \indented{2cm
}{\begin{twocollist
}
1999 \twocolitem{{\bf ScreenToClient(point)
}}{Accepts and returns a wxPoint
}
2000 \twocolitem{{\bf ScreenToClientXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
2004 \membersection{wxWindow::ScrollLines
}\label{wxwindowscrolllines
}
2006 \func{virtual bool
}{ScrollLines
}{\param{int
}{lines
}}
2008 Scrolls the window by the given number of lines down (if
{\it lines
} is
2011 \wxheading{Return value
}
2013 Returns
{\tt true
} if the window was scrolled,
{\tt false
} if it was already
2014 on top/bottom and nothing was done.
2018 This function is currently only implemented under MSW and wxTextCtrl under
2019 wxGTK (it also works for wxScrolledWindow derived classes under all
2022 \wxheading{See also
}
2024 \helpref{ScrollPages
}{wxwindowscrollpages
}
2026 \membersection{wxWindow::ScrollPages
}\label{wxwindowscrollpages
}
2028 \func{virtual bool
}{ScrollPages
}{\param{int
}{pages
}}
2030 Scrolls the window by the given number of pages down (if
{\it pages
} is
2033 \wxheading{Return value
}
2035 Returns
{\tt true
} if the window was scrolled,
{\tt false
} if it was already
2036 on top/bottom and nothing was done.
2040 This function is currently only implemented under MSW and wxTextCtrl under
2041 wxGTK (it also works for wxScrolledWindow derived classes under all
2044 \wxheading{See also
}
2046 \helpref{ScrollLines
}{wxwindowscrolllines
}
2048 \membersection{wxWindow::ScrollWindow
}\label{wxwindowscrollwindow
}
2050 \func{virtual void
}{ScrollWindow
}{\param{int
}{dx
},
\param{int
}{dy
},
\param{const wxRect*
}{ rect = NULL
}}
2052 Physically scrolls the pixels in the window and move child windows accordingly.
2054 \wxheading{Parameters
}
2056 \docparam{dx
}{Amount to scroll horizontally.
}
2058 \docparam{dy
}{Amount to scroll vertically.
}
2060 \docparam{rect
}{Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
2061 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
2062 can optimize painting by checking for the invalidated region. This parameter is ignored under GTK.
}
2066 Use this function to optimise your scrolling implementations, to minimise the area that must be
2067 redrawn. Note that it is rarely required to call this function from a user program.
2069 \membersection{wxWindow::SetAcceleratorTable
}\label{wxwindowsetacceleratortable
}
2071 \func{virtual void
}{SetAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{ accel
}}
2073 Sets the accelerator table for this window. See
\helpref{wxAcceleratorTable
}{wxacceleratortable
}.
2075 \membersection{wxWindow::SetAccessible
}\label{wxwindowsetaccessible
}
2077 \func{void
}{SetAccessible
}{\param{wxAccessibile*
}{ accessible
}}
2079 Sets the accessible for this window. Any existing accessible for this window
2080 will be deleted first, if not identical to
{\it accessible
}.
2082 See also
\helpref{wxAccessible
}{wxaccessible
}.
2084 \membersection{wxWindow::SetAutoLayout
}\label{wxwindowsetautolayout
}
2086 \func{void
}{SetAutoLayout
}{\param{bool
}{ autoLayout
}}
2088 Determines whether the
\helpref{wxWindow::Layout
}{wxwindowlayout
} function will
2089 be called automatically when the window is resized. It is called implicitly by
2090 \helpref{wxWindow::SetSizer
}{wxwindowsetsizer
} but if you use
2091 \helpref{wxWindow::SetConstraints
}{wxwindowsetconstraints
} you should call it
2092 manually or otherwise the window layout won't be correctly updated when its
2095 \wxheading{Parameters
}
2097 \docparam{autoLayout
}{Set this to
{\tt true
} if you wish the Layout function to be called
2098 from within wxWindow::OnSize functions.
}
2100 \wxheading{See also
}
2102 \helpref{wxWindow::SetConstraints
}{wxwindowsetconstraints
}
2104 \membersection{wxWindow::SetBackgroundColour
}\label{wxwindowsetbackgroundcolour
}
2106 \func{virtual void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colour
}}
2108 Sets the background colour of the window.
2110 \wxheading{Parameters
}
2112 \docparam{colour
}{The colour to be used as the background colour.
}
2116 The background colour is usually painted by the default
\rtfsp
2117 \helpref{wxEraseEvent
}{wxeraseevent
} event handler function
2118 under Windows and automatically under GTK.
2120 Note that setting the background colour does not cause an immediate refresh, so you
2121 may wish to call
\helpref{wxWindow::ClearBackground
}{wxwindowclearbackground
} or
\helpref{wxWindow::Refresh
}{wxwindowrefresh
} after
2122 calling this function.
2124 Use this function with care under GTK+ as the new appearance of the window might
2125 not look equally well when used with "Themes", i.e GTK+'s ability to change its
2126 look as the user wishes with run-time loadable modules.
2128 \wxheading{See also
}
2130 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
},
\rtfsp
2131 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
2132 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
2133 \helpref{wxWindow::ClearBackground
}{wxwindowclearbackground
},
\rtfsp
2134 \helpref{wxWindow::Refresh
}{wxwindowrefresh
},
\rtfsp
2135 \helpref{wxEraseEvent
}{wxeraseevent
}
2137 \membersection{wxWindow::SetCaret
}\label{wxwindowsetcaret
}
2139 \constfunc{void
}{SetCaret
}{\param{wxCaret *
}{caret
}}
2141 Sets the
\helpref{caret
}{wxcaret
} associated with the window.
2143 \membersection{wxWindow::SetClientSize
}\label{wxwindowsetclientsize
}
2145 \func{virtual void
}{SetClientSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
2147 \func{virtual void
}{SetClientSize
}{\param{const wxSize\&
}{ size
}}
2149 This sets the size of the window client area in pixels. Using this function to size a window
2150 tends to be more device-independent than
\helpref{wxWindow::SetSize
}{wxwindowsetsize
}, since the application need not
2151 worry about what dimensions the border or title bar have when trying to fit the window
2152 around panel items, for example.
2154 \wxheading{Parameters
}
2156 \docparam{width
}{The required client area width.
}
2158 \docparam{height
}{The required client area height.
}
2160 \docparam{size
}{The required client size.
}
2162 \pythonnote{In place of a single overloaded method name, wxPython
2163 implements the following methods:
\par
2164 \indented{2cm
}{\begin{twocollist
}
2165 \twocolitem{{\bf SetClientSize(size)
}}{Accepts a wxSize
}
2166 \twocolitem{{\bf SetClientSizeWH(width, height)
}}{}
2170 \membersection{wxWindow::SetContainingSizer
}\label{wxwindowsetcontainingsizer
}
2172 \func{void
}{SetContainingSizer
}{\param{wxSizer*
}{sizer
}}
2174 This normally does not need to be called by user code. It is called
2175 when a window is added to a sizer, and is used so the window can
2176 remove itself from the sizer when it is destroyed.
2178 \membersection{wxWindow::SetCursor
}\label{wxwindowsetcursor
}
2180 \func{virtual void
}{SetCursor
}{\param{const wxCursor\&
}{cursor
}}
2182 % VZ: the docs are correct, if the code doesn't behave like this, it must be
2184 Sets the window's cursor. Notice that the window cursor also sets it for the
2185 children of the window implicitly.
2187 The
{\it cursor
} may be
{\tt wxNullCursor
} in which case the window cursor will
2188 be reset back to default.
2190 \wxheading{Parameters
}
2192 \docparam{cursor
}{Specifies the cursor that the window should normally display.
}
2194 \wxheading{See also
}
2196 \helpref{::wxSetCursor
}{wxsetcursor
},
\helpref{wxCursor
}{wxcursor
}
2198 \membersection{wxWindow::SetConstraints
}\label{wxwindowsetconstraints
}
2200 \func{void
}{SetConstraints
}{\param{wxLayoutConstraints*
}{constraints
}}
2202 Sets the window to have the given layout constraints. The window
2203 will then own the object, and will take care of its deletion.
2204 If an existing layout constraints object is already owned by the
2205 window, it will be deleted.
2207 \wxheading{Parameters
}
2209 \docparam{constraints
}{The constraints to set. Pass NULL to disassociate and delete the window's
2214 You must call
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} to tell a window to use
2215 the constraints automatically in OnSize; otherwise, you must override OnSize and call Layout()
2216 explicitly. When setting both a wxLayoutConstraints and a
\helpref{wxSizer
}{wxsizer
}, only the
2217 sizer will have effect.
2219 \membersection{wxWindow::SetDropTarget
}\label{wxwindowsetdroptarget
}
2221 \func{void
}{SetDropTarget
}{\param{wxDropTarget*
}{ target
}}
2223 Associates a drop target with this window.
2225 If the window already has a drop target, it is deleted.
2227 \wxheading{See also
}
2229 \helpref{wxWindow::GetDropTarget
}{wxwindowgetdroptarget
},
2230 \helpref{Drag and drop overview
}{wxdndoverview
}
2232 \membersection{wxWindow::SetEventHandler
}\label{wxwindowseteventhandler
}
2234 \func{void
}{SetEventHandler
}{\param{wxEvtHandler*
}{handler
}}
2236 Sets the event handler for this window.
2238 \wxheading{Parameters
}
2240 \docparam{handler
}{Specifies the handler to be set.
}
2244 An event handler is an object that is capable of processing the events
2245 sent to a window. By default, the window is its own event handler, but
2246 an application may wish to substitute another, for example to allow
2247 central implementation of event-handling for a variety of different
2250 It is usually better to use
\helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} since
2251 this sets up a chain of event handlers, where an event not handled by one event handler is
2252 handed to the next one in the chain.
2254 \wxheading{See also
}
2256 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
2257 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
2258 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
2259 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
2260 \helpref{wxEvtHandler
}{wxevthandler
}
2262 \membersection{wxWindow::SetExtraStyle
}\label{wxwindowsetextrastyle
}
2264 \func{void
}{SetExtraStyle
}{\param{long
}{exStyle
}}
2266 Sets the extra style bits for the window. The currently defined extra style
2270 \begin{twocollist
}\itemsep=
0pt
2271 \twocolitem{\windowstyle{wxWS
\_EX\_VALIDATE\_RECURSIVELY}}{TransferDataTo/FromWindow()
2272 and Validate() methods will recursively descend into all children of the
2273 window if it has this style flag set.
}
2274 \twocolitem{\windowstyle{wxWS
\_EX\_BLOCK\_EVENTS}}{Normally, the command
2275 events are propagated upwards to the window parent recursively until a handler
2276 for them is found. Using this style allows to prevent them from being
2277 propagated beyond this window. Notice that wxDialog has this style on by
2278 default for the reasons explained in the
2279 \helpref{event processing overview
}{eventprocessing
}.
}
2280 \twocolitem{\windowstyle{wxWS
\_EX\_TRANSIENT}}{This can be used to prevent a
2281 window from being used as an implicit parent for the dialogs which were
2282 created without a parent. It is useful for the windows which can disappear at
2283 any moment as creating children of such windows results in fatal problems.
}
2284 \twocolitem{\windowstyle{wxFRAME
\_EX\_CONTEXTHELP}}{Under Windows, puts a query button on the
2285 caption. When pressed, Windows will go into a context-sensitive help mode and wxWindows will send
2286 a wxEVT
\_HELP event if the user clicked on an application window.
2287 This style cannot be used together with wxMAXIMIZE
\_BOX or wxMINIMIZE
\_BOX, so
2288 you should use the style of
2289 {\tt wxDEFAULT
\_FRAME\_STYLE \&
\textasciitilde(wxMINIMIZE
\_BOX | wxMAXIMIZE
\_BOX)
} for the
2290 frames having this style (the dialogs don't have minimize nor maximize box by
2294 \membersection{wxWindow::SetFocus
}\label{wxwindowsetfocus
}
2296 \func{virtual void
}{SetFocus
}{\void}
2298 This sets the window to receive keyboard input.
2300 \wxheading{See also
}
2302 \helpref{wxFocusEvent
}{wxfocusevent
}
2304 \membersection{wxWindow::SetFocusFromKbd
}\label{wxwindowsetfocusfromkbd
}
2306 \func{virtual void
}{SetFocusFromKbd
}{\void}
2308 This function is called by wxWindows keyboard navigation code when the user
2309 gives the focus to this window from keyboard (e.g. using
{\tt TAB
} key).
2310 By default this method simply calls
\helpref{SetFocus
}{wxwindowsetfocus
} but
2311 can be overridden to do something in addition to this in the derived classes.
2313 \membersection{wxWindow::SetFont
}\label{wxwindowsetfont
}
2315 \func{void
}{SetFont
}{\param{const wxFont\&
}{font
}}
2317 Sets the font for this window.
2319 \wxheading{Parameters
}
2321 \docparam{font
}{Font to associate with this window.
}
2323 \wxheading{See also
}
2325 \helpref{wxWindow::GetFont
}{wxwindowgetfont
}
2327 \membersection{wxWindow::SetForegroundColour
}\label{wxwindowsetforegroundcolour
}
2329 \func{virtual void
}{SetForegroundColour
}{\param{const wxColour\&
}{colour
}}
2331 Sets the foreground colour of the window.
2333 \wxheading{Parameters
}
2335 \docparam{colour
}{The colour to be used as the foreground colour.
}
2339 The interpretation of foreground colour is open to interpretation according
2340 to the window class; it may be the text colour or other colour, or it may not
2343 Note that when using this functions under GTK, you will disable the so called "themes",
2344 i.e. the user chosen appearance of windows and controls, including the themes of
2345 their parent windows.
2347 \wxheading{See also
}
2349 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
2350 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
2351 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
2353 \membersection{wxWindow::SetHelpText
}\label{wxwindowsethelptext
}
2355 \func{virtual void
}{SetHelpText
}{\param{const wxString\&
}{helpText
}}
2357 Sets the help text to be used as context-sensitive help for this window.
2359 Note that the text is actually stored by the current
\helpref{wxHelpProvider
}{wxhelpprovider
} implementation,
2360 and not in the window object itself.
2362 \wxheading{See also
}
2364 \helpref{GetHelpText
}{wxwindowgethelptext
},
\helpref{wxHelpProvider
}{wxhelpprovider
}
2366 \membersection{wxWindow::SetId
}\label{wxwindowsetid
}
2368 \func{void
}{SetId
}{\param{int
}{ id
}}
2370 Sets the identifier of the window.
2374 Each window has an integer identifier. If the application has not provided one,
2375 an identifier will be generated. Normally, the identifier should be provided
2376 on creation and should not be modified subsequently.
2378 \wxheading{See also
}
2380 \helpref{wxWindow::GetId
}{wxwindowgetid
},
\rtfsp
2381 \helpref{Window identifiers
}{windowids
}
2383 \membersection{wxWindow::SetName
}\label{wxwindowsetname
}
2385 \func{virtual void
}{SetName
}{\param{const wxString\&
}{name
}}
2387 Sets the window's name.
2389 \wxheading{Parameters
}
2391 \docparam{name
}{A name to set for the window.
}
2393 \wxheading{See also
}
2395 \helpref{wxWindow::GetName
}{wxwindowgetname
}
2397 \membersection{wxWindow::SetPalette
}\label{wxwindowsetpalette
}
2399 \func{virtual void
}{SetPalette
}{\param{wxPalette*
}{palette
}}
2401 Obsolete - use
\helpref{wxDC::SetPalette
}{wxdcsetpalette
} instead.
2403 \membersection{wxWindow::SetScrollbar
}\label{wxwindowsetscrollbar
}
2405 \func{virtual void
}{SetScrollbar
}{\param{int
}{orientation
},
\param{int
}{position
},
\rtfsp
2406 \param{int
}{thumbSize
},
\param{int
}{range
},
\rtfsp
2407 \param{bool
}{refresh =
{\tt true
}}}
2409 Sets the scrollbar properties of a built-in scrollbar.
2411 \wxheading{Parameters
}
2413 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2415 \docparam{position
}{The position of the scrollbar in scroll units.
}
2417 \docparam{thumbSize
}{The size of the thumb, or visible portion of the scrollbar, in scroll units.
}
2419 \docparam{range
}{The maximum position of the scrollbar.
}
2421 \docparam{refresh
}{{\tt true
} to redraw the scrollbar,
{\tt false
} otherwise.
}
2425 Let's say you wish to display
50 lines of text, using the same font.
2426 The window is sized so that you can only see
16 lines at a time.
2432 SetScrollbar(wxVERTICAL,
0,
16,
50);
2436 Note that with the window at this size, the thumb position can never go
2437 above
50 minus
16, or
34.
2439 You can determine how many lines are currently visible by dividing the current view
2440 size by the character height in pixels.
2442 When defining your own scrollbar behaviour, you will always need to recalculate
2443 the scrollbar settings when the window size changes. You could therefore put your
2444 scrollbar calculations and SetScrollbar
2445 call into a function named AdjustScrollbars, which can be called initially and also
2446 from your
\helpref{wxSizeEvent
}{wxsizeevent
} handler function.
2448 \wxheading{See also
}
2450 \helpref{Scrolling overview
}{scrollingoverview
},
\rtfsp
2451 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2454 \membersection{wxWindow::SetScrollPage
}\label{wxwindowsetscrollpage
}
2456 \func{virtual void
}{SetScrollPage
}{\param{int
}{orientation
},
\param{int
}{pageSize
},
\param{bool
}{refresh =
{\tt true
}}}
2458 Sets the page size of one of the built-in scrollbars.
2460 \wxheading{Parameters
}
2462 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2464 \docparam{pageSize
}{Page size in scroll units.
}
2466 \docparam{refresh
}{{\tt true
} to redraw the scrollbar,
{\tt false
} otherwise.
}
2470 The page size of a scrollbar is the number of scroll units that the scroll thumb travels when you
2471 click on the area above/left of or below/right of the thumb. Normally you will want a whole visible
2472 page to be scrolled, i.e. the size of the current view (perhaps the window client size). This
2473 value has to be adjusted when the window is resized, since the page size will have changed.
2475 In addition to specifying how far the scroll thumb travels when paging, in Motif and some versions of Windows
2476 the thumb changes size to reflect the page size relative to the length of the
document. When the
2477 document size is only slightly bigger than the current view (window) size, almost all of the scrollbar
2478 will be taken up by the thumb. When the two values become the same, the scrollbar will (on some systems)
2481 Currently, this function should be called before SetPageRange, because of a quirk in the Windows
2482 handling of pages and ranges.
2484 \wxheading{See also
}
2486 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2487 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2488 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2489 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2492 \membersection{wxWindow::SetScrollPos
}\label{wxwindowsetscrollpos
}
2494 \func{virtual void
}{SetScrollPos
}{\param{int
}{orientation
},
\param{int
}{pos
},
\param{bool
}{refresh =
{\tt true
}}}
2496 Sets the position of one of the built-in scrollbars.
2498 \wxheading{Parameters
}
2500 \docparam{orientation
}{Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2502 \docparam{pos
}{Position in scroll units.
}
2504 \docparam{refresh
}{{\tt true
} to redraw the scrollbar,
{\tt false
} otherwise.
}
2508 This function does not directly affect the contents of the window: it is up to the
2509 application to take note of scrollbar attributes and redraw contents accordingly.
2511 \wxheading{See also
}
2513 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
},
\rtfsp
2514 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2515 \helpref{wxWindow::GetScrollThumb
}{wxwindowgetscrollthumb
},
\rtfsp
2516 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2519 \membersection{wxWindow::SetScrollRange
}\label{wxwindowsetscrollrange
}
2521 \func{virtual void
}{SetScrollRange
}{\param{int
}{orientation
},
\param{int
}{range
},
\param{bool
}{refresh =
{\tt true
}}}
2523 Sets the range of one of the built-in scrollbars.
2525 \wxheading{Parameters
}
2527 \docparam{orientation
}{Determines the scrollbar whose range is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2529 \docparam{range
}{Scroll range.
}
2531 \docparam{refresh
}{{\tt true
} to redraw the scrollbar,
{\tt false
} otherwise.
}
2535 The range of a scrollbar is the number of steps that the thumb may travel, rather than the total
2536 object length of the scrollbar. If you are implementing a scrolling window, for example, you
2537 would adjust the scroll range when the window is resized, by subtracting the window view size from the
2538 total virtual window size. When the two sizes are the same (all the window is visible), the range goes to zero
2539 and usually the scrollbar will be automatically hidden.
2541 \wxheading{See also
}
2543 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2544 \helpref{wxWindow::SetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2545 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2546 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2547 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2550 \membersection{wxWindow::SetSize
}\label{wxwindowsetsize
}
2552 \func{virtual void
}{SetSize
}{\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
},
2553 \param{int
}{ sizeFlags = wxSIZE
\_AUTO}}
2555 \func{virtual void
}{SetSize
}{\param{const wxRect\&
}{ rect
}}
2557 Sets the size and position of the window in pixels.
2559 \func{virtual void
}{SetSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
2561 \func{virtual void
}{SetSize
}{\param{const wxSize\&
}{ size
}}
2563 Sets the size of the window in pixels.
2565 \wxheading{Parameters
}
2567 \docparam{x
}{Required x position in pixels, or -
1 to indicate that the existing
2568 value should be used.
}
2570 \docparam{y
}{Required y position in pixels, or -
1 to indicate that the existing
2571 value should be used.
}
2573 \docparam{width
}{Required width in pixels, or -
1 to indicate that the existing
2574 value should be used.
}
2576 \docparam{height
}{Required height position in pixels, or -
1 to indicate that the existing
2577 value should be used.
}
2579 \docparam{size
}{\helpref{wxSize
}{wxsize
} object for setting the size.
}
2581 \docparam{rect
}{\helpref{wxRect
}{wxrect
} object for setting the position and size.
}
2583 \docparam{sizeFlags
}{Indicates the interpretation of other parameters. It is a bit list of the following:
2585 {\bf wxSIZE
\_AUTO\_WIDTH}: a -
1 width value is taken to indicate
2586 a wxWindows-supplied default width.\\
2587 {\bf wxSIZE
\_AUTO\_HEIGHT}: a -
1 height value is taken to indicate
2588 a wxWindows-supplied default width.\\
2589 {\bf wxSIZE
\_AUTO}: -
1 size values are taken to indicate
2590 a wxWindows-supplied default size.\\
2591 {\bf wxSIZE
\_USE\_EXISTING}: existing dimensions should be used
2592 if -
1 values are supplied.\\
2593 {\bf wxSIZE
\_ALLOW\_MINUS\_ONE}: allow dimensions of -
1 and less to be interpreted
2594 as real dimensions, not default values.
2599 The second form is a convenience for calling the first form with default
2600 x and y parameters, and must be used with non-default width and height values.
2602 The first form sets the position and optionally size, of the window.
2603 Parameters may be -
1 to indicate either that a default should be supplied
2604 by wxWindows, or that the current value of the dimension should be used.
2606 \wxheading{See also
}
2608 \helpref{wxWindow::Move
}{wxwindowmove
}
2610 \pythonnote{In place of a single overloaded method name, wxPython
2611 implements the following methods:
\par
2612 \indented{2cm
}{\begin{twocollist
}
2613 \twocolitem{{\bf SetDimensions(x, y, width, height, sizeFlags=wxSIZE
\_AUTO)
}}{}
2614 \twocolitem{{\bf SetSize(size)
}}{}
2615 \twocolitem{{\bf SetPosition(point)
}}{}
2619 \membersection{wxWindow::SetSizeHints
}\label{wxwindowsetsizehints
}
2621 \func{virtual void
}{SetSizeHints
}{\param{int
}{ minW=-
1},
\param{int
}{ minH=-
1},
\param{int
}{ maxW=-
1},
\param{int
}{ maxH=-
1},
2622 \param{int
}{ incW=-
1},
\param{int
}{ incH=-
1}}
2624 Allows specification of minimum and maximum window sizes, and window size increments.
2625 If a pair of values is not set (or set to -
1), the default values will be used.
2627 \wxheading{Parameters
}
2629 \docparam{minW
}{Specifies the minimum width allowable.
}
2631 \docparam{minH
}{Specifies the minimum height allowable.
}
2633 \docparam{maxW
}{Specifies the maximum width allowable.
}
2635 \docparam{maxH
}{Specifies the maximum height allowable.
}
2637 \docparam{incW
}{Specifies the increment for sizing the width (Motif/Xt only).
}
2639 \docparam{incH
}{Specifies the increment for sizing the height (Motif/Xt only).
}
2643 If this function is called, the user will not be able to size the window outside the
2646 The resizing increments are only significant under Motif or Xt.
2648 \membersection{wxWindow::SetSizer
}\label{wxwindowsetsizer
}
2650 \func{void
}{SetSizer
}{\param{wxSizer*
}{sizer
},
\param{bool
}{deleteOld=true
}}
2652 Sets the window to have the given layout sizer. The window
2653 will then own the object, and will take care of its deletion.
2654 If an existing layout constraints object is already owned by the
2655 window, it will be deleted if the deleteOld parameter is true.
2657 Note that this function will also call
2658 \helpref{SetAutoLayout
}{wxwindowsetautolayout
} implicitly with
{\tt true
}
2659 parameter if the
{\it sizer
}\/ is non-NULL and
{\tt false
} otherwise.
2661 \wxheading{Parameters
}
2663 \docparam{sizer
}{The sizer to set. Pass NULL to disassociate and conditionally delete
2664 the window's sizer. See below.
}
2666 \docparam{deleteOld
}{If true (the default), this will delete any prexisting sizer.
2667 Pass false if you wish to handle deleting the old sizer yourself.
}
2671 SetSizer now enables and disables Layout automatically, but prior to wxWindows
2.3.3
2672 the following applied:
2674 You must call
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} to tell a window to use
2675 the sizer automatically in OnSize; otherwise, you must override OnSize and call Layout()
2676 explicitly. When setting both a wxSizer and a
\helpref{wxLayoutConstraints
}{wxlayoutconstraints
},
2677 only the sizer will have effect.
2679 \membersection{wxWindow::SetSizerAndFit
}\label{wxwindowsetsizerandfit
}
2681 \func{void
}{SetSizerAndFit
}{\param{wxSizer*
}{sizer
},
\param{bool
}{deleteOld=true
}}
2683 The same as
\helpref{SetSizer
}{wxwindowsetsizer
}, except it also sets the size hints
2684 for the window based on the sizer's minimum size.
2686 \membersection{wxWindow::SetTitle
}\label{wxwindowsettitle
}
2688 \func{virtual void
}{SetTitle
}{\param{const wxString\&
}{title
}}
2690 Sets the window's title. Applicable only to frames and dialogs.
2692 \wxheading{Parameters
}
2694 \docparam{title
}{The window's title.
}
2696 \wxheading{See also
}
2698 \helpref{wxWindow::GetTitle
}{wxwindowgettitle
}
2700 \membersection{wxWindow::SetThemeEnabled
}\label{wxwindowsetthemeenabled
}
2702 \func{virtual void
}{SetThemeEnabled
}{\param{bool
}{enable
}}
2704 This function tells a window if it should use the system's "theme" code
2705 to draw the windows' background instead if its own background drawing
2706 code. This does not always have any effect since the underlying platform
2707 obviously needs to support the notion of themes in user defined windows.
2708 One such platform is GTK+ where windows can have (very colourful) backgrounds
2709 defined by a user's selected theme.
2711 Dialogs, notebook pages and the status bar have this flag set to true
2712 by default so that the default look and feel is simulated best.
2714 \membersection{wxWindow::SetToolTip
}\label{wxwindowsettooltip
}
2716 \func{void
}{SetToolTip
}{\param{const wxString\&
}{tip
}}
2718 \func{void
}{SetToolTip
}{\param{wxToolTip*
}{tip
}}
2720 Attach a tooltip to the window.
2722 See also:
\helpref{GetToolTip
}{wxwindowgettooltip
},
2723 \helpref{wxToolTip
}{wxtooltip
}
2725 \membersection{wxWindow::SetValidator
}\label{wxwindowsetvalidator
}
2727 \func{virtual void
}{SetValidator
}{\param{const wxValidator\&
}{ validator
}}
2729 Deletes the current validator (if any) and sets the window validator, having called wxValidator::Clone to
2730 create a new validator of this type.
2732 \membersection{wxWindow::SetVirtualSize
}\label{wxwindowsetvirtualsize
}
2734 \func{void
}{SetVirtualSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
2736 \func{void
}{SetVirtualSize
}{\param{const wxSize\&
}{ size
}}
2738 Sets the virtual size of the window in pixels.
2740 \membersection{wxWindow::SetVirtualSizeHints
}\label{wxwindowsetvirtualsizehints
}
2742 \func{virtual void
}{SetVirtualSizeHints
}{\param{int
}{ minW
},
\param{int
}{ minH
},
\param{int
}{ maxW=-
1},
\param{int
}{ maxH=-
1}}
2744 Allows specification of minimum and maximum virtual window sizes.
2745 If a pair of values is not set (or set to -
1), the default values
2748 \wxheading{Parameters
}
2750 \docparam{minW
}{Specifies the minimum width allowable.
}
2752 \docparam{minH
}{Specifies the minimum height allowable.
}
2754 \docparam{maxW
}{Specifies the maximum width allowable.
}
2756 \docparam{maxH
}{Specifies the maximum height allowable.
}
2760 If this function is called, the user will not be able to size the virtual area
2761 of the window outside the given bounds.
2763 \membersection{wxWindow::SetWindowStyle
}\label{wxwindowsetwindowstyle
}
2765 \func{void
}{SetWindowStyle
}{\param{long
}{ style
}}
2767 Identical to
\helpref{SetWindowStyleFlag
}{wxwindowsetwindowstyleflag
}.
2769 \membersection{wxWindow::SetWindowStyleFlag
}\label{wxwindowsetwindowstyleflag
}
2771 \func{virtual void
}{SetWindowStyleFlag
}{\param{long
}{ style
}}
2773 Sets the style of the window. Please note that some styles cannot be changed
2774 after the window creation and that
\helpref{Refresh()
}{wxwindowrefresh
} might
2775 be called after changing the others for the change to take place immediately.
2777 See
\helpref{Window styles
}{windowstyles
} for more information about flags.
2779 \wxheading{See also
}
2781 \helpref{GetWindowStyleFlag
}{wxwindowgetwindowstyleflag
}
2783 \membersection{wxWindow::Show
}\label{wxwindowshow
}
2785 \func{virtual bool
}{Show
}{\param{bool
}{ show =
{\tt true
}}}
2787 Shows or hides the window. You may need to call
\helpref{Raise
}{wxwindowraise
}
2788 for a top level window if you want to bring it to top, although this is not
2789 needed if Show() is called immediately after the frame creation.
2791 \wxheading{Parameters
}
2793 \docparam{show
}{If
{\tt true
} displays the window. Otherwise, hides it.
}
2795 \wxheading{Return value
}
2797 {\tt true
} if the window has been shown or hidden or
{\tt false
} if nothing was
2798 done because it already was in the requested state.
2800 \wxheading{See also
}
2802 \helpref{wxWindow::IsShown
}{wxwindowisshown
}
2804 \membersection{wxWindow::Thaw
}\label{wxwindowthaw
}
2806 \func{virtual void
}{Thaw
}{\void}
2808 Reenables window updating after a previous call to
2809 \helpref{Freeze
}{wxwindowfreeze
}.
2811 \membersection{wxWindow::TransferDataFromWindow
}\label{wxwindowtransferdatafromwindow
}
2813 \func{virtual bool
}{TransferDataFromWindow
}{\void}
2815 Transfers values from child controls to data areas specified by their validators. Returns
2816 {\tt false
} if a transfer failed.
2818 If the window has
{\tt wxWS
\_EX\_VALIDATE\_RECURSIVELY} extra style flag set,
2819 the method will also call TransferDataFromWindow() of all child windows.
2821 \wxheading{See also
}
2823 \helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
},
\rtfsp
2824 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2826 \membersection{wxWindow::TransferDataToWindow
}\label{wxwindowtransferdatatowindow
}
2828 \func{virtual bool
}{TransferDataToWindow
}{\void}
2830 Transfers values to child controls from data areas specified by their validators.
2832 If the window has
{\tt wxWS
\_EX\_VALIDATE\_RECURSIVELY} extra style flag set,
2833 the method will also call TransferDataToWindow() of all child windows.
2835 \wxheading{Return value
}
2837 Returns
{\tt false
} if a transfer failed.
2839 \wxheading{See also
}
2841 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2842 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2844 \membersection{wxWindow::UnregisterHotKey
}\label{wxwindowunregisterhotkey
}
2846 \func{bool
}{UnregisterHotKey
}{\param{int
}{ hotkeyId
}}
2848 Unregisters a system wide hotkey.
2850 \wxheading{Parameters
}
2852 \docparam{hotkeyId
}{Numeric identifier of the hotkey. Must be the same id that was passed to RegisterHotKey.
}
2854 \wxheading{Return value
}
2856 {\tt true
} if the hotkey was unregistered successfully,
{\tt false
} if the id was invalid.
2860 This function is currently only implemented under MSW.
2862 \wxheading{See also
}
2864 \helpref{wxWindow::RegisterHotKey
}{wxwindowregisterhotkey
}
2866 \membersection{wxWindow::Update
}\label{wxwindowupdate
}
2868 \func{virtual void
}{Update
}{\void}
2870 Calling this method immediately repaints the invalidated area of the window
2871 while this would usually only happen when the flow of control returns to the
2872 event loop. Notice that this function doesn't refresh the window and does
2873 nothing if the window hadn't been already repainted. Use
2874 \helpref{Refresh
}{wxwindowrefresh
} first if you want to immediately redraw the
2875 window unconditionally.
2877 \membersection{wxWindow::UpdateWindowUI
}\label{wxwindowupdatewindowui
}
2879 \func{virtual void
}{UpdateWindowUI
}{\param{long
}{ flags = wxUPDATE_UI_NONE
}}
2881 This function sends
\helpref{wxUpdateUIEvents
}{wxupdateuievent
} to
2882 the window. The particular implementation depends on the window; for
2883 example a wxToolBar will send an update UI event for each toolbar button,
2884 and a wxFrame will send an update UI event for each menubar menu item.
2885 You can call this function from your application to ensure that your
2886 UI is up-to-date at this point (as far as your wxUpdateUIEvent handlers
2887 are concerned). This may be necessary if you have called
2888 \helpref{wxUpdateUIEvent::SetMode
}{wxupdateuieventsetmode
} or
2889 \helpref{wxUpdateUIEvent::SetUpdateInterval
}{wxupdateuieventsetupdateinterval
} to
2890 limit the overhead that wxWindows incurs by sending update UI events in idle time.
2892 {\it flags
} should be a bitlist of one or more of the following values.
2897 wxUPDATE_UI_NONE =
0x0000, // No particular value
2898 wxUPDATE_UI_RECURSE =
0x0001, // Call the function for descendants
2899 wxUPDATE_UI_FROMIDLE =
0x0002 // Invoked from On(Internal)Idle
2903 If you are calling this function from an OnInternalIdle or OnIdle
2904 function, make sure you pass the wxUPDATE
\_UI\_FROMIDLE flag, since
2905 this tells the window to only update the UI elements that need
2906 to be updated in idle time. Some windows update their elements
2907 only when necessary, for example when a menu is about to be shown.
2908 The following is an example of how to call UpdateWindowUI from
2912 void MyWindow::OnInternalIdle()
2914 if (wxUpdateUIEvent::CanUpdate(this))
2915 UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
2919 \wxheading{See also
}
2921 \helpref{wxUpdateUIEvent
}{wxupdateuievent
},
2922 \helpref{wxWindow::DoUpdateWindowUI
}{wxwindowdoupdatewindowui
},
2923 \helpref{wxWindow::OnInternalIdle
}{wxwindowoninternalidle
}
2925 \membersection{wxWindow::Validate
}\label{wxwindowvalidate
}
2927 \func{virtual bool
}{Validate
}{\void}
2929 Validates the current values of the child controls using their validators.
2931 If the window has
{\tt wxWS
\_EX\_VALIDATE\_RECURSIVELY} extra style flag set,
2932 the method will also call Validate() of all child windows.
2934 \wxheading{Return value
}
2936 Returns
{\tt false
} if any of the validations failed.
2938 \wxheading{See also
}
2940 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2941 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2942 \helpref{wxValidator
}{wxvalidator
}
2944 \membersection{wxWindow::WarpPointer
}\label{wxwindowwarppointer
}
2946 \func{void
}{WarpPointer
}{\param{int
}{ x
},
\param{int
}{ y
}}
2948 Moves the pointer to the given position on the window.
2950 {\bf NB:
} This function is not supported under Mac because Apple Human
2951 Interface Guidelines forbid moving the mouse cursor programmatically.
2953 \wxheading{Parameters
}
2955 \docparam{x
}{The new x position for the cursor.
}
2957 \docparam{y
}{The new y position for the cursor.
}