2 <head><title>wxWindow
</title></head>
3 <BODY BGCOLOR=
"#FFFFFF">
4 <A NAME=
"wxwindow"></A><CENTER>
5 <A HREF=
"http://www.wx.org/wx.zip#zip:wx.htm#anchor">Contents
</A> <A HREF=
"wx22.htm#classref">Up
</A> <A HREF=
"wx259.htm#wxwave"><<</A> <A HREF=
"wx261.htm#wxwindowdc">>></A> </CENTER><HR>
9 wxWindow is the base class for all windows. Any
10 children of the window will be deleted automatically by the destructor
11 before the window itself is deleted.
<P>
12 <B><FONT COLOR=
"#FF0000">Derived from
</FONT></B><P>
13 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><BR>
15 <A HREF=
"wx158.htm#wxobject">wxObject
</A><P>
16 <B><FONT COLOR=
"#FF0000">Include files
</FONT></B><P>
17 <wx/window.h
><P>
18 <B><FONT COLOR=
"#FF0000">Window styles
</FONT></B><P>
19 The following styles can apply to all windows, although they will not always make sense for a particular
26 <B>wxSIMPLE_BORDER
</B>
30 Displays a thin border around the window. wxBORDER is the old name
36 <B>wxDOUBLE_BORDER
</B>
40 Displays a double border. Windows only.
45 <B>wxSUNKEN_BORDER
</B>
49 Displays a sunken border.
54 <B>wxRAISED_BORDER
</B>
58 Displays a raised border.
63 <B>wxSTATIC_BORDER
</B>
67 Displays a border suitable for a static control.
72 <B>wxTRANSPARENT_WINDOW
</B>
76 The window is transparent, that is, it will not receive paint
86 Prevents the children of this window taking on
3D styles, even though
87 the application-wide policy is for
3D controls. Windows only.
92 <B>wxTAB_TRAVERSAL
</B>
96 Use this to enable tab traversal for non-dialog windows.
105 Use this style to enable a vertical scrollbar.
114 Use this style to enable a horizontal scrollbar.
119 <B>wxCLIP_CHILDREN
</B>
123 Use this style to eliminate flicker caused by the background being
124 repainted, then children being painted over them. Windows-only.
130 See also
<A HREF=
"wx305.htm#windowstyles">window styles overview
</A>.
<P>
131 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
132 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
133 <B><FONT COLOR=
"#FF0000">Members
</FONT></B><P>
134 <A HREF=
"#topic1026">wxWindow::wxWindow
</A><BR>
135 <A HREF=
"#topic1027">wxWindow::~wxWindow
</A><BR>
136 <A HREF=
"#topic1028">wxWindow::AddChild
</A><BR>
137 <A HREF=
"#wxwindowcapturemouse">wxWindow::CaptureMouse
</A><BR>
138 <A HREF=
"#wxwindowcenter">wxWindow::Center
</A><BR>
139 <A HREF=
"#wxwindowcentre">wxWindow::Centre
</A><BR>
140 <A HREF=
"#wxwindowclear">wxWindow::Clear
</A><BR>
141 <A HREF=
"#topic1029">wxWindow::ClientToScreen
</A><BR>
142 <A HREF=
"#wxwindowclose">wxWindow::Close
</A><BR>
143 <A HREF=
"#wxwindowconvertdialogtopixels">wxWindow::ConvertDialogToPixels
</A><BR>
144 <A HREF=
"#wxwindowconvertpixelstodialog">wxWindow::ConvertPixelsToDialog
</A><BR>
145 <A HREF=
"#wxwindowdestroy">wxWindow::Destroy
</A><BR>
146 <A HREF=
"#topic1030">wxWindow::DestroyChildren
</A><BR>
147 <A HREF=
"#wxwindowdragacceptfiles">wxWindow::DragAcceptFiles
</A><BR>
148 <A HREF=
"#wxwindowenable">wxWindow::Enable
</A><BR>
149 <A HREF=
"#wxwindowfindfocus">wxWindow::FindFocus
</A><BR>
150 <A HREF=
"#wxwindowfindwindow">wxWindow::FindWindow
</A><BR>
151 <A HREF=
"#wxwindowfit">wxWindow::Fit
</A><BR>
152 <A HREF=
"#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A><BR>
153 <A HREF=
"#topic1031">wxWindow::GetCharHeight
</A><BR>
154 <A HREF=
"#topic1032">wxWindow::GetCharWidth
</A><BR>
155 <A HREF=
"#topic1033">wxWindow::GetChildren
</A><BR>
156 <A HREF=
"#wxwindowgetclientsize">wxWindow::GetClientSize
</A><BR>
157 <A HREF=
"#wxwindowgetconstraints">wxWindow::GetConstraints
</A><BR>
158 <A HREF=
"#wxwindowgetdefaultitem">wxWindow::GetDefaultItem
</A><BR>
159 <A HREF=
"#wxwindowgetdroptarget">wxWindow::GetDropTarget
</A><BR>
160 <A HREF=
"#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A><BR>
161 <A HREF=
"#wxwindowgetfont">wxWindow::GetFont
</A><BR>
162 <A HREF=
"#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A><BR>
163 <A HREF=
"#topic1034">wxWindow::GetGrandParent
</A><BR>
164 <A HREF=
"#topic1035">wxWindow::GetHandle
</A><BR>
165 <A HREF=
"#wxwindowgetid">wxWindow::GetId
</A><BR>
166 <A HREF=
"#topic1036">wxWindow::GetPosition
</A><BR>
167 <A HREF=
"#topic1037">wxWindow::GetLabel
</A><BR>
168 <A HREF=
"#wxwindowgetname">wxWindow::GetName
</A><BR>
169 <A HREF=
"#topic1038">wxWindow::GetParent
</A><BR>
170 <A HREF=
"#wxwindowgetrect">wxWindow::GetRect
</A><BR>
171 <A HREF=
"#wxwindowgetreturncode">wxWindow::GetReturnCode
</A><BR>
172 <A HREF=
"#wxwindowgetscrollthumb">wxWindow::GetScrollThumb
</A><BR>
173 <A HREF=
"#wxwindowgetscrollpos">wxWindow::GetScrollPos
</A><BR>
174 <A HREF=
"#wxwindowgetscrollrange">wxWindow::GetScrollRange
</A><BR>
175 <A HREF=
"#wxwindowgetsize">wxWindow::GetSize
</A><BR>
176 <A HREF=
"#topic1039">wxWindow::GetTextExtent
</A><BR>
177 <A HREF=
"#wxwindowgettitle">wxWindow::GetTitle
</A><BR>
178 <A HREF=
"#wxwindowgetupdateregion">wxWindow::GetUpdateRegion
</A><BR>
179 <A HREF=
"#topic1040">wxWindow::GetWindowStyleFlag
</A><BR>
180 <A HREF=
"#wxwindowinitdialog">wxWindow::InitDialog
</A><BR>
181 <A HREF=
"#wxwindowisenabled">wxWindow::IsEnabled
</A><BR>
182 <A HREF=
"#wxwindowisretained">wxWindow::IsRetained
</A><BR>
183 <A HREF=
"#wxwindowisshown">wxWindow::IsShown
</A><BR>
184 <A HREF=
"#wxwindowlayout">wxWindow::Layout
</A><BR>
185 <A HREF=
"#wxwindowloadfromresource">wxWindow::LoadFromResource
</A><BR>
186 <A HREF=
"#wxwindowlower">wxWindow::Lower
</A><BR>
187 <A HREF=
"#wxwindowmakemodal">wxWindow::MakeModal
</A><BR>
188 <A HREF=
"#wxwindowmove">wxWindow::Move
</A><BR>
189 <A HREF=
"#wxwindowonactivate">wxWindow::OnActivate
</A><BR>
190 <A HREF=
"#wxwindowonchar">wxWindow::OnChar
</A><BR>
191 <A HREF=
"#wxwindowoncharhook">wxWindow::OnCharHook
</A><BR>
192 <A HREF=
"#wxwindowoncommand">wxWindow::OnCommand
</A><BR>
193 <A HREF=
"#wxwindowonclose">wxWindow::OnClose
</A><BR>
194 <A HREF=
"#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A><BR>
195 <A HREF=
"#wxwindowondropfiles">wxWindow::OnDropFiles
</A><BR>
196 <A HREF=
"#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A><BR>
197 <A HREF=
"#wxwindowonkeydown">wxWindow::OnKeyDown
</A><BR>
198 <A HREF=
"#wxwindowonkeyup">wxWindow::OnKeyUp
</A><BR>
199 <A HREF=
"#wxwindowonkillfocus">wxWindow::OnKillFocus
</A><BR>
200 <A HREF=
"#wxwindowonidle">wxWindow::OnIdle
</A><BR>
201 <A HREF=
"#wxwindowoninitdialog">wxWindow::OnInitDialog
</A><BR>
202 <A HREF=
"#wxwindowonmenucommand">wxWindow::OnMenuCommand
</A><BR>
203 <A HREF=
"#wxwindowonmenuhighlight">wxWindow::OnMenuHighlight
</A><BR>
204 <A HREF=
"#wxwindowonmouseevent">wxWindow::OnMouseEvent
</A><BR>
205 <A HREF=
"#wxwindowonmove">wxWindow::OnMove
</A><BR>
206 <A HREF=
"#wxwindowonpaint">wxWindow::OnPaint
</A><BR>
207 <A HREF=
"#wxwindowonscroll">wxWindow::OnScroll
</A><BR>
208 <A HREF=
"#wxwindowonsetfocus">wxWindow::OnSetFocus
</A><BR>
209 <A HREF=
"#wxwindowonsize">wxWindow::OnSize
</A><BR>
210 <A HREF=
"#wxwindowonsyscolourchanged">wxWindow::OnSysColourChanged
</A><BR>
211 <A HREF=
"#wxwindowpopeventhandler">wxWindow::PopEventHandler
</A><BR>
212 <A HREF=
"#wxwindowpopupmenu">wxWindow::PopupMenu
</A><BR>
213 <A HREF=
"#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A><BR>
214 <A HREF=
"#wxwindowraise">wxWindow::Raise
</A><BR>
215 <A HREF=
"#wxwindowrefresh">wxWindow::Refresh
</A><BR>
216 <A HREF=
"#wxwindowreleasemouse">wxWindow::ReleaseMouse
</A><BR>
217 <A HREF=
"#wxwindowremovechild">wxWindow::RemoveChild
</A><BR>
218 <A HREF=
"#wxwindowscreentoclient">wxWindow::ScreenToClient
</A><BR>
219 <A HREF=
"#wxwindowscrollwindow">wxWindow::ScrollWindow
</A><BR>
220 <A HREF=
"#wxwindowsetacceleratortable">wxWindow::SetAcceleratorTable
</A><BR>
221 <A HREF=
"#wxwindowsetautolayout">wxWindow::SetAutoLayout
</A><BR>
222 <A HREF=
"#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A><BR>
223 <A HREF=
"#wxwindowsetclientsize">wxWindow::SetClientSize
</A><BR>
224 <A HREF=
"#wxwindowsetcursor">wxWindow::SetCursor
</A><BR>
225 <A HREF=
"#wxwindowseteventhandler">wxWindow::SetEventHandler
</A><BR>
226 <A HREF=
"#wxwindowsetconstraints">wxWindow::SetConstraints
</A><BR>
227 <A HREF=
"#wxwindowsetdroptarget">wxWindow::SetDropTarget
</A><BR>
228 <A HREF=
"#wxwindowsetfocus">wxWindow::SetFocus
</A><BR>
229 <A HREF=
"#wxwindowsetfont">wxWindow::SetFont
</A><BR>
230 <A HREF=
"#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A><BR>
231 <A HREF=
"#wxwindowsetid">wxWindow::SetId
</A><BR>
232 <A HREF=
"#wxwindowsetname">wxWindow::SetName
</A><BR>
233 <A HREF=
"#wxwindowsetpalette">wxWindow::SetPalette
</A><BR>
234 <A HREF=
"#wxwindowsetreturncode">wxWindow::SetReturnCode
</A><BR>
235 <A HREF=
"#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><BR>
236 <A HREF=
"#wxwindowsetscrollpos">wxWindow::SetScrollPos
</A><BR>
237 <A HREF=
"#wxwindowsetsize">wxWindow::SetSize
</A><BR>
238 <A HREF=
"#wxwindowsetsizehints">wxWindow::SetSizeHints
</A><BR>
239 <A HREF=
"#wxwindowsettitle">wxWindow::SetTitle
</A><BR>
240 <A HREF=
"#topic1041">wxWindow::Show
</A><BR>
241 <A HREF=
"#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A><BR>
242 <A HREF=
"#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A><BR>
243 <A HREF=
"#wxwindowvalidate">wxWindow::Validate
</A><BR>
244 <A HREF=
"#wxwindowwarppointer">wxWindow::WarpPointer
</A><BR>
248 <A NAME=
"topic1026"></A>
249 <H3>wxWindow::wxWindow
</H3>
251 <B></B> <B>wxWindow
</B>()
<P>
252 Default constructor.
<P>
253 <B></B> <B>wxWindow
</B>(
<B>wxWindow*
</B><I> parent
</I>,
<B>wxWindowID
</B><I>id
</I>,
254 <B>const wxPoint
& </B><I>pos = wxDefaultPosition
</I>,
255 <B>const wxSize
& </B><I>size = wxDefaultSize
</I>,
256 <B>long
</B><I>style =
0</I>,
257 <B>const wxString
& </B><I>name = wxPanelNameStr
</I>)
<P>
258 Constructs a window, which can be a child of a frame, dialog or any other non-control window.
<P>
259 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
260 <I>parent
</I><UL><UL>
261 Pointer to a parent window.
</UL></UL>
264 Window identifier. If -
1, will automatically create an identifier.
</UL></UL>
267 Window position. wxDefaultPosition is (-
1, -
1) which indicates that wxWindows
268 should generate a default position for the window. If using the wxWindow class directly, supply
269 an actual position.
</UL></UL>
272 Window size. wxDefaultSize is (-
1, -
1) which indicates that wxWindows
273 should generate a default size for the window.
</UL></UL>
276 Window style. For generic window styles, please see
<A HREF=
"wx260.htm#wxwindow">wxWindow
</A>.
</UL></UL>
279 Window name.
</UL></UL>
283 <A NAME=
"topic1027"></A>
284 <H3>wxWindow::~wxWindow
</H3>
286 <B></B> <B>~wxWindow
</B>()
<P>
287 Destructor. Deletes all subwindows, then deletes itself. Instead of using
288 the
<B>delete
</B> operator explicitly, you should normally
289 use
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A> so that wxWindows
290 can delete a window only when it is safe to do so, in idle time.
<P>
291 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
292 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
293 <A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A>,
294 <A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>,
295 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A><P>
298 <A NAME=
"topic1028"></A>
299 <H3>wxWindow::AddChild
</H3>
301 <B>virtual void
</B> <B>AddChild
</B>(
<B>wxWindow*
</B><I>child
</I>)
<P>
302 Adds a child window. This is called automatically by window creation
303 functions so should not be required by the application programmer.
<P>
304 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
306 Child window to add.
</UL></UL>
310 <A NAME=
"wxwindowcapturemouse"></A>
311 <H3>wxWindow::CaptureMouse
</H3>
313 <B>virtual void
</B> <B>CaptureMouse
</B>()
<P>
314 Directs all mouse input to this window. Call
<A HREF=
"wx260.htm#wxwindowreleasemouse">wxWindow::ReleaseMouse
</A> to
315 release the capture.
<P>
316 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
317 <A HREF=
"wx260.htm#wxwindowreleasemouse">wxWindow::ReleaseMouse
</A><P>
320 <A NAME=
"wxwindowcenter"></A>
321 <H3>wxWindow::Center
</H3>
323 <B>void
</B> <B>Center
</B>(
<B>int
</B><I> direction
</I>)
<P>
324 A synonym for
<A HREF=
"wx260.htm#wxwindowcentre">Centre
</A>.
<P>
327 <A NAME=
"wxwindowcentre"></A>
328 <H3>wxWindow::Centre
</H3>
330 <B>virtual void
</B> <B>Centre
</B>(
<B>int
</B><I> direction = wxHORIZONTAL
</I>)
<P>
331 Centres the window.
<P>
332 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
333 <I>direction
</I><UL><UL>
334 Specifies the direction for the centering. May be
<TT>wxHORIZONTAL
</TT>,
<TT>wxVERTICAL
</TT>
335 or
<TT>wxBOTH
</TT>.
</UL></UL>
337 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
338 The actual behaviour depends on the derived window. For a frame or dialog box,
339 centring is relative to the whole display. For a panel item, centring is
340 relative to the panel.
<P>
341 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
342 <A HREF=
"wx260.htm#wxwindowcenter">wxWindow::Center
</A><P>
345 <A NAME=
"wxwindowclear"></A>
346 <H3>wxWindow::Clear
</H3>
348 <B>void
</B> <B>Clear
</B>()
<P>
349 Clears the window by filling it with the current background colour. Does not
350 cause an erase background event to be generated.
<P>
353 <A NAME=
"topic1029"></A>
354 <H3>wxWindow::ClientToScreen
</H3>
356 <B>virtual void
</B> <B>ClientToScreen
</B>(
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>)
<B>const
</B><P>
357 <B>virtual wxPoint
</B> <B>ClientToScreen
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<B>const
</B><P>
358 Converts to screen coordinates from coordinates relative to this window.
<P>
360 A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
361 a screen coordinate will be passed out.
</UL></UL>
364 A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
365 a screen coordinate will be passed out.
</UL></UL>
368 The client position for the second form of the function.
</UL></UL>
370 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
371 In place of a single overloaded method name, wxPython
372 implements the following methods:
<P>
380 <B>ClientToScreen(point)
</B>
384 Accepts and returns a wxPoint
389 <B>ClientToScreenXY(x, y)
</B>
393 Returns a
2-tuple, (x, y)
404 <A NAME=
"wxwindowclose"></A>
405 <H3>wxWindow::Close
</H3>
407 <B>virtual bool
</B> <B>Close
</B>(
<B>const bool
</B><I> force = FALSE
</I>)
<P>
408 The purpose of this call is to provide a safer way of destroying a window than using
409 the
<I>delete
</I> operator.
<P>
410 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
412 FALSE if the window's close handler should be able to veto the destruction
413 of this window, TRUE if it cannot.
</UL></UL>
415 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
416 Close calls the
<A HREF=
"wx45.htm#wxcloseevent">close handler
</A> for the window, providing an opportunity for the window to
417 choose whether to destroy the window.
<P>
418 The close handler should check whether the window is being deleted forcibly,
419 using
<A HREF=
"wx45.htm#wxcloseeventgetforce">wxCloseEvent::GetForce
</A>, in which case it should
420 destroy the window using
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>.
<P>
421 Applies to managed windows (wxFrame and wxDialog classes) only.
<P>
422 <I>Note
</I> that calling Close does not guarantee that the window will be destroyed; but it
423 provides a way to simulate a manual close of a window, which may or may not be implemented by
424 destroying the window. The default implementation of wxDialog::OnCloseWindow does not
425 necessarily delete the dialog, since it will simply simulate an wxID_CANCEL event which
426 itself only hides the dialog.
<P>
427 To guarantee that the window will be destroyed, call
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A> instead.
<P>
428 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
429 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
430 <A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A>,
431 <A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>,
432 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A><P>
435 <A NAME=
"wxwindowconvertdialogtopixels"></A>
436 <H3>wxWindow::ConvertDialogToPixels
</H3>
438 <B>wxPoint
</B> <B>ConvertDialogToPixels
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<P>
439 <B>wxSize
</B> <B>ConvertDialogToPixels
</B>(
<B>const wxSize
&</B><I> sz
</I>)
<P>
440 Converts a point or size from dialog units to pixels.
<P>
441 For the x dimension, the dialog units are multiplied by the average character width
442 and then divided by
4.
<P>
443 For the y dimension, the dialog units are multiplied by the average character height
444 and then divided by
8.
<P>
445 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
446 Dialog units are used for maintaining a dialog's proportions even if the font changes.
447 Dialogs created using Dialog Editor optionally use dialog units.
<P>
448 You can also use these functions programmatically. A convenience macro is defined:
<P>
451 #define wxDLG_UNIT(parent, pt) parent-
>ConvertDialogToPixels(pt)
454 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
455 <A HREF=
"wx260.htm#wxwindowconvertpixelstodialog">wxWindow::ConvertPixelsToDialog
</A><P>
456 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
457 In place of a single overloaded method name, wxPython
458 implements the following methods:
<P>
466 <B>ConvertDialogPointToPixels(point)
</B>
470 Accepts and returns a wxPoint
475 <B>ConvertDialogSizeToPixels(size)
</B>
479 Accepts and returns a wxSize
486 Additionally, the following helper functions are defined:
<P>
494 <B>wxDLG_PNT(win, point)
</B>
498 Converts a wxPoint from dialog
504 <B>wxDLG_SZE(win, size)
</B>
508 Converts a wxSize from dialog
520 <A NAME=
"wxwindowconvertpixelstodialog"></A>
521 <H3>wxWindow::ConvertPixelsToDialog
</H3>
523 <B>wxPoint
</B> <B>ConvertPixelsToDialog
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<P>
524 <B>wxSize
</B> <B>ConvertPixelsToDialog
</B>(
<B>const wxSize
&</B><I> sz
</I>)
<P>
525 Converts a point or size from pixels to dialog units.
<P>
526 For the x dimension, the pixels are multiplied by
4 and then divided by the average
528 For the y dimension, the pixels are multipled by
8 and then divided by the average
530 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
531 Dialog units are used for maintaining a dialog's proportions even if the font changes.
532 Dialogs created using Dialog Editor optionally use dialog units.
<P>
533 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
534 <A HREF=
"wx260.htm#wxwindowconvertdialogtopixels">wxWindow::ConvertDialogToPixels
</A><P>
536 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
537 In place of a single overloaded method name, wxPython
538 implements the following methods:
<P>
546 <B>ConvertDialogPointToPixels(point)
</B>
550 Accepts and returns a wxPoint
555 <B>ConvertDialogSizeToPixels(size)
</B>
559 Accepts and returns a wxSize
569 <A NAME=
"wxwindowdestroy"></A>
570 <H3>wxWindow::Destroy
</H3>
572 <B>virtual bool
</B> <B>Destroy
</B>()
<P>
573 Destroys the window safely. Use this function instead of the delete operator, since
574 different window classes can be destroyed differently. Frames and dialogs
575 are not destroyed immediately when this function is called - they are added
576 to a list of windows to be deleted on idle time, when all the window's events
577 have been processed. This prevents problems with events being sent to non-existant
579 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
580 TRUE if the window has either been successfully deleted, or it has been added
581 to the list of windows pending real deletion.
<P>
584 <A NAME=
"topic1030"></A>
585 <H3>wxWindow::DestroyChildren
</H3>
587 <B>virtual void
</B> <B>DestroyChildren
</B>()
<P>
588 Destroys all children of a window. Called automatically by the destructor.
<P>
591 <A NAME=
"wxwindowdragacceptfiles"></A>
592 <H3>wxWindow::DragAcceptFiles
</H3>
594 <B>virtual void
</B> <B>DragAcceptFiles
</B>(
<B>const bool
</B><I> accept
</I>)
<P>
595 Enables or disables elibility for drop file events (OnDropFiles).
<P>
596 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
597 <I>accept
</I><UL><UL>
598 If TRUE, the window is eligible for drop file events. If FALSE, the window
599 will not accept drop file events.
</UL></UL>
601 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
603 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
604 <A HREF=
"wx260.htm#wxwindowondropfiles">wxWindow::OnDropFiles
</A><P>
607 <A NAME=
"wxwindowenable"></A>
608 <H3>wxWindow::Enable
</H3>
610 <B>virtual void
</B> <B>Enable
</B>(
<B>const bool
</B><I> enable
</I>)
<P>
611 Enable or disable the window for user input.
<P>
612 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
613 <I>enable
</I><UL><UL>
614 If TRUE, enables the window for input. If FALSE, disables the window.
</UL></UL>
616 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
617 <A HREF=
"wx260.htm#wxwindowisenabled">wxWindow::IsEnabled
</A><P>
620 <A NAME=
"wxwindowfindfocus"></A>
621 <H3>wxWindow::FindFocus
</H3>
623 <B>static wxWindow*
</B> <B>FindFocus
</B>()
<P>
624 Finds the window or control which currently has the keyboard focus.
<P>
625 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
626 Note that this is a static function, so it can be called without needing a wxWindow pointer.
<P>
627 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
628 <A HREF=
"wx260.htm#wxwindowsetfocus">wxWindow::SetFocus
</A><P>
631 <A NAME=
"wxwindowfindwindow"></A>
632 <H3>wxWindow::FindWindow
</H3>
634 <B>wxWindow*
</B> <B>FindWindow
</B>(
<B>long
</B><I> id
</I>)
<P>
635 Find a child of this window, by identifier.
<P>
636 <B>wxWindow*
</B> <B>FindWindow
</B>(
<B>const wxString
&</B><I> name
</I>)
<P>
637 Find a child of this window, by name.
<P>
638 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
639 In place of a single overloaded method name, wxPython
640 implements the following methods:
<P>
648 <B>FindWindowById(id)
</B>
657 <B>FindWindowByName(name)
</B>
671 <A NAME=
"wxwindowfit"></A>
672 <H3>wxWindow::Fit
</H3>
674 <B>virtual void
</B> <B>Fit
</B>()
<P>
675 Sizes the window so that it fits around its subwindows.
<P>
678 <A NAME=
"wxwindowgetbackgroundcolour"></A>
679 <H3>wxWindow::GetBackgroundColour
</H3>
681 <B>virtual wxColour
</B> <B>GetBackgroundColour
</B>()
<B>const
</B><P>
682 Returns the background colour of the window.
<P>
683 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
684 <A HREF=
"wx260.htm#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A>,
685 <A HREF=
"wx260.htm#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A>,
686 <A HREF=
"wx260.htm#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A>,
687 <A HREF=
"wx260.htm#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A><P>
690 <A NAME=
"topic1031"></A>
691 <H3>wxWindow::GetCharHeight
</H3>
693 <B>virtual int
</B> <B>GetCharHeight
</B>()
<B>const
</B><P>
694 Returns the character height for this window.
<P>
697 <A NAME=
"topic1032"></A>
698 <H3>wxWindow::GetCharWidth
</H3>
700 <B>virtual int
</B> <B>GetCharWidth
</B>()
<B>const
</B><P>
701 Returns the average character width for this window.
<P>
704 <A NAME=
"topic1033"></A>
705 <H3>wxWindow::GetChildren
</H3>
707 <B>wxList
&</B> <B>GetChildren
</B>()
<P>
708 Returns a reference to the list of the window's children.
<P>
711 <A NAME=
"wxwindowgetclientsize"></A>
712 <H3>wxWindow::GetClientSize
</H3>
714 <B>virtual void
</B> <B>GetClientSize
</B>(
<B>int*
</B><I>width
</I>,
<B>int*
</B><I>height
</I>)
<B>const
</B><P>
715 <B>virtual wxSize
</B> <B>GetClientSize
</B>()
<B>const
</B><P>
716 This gets the size of the window 'client area' in pixels. The client area is the
717 area which may be drawn on by the programmer, excluding title bar, border etc.
<P>
718 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
720 Receives the client width in pixels.
</UL></UL>
722 <I>height
</I><UL><UL>
723 Receives the client height in pixels.
</UL></UL>
725 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
726 In place of a single overloaded method name, wxPython
727 implements the following methods:
<P>
735 <B>wxGetClientSizeTuple()
</B>
739 Returns a
2-tuple of (width, height)
744 <B>wxGetClientSize()
</B>
748 Returns a wxSize object
758 <A NAME=
"wxwindowgetconstraints"></A>
759 <H3>wxWindow::GetConstraints
</H3>
761 <B>wxLayoutConstraints*
</B> <B>GetConstraints
</B>()
<B>const
</B><P>
762 Returns a pointer to the window's layout constraints, or NULL if there are none.
<P>
765 <A NAME=
"wxwindowgetdefaultitem"></A>
766 <H3>wxWindow::GetDefaultItem
</H3>
768 <B>wxButton*
</B> <B>GetDefaultItem
</B>()
<B>const
</B><P>
769 Returns a pointer to the button which is the default for this window, or NULL.
<P>
772 <A NAME=
"wxwindowgetdroptarget"></A>
773 <H3>wxWindow::GetDropTarget
</H3>
775 <B>wxDropTarget*
</B> <B>GetDropTarget
</B>()
<B>const
</B><P>
776 Returns the associated drop target, which may be NULL.
<P>
777 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
778 <A HREF=
"wx260.htm#wxwindowsetdroptarget">wxWindow::SetDropTarget
</A>,
779 <A HREF=
"wx312.htm#wxdndoverview">Drag and drop overview
</A><P>
782 <A NAME=
"wxwindowgeteventhandler"></A>
783 <H3>wxWindow::GetEventHandler
</H3>
785 <B>wxEvtHandler*
</B> <B>GetEventHandler
</B>()
<B>const
</B><P>
786 Returns the event handler for this window. By default, the window is its
787 own event handler.
<P>
788 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
789 <A HREF=
"wx260.htm#wxwindowseteventhandler">wxWindow::SetEventHandler
</A>,
790 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A>,
791 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PopEventHandler
</A>,
792 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
793 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
796 <A NAME=
"wxwindowgetfont"></A>
797 <H3>wxWindow::GetFont
</H3>
799 <B>wxFont
&</B> <B>GetFont
</B>()
<B>const
</B><P>
800 Returns a reference to the font for this window.
<P>
801 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
802 <A HREF=
"wx260.htm#wxwindowsetfont">wxWindow::SetFont
</A><P>
805 <A NAME=
"wxwindowgetforegroundcolour"></A>
806 <H3>wxWindow::GetForegroundColour
</H3>
808 <B>virtual wxColour
</B> <B>GetForegroundColour
</B>()
<P>
809 Returns the foreground colour of the window.
<P>
810 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
811 The interpretation of foreground colour is open to interpretation according
812 to the window class; it may be the text colour or other colour, or it may not
814 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
815 <A HREF=
"wx260.htm#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A>,
816 <A HREF=
"wx260.htm#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A>,
817 <A HREF=
"wx260.htm#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A><P>
820 <A NAME=
"topic1034"></A>
821 <H3>wxWindow::GetGrandParent
</H3>
823 <B>wxWindow*
</B> <B>GetGrandParent
</B>()
<B>const
</B><P>
824 Returns the grandparent of a window, or NULL if there isn't one.
<P>
827 <A NAME=
"topic1035"></A>
828 <H3>wxWindow::GetHandle
</H3>
830 <B>void*
</B> <B>GetHandle
</B>()
<B>const
</B><P>
831 Returns the platform-specific handle of the physical window. Cast it to an appropriate
832 handle, such as
<B>HWND
</B> for Windows or
<B>Widget
</B> for Motif.
<P>
835 <A NAME=
"wxwindowgetid"></A>
836 <H3>wxWindow::GetId
</H3>
838 <B>int
</B> <B>GetId
</B>()
<B>const
</B><P>
839 Returns the identifier of the window.
<P>
840 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
841 Each window has an integer identifier. If the application has not provided one,
842 an identifier will be generated.
<P>
843 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
844 <A HREF=
"wx260.htm#wxwindowsetid">wxWindow::SetId
</A>
845 <A HREF=
"wx299.htm#windowids">Window identifiers
</A><P>
848 <A NAME=
"topic1036"></A>
849 <H3>wxWindow::GetPosition
</H3>
851 <B>virtual void
</B> <B>GetPosition
</B>(
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>)
<B>const
</B><P>
852 This gets the position of the window in pixels, relative to the parent window or
853 if no parent, relative to the whole display.
<P>
854 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
856 Receives the x position of the window.
</UL></UL>
859 Receives the y position of the window.
</UL></UL>
861 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
862 In place of a single overloaded method name, wxPython
863 implements the following methods:
<P>
880 <B>GetPositionTuple()
</B>
884 Returns a tuple (x, y)
894 <A NAME=
"topic1037"></A>
895 <H3>wxWindow::GetLabel
</H3>
897 <B>virtual wxString
& </B> <B>GetLabel
</B>()
<B>const
</B><P>
898 Generic way of getting a label from any window, for
899 identification purposes.
<P>
900 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
901 The interpretation of this function differs from class to class.
902 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
903 the button text. This function can be useful for meta-programs (such as testing
904 tools or special-needs access programs) which need to identify windows
908 <A NAME=
"wxwindowgetname"></A>
909 <H3>wxWindow::GetName
</H3>
911 <B>virtual wxString
& </B> <B>GetName
</B>()
<B>const
</B><P>
912 Returns the window's name.
<P>
913 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
914 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
915 name in the window constructor or via
<A HREF=
"wx260.htm#wxwindowsetname">wxWindow::SetName
</A>.
<P>
916 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
917 <A HREF=
"wx260.htm#wxwindowsetname">wxWindow::SetName
</A><P>
920 <A NAME=
"topic1038"></A>
921 <H3>wxWindow::GetParent
</H3>
923 <B>virtual wxWindow*
</B> <B>GetParent
</B>()
<B>const
</B><P>
924 Returns the parent of the window, or NULL if there is no parent.
<P>
927 <A NAME=
"wxwindowgetrect"></A>
928 <H3>wxWindow::GetRect
</H3>
930 <B>virtual wxRect
</B> <B>GetRect
</B>()
<B>const
</B><P>
931 Returns the size and position of the window as a
<A HREF=
"wx193.htm#wxrect">wxRect
</A> object.
<P>
934 <A NAME=
"wxwindowgetreturncode"></A>
935 <H3>wxWindow::GetReturnCode
</H3>
937 <B>int
</B> <B>GetReturnCode
</B>()
<P>
938 Gets the return code for this window.
<P>
939 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
940 A return code is normally associated with a modal dialog, where
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A> returns
941 a code to the application.
<P>
942 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
943 <A HREF=
"wx260.htm#wxwindowsetreturncode">wxWindow::SetReturnCode
</A>,
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A>,
944 <A HREF=
"wx71.htm#wxdialogendmodal">wxDialog::EndModal
</A><P>
947 <A NAME=
"wxwindowgetscrollthumb"></A>
948 <H3>wxWindow::GetScrollThumb
</H3>
950 <B>virtual int
</B> <B>GetScrollThumb
</B>(
<B>int
</B><I>orientation
</I>)
<P>
951 Returns the built-in scrollbar thumb size.
<P>
952 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
953 <A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><P>
956 <A NAME=
"wxwindowgetscrollpos"></A>
957 <H3>wxWindow::GetScrollPos
</H3>
959 <B>virtual int
</B> <B>GetScrollPos
</B>(
<B>int
</B><I>orientation
</I>)
<P>
960 Returns the built-in scrollbar position.
<P>
961 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
962 See
<A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><P>
965 <A NAME=
"wxwindowgetscrollrange"></A>
966 <H3>wxWindow::GetScrollRange
</H3>
968 <B>virtual int
</B> <B>GetScrollRange
</B>(
<B>int
</B><I>orientation
</I>)
<P>
969 Returns the built-in scrollbar range.
<P>
970 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
971 <A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><P>
974 <A NAME=
"wxwindowgetsize"></A>
975 <H3>wxWindow::GetSize
</H3>
977 <B>virtual void
</B> <B>GetSize
</B>(
<B>int*
</B><I>width
</I>,
<B>int*
</B><I>height
</I>)
<B>const
</B><P>
978 <B>virtual wxSize
</B> <B>GetSize
</B>()
<B>const
</B><P>
979 This gets the size of the entire window in pixels.
<P>
980 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
982 Receives the window width.
</UL></UL>
984 <I>height
</I><UL><UL>
985 Receives the window height.
</UL></UL>
987 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
988 In place of a single overloaded method name, wxPython
989 implements the following methods:
<P>
1006 <B>GetSizeTuple()
</B>
1010 Returns a
2-tuple (width, height)
1020 <A NAME=
"topic1039"></A>
1021 <H3>wxWindow::GetTextExtent
</H3>
1023 <B>virtual void
</B> <B>GetTextExtent
</B>(
<B>const wxString
& </B><I>string
</I>,
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>,
1024 <B>int*
</B><I>descent = NULL
</I>,
<B>int*
</B><I>externalLeading = NULL
</I>,
1025 <B>const wxFont*
</B><I>font = NULL
</I>,
<B>const bool
</B><I> use16 = FALSE
</I>)
<B>const
</B><P>
1026 Gets the dimensions of the string as it would be drawn on the
1027 window with the currently selected font.
<P>
1028 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1029 <I>string
</I><UL><UL>
1030 String whose extent is to be measured.
</UL></UL>
1033 Return value for width.
</UL></UL>
1036 Return value for height.
</UL></UL>
1038 <I>descent
</I><UL><UL>
1039 Return value for descent (optional).
</UL></UL>
1041 <I>externalLeading
</I><UL><UL>
1042 Return value for external leading (optional).
</UL></UL>
1045 Font to use instead of the current window font (optional).
</UL></UL>
1047 <I>use16
</I><UL><UL>
1048 If TRUE,
<I>string
</I> contains
16-bit characters. The default is FALSE.
</UL></UL>
1051 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1052 In place of a single overloaded method name, wxPython
1053 implements the following methods:
<P>
1061 <B>GetTextExtent(string)
</B>
1065 Returns a
2-tuple, (width, height)
1070 <B>GetFullTextExtent(string, font=NULL)
</B>
1075 4-tuple, (width, height, descent, externalLeading)
1086 <A NAME=
"wxwindowgettitle"></A>
1087 <H3>wxWindow::GetTitle
</H3>
1089 <B>virtual wxString
</B> <B>GetTitle
</B>()
<P>
1090 Gets the window's title. Applicable only to frames and dialogs.
<P>
1091 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1092 <A HREF=
"wx260.htm#wxwindowsettitle">wxWindow::SetTitle
</A><P>
1095 <A NAME=
"wxwindowgetupdateregion"></A>
1096 <H3>wxWindow::GetUpdateRegion
</H3>
1098 <B>virtual wxRegion
</B> <B>GetUpdateRegion
</B>()
<B>const
</B><P>
1099 Returns the region specifying which parts of the window have been damaged. Should
1100 only be called within an
<A HREF=
"wx260.htm#wxwindowonpaint">OnPaint
</A> event handler.
<P>
1101 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1102 <A HREF=
"wx195.htm#wxregion">wxRegion
</A>,
<A HREF=
"wx196.htm#wxregioniterator">wxRegionIterator
</A>,
<A HREF=
"wx260.htm#wxwindowonpaint">wxWindow::OnPaint
</A><P>
1105 <A NAME=
"topic1040"></A>
1106 <H3>wxWindow::GetWindowStyleFlag
</H3>
1108 <B>long
</B> <B>GetWindowStyleFlag
</B>()
<B>const
</B><P>
1109 Gets the window style that was passed to the consructor or
<B>Create
</B> member.
<P>
1112 <A NAME=
"wxwindowinitdialog"></A>
1113 <H3>wxWindow::InitDialog
</H3>
1115 <B>void
</B> <B>InitDialog
</B>()
<P>
1116 Sends an
<A HREF=
"wx260.htm#wxwindowoninitdialog">wxWindow::OnInitDialog
</A> event, which
1117 in turn transfers data to the dialog via validators.
<P>
1118 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1119 <A HREF=
"wx260.htm#wxwindowoninitdialog">wxWindow::OnInitDialog
</A><P>
1122 <A NAME=
"wxwindowisenabled"></A>
1123 <H3>wxWindow::IsEnabled
</H3>
1125 <B>virtual bool
</B> <B>IsEnabled
</B>()
<B>const
</B><P>
1126 Returns TRUE if the window is enabled for input, FALSE otherwise.
<P>
1127 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1128 <A HREF=
"wx260.htm#wxwindowenable">wxWindow::Enable
</A><P>
1131 <A NAME=
"wxwindowisretained"></A>
1132 <H3>wxWindow::IsRetained
</H3>
1134 <B>virtual bool
</B> <B>IsRetained
</B>()
<B>const
</B><P>
1135 Returns TRUE if the window is retained, FALSE otherwise.
<P>
1136 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1137 Retained windows are only available on X platforms.
<P>
1140 <A NAME=
"wxwindowisshown"></A>
1141 <H3>wxWindow::IsShown
</H3>
1143 <B>virtual bool
</B> <B>IsShown
</B>()
<B>const
</B><P>
1144 Returns TRUE if the window is shown, FALSE if it has been hidden.
<P>
1147 <A NAME=
"wxwindowlayout"></A>
1148 <H3>wxWindow::Layout
</H3>
1150 <B>void
</B> <B>Layout
</B>()
<P>
1151 Invokes the constraint-based layout algorithm for this window. It is called
1152 automatically by the default
<B>wxWindow::OnSize
</B> member.
<P>
1155 <A NAME=
"wxwindowloadfromresource"></A>
1156 <H3>wxWindow::LoadFromResource
</H3>
1158 <B>virtual bool
</B> <B>LoadFromResource
</B>(
<B>wxWindow*
</B><I>parent
</I>,
1159 <B>const wxString
& </B><I>resourceName
</I>,
<B>const wxResourceTable*
</B><I>resourceTable = NULL
</I>)
<P>
1160 Loads a panel or dialog from a resource file.
<P>
1161 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1162 <I>parent
</I><UL><UL>
1163 Parent window.
</UL></UL>
1165 <I>resourceName
</I><UL><UL>
1166 The name of the resource to load.
</UL></UL>
1168 <I>resourceTable
</I><UL><UL>
1169 The resource table to load it from. If this is NULL, the
1170 default resource table will be used.
</UL></UL>
1172 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
1173 TRUE if the operation succeeded, otherwise FALSE.
<P>
1176 <A NAME=
"wxwindowlower"></A>
1177 <H3>wxWindow::Lower
</H3>
1179 <B>void
</B> <B>Lower
</B>()
<P>
1180 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
1184 <A NAME=
"wxwindowmakemodal"></A>
1185 <H3>wxWindow::MakeModal
</H3>
1187 <B>virtual void
</B> <B>MakeModal
</B>(
<B>const bool
</B><I>flag
</I>)
<P>
1188 Disables all other windows in the application so that
1189 the user can only interact with this window.
<P>
1190 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1192 If TRUE, this call disables all other windows in the application so that
1193 the user can only interact with this window. If FALSE, the effect is reversed.
</UL></UL>
1197 <A NAME=
"wxwindowmove"></A>
1198 <H3>wxWindow::Move
</H3>
1200 <B>void
</B> <B>Move
</B>(
<B>int
</B><I> x
</I>,
<B>int
</B><I> y
</I>)
<P>
1201 <B>void
</B> <B>Move
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<P>
1202 Moves the window to the given position.
<P>
1203 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1205 Required x position.
</UL></UL>
1208 Required y position.
</UL></UL>
1211 <A HREF=
"wx171.htm#wxpoint">wxPoint
</A> object representing the position.
</UL></UL>
1213 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1214 Implementations of SetSize can also implicitly implement the
1215 wxWindow::Move function, which is defined in the base wxWindow class
1218 SetSize(x, y, -
1, -
1, wxSIZE_USE_EXISTING);
1220 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1221 <A HREF=
"wx260.htm#wxwindowsetsize">wxWindow::SetSize
</A><P>
1222 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1223 In place of a single overloaded method name, wxPython
1224 implements the following methods:
<P>
1245 Accepts a pair of integers
1255 <A NAME=
"wxwindowonactivate"></A>
1256 <H3>wxWindow::OnActivate
</H3>
1258 <B>void
</B> <B>OnActivate
</B>(
<B>wxActivateEvent
&</B><I> event
</I>)
<P>
1259 Called when a window is activated or deactivated.
<P>
1260 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1261 <I>event
</I><UL><UL>
1262 Object containing activation information.
</UL></UL>
1264 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1265 If the window is being activated,
<A HREF=
"wx25.htm#wxactivateeventgetactive">wxActivateEvent::GetActive
</A> returns TRUE,
1266 otherwise it returns FALSE (it is being deactivated).
<P>
1267 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1268 <A HREF=
"wx25.htm#wxactivateevent">wxActivateEvent
</A>,
1269 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1272 <A NAME=
"wxwindowonchar"></A>
1273 <H3>wxWindow::OnChar
</H3>
1275 <B>void
</B> <B>OnChar
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1276 Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
<P>
1277 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1278 <I>event
</I><UL><UL>
1279 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1280 details about this class.
</UL></UL>
1282 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1283 This member function is called in response to a keypress. To intercept this event,
1284 use the EVT_CHAR macro in an event table definition. Your
<B>OnChar
</B> handler may call this
1285 default function to achieve default keypress functionality.
<P>
1286 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
1288 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
1289 keypresses, then you will need to use
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A> or
1290 <A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>.
<P>
1291 Most, but not all, windows allow keypresses to be intercepted.
<P>
1292 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1293 <A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A>,
<A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>,
1294 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1295 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1298 <A NAME=
"wxwindowoncharhook"></A>
1299 <H3>wxWindow::OnCharHook
</H3>
1301 <B>void
</B> <B>OnCharHook
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1302 This member is called to allow the window to intercept keyboard events
1303 before they are processed by child windows.
<P>
1304 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1305 <I>event
</I><UL><UL>
1306 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1307 details about this class.
</UL></UL>
1309 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1310 This member function is called in response to a keypress, if the window is active. To intercept this event,
1311 use the EVT_CHAR_HOOK macro in an event table definition. If you do not process a particular
1312 keypress, call
<A HREF=
"wx84.htm#wxeventskip">wxEvent::Skip
</A> to allow default processing.
<P>
1313 An example of using this function is in the implementation of escape-character processing for wxDialog,
1314 where pressing ESC dismisses the dialog by
<B>OnCharHook
</B> 'forging' a cancel button press event.
<P>
1315 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
1317 This function is only relevant to top-level windows (frames and dialogs), and under
1319 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1320 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1321 <A HREF=
"wx26.htm#wxapponcharhook">wxApp::OnCharHook
</A>,
1322 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1325 <A NAME=
"wxwindowoncommand"></A>
1326 <H3>wxWindow::OnCommand
</H3>
1328 <B>virtual void
</B> <B>OnCommand
</B>(
<B>wxEvtHandler
& </B><I>object
</I>,
<B>wxCommandEvent
& </B><I>event
</I>)
<P>
1329 This virtual member function is called if the control does not handle the command event.
<P>
1330 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1331 <I>object
</I><UL><UL>
1332 Object receiving the command event.
</UL></UL>
1334 <I>event
</I><UL><UL>
1335 Command event
</UL></UL>
1337 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1338 This virtual function is provided mainly for backward compatibility. You can also intercept commands
1339 from child controls by using an event table, with identifiers or identifier ranges to identify
1340 the control(s) in question.
<P>
1341 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1342 <A HREF=
"wx52.htm#wxcommandevent">wxCommandEvent
</A>,
1343 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1346 <A NAME=
"wxwindowonclose"></A>
1347 <H3>wxWindow::OnClose
</H3>
1349 <B>virtual bool
</B> <B>OnClose
</B>()
<P>
1350 Called when the user has tried to close a a frame
1351 or dialog box using the window manager (X) or system menu (Windows).
<P>
1352 <B>Note:
</B> This is an obsolete function.
1353 It is superceded by the
<A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A> event
1355 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
1356 If TRUE is returned by OnClose, the window will be deleted by the system, otherwise the
1357 attempt will be ignored. Do not delete the window from within this handler, although
1358 you may delete other windows.
<P>
1359 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1360 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
1361 <A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A>,
1362 <A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A>,
1363 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A><P>
1366 <A NAME=
"wxwindowonclosewindow"></A>
1367 <H3>wxWindow::OnCloseWindow
</H3>
1369 <B>void
</B> <B>OnCloseWindow
</B>(
<B>wxCloseEvent
& </B><I>event
</I>)
<P>
1370 This is an event handler function called when the user has tried to close a a frame
1371 or dialog box using the window manager (X) or system menu (Windows). It is
1372 called via the
<A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A> function, so
1373 that the application can also invoke the handler programmatically.
<P>
1374 Use the EVT_CLOSE event table macro to handle close events.
<P>
1375 You should check whether the application is forcing the deletion of the window
1376 using
<A HREF=
"wx45.htm#wxcloseeventgetforce">wxCloseEvent::GetForce
</A>. If this is TRUE,
1377 destroy the window using
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>.
1378 If not, it is up to you whether you respond by destroying the window.
<P>
1379 (Note: GetForce is now superceded by CanVeto. So to test whether forced destruction of
1380 the window is required, test for the negative of CanVeto. If CanVeto returns FALSE,
1381 it is not possible to skip window deletion.)
<P>
1382 If you don't destroy the window, you should call
<A HREF=
"wx45.htm#wxcloseeventveto">wxCloseEvent::Veto
</A> to
1383 let the calling code know that you did not destroy the window. This allows the
<A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A> function
1384 to return TRUE or FALSE depending on whether the close instruction was honoured or not.
<P>
1385 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1386 The
<A HREF=
"wx260.htm#wxwindowonclose">wxWindow::OnClose
</A> virtual function remains
1387 for backward compatibility with earlier versions of wxWindows. The
1388 default
<B>OnCloseWindow
</B> handler for wxFrame and wxDialog will call
<B>OnClose
</B>,
1389 destroying the window if it returns TRUE or if the close is being forced.
<P>
1390 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1391 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
1392 <A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A>,
1393 <A HREF=
"wx260.htm#wxwindowonclose">wxWindow::OnClose
</A>,
1394 <A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>,
1395 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A>,
1396 <A HREF=
"wx26.htm#wxapponqueryendsession">wxApp::OnQueryEndSession
</A>,
1397 <A HREF=
"wx26.htm#wxapponendsession">wxApp::OnEndSession
</A><P>
1400 <A NAME=
"wxwindowondropfiles"></A>
1401 <H3>wxWindow::OnDropFiles
</H3>
1403 <B>void
</B> <B>OnDropFiles
</B>(
<B>wxDropFilesEvent
&</B><I> event
</I>)
<P>
1404 Called when files have been dragged from the file manager to the window.
<P>
1405 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1406 <I>event
</I><UL><UL>
1407 Drop files event. For more information, see
<A HREF=
"wx80.htm#wxdropfilesevent">wxDropFilesEvent
</A>.
</UL></UL>
1409 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1410 The window must have previously been enabled for dropping by calling
1411 <A HREF=
"wx260.htm#wxwindowdragacceptfiles">wxWindow::DragAcceptFiles
</A>.
<P>
1412 This event is only generated under Windows.
<P>
1413 To intercept this event, use the EVT_DROP_FILES macro in an event table definition.
<P>
1414 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1415 <A HREF=
"wx80.htm#wxdropfilesevent">wxDropFilesEvent
</A>,
<A HREF=
"wx260.htm#wxwindowdragacceptfiles">wxWindow::DragAcceptFiles
</A>,
1416 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1419 <A NAME=
"wxwindowonerasebackground"></A>
1420 <H3>wxWindow::OnEraseBackground
</H3>
1422 <B>void
</B> <B>OnEraseBackground
</B>(
<B>wxEraseEvent
&</B><I> event
</I>)
<P>
1423 Called when the background of the window needs to be erased.
<P>
1424 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1425 <I>event
</I><UL><UL>
1426 Erase background event. For more information, see
<A HREF=
"wx83.htm#wxeraseevent">wxEraseEvent
</A>.
</UL></UL>
1428 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1429 This event is only generated under Windows.
<P>
1430 To intercept this event, use the EVT_ERASE_BACKGROUND macro in an event table definition.
<P>
1431 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1432 <A HREF=
"wx83.htm#wxeraseevent">wxEraseEvent
</A>,
<A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1435 <A NAME=
"wxwindowonkeydown"></A>
1436 <H3>wxWindow::OnKeyDown
</H3>
1438 <B>void
</B> <B>OnKeyDown
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1439 Called when the user has pressed a key, before it is translated into an ASCII value using other
1440 modifier keys that might be pressed at the same time.
<P>
1441 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1442 <I>event
</I><UL><UL>
1443 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1444 details about this class.
</UL></UL>
1446 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1447 This member function is called in response to a key down event. To intercept this event,
1448 use the EVT_KEY_DOWN macro in an event table definition. Your
<B>OnKeyDown
</B> handler may call this
1449 default function to achieve default keypress functionality.
<P>
1450 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1451 keys, such as shift, control, and function keys, then you will need to use
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A> or
1452 <A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>.
<P>
1453 Most, but not all, windows allow keypresses to be intercepted.
<P>
1454 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1455 <A HREF=
"wx260.htm#wxwindowonchar">wxWindow::OnChar
</A>,
<A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>,
1456 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1457 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1460 <A NAME=
"wxwindowonkeyup"></A>
1461 <H3>wxWindow::OnKeyUp
</H3>
1463 <B>void
</B> <B>OnKeyUp
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1464 Called when the user has released a key.
<P>
1465 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1466 <I>event
</I><UL><UL>
1467 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1468 details about this class.
</UL></UL>
1470 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1471 This member function is called in response to a key up event. To intercept this event,
1472 use the EVT_KEY_UP macro in an event table definition. Your
<B>OnKeyUp
</B> handler may call this
1473 default function to achieve default keypress functionality.
<P>
1474 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1475 keys, such as shift, control, and function keys, then you will need to use
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A> or
1476 <A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>.
<P>
1477 Most, but not all, windows allow key up events to be intercepted.
<P>
1478 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1479 <A HREF=
"wx260.htm#wxwindowonchar">wxWindow::OnChar
</A>,
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A>,
1480 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1481 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1484 <A NAME=
"wxwindowonkillfocus"></A>
1485 <H3>wxWindow::OnKillFocus
</H3>
1487 <B>void
</B> <B>OnKillFocus
</B>(
<B>wxFocusEvent
& </B><I>event
</I>)
<P>
1488 Called when a window's focus is being killed.
<P>
1489 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1490 <I>event
</I><UL><UL>
1491 The focus event. For more information, see
<A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>.
</UL></UL>
1493 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1494 To intercept this event, use the macro EVT_KILL_FOCUS in an event table definition.
<P>
1495 Most, but not all, windows respond to this event.
<P>
1496 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1497 <A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>,
<A HREF=
"wx260.htm#wxwindowonsetfocus">wxWindow::OnSetFocus
</A>,
1498 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1501 <A NAME=
"wxwindowonidle"></A>
1502 <H3>wxWindow::OnIdle
</H3>
1504 <B>void
</B> <B>OnIdle
</B>(
<B>wxIdleEvent
& </B><I>event
</I>)
<P>
1505 Provide this member function for any processing which needs to be done
1506 when the application is idle.
<P>
1507 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1508 <A HREF=
"wx26.htm#wxapponidle">wxApp::OnIdle
</A>,
<A HREF=
"wx113.htm#wxidleevent">wxIdleEvent
</A><P>
1511 <A NAME=
"wxwindowoninitdialog"></A>
1512 <H3>wxWindow::OnInitDialog
</H3>
1514 <B>void
</B> <B>OnInitDialog
</B>(
<B>wxInitDialogEvent
&</B><I> event
</I>)
<P>
1515 Default handler for the wxEVT_INIT_DIALOG event. Calls
<A HREF=
"wx260.htm#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A>.
<P>
1516 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1517 <I>event
</I><UL><UL>
1518 Dialog initialisation event.
</UL></UL>
1520 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1521 Gives the window the default behaviour of transferring data to child controls via
1522 the validator that each control has.
<P>
1523 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1524 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A>,
<A HREF=
"wx260.htm#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A><P>
1527 <A NAME=
"wxwindowonmenucommand"></A>
1528 <H3>wxWindow::OnMenuCommand
</H3>
1530 <B>void
</B> <B>OnMenuCommand
</B>(
<B>wxCommandEvent
& </B><I>event
</I>)
<P>
1531 Called when a menu command is received from a menu bar.
<P>
1532 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1533 <I>event
</I><UL><UL>
1534 The menu command event. For more information, see
<A HREF=
"wx52.htm#wxcommandevent">wxCommandEvent
</A>.
</UL></UL>
1536 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1537 A function with this name doesn't actually exist; you can choose any member function to receive
1538 menu command events, using the EVT_COMMAND macro for individual commands or EVT_COMMAND_RANGE for
1539 a range of commands.
<P>
1540 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1541 <A HREF=
"wx52.htm#wxcommandevent">wxCommandEvent
</A>,
1542 <A HREF=
"wx260.htm#wxwindowonmenuhighlight">wxWindow::OnMenuHighlight
</A>,
1543 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1546 <A NAME=
"wxwindowonmenuhighlight"></A>
1547 <H3>wxWindow::OnMenuHighlight
</H3>
1549 <B>void
</B> <B>OnMenuHighlight
</B>(
<B>wxMenuEvent
& </B><I>event
</I>)
<P>
1550 Called when a menu select is received from a menu bar: that is, the
1551 mouse cursor is over a menu item, but the left mouse button has not been
1553 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1554 <I>event
</I><UL><UL>
1555 The menu highlight event. For more information, see
<A HREF=
"wx143.htm#wxmenuevent">wxMenuEvent
</A>.
</UL></UL>
1557 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1558 You can choose any member function to receive
1559 menu select events, using the EVT_MENU_HIGHLIGHT macro for individual menu items or EVT_MENU_HIGHLIGHT_ALL macro
1560 for all menu items.
<P>
1561 The default implementation for
<A HREF=
"wx104.htm#wxframeonmenuhighlight">wxFrame::OnMenuHighlight
</A> displays help
1562 text in the first field of the status bar.
<P>
1563 This function was known as
<B>OnMenuSelect
</B> in earlier versions of wxWindows, but this was confusing
1564 since a selection is normally a left-click action.
<P>
1565 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1566 <A HREF=
"wx143.htm#wxmenuevent">wxMenuEvent
</A>,
1567 <A HREF=
"wx260.htm#wxwindowonmenucommand">wxWindow::OnMenuCommand
</A>,
1568 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1572 <A NAME=
"wxwindowonmouseevent"></A>
1573 <H3>wxWindow::OnMouseEvent
</H3>
1575 <B>void
</B> <B>OnMouseEvent
</B>(
<B>wxMouseEvent
&</B><I> event
</I>)
<P>
1576 Called when the user has initiated an event with the
1578 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1579 <I>event
</I><UL><UL>
1580 The mouse event. See
<A HREF=
"wx150.htm#wxmouseevent">wxMouseEvent
</A> for
1581 more details.
</UL></UL>
1583 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1584 Most, but not all, windows respond to this event.
<P>
1585 To intercept this event, use the EVT_MOUSE_EVENTS macro in an event table definition, or individual
1586 mouse event macros such as EVT_LEFT_DOWN.
<P>
1587 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1588 <A HREF=
"wx150.htm#wxmouseevent">wxMouseEvent
</A>,
1589 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1592 <A NAME=
"wxwindowonmove"></A>
1593 <H3>wxWindow::OnMove
</H3>
1595 <B>void
</B> <B>OnMove
</B>(
<B>wxMoveEvent
& </B><I>event
</I>)
<P>
1596 Called when a window is moved.
<P>
1597 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1598 <I>event
</I><UL><UL>
1599 The move event. For more information, see
<A HREF=
"wx151.htm#wxmoveevent">wxMoveEvent
</A>.
</UL></UL>
1601 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1602 Use the EVT_MOVE macro to intercept move events.
<P>
1603 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1604 Not currently implemented.
<P>
1605 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1606 <A HREF=
"wx151.htm#wxmoveevent">wxMoveEvent
</A>,
1607 <A HREF=
"wx104.htm#wxframeonsize">wxFrame::OnSize
</A>,
1608 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1611 <A NAME=
"wxwindowonpaint"></A>
1612 <H3>wxWindow::OnPaint
</H3>
1614 <B>void
</B> <B>OnPaint
</B>(
<B>wxPaintEvent
& </B><I>event
</I>)
<P>
1615 Sent to the event handler when the window must be refreshed.
<P>
1616 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1617 <I>event
</I><UL><UL>
1618 Paint event. For more information, see
<A HREF=
"wx164.htm#wxpaintevent">wxPaintEvent
</A>.
</UL></UL>
1620 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1621 Use the EVT_PAINT macro in an event table definition to intercept paint events.
<P>
1622 In a paint event handler, the application should always create a
<A HREF=
"wx163.htm#wxpaintdc">wxPaintDC
</A> object.
<P>
1625 void MyWindow::OnPaint(wxPaintEvent& event)
1632 </FONT>You can optimize painting by retrieving the rectangles
1633 that have been damaged and only repainting these. The rectangles are in
1634 terms of the client area, and are unscrolled, so you will need to do
1635 some calculations using the current view position to obtain logical,
1637 Here is an example of using the
<A HREF=
"wx196.htm#wxregioniterator">wxRegionIterator
</A> class:
<P>
1639 // Called when window needs to be repainted.
1640 void MyWindow::OnPaint(wxPaintEvent& event)
1644 // Find Out where the window is scrolled to
1645 int vbX,vbY; // Top left corner of client
1646 ViewStart(&vbX,&vbY);
1648 int vX,vY,vW,vH; // Dimensions of client area in pixels
1649 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1658 // Alternatively we can do this:
1660 // upd.GetRect(&rect);
1662 // Repaint this rectangle
1669 </FONT><B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1670 <A HREF=
"wx164.htm#wxpaintevent">wxPaintEvent
</A>,
1671 <A HREF=
"wx163.htm#wxpaintdc">wxPaintDC
</A>,
1672 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1675 <A NAME=
"wxwindowonscroll"></A>
1676 <H3>wxWindow::OnScroll
</H3>
1678 <B>void
</B> <B>OnScroll
</B>(
<B>wxScrollEvent
& </B><I>event
</I>)
<P>
1679 Called when a scroll event is received from one of the window's built-in scrollbars.
<P>
1680 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1681 <I>event
</I><UL><UL>
1682 Command event. Retrieve the new scroll position by
1683 calling
<A HREF=
"wx202.htm#wxscrolleventgetposition">wxScrollEvent::GetPosition
</A>, and the
1684 scrollbar orientation by calling
<A HREF=
"wx202.htm#wxscrolleventgetorientation">wxScrollEvent::GetOrientation
</A>.
</UL></UL>
1686 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1687 Note that it is not possible to distinguish between horizontal and vertical scrollbars
1688 until the function is executing (you can't have one function for vertical, another
1689 for horizontal events).
<P>
1690 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1691 <A HREF=
"wx202.htm#wxscrollevent">wxScrollEvent
</A>,
1692 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1695 <A NAME=
"wxwindowonsetfocus"></A>
1696 <H3>wxWindow::OnSetFocus
</H3>
1698 <B>void
</B> <B>OnSetFocus
</B>(
<B>wxFocusEvent
& </B><I>event
</I>)
<P>
1699 Called when a window's focus is being set.
<P>
1700 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1701 <I>event
</I><UL><UL>
1702 The focus event. For more information, see
<A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>.
</UL></UL>
1704 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1705 To intercept this event, use the macro EVT_SET_FOCUS in an event table definition.
<P>
1706 Most, but not all, windows respond to this event.
<P>
1707 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1708 <A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>,
<A HREF=
"wx260.htm#wxwindowonkillfocus">wxWindow::OnKillFocus
</A>,
1709 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1712 <A NAME=
"wxwindowonsize"></A>
1713 <H3>wxWindow::OnSize
</H3>
1715 <B>void
</B> <B>OnSize
</B>(
<B>wxSizeEvent
& </B><I>event
</I>)
<P>
1716 Called when the window has been resized.
<P>
1717 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1718 <I>event
</I><UL><UL>
1719 Size event. For more information, see
<A HREF=
"wx206.htm#wxsizeevent">wxSizeEvent
</A>.
</UL></UL>
1721 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1722 You may wish to use this for frames to resize their child windows as appropriate.
<P>
1723 Note that the size passed is of
1724 the whole window: call
<A HREF=
"wx260.htm#wxwindowgetclientsize">wxWindow::GetClientSize
</A> for the area which may be
1725 used by the application.
<P>
1726 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1727 <A HREF=
"wx206.htm#wxsizeevent">wxSizeEvent
</A>,
1728 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1731 <A NAME=
"wxwindowonsyscolourchanged"></A>
1732 <H3>wxWindow::OnSysColourChanged
</H3>
1734 <B>void
</B> <B>OnSysColourChanged
</B>(
<B>wxOnSysColourChangedEvent
& </B><I>event
</I>)
<P>
1735 Called when the user has changed the system colours.
<P>
1736 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1737 <I>event
</I><UL><UL>
1738 System colour change event. For more information, see
<A HREF=
"wx227.htm#wxsyscolourchangedevent">wxSysColourChangedEvent
</A>.
</UL></UL>
1740 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1741 <A HREF=
"wx227.htm#wxsyscolourchangedevent">wxSysColourChangedEvent
</A>,
1742 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1745 <A NAME=
"wxwindowpopeventhandler"></A>
1746 <H3>wxWindow::PopEventHandler
</H3>
1748 <B>wxEvtHandler*
</B> <B>PopEventHandler
</B>(
<B>bool
</B><I>deleteHandler = FALSE
</I>)
<B>const
</B><P>
1749 Removes and returns the top-most event handler on the event handler stack.
<P>
1750 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1751 <I>deleteHandler
</I><UL><UL>
1752 If this is TRUE, the handler will be deleted after it is removed. The
1753 default value is FALSE.
</UL></UL>
1755 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1756 <A HREF=
"wx260.htm#wxwindowseteventhandler">wxWindow::SetEventHandler
</A>,
1757 <A HREF=
"wx260.htm#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A>,
1758 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A>,
1759 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
1760 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
1763 <A NAME=
"wxwindowpopupmenu"></A>
1764 <H3>wxWindow::PopupMenu
</H3>
1766 <B>virtual bool
</B> <B>PopupMenu
</B>(
<B>wxMenu*
</B><I>menu
</I>,
<B>int
</B><I>x
</I>,
<B>int
</B><I>y
</I>)
<P>
1767 Pops up the given menu at the specified coordinates, relative to this
1768 window, and returns control when the user has dismissed the menu. If a
1769 menu item is selected, the callback defined for the menu is called with
1770 wxMenu and wxCommandEvent reference arguments. The callback should access
1771 the commandInt member of the event to check the selected menu identifier.
<P>
1772 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1774 Menu to pop up.
</UL></UL>
1777 Required x position for the menu to appear.
</UL></UL>
1780 Required y position for the menu to appear.
</UL></UL>
1782 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1783 <A HREF=
"wx140.htm#wxmenu">wxMenu
</A><P>
1784 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1785 Just before the menu is popped up,
<A HREF=
"wx140.htm#wxmenuupdateui">wxMenu::UpdateUI
</A> is called
1786 to ensure that the menu items are in the correct state.
<P>
1789 <A NAME=
"wxwindowpusheventhandler"></A>
1790 <H3>wxWindow::PushEventHandler
</H3>
1792 <B>void
</B> <B>PushEventHandler
</B>(
<B>wxEvtHandler*
</B><I>handler
</I>)
<P>
1793 Pushes this event handler onto the event stack for the window.
<P>
1794 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1795 <I>handler
</I><UL><UL>
1796 Specifies the handler to be pushed.
</UL></UL>
1798 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1799 An event handler is an object that is capable of processing the events
1800 sent to a window. By default, the window is its own event handler, but
1801 an application may wish to substitute another, for example to allow
1802 central implementation of event-handling for a variety of different
1804 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A> allows
1805 an application to set up a chain of event handlers, where an event not handled by one event handler is
1806 handed to the next one in the chain. Use
<A HREF=
"wx260.htm#wxwindowpopeventhandler">wxWindow::PopEventHandler
</A> to
1807 remove the event handler.
<P>
1808 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1809 <A HREF=
"wx260.htm#wxwindowseteventhandler">wxWindow::SetEventHandler
</A>,
1810 <A HREF=
"wx260.htm#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A>,
1811 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PopEventHandler
</A>,
1812 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
1813 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
1816 <A NAME=
"wxwindowraise"></A>
1817 <H3>wxWindow::Raise
</H3>
1819 <B>void
</B> <B>Raise
</B>()
<P>
1820 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1824 <A NAME=
"wxwindowrefresh"></A>
1825 <H3>wxWindow::Refresh
</H3>
1827 <B>virtual void
</B> <B>Refresh
</B>(
<B>const bool
</B><I> eraseBackground = TRUE
</I>,
<B>const wxRect*
</B><I>rect
1829 Causes a message or event to be generated to repaint the
1831 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1832 <I>eraseBackground
</I><UL><UL>
1833 If TRUE, the background will be
1837 If non-NULL, only the given rectangle will
1838 be treated as damaged.
</UL></UL>
1842 <A NAME=
"wxwindowreleasemouse"></A>
1843 <H3>wxWindow::ReleaseMouse
</H3>
1845 <B>virtual void
</B> <B>ReleaseMouse
</B>()
<P>
1846 Releases mouse input captured with
<A HREF=
"wx260.htm#wxwindowcapturemouse">wxWindow::CaptureMouse
</A>.
<P>
1847 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1848 <A HREF=
"wx260.htm#wxwindowcapturemouse">wxWindow::CaptureMouse
</A><P>
1851 <A NAME=
"wxwindowremovechild"></A>
1852 <H3>wxWindow::RemoveChild
</H3>
1854 <B>virtual void
</B> <B>RemoveChild
</B>(
<B>wxWindow*
</B><I>child
</I>)
<P>
1855 Removes a child window. This is called automatically by window deletion
1856 functions so should not be required by the application programmer.
<P>
1857 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1858 <I>child
</I><UL><UL>
1859 Child window to remove.
</UL></UL>
1863 <A NAME=
"wxwindowscreentoclient"></A>
1864 <H3>wxWindow::ScreenToClient
</H3>
1866 <B>virtual void
</B> <B>ScreenToClient
</B>(
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>)
<B>const
</B><P>
1867 <B>virtual wxPoint
</B> <B>ScreenToClient
</B>(
<B>const wxPoint
& </B><I>pt
</I>)
<B>const
</B><P>
1868 Converts from screen to client window coordinates.
<P>
1869 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1871 Stores the screen x coordinate and receives the client x coordinate.
</UL></UL>
1874 Stores the screen x coordinate and receives the client x coordinate.
</UL></UL>
1877 The screen position for the second form of the function.
</UL></UL>
1879 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1880 In place of a single overloaded method name, wxPython
1881 implements the following methods:
<P>
1889 <B>ScreenToClient(point)
</B>
1893 Accepts and returns a wxPoint
1898 <B>ScreenToClientXY(x, y)
</B>
1902 Returns a
2-tuple, (x, y)
1913 <A NAME=
"wxwindowscrollwindow"></A>
1914 <H3>wxWindow::ScrollWindow
</H3>
1916 <B>virtual void
</B> <B>ScrollWindow
</B>(
<B>int
</B><I>dx
</I>,
<B>int
</B><I>dy
</I>,
<B>const wxRect*
</B><I> rect = NULL
</I>)
<P>
1917 Physically scrolls the pixels in the window.
<P>
1918 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1920 Amount to scroll horizontally.
</UL></UL>
1923 Amount to scroll vertically.
</UL></UL>
1926 Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
1927 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
1928 can optimise painting by checking for the invalidated region.
</UL></UL>
1930 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1931 Available only under Windows.
<P>
1932 Use this function to optimise your scrolling implementations, to minimise the area that must be
1936 <A NAME=
"wxwindowsetacceleratortable"></A>
1937 <H3>wxWindow::SetAcceleratorTable
</H3>
1939 <B>virtual void
</B> <B>SetAcceleratorTable
</B>(
<B>const wxAcceleratorTable
&</B><I> accel
</I>)
<P>
1940 Sets the accelerator table for this window. See
<A HREF=
"wx24.htm#wxacceleratortable">wxAcceleratorTable
</A>.
<P>
1943 <A NAME=
"wxwindowsetautolayout"></A>
1944 <H3>wxWindow::SetAutoLayout
</H3>
1946 <B>void
</B> <B>SetAutoLayout
</B>(
<B>const bool
</B><I> autoLayout
</I>)
<P>
1947 Determines whether the
<A HREF=
"wx260.htm#wxwindowlayout">wxWindow::Layout
</A> function will
1948 be called automatically when the window is resized.
<P>
1949 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1950 <I>autoLayout
</I><UL><UL>
1951 Set this to TRUE if you wish the Layout function to be called
1952 from within wxWindow::OnSize functions.
</UL></UL>
1954 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1955 <A HREF=
"wx260.htm#wxwindowsetconstraints">wxWindow::SetConstraints
</A><P>
1958 <A NAME=
"wxwindowsetbackgroundcolour"></A>
1959 <H3>wxWindow::SetBackgroundColour
</H3>
1961 <B>virtual void
</B> <B>SetBackgroundColour
</B>(
<B>const wxColour
& </B><I>colour
</I>)
<P>
1962 Sets the background colour of the window.
<P>
1963 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1964 <I>colour
</I><UL><UL>
1965 The colour to be used as the background colour.
</UL></UL>
1967 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1968 The background colour is usually painted by the default
1969 <A HREF=
"wx260.htm#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A> event handler function.
<P>
1970 Note that setting the background colour does not cause an immediate refresh, so you
1971 may wish to call
<A HREF=
"wx260.htm#wxwindowclear">wxWindow::Clear
</A> or
<A HREF=
"wx260.htm#wxwindowrefresh">wxWindow::Refresh
</A> after
1972 calling this function.
<P>
1973 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1974 <A HREF=
"wx260.htm#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A>,
1975 <A HREF=
"wx260.htm#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A>,
1976 <A HREF=
"wx260.htm#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A>,
1977 <A HREF=
"wx260.htm#wxwindowclear">wxWindow::Clear
</A>,
1978 <A HREF=
"wx260.htm#wxwindowrefresh">wxWindow::Refresh
</A>,
1979 <A HREF=
"wx260.htm#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A><P>
1982 <A NAME=
"wxwindowsetclientsize"></A>
1983 <H3>wxWindow::SetClientSize
</H3>
1985 <B>virtual void
</B> <B>SetClientSize
</B>(
<B>int
</B><I> width
</I>,
<B>int
</B><I> height
</I>)
<P>
1986 <B>virtual void
</B> <B>SetClientSize
</B>(
<B>const wxSize
&</B><I> size
</I>)
<P>
1987 This sets the size of the window client area in pixels. Using this function to size a window
1988 tends to be more device-independent than
<A HREF=
"wx260.htm#wxwindowsetsize">wxWindow::SetSize
</A>, since the application need not
1989 worry about what dimensions the border or title bar have when trying to fit the window
1990 around panel items, for example.
<P>
1991 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1992 <I>width
</I><UL><UL>
1993 The required client area width.
</UL></UL>
1995 <I>height
</I><UL><UL>
1996 The required client area height.
</UL></UL>
1999 The required client size.
</UL></UL>
2001 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
2002 In place of a single overloaded method name, wxPython
2003 implements the following methods:
<P>
2011 <B>SetClientSize(size)
</B>
2020 <B>SetClientSizeWH(width, height)
</B>
2034 <A NAME=
"wxwindowsetcursor"></A>
2035 <H3>wxWindow::SetCursor
</H3>
2037 <B>virtual void
</B> <B>SetCursor
</B>(
<B>const wxCursor
&</B><I>cursor
</I>)
<P>
2038 Sets the window's cursor. Notice that setting the cursor for this window does
2039 not set it for its children so you'll need to explicitly call SetCursor() for
2040 them too if you need it.
<P>
2041 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2042 <I>cursor
</I><UL><UL>
2043 Specifies the cursor that the window should normally display.
</UL></UL>
2045 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2046 <A HREF=
"wx268.htm#wxsetcursor">::wxSetCursor
</A>,
<A HREF=
"wx59.htm#wxcursor">wxCursor
</A><P>
2049 <A NAME=
"wxwindowseteventhandler"></A>
2050 <H3>wxWindow::SetEventHandler
</H3>
2052 <B>void
</B> <B>SetEventHandler
</B>(
<B>wxEvtHandler*
</B><I>handler
</I>)
<P>
2053 Sets the event handler for this window.
<P>
2054 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2055 <I>handler
</I><UL><UL>
2056 Specifies the handler to be set.
</UL></UL>
2058 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2059 An event handler is an object that is capable of processing the events
2060 sent to a window. By default, the window is its own event handler, but
2061 an application may wish to substitute another, for example to allow
2062 central implementation of event-handling for a variety of different
2064 It is usually better to use
<A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A> since
2065 this sets up a chain of event handlers, where an event not handled by one event handler is
2066 handed to the next one in the chain.
<P>
2067 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2068 <A HREF=
"wx260.htm#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A>,
2069 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A>,
2070 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PopEventHandler
</A>,
2071 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
2072 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
2075 <A NAME=
"wxwindowsetconstraints"></A>
2076 <H3>wxWindow::SetConstraints
</H3>
2078 <B>void
</B> <B>SetConstraints
</B>(
<B>wxLayoutConstraints*
</B><I>constraints
</I>)
<P>
2079 Sets the window to have the given layout constraints. The window
2080 will then own the object, and will take care of its deletion.
2081 If an existing layout constraints object is already owned by the
2082 window, it will be deleted.
<P>
2083 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2084 <I>constraints
</I><UL><UL>
2085 The constraints to set. Pass NULL to disassociate and delete the window's
2086 constraints.
</UL></UL>
2088 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2089 You must call
<A HREF=
"wx260.htm#wxwindowsetautolayout">wxWindow::SetAutoLayout
</A> to tell a window to use
2090 the constraints automatically in OnSize; otherwise, you must
2091 override OnSize and call Layout explicitly.
<P>
2094 <A NAME=
"wxwindowsetdroptarget"></A>
2095 <H3>wxWindow::SetDropTarget
</H3>
2097 <B>void
</B> <B>SetDropTarget
</B>(
<B>wxDropTarget*
</B><I> target
</I>)
<P>
2098 Associates a drop target with this window.
<P>
2099 If the window already has a drop target, it is deleted.
<P>
2100 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2101 <A HREF=
"wx260.htm#wxwindowgetdroptarget">wxWindow::GetDropTarget
</A>,
2102 <A HREF=
"wx312.htm#wxdndoverview">Drag and drop overview
</A><P>
2105 <A NAME=
"wxwindowsetfocus"></A>
2106 <H3>wxWindow::SetFocus
</H3>
2108 <B>virtual void
</B> <B>SetFocus
</B>()
<P>
2109 This sets the window to receive keyboard input.
<P>
2112 <A NAME=
"wxwindowsetfont"></A>
2113 <H3>wxWindow::SetFont
</H3>
2115 <B>void
</B> <B>SetFont
</B>(
<B>const wxFont
& </B><I>font
</I>)
<P>
2116 Sets the font for this window.
<P>
2117 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2119 Font to associate with this window.
</UL></UL>
2121 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2122 <A HREF=
"wx260.htm#wxwindowgetfont">wxWindow::GetFont
</A><P>
2125 <A NAME=
"wxwindowsetforegroundcolour"></A>
2126 <H3>wxWindow::SetForegroundColour
</H3>
2128 <B>virtual void
</B> <B>SetForegroundColour
</B>(
<B>const wxColour
& </B><I>colour
</I>)
<P>
2129 Sets the foreground colour of the window.
<P>
2130 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2131 <I>colour
</I><UL><UL>
2132 The colour to be used as the foreground colour.
</UL></UL>
2134 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2135 The interpretation of foreground colour is open to interpretation according
2136 to the window class; it may be the text colour or other colour, or it may not
2138 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2139 <A HREF=
"wx260.htm#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A>,
2140 <A HREF=
"wx260.htm#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A>,
2141 <A HREF=
"wx260.htm#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A><P>
2144 <A NAME=
"wxwindowsetid"></A>
2145 <H3>wxWindow::SetId
</H3>
2147 <B>void
</B> <B>SetId
</B>(
<B>int
</B><I> id
</I>)
<P>
2148 Sets the identifier of the window.
<P>
2149 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2150 Each window has an integer identifier. If the application has not provided one,
2151 an identifier will be generated. Normally, the identifier should be provided
2152 on creation and should not be modified subsequently.
<P>
2153 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2154 <A HREF=
"wx260.htm#wxwindowgetid">wxWindow::GetId
</A>,
2155 <A HREF=
"wx299.htm#windowids">Window identifiers
</A><P>
2158 <A NAME=
"wxwindowsetname"></A>
2159 <H3>wxWindow::SetName
</H3>
2161 <B>virtual void
</B> <B>SetName
</B>(
<B>const wxString
& </B><I>name
</I>)
<P>
2162 Sets the window's name.
<P>
2163 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2165 A name to set for the window.
</UL></UL>
2167 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2168 <A HREF=
"wx260.htm#wxwindowgetname">wxWindow::GetName
</A><P>
2171 <A NAME=
"wxwindowsetpalette"></A>
2172 <H3>wxWindow::SetPalette
</H3>
2174 <B>virtual void
</B> <B>SetPalette
</B>(
<B>wxPalette*
</B><I>palette
</I>)
<P>
2175 Obsolete - use
<A HREF=
"wx65.htm#wxdcsetpalette">wxDC::SetPalette
</A> instead.
<P>
2178 <A NAME=
"wxwindowsetreturncode"></A>
2179 <H3>wxWindow::SetReturnCode
</H3>
2181 <B>void
</B> <B>SetReturnCode
</B>(
<B>int
</B><I>retCode
</I>)
<P>
2182 Sets the return code for this window.
<P>
2183 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2184 <I>retCode
</I><UL><UL>
2185 The integer return code, usually a control identifier.
</UL></UL>
2187 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2188 A return code is normally associated with a modal dialog, where
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A> returns
2189 a code to the application. The function
<A HREF=
"wx71.htm#wxdialogendmodal">wxDialog::EndModal
</A> calls
<B>SetReturnCode
</B>.
<P>
2190 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2191 <A HREF=
"wx260.htm#wxwindowgetreturncode">wxWindow::GetReturnCode
</A>,
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A>,
2192 <A HREF=
"wx71.htm#wxdialogendmodal">wxDialog::EndModal
</A><P>
2195 <A NAME=
"wxwindowsetscrollbar"></A>
2196 <H3>wxWindow::SetScrollbar
</H3>
2198 <B>virtual void
</B> <B>SetScrollbar
</B>(
<B>int
</B><I>orientation
</I>,
<B>int
</B><I>position
</I>,
2199 <B>int
</B><I>thumbSize
</I>,
<B>int
</B><I>range
</I>,
2200 <B>const bool
</B><I>refresh = TRUE
</I>)
<P>
2201 Sets the scrollbar properties of a built-in scrollbar.
<P>
2202 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2203 <I>orientation
</I><UL><UL>
2204 Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
</UL></UL>
2206 <I>position
</I><UL><UL>
2207 The position of the scrollbar in scroll units.
</UL></UL>
2209 <I>thumbSize
</I><UL><UL>
2210 The size of the thumb, or visible portion of the scrollbar, in scroll units.
</UL></UL>
2212 <I>range
</I><UL><UL>
2213 The maximum position of the scrollbar.
</UL></UL>
2215 <I>refresh
</I><UL><UL>
2216 TRUE to redraw the scrollbar, FALSE otherwise.
</UL></UL>
2218 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2219 Let's say you wish to display
50 lines of text, using the same font.
2220 The window is sized so that you can only see
16 lines at a time.
<P>
2223 SetScrollbar(wxVERTICAL,
0,
16,
50);
2226 Note that with the window at this size, the thumb position can never go
2227 above
50 minus
16, or
34.
<P>
2228 You can determine how many lines are currently visible by dividing the current view
2229 size by the character height in pixels.
<P>
2230 When defining your own scrollbar behaviour, you will always need to recalculate
2231 the scrollbar settings when the window size changes. You could therefore put your
2232 scrollbar calculations and SetScrollbar
2233 call into a function named AdjustScrollbars, which can be called initially and also
2234 from your
<A HREF=
"wx260.htm#wxwindowonsize">wxWindow::OnSize
</A> event handler function.
<P>
2235 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2236 <A HREF=
"wx297.htm#scrollingoverview">Scrolling overview
</A>,
2237 <A HREF=
"wx201.htm#wxscrollbar">wxScrollBar
</A>,
<A HREF=
"wx203.htm#wxscrolledwindow">wxScrolledWindow
</A><P>
2240 <A NAME=
"wxwindowsetscrollpos"></A>
2241 <H3>wxWindow::SetScrollPos
</H3>
2243 <B>virtual void
</B> <B>SetScrollPos
</B>(
<B>int
</B><I>orientation
</I>,
<B>int
</B><I>pos
</I>,
<B>const bool
</B><I>refresh = TRUE
</I>)
<P>
2244 Sets the position of one of the built-in scrollbars.
<P>
2245 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2246 <I>orientation
</I><UL><UL>
2247 Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.
</UL></UL>
2250 Position in scroll units.
</UL></UL>
2252 <I>refresh
</I><UL><UL>
2253 TRUE to redraw the scrollbar, FALSE otherwise.
</UL></UL>
2255 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2256 This function does not directly affect the contents of the window: it is up to the
2257 application to take note of scrollbar attributes and redraw contents accordingly.
<P>
2258 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2259 <A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A>,
2260 <A HREF=
"wx260.htm#wxwindowsetscrollpos">wxWindow::GetScrollPos
</A>,
2261 <A HREF=
"wx260.htm#wxwindowgetscrollthumb">wxWindow::GetScrollThumb
</A>,
2262 <A HREF=
"wx201.htm#wxscrollbar">wxScrollBar
</A>,
<A HREF=
"wx203.htm#wxscrolledwindow">wxScrolledWindow
</A><P>
2265 <A NAME=
"wxwindowsetsize"></A>
2266 <H3>wxWindow::SetSize
</H3>
2268 <B>virtual void
</B> <B>SetSize
</B>(
<B>int
</B><I> x
</I>,
<B>int
</B><I> y
</I>,
<B>int
</B><I> width
</I>,
<B>int
</B><I> height
</I>,
2269 <B>int
</B><I> sizeFlags = wxSIZE_AUTO
</I>)
<P>
2270 <B>virtual void
</B> <B>SetSize
</B>(
<B>const wxRect
&</B><I> rect
</I>)
<P>
2271 Sets the size and position of the window in pixels.
<P>
2272 <B>virtual void
</B> <B>SetSize
</B>(
<B>int
</B><I> width
</I>,
<B>int
</B><I> height
</I>)
<P>
2273 <B>virtual void
</B> <B>SetSize
</B>(
<B>const wxSize
&</B><I> size
</I>)
<P>
2274 Sets the size of the window in pixels.
<P>
2275 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2277 Required x position in pixels, or -
1 to indicate that the existing
2278 value should be used.
</UL></UL>
2281 Required y position in pixels, or -
1 to indicate that the existing
2282 value should be used.
</UL></UL>
2284 <I>width
</I><UL><UL>
2285 Required width in pixels, or -
1 to indicate that the existing
2286 value should be used.
</UL></UL>
2288 <I>height
</I><UL><UL>
2289 Required height position in pixels, or -
1 to indicate that the existing
2290 value should be used.
</UL></UL>
2293 <A HREF=
"wx205.htm#wxsize">wxSize
</A> object for setting the size.
</UL></UL>
2296 <A HREF=
"wx193.htm#wxrect">wxRect
</A> object for setting the position and size.
</UL></UL>
2298 <I>sizeFlags
</I><UL><UL>
2299 Indicates the interpretation of other parameters. It is a bit list of the following:
<P>
2300 <B>wxSIZE_AUTO_WIDTH
</B>: a -
1 width value is taken to indicate
2301 a wxWindows-supplied default width.
<BR>
2303 <B>wxSIZE_AUTO_HEIGHT
</B>: a -
1 height value is taken to indicate
2304 a wxWindows-supplied default width.
<BR>
2306 <B>wxSIZE_AUTO
</B>: -
1 size values are taken to indicate
2307 a wxWindows-supplied default size.
<BR>
2309 <B>wxSIZE_USE_EXISTING
</B>: existing dimensions should be used
2310 if -
1 values are supplied.
<BR>
2312 <B>wxSIZE_ALLOW_MINUS_ONE
</B>: allow dimensions of -
1 and less to be interpreted
2313 as real dimensions, not default values.
2316 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2317 The second form is a convenience for calling the first form with default
2318 x and y parameters, and must be used with non-default width and height values.
<P>
2319 The first form sets the position and optionally size, of the window.
2320 Parameters may be -
1 to indicate either that a default should be supplied
2321 by wxWindows, or that the current value of the dimension should be used.
<P>
2322 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2323 <A HREF=
"wx260.htm#wxwindowmove">wxWindow::Move
</A><P>
2324 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
2325 In place of a single overloaded method name, wxPython
2326 implements the following methods:
<P>
2334 <B>SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO)
</B>
2343 <B>SetSize(size)
</B>
2352 <B>SetPosition(point)
</B>
2366 <A NAME=
"wxwindowsetsizehints"></A>
2367 <H3>wxWindow::SetSizeHints
</H3>
2369 <B>virtual void
</B> <B>SetSizeHints
</B>(
<B>int
</B><I> minW=-
1</I>,
<B>int
</B><I> minH=-
1</I>,
<B>int
</B><I> maxW=-
1</I>,
<B>int
</B><I> maxH=-
1</I>,
2370 <B>int
</B><I> incW=-
1</I>,
<B>int
</B><I> incH=-
1</I>)
<P>
2371 Allows specification of minimum and maximum window sizes, and window size increments.
2372 If a pair of values is not set (or set to -
1), the default values will be used.
<P>
2373 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2375 Specifies the minimum width allowable.
</UL></UL>
2378 Specifies the minimum height allowable.
</UL></UL>
2381 Specifies the maximum width allowable.
</UL></UL>
2384 Specifies the maximum height allowable.
</UL></UL>
2387 Specifies the increment for sizing the width (Motif/Xt only).
</UL></UL>
2390 Specifies the increment for sizing the height (Motif/Xt only).
</UL></UL>
2392 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2393 If this function is called, the user will not be able to size the window outside the
2395 The resizing increments are only significant under Motif or Xt.
<P>
2398 <A NAME=
"wxwindowsettitle"></A>
2399 <H3>wxWindow::SetTitle
</H3>
2401 <B>virtual void
</B> <B>SetTitle
</B>(
<B>const wxString
& </B><I>title
</I>)
<P>
2402 Sets the window's title. Applicable only to frames and dialogs.
<P>
2403 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2404 <I>title
</I><UL><UL>
2405 The window's title.
</UL></UL>
2407 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2408 <A HREF=
"wx260.htm#wxwindowgettitle">wxWindow::GetTitle
</A><P>
2411 <A NAME=
"topic1041"></A>
2412 <H3>wxWindow::Show
</H3>
2414 <B>virtual bool
</B> <B>Show
</B>(
<B>const bool
</B><I> show
</I>)
<P>
2415 Shows or hides the window.
<P>
2416 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2418 If TRUE, displays the window and brings it to the front. Otherwise,
2419 hides the window.
</UL></UL>
2421 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2422 <A HREF=
"wx260.htm#wxwindowisshown">wxWindow::IsShown
</A><P>
2425 <A NAME=
"wxwindowtransferdatafromwindow"></A>
2426 <H3>wxWindow::TransferDataFromWindow
</H3>
2428 <B>virtual bool
</B> <B>TransferDataFromWindow
</B>()
<P>
2429 Transfers values from child controls to data areas specified by their validators. Returns
2430 FALSE if a transfer failed.
<P>
2431 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2432 <A HREF=
"wx260.htm#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A>,
2433 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A>,
<A HREF=
"wx260.htm#wxwindowvalidate">wxWindow::Validate
</A><P>
2436 <A NAME=
"wxwindowtransferdatatowindow"></A>
2437 <H3>wxWindow::TransferDataToWindow
</H3>
2439 <B>virtual bool
</B> <B>TransferDataToWindow
</B>()
<P>
2440 Transfers values to child controls from data areas specified by their validators.
<P>
2441 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
2442 Returns FALSE if a transfer failed.
<P>
2443 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2444 <A HREF=
"wx260.htm#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A>,
2445 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A>,
<A HREF=
"wx260.htm#wxwindowvalidate">wxWindow::Validate
</A><P>
2448 <A NAME=
"wxwindowvalidate"></A>
2449 <H3>wxWindow::Validate
</H3>
2451 <B>virtual bool
</B> <B>Validate
</B>()
<P>
2452 Validates the current values of the child controls using their validators.
<P>
2453 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
2454 Returns FALSE if any of the validations failed.
<P>
2455 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2456 <A HREF=
"wx260.htm#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A>,
2457 <A HREF=
"wx260.htm#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A>,
2458 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A><P>
2461 <A NAME=
"wxwindowwarppointer"></A>
2462 <H3>wxWindow::WarpPointer
</H3>
2464 <B>void
</B> <B>WarpPointer
</B>(
<B>int
</B><I> x
</I>,
<B>int
</B><I> y
</I>)
<P>
2465 Moves the pointer to the given position on the window.
<P>
2466 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2468 The new x position for the cursor.
</UL></UL>
2471 The new y position for the cursor.
</UL></UL>