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=
"#wxwindowonmenuhighlight">wxWindow::OnMenuHighlight
</A><BR>
203 <A HREF=
"#wxwindowonmouseevent">wxWindow::OnMouseEvent
</A><BR>
204 <A HREF=
"#wxwindowonmove">wxWindow::OnMove
</A><BR>
205 <A HREF=
"#wxwindowonpaint">wxWindow::OnPaint
</A><BR>
206 <A HREF=
"#wxwindowonscroll">wxWindow::OnScroll
</A><BR>
207 <A HREF=
"#wxwindowonsetfocus">wxWindow::OnSetFocus
</A><BR>
208 <A HREF=
"#wxwindowonsize">wxWindow::OnSize
</A><BR>
209 <A HREF=
"#wxwindowonsyscolourchanged">wxWindow::OnSysColourChanged
</A><BR>
210 <A HREF=
"#wxwindowpopeventhandler">wxWindow::PopEventHandler
</A><BR>
211 <A HREF=
"#wxwindowpopupmenu">wxWindow::PopupMenu
</A><BR>
212 <A HREF=
"#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A><BR>
213 <A HREF=
"#wxwindowraise">wxWindow::Raise
</A><BR>
214 <A HREF=
"#wxwindowrefresh">wxWindow::Refresh
</A><BR>
215 <A HREF=
"#wxwindowreleasemouse">wxWindow::ReleaseMouse
</A><BR>
216 <A HREF=
"#wxwindowremovechild">wxWindow::RemoveChild
</A><BR>
217 <A HREF=
"#wxwindowscreentoclient">wxWindow::ScreenToClient
</A><BR>
218 <A HREF=
"#wxwindowscrollwindow">wxWindow::ScrollWindow
</A><BR>
219 <A HREF=
"#wxwindowsetacceleratortable">wxWindow::SetAcceleratorTable
</A><BR>
220 <A HREF=
"#wxwindowsetautolayout">wxWindow::SetAutoLayout
</A><BR>
221 <A HREF=
"#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A><BR>
222 <A HREF=
"#wxwindowsetclientsize">wxWindow::SetClientSize
</A><BR>
223 <A HREF=
"#wxwindowsetcursor">wxWindow::SetCursor
</A><BR>
224 <A HREF=
"#wxwindowseteventhandler">wxWindow::SetEventHandler
</A><BR>
225 <A HREF=
"#wxwindowsetconstraints">wxWindow::SetConstraints
</A><BR>
226 <A HREF=
"#wxwindowsetdroptarget">wxWindow::SetDropTarget
</A><BR>
227 <A HREF=
"#wxwindowsetfocus">wxWindow::SetFocus
</A><BR>
228 <A HREF=
"#wxwindowsetfont">wxWindow::SetFont
</A><BR>
229 <A HREF=
"#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A><BR>
230 <A HREF=
"#wxwindowsetid">wxWindow::SetId
</A><BR>
231 <A HREF=
"#wxwindowsetname">wxWindow::SetName
</A><BR>
232 <A HREF=
"#wxwindowsetpalette">wxWindow::SetPalette
</A><BR>
233 <A HREF=
"#wxwindowsetreturncode">wxWindow::SetReturnCode
</A><BR>
234 <A HREF=
"#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><BR>
235 <A HREF=
"#wxwindowsetscrollpos">wxWindow::SetScrollPos
</A><BR>
236 <A HREF=
"#wxwindowsetsize">wxWindow::SetSize
</A><BR>
237 <A HREF=
"#wxwindowsetsizehints">wxWindow::SetSizeHints
</A><BR>
238 <A HREF=
"#wxwindowsettitle">wxWindow::SetTitle
</A><BR>
239 <A HREF=
"#topic1041">wxWindow::Show
</A><BR>
240 <A HREF=
"#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A><BR>
241 <A HREF=
"#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A><BR>
242 <A HREF=
"#wxwindowvalidate">wxWindow::Validate
</A><BR>
243 <A HREF=
"#wxwindowwarppointer">wxWindow::WarpPointer
</A><BR>
247 <A NAME=
"topic1026"></A>
248 <H3>wxWindow::wxWindow
</H3>
250 <B></B> <B>wxWindow
</B>()
<P>
251 Default constructor.
<P>
252 <B></B> <B>wxWindow
</B>(
<B>wxWindow*
</B><I> parent
</I>,
<B>wxWindowID
</B><I>id
</I>,
253 <B>const wxPoint
& </B><I>pos = wxDefaultPosition
</I>,
254 <B>const wxSize
& </B><I>size = wxDefaultSize
</I>,
255 <B>long
</B><I>style =
0</I>,
256 <B>const wxString
& </B><I>name = wxPanelNameStr
</I>)
<P>
257 Constructs a window, which can be a child of a frame, dialog or any other non-control window.
<P>
258 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
259 <I>parent
</I><UL><UL>
260 Pointer to a parent window.
</UL></UL>
263 Window identifier. If -
1, will automatically create an identifier.
</UL></UL>
266 Window position. wxDefaultPosition is (-
1, -
1) which indicates that wxWindows
267 should generate a default position for the window. If using the wxWindow class directly, supply
268 an actual position.
</UL></UL>
271 Window size. wxDefaultSize is (-
1, -
1) which indicates that wxWindows
272 should generate a default size for the window.
</UL></UL>
275 Window style. For generic window styles, please see
<A HREF=
"wx260.htm#wxwindow">wxWindow
</A>.
</UL></UL>
278 Window name.
</UL></UL>
282 <A NAME=
"topic1027"></A>
283 <H3>wxWindow::~wxWindow
</H3>
285 <B></B> <B>~wxWindow
</B>()
<P>
286 Destructor. Deletes all subwindows, then deletes itself. Instead of using
287 the
<B>delete
</B> operator explicitly, you should normally
288 use
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A> so that wxWindows
289 can delete a window only when it is safe to do so, in idle time.
<P>
290 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
291 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
292 <A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A>,
293 <A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>,
294 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A><P>
297 <A NAME=
"topic1028"></A>
298 <H3>wxWindow::AddChild
</H3>
300 <B>virtual void
</B> <B>AddChild
</B>(
<B>wxWindow*
</B><I>child
</I>)
<P>
301 Adds a child window. This is called automatically by window creation
302 functions so should not be required by the application programmer.
<P>
303 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
305 Child window to add.
</UL></UL>
309 <A NAME=
"wxwindowcapturemouse"></A>
310 <H3>wxWindow::CaptureMouse
</H3>
312 <B>virtual void
</B> <B>CaptureMouse
</B>()
<P>
313 Directs all mouse input to this window. Call
<A HREF=
"wx260.htm#wxwindowreleasemouse">wxWindow::ReleaseMouse
</A> to
314 release the capture.
<P>
315 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
316 <A HREF=
"wx260.htm#wxwindowreleasemouse">wxWindow::ReleaseMouse
</A><P>
319 <A NAME=
"wxwindowcenter"></A>
320 <H3>wxWindow::Center
</H3>
322 <B>void
</B> <B>Center
</B>(
<B>int
</B><I> direction
</I>)
<P>
323 A synonym for
<A HREF=
"wx260.htm#wxwindowcentre">Centre
</A>.
<P>
326 <A NAME=
"wxwindowcentre"></A>
327 <H3>wxWindow::Centre
</H3>
329 <B>virtual void
</B> <B>Centre
</B>(
<B>int
</B><I> direction = wxHORIZONTAL
</I>)
<P>
330 Centres the window.
<P>
331 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
332 <I>direction
</I><UL><UL>
333 Specifies the direction for the centering. May be
<TT>wxHORIZONTAL
</TT>,
<TT>wxVERTICAL
</TT>
334 or
<TT>wxBOTH
</TT>.
</UL></UL>
336 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
337 The actual behaviour depends on the derived window. For a frame or dialog box,
338 centring is relative to the whole display. For a panel item, centring is
339 relative to the panel.
<P>
340 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
341 <A HREF=
"wx260.htm#wxwindowcenter">wxWindow::Center
</A><P>
344 <A NAME=
"wxwindowclear"></A>
345 <H3>wxWindow::Clear
</H3>
347 <B>void
</B> <B>Clear
</B>()
<P>
348 Clears the window by filling it with the current background colour. Does not
349 cause an erase background event to be generated.
<P>
352 <A NAME=
"topic1029"></A>
353 <H3>wxWindow::ClientToScreen
</H3>
355 <B>virtual void
</B> <B>ClientToScreen
</B>(
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>)
<B>const
</B><P>
356 <B>virtual wxPoint
</B> <B>ClientToScreen
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<B>const
</B><P>
357 Converts to screen coordinates from coordinates relative to this window.
<P>
359 A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
360 a screen coordinate will be passed out.
</UL></UL>
363 A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
364 a screen coordinate will be passed out.
</UL></UL>
367 The client position for the second form of the function.
</UL></UL>
369 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
370 In place of a single overloaded method name, wxPython
371 implements the following methods:
<P>
379 <B>ClientToScreen(point)
</B>
383 Accepts and returns a wxPoint
388 <B>ClientToScreenXY(x, y)
</B>
392 Returns a
2-tuple, (x, y)
403 <A NAME=
"wxwindowclose"></A>
404 <H3>wxWindow::Close
</H3>
406 <B>virtual bool
</B> <B>Close
</B>(
<B>const bool
</B><I> force = FALSE
</I>)
<P>
407 The purpose of this call is to provide a safer way of destroying a window than using
408 the
<I>delete
</I> operator.
<P>
409 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
411 FALSE if the window's close handler should be able to veto the destruction
412 of this window, TRUE if it cannot.
</UL></UL>
414 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
415 Close calls the
<A HREF=
"wx45.htm#wxcloseevent">close handler
</A> for the window, providing an opportunity for the window to
416 choose whether to destroy the window.
<P>
417 The close handler should check whether the window is being deleted forcibly,
418 using
<A HREF=
"wx45.htm#wxcloseeventgetforce">wxCloseEvent::GetForce
</A>, in which case it should
419 destroy the window using
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>.
<P>
420 Applies to managed windows (wxFrame and wxDialog classes) only.
<P>
421 <I>Note
</I> that calling Close does not guarantee that the window will be destroyed; but it
422 provides a way to simulate a manual close of a window, which may or may not be implemented by
423 destroying the window. The default implementation of wxDialog::OnCloseWindow does not
424 necessarily delete the dialog, since it will simply simulate an wxID_CANCEL event which
425 itself only hides the dialog.
<P>
426 To guarantee that the window will be destroyed, call
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A> instead.
<P>
427 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
428 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
429 <A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A>,
430 <A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>,
431 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A><P>
434 <A NAME=
"wxwindowconvertdialogtopixels"></A>
435 <H3>wxWindow::ConvertDialogToPixels
</H3>
437 <B>wxPoint
</B> <B>ConvertDialogToPixels
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<P>
438 <B>wxSize
</B> <B>ConvertDialogToPixels
</B>(
<B>const wxSize
&</B><I> sz
</I>)
<P>
439 Converts a point or size from dialog units to pixels.
<P>
440 For the x dimension, the dialog units are multiplied by the average character width
441 and then divided by
4.
<P>
442 For the y dimension, the dialog units are multiplied by the average character height
443 and then divided by
8.
<P>
444 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
445 Dialog units are used for maintaining a dialog's proportions even if the font changes.
446 Dialogs created using Dialog Editor optionally use dialog units.
<P>
447 You can also use these functions programmatically. A convenience macro is defined:
<P>
450 #define wxDLG_UNIT(parent, pt) parent-
>ConvertDialogToPixels(pt)
453 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
454 <A HREF=
"wx260.htm#wxwindowconvertpixelstodialog">wxWindow::ConvertPixelsToDialog
</A><P>
455 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
456 In place of a single overloaded method name, wxPython
457 implements the following methods:
<P>
465 <B>ConvertDialogPointToPixels(point)
</B>
469 Accepts and returns a wxPoint
474 <B>ConvertDialogSizeToPixels(size)
</B>
478 Accepts and returns a wxSize
485 Additionally, the following helper functions are defined:
<P>
493 <B>wxDLG_PNT(win, point)
</B>
497 Converts a wxPoint from dialog
503 <B>wxDLG_SZE(win, size)
</B>
507 Converts a wxSize from dialog
519 <A NAME=
"wxwindowconvertpixelstodialog"></A>
520 <H3>wxWindow::ConvertPixelsToDialog
</H3>
522 <B>wxPoint
</B> <B>ConvertPixelsToDialog
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<P>
523 <B>wxSize
</B> <B>ConvertPixelsToDialog
</B>(
<B>const wxSize
&</B><I> sz
</I>)
<P>
524 Converts a point or size from pixels to dialog units.
<P>
525 For the x dimension, the pixels are multiplied by
4 and then divided by the average
527 For the y dimension, the pixels are multipled by
8 and then divided by the average
529 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
530 Dialog units are used for maintaining a dialog's proportions even if the font changes.
531 Dialogs created using Dialog Editor optionally use dialog units.
<P>
532 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
533 <A HREF=
"wx260.htm#wxwindowconvertdialogtopixels">wxWindow::ConvertDialogToPixels
</A><P>
535 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
536 In place of a single overloaded method name, wxPython
537 implements the following methods:
<P>
545 <B>ConvertDialogPointToPixels(point)
</B>
549 Accepts and returns a wxPoint
554 <B>ConvertDialogSizeToPixels(size)
</B>
558 Accepts and returns a wxSize
568 <A NAME=
"wxwindowdestroy"></A>
569 <H3>wxWindow::Destroy
</H3>
571 <B>virtual bool
</B> <B>Destroy
</B>()
<P>
572 Destroys the window safely. Use this function instead of the delete operator, since
573 different window classes can be destroyed differently. Frames and dialogs
574 are not destroyed immediately when this function is called - they are added
575 to a list of windows to be deleted on idle time, when all the window's events
576 have been processed. This prevents problems with events being sent to non-existant
578 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
579 TRUE if the window has either been successfully deleted, or it has been added
580 to the list of windows pending real deletion.
<P>
583 <A NAME=
"topic1030"></A>
584 <H3>wxWindow::DestroyChildren
</H3>
586 <B>virtual void
</B> <B>DestroyChildren
</B>()
<P>
587 Destroys all children of a window. Called automatically by the destructor.
<P>
590 <A NAME=
"wxwindowdragacceptfiles"></A>
591 <H3>wxWindow::DragAcceptFiles
</H3>
593 <B>virtual void
</B> <B>DragAcceptFiles
</B>(
<B>const bool
</B><I> accept
</I>)
<P>
594 Enables or disables elibility for drop file events (OnDropFiles).
<P>
595 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
596 <I>accept
</I><UL><UL>
597 If TRUE, the window is eligible for drop file events. If FALSE, the window
598 will not accept drop file events.
</UL></UL>
600 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
602 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
603 <A HREF=
"wx260.htm#wxwindowondropfiles">wxWindow::OnDropFiles
</A><P>
606 <A NAME=
"wxwindowenable"></A>
607 <H3>wxWindow::Enable
</H3>
609 <B>virtual void
</B> <B>Enable
</B>(
<B>const bool
</B><I> enable
</I>)
<P>
610 Enable or disable the window for user input.
<P>
611 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
612 <I>enable
</I><UL><UL>
613 If TRUE, enables the window for input. If FALSE, disables the window.
</UL></UL>
615 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
616 <A HREF=
"wx260.htm#wxwindowisenabled">wxWindow::IsEnabled
</A><P>
619 <A NAME=
"wxwindowfindfocus"></A>
620 <H3>wxWindow::FindFocus
</H3>
622 <B>static wxWindow*
</B> <B>FindFocus
</B>()
<P>
623 Finds the window or control which currently has the keyboard focus.
<P>
624 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
625 Note that this is a static function, so it can be called without needing a wxWindow pointer.
<P>
626 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
627 <A HREF=
"wx260.htm#wxwindowsetfocus">wxWindow::SetFocus
</A><P>
630 <A NAME=
"wxwindowfindwindow"></A>
631 <H3>wxWindow::FindWindow
</H3>
633 <B>wxWindow*
</B> <B>FindWindow
</B>(
<B>long
</B><I> id
</I>)
<P>
634 Find a child of this window, by identifier.
<P>
635 <B>wxWindow*
</B> <B>FindWindow
</B>(
<B>const wxString
&</B><I> name
</I>)
<P>
636 Find a child of this window, by name.
<P>
637 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
638 In place of a single overloaded method name, wxPython
639 implements the following methods:
<P>
647 <B>FindWindowById(id)
</B>
656 <B>FindWindowByName(name)
</B>
670 <A NAME=
"wxwindowfit"></A>
671 <H3>wxWindow::Fit
</H3>
673 <B>virtual void
</B> <B>Fit
</B>()
<P>
674 Sizes the window so that it fits around its subwindows.
<P>
677 <A NAME=
"wxwindowgetbackgroundcolour"></A>
678 <H3>wxWindow::GetBackgroundColour
</H3>
680 <B>virtual wxColour
</B> <B>GetBackgroundColour
</B>()
<B>const
</B><P>
681 Returns the background colour of the window.
<P>
682 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
683 <A HREF=
"wx260.htm#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A>,
684 <A HREF=
"wx260.htm#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A>,
685 <A HREF=
"wx260.htm#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A>,
686 <A HREF=
"wx260.htm#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A><P>
689 <A NAME=
"topic1031"></A>
690 <H3>wxWindow::GetCharHeight
</H3>
692 <B>virtual int
</B> <B>GetCharHeight
</B>()
<B>const
</B><P>
693 Returns the character height for this window.
<P>
696 <A NAME=
"topic1032"></A>
697 <H3>wxWindow::GetCharWidth
</H3>
699 <B>virtual int
</B> <B>GetCharWidth
</B>()
<B>const
</B><P>
700 Returns the average character width for this window.
<P>
703 <A NAME=
"topic1033"></A>
704 <H3>wxWindow::GetChildren
</H3>
706 <B>wxList
&</B> <B>GetChildren
</B>()
<P>
707 Returns a reference to the list of the window's children.
<P>
710 <A NAME=
"wxwindowgetclientsize"></A>
711 <H3>wxWindow::GetClientSize
</H3>
713 <B>virtual void
</B> <B>GetClientSize
</B>(
<B>int*
</B><I>width
</I>,
<B>int*
</B><I>height
</I>)
<B>const
</B><P>
714 <B>virtual wxSize
</B> <B>GetClientSize
</B>()
<B>const
</B><P>
715 This gets the size of the window 'client area' in pixels. The client area is the
716 area which may be drawn on by the programmer, excluding title bar, border etc.
<P>
717 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
719 Receives the client width in pixels.
</UL></UL>
721 <I>height
</I><UL><UL>
722 Receives the client height in pixels.
</UL></UL>
724 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
725 In place of a single overloaded method name, wxPython
726 implements the following methods:
<P>
734 <B>wxGetClientSizeTuple()
</B>
738 Returns a
2-tuple of (width, height)
743 <B>wxGetClientSize()
</B>
747 Returns a wxSize object
757 <A NAME=
"wxwindowgetconstraints"></A>
758 <H3>wxWindow::GetConstraints
</H3>
760 <B>wxLayoutConstraints*
</B> <B>GetConstraints
</B>()
<B>const
</B><P>
761 Returns a pointer to the window's layout constraints, or NULL if there are none.
<P>
764 <A NAME=
"wxwindowgetdefaultitem"></A>
765 <H3>wxWindow::GetDefaultItem
</H3>
767 <B>wxButton*
</B> <B>GetDefaultItem
</B>()
<B>const
</B><P>
768 Returns a pointer to the button which is the default for this window, or NULL.
<P>
771 <A NAME=
"wxwindowgetdroptarget"></A>
772 <H3>wxWindow::GetDropTarget
</H3>
774 <B>wxDropTarget*
</B> <B>GetDropTarget
</B>()
<B>const
</B><P>
775 Returns the associated drop target, which may be NULL.
<P>
776 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
777 <A HREF=
"wx260.htm#wxwindowsetdroptarget">wxWindow::SetDropTarget
</A>,
778 <A HREF=
"wx312.htm#wxdndoverview">Drag and drop overview
</A><P>
781 <A NAME=
"wxwindowgeteventhandler"></A>
782 <H3>wxWindow::GetEventHandler
</H3>
784 <B>wxEvtHandler*
</B> <B>GetEventHandler
</B>()
<B>const
</B><P>
785 Returns the event handler for this window. By default, the window is its
786 own event handler.
<P>
787 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
788 <A HREF=
"wx260.htm#wxwindowseteventhandler">wxWindow::SetEventHandler
</A>,
789 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A>,
790 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PopEventHandler
</A>,
791 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
792 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
795 <A NAME=
"wxwindowgetfont"></A>
796 <H3>wxWindow::GetFont
</H3>
798 <B>wxFont
&</B> <B>GetFont
</B>()
<B>const
</B><P>
799 Returns a reference to the font for this window.
<P>
800 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
801 <A HREF=
"wx260.htm#wxwindowsetfont">wxWindow::SetFont
</A><P>
804 <A NAME=
"wxwindowgetforegroundcolour"></A>
805 <H3>wxWindow::GetForegroundColour
</H3>
807 <B>virtual wxColour
</B> <B>GetForegroundColour
</B>()
<P>
808 Returns the foreground colour of the window.
<P>
809 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
810 The interpretation of foreground colour is open to interpretation according
811 to the window class; it may be the text colour or other colour, or it may not
813 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
814 <A HREF=
"wx260.htm#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A>,
815 <A HREF=
"wx260.htm#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A>,
816 <A HREF=
"wx260.htm#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A><P>
819 <A NAME=
"topic1034"></A>
820 <H3>wxWindow::GetGrandParent
</H3>
822 <B>wxWindow*
</B> <B>GetGrandParent
</B>()
<B>const
</B><P>
823 Returns the grandparent of a window, or NULL if there isn't one.
<P>
826 <A NAME=
"topic1035"></A>
827 <H3>wxWindow::GetHandle
</H3>
829 <B>void*
</B> <B>GetHandle
</B>()
<B>const
</B><P>
830 Returns the platform-specific handle of the physical window. Cast it to an appropriate
831 handle, such as
<B>HWND
</B> for Windows or
<B>Widget
</B> for Motif.
<P>
834 <A NAME=
"wxwindowgetid"></A>
835 <H3>wxWindow::GetId
</H3>
837 <B>int
</B> <B>GetId
</B>()
<B>const
</B><P>
838 Returns the identifier of the window.
<P>
839 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
840 Each window has an integer identifier. If the application has not provided one,
841 an identifier will be generated.
<P>
842 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
843 <A HREF=
"wx260.htm#wxwindowsetid">wxWindow::SetId
</A>
844 <A HREF=
"wx299.htm#windowids">Window identifiers
</A><P>
847 <A NAME=
"topic1036"></A>
848 <H3>wxWindow::GetPosition
</H3>
850 <B>virtual void
</B> <B>GetPosition
</B>(
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>)
<B>const
</B><P>
851 This gets the position of the window in pixels, relative to the parent window or
852 if no parent, relative to the whole display.
<P>
853 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
855 Receives the x position of the window.
</UL></UL>
858 Receives the y position of the window.
</UL></UL>
860 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
861 In place of a single overloaded method name, wxPython
862 implements the following methods:
<P>
879 <B>GetPositionTuple()
</B>
883 Returns a tuple (x, y)
893 <A NAME=
"topic1037"></A>
894 <H3>wxWindow::GetLabel
</H3>
896 <B>virtual wxString
& </B> <B>GetLabel
</B>()
<B>const
</B><P>
897 Generic way of getting a label from any window, for
898 identification purposes.
<P>
899 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
900 The interpretation of this function differs from class to class.
901 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
902 the button text. This function can be useful for meta-programs (such as testing
903 tools or special-needs access programs) which need to identify windows
907 <A NAME=
"wxwindowgetname"></A>
908 <H3>wxWindow::GetName
</H3>
910 <B>virtual wxString
& </B> <B>GetName
</B>()
<B>const
</B><P>
911 Returns the window's name.
<P>
912 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
913 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
914 name in the window constructor or via
<A HREF=
"wx260.htm#wxwindowsetname">wxWindow::SetName
</A>.
<P>
915 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
916 <A HREF=
"wx260.htm#wxwindowsetname">wxWindow::SetName
</A><P>
919 <A NAME=
"topic1038"></A>
920 <H3>wxWindow::GetParent
</H3>
922 <B>virtual wxWindow*
</B> <B>GetParent
</B>()
<B>const
</B><P>
923 Returns the parent of the window, or NULL if there is no parent.
<P>
926 <A NAME=
"wxwindowgetrect"></A>
927 <H3>wxWindow::GetRect
</H3>
929 <B>virtual wxRect
</B> <B>GetRect
</B>()
<B>const
</B><P>
930 Returns the size and position of the window as a
<A HREF=
"wx193.htm#wxrect">wxRect
</A> object.
<P>
933 <A NAME=
"wxwindowgetreturncode"></A>
934 <H3>wxWindow::GetReturnCode
</H3>
936 <B>int
</B> <B>GetReturnCode
</B>()
<P>
937 Gets the return code for this window.
<P>
938 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
939 A return code is normally associated with a modal dialog, where
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A> returns
940 a code to the application.
<P>
941 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
942 <A HREF=
"wx260.htm#wxwindowsetreturncode">wxWindow::SetReturnCode
</A>,
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A>,
943 <A HREF=
"wx71.htm#wxdialogendmodal">wxDialog::EndModal
</A><P>
946 <A NAME=
"wxwindowgetscrollthumb"></A>
947 <H3>wxWindow::GetScrollThumb
</H3>
949 <B>virtual int
</B> <B>GetScrollThumb
</B>(
<B>int
</B><I>orientation
</I>)
<P>
950 Returns the built-in scrollbar thumb size.
<P>
951 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
952 <A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><P>
955 <A NAME=
"wxwindowgetscrollpos"></A>
956 <H3>wxWindow::GetScrollPos
</H3>
958 <B>virtual int
</B> <B>GetScrollPos
</B>(
<B>int
</B><I>orientation
</I>)
<P>
959 Returns the built-in scrollbar position.
<P>
960 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
961 See
<A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><P>
964 <A NAME=
"wxwindowgetscrollrange"></A>
965 <H3>wxWindow::GetScrollRange
</H3>
967 <B>virtual int
</B> <B>GetScrollRange
</B>(
<B>int
</B><I>orientation
</I>)
<P>
968 Returns the built-in scrollbar range.
<P>
969 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
970 <A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A><P>
973 <A NAME=
"wxwindowgetsize"></A>
974 <H3>wxWindow::GetSize
</H3>
976 <B>virtual void
</B> <B>GetSize
</B>(
<B>int*
</B><I>width
</I>,
<B>int*
</B><I>height
</I>)
<B>const
</B><P>
977 <B>virtual wxSize
</B> <B>GetSize
</B>()
<B>const
</B><P>
978 This gets the size of the entire window in pixels.
<P>
979 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
981 Receives the window width.
</UL></UL>
983 <I>height
</I><UL><UL>
984 Receives the window height.
</UL></UL>
986 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
987 In place of a single overloaded method name, wxPython
988 implements the following methods:
<P>
1005 <B>GetSizeTuple()
</B>
1009 Returns a
2-tuple (width, height)
1019 <A NAME=
"topic1039"></A>
1020 <H3>wxWindow::GetTextExtent
</H3>
1022 <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>,
1023 <B>int*
</B><I>descent = NULL
</I>,
<B>int*
</B><I>externalLeading = NULL
</I>,
1024 <B>const wxFont*
</B><I>font = NULL
</I>,
<B>const bool
</B><I> use16 = FALSE
</I>)
<B>const
</B><P>
1025 Gets the dimensions of the string as it would be drawn on the
1026 window with the currently selected font.
<P>
1027 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1028 <I>string
</I><UL><UL>
1029 String whose extent is to be measured.
</UL></UL>
1032 Return value for width.
</UL></UL>
1035 Return value for height.
</UL></UL>
1037 <I>descent
</I><UL><UL>
1038 Return value for descent (optional).
</UL></UL>
1040 <I>externalLeading
</I><UL><UL>
1041 Return value for external leading (optional).
</UL></UL>
1044 Font to use instead of the current window font (optional).
</UL></UL>
1046 <I>use16
</I><UL><UL>
1047 If TRUE,
<I>string
</I> contains
16-bit characters. The default is FALSE.
</UL></UL>
1050 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1051 In place of a single overloaded method name, wxPython
1052 implements the following methods:
<P>
1060 <B>GetTextExtent(string)
</B>
1064 Returns a
2-tuple, (width, height)
1069 <B>GetFullTextExtent(string, font=NULL)
</B>
1074 4-tuple, (width, height, descent, externalLeading)
1085 <A NAME=
"wxwindowgettitle"></A>
1086 <H3>wxWindow::GetTitle
</H3>
1088 <B>virtual wxString
</B> <B>GetTitle
</B>()
<P>
1089 Gets the window's title. Applicable only to frames and dialogs.
<P>
1090 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1091 <A HREF=
"wx260.htm#wxwindowsettitle">wxWindow::SetTitle
</A><P>
1094 <A NAME=
"wxwindowgetupdateregion"></A>
1095 <H3>wxWindow::GetUpdateRegion
</H3>
1097 <B>virtual wxRegion
</B> <B>GetUpdateRegion
</B>()
<B>const
</B><P>
1098 Returns the region specifying which parts of the window have been damaged. Should
1099 only be called within an
<A HREF=
"wx260.htm#wxwindowonpaint">OnPaint
</A> event handler.
<P>
1100 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1101 <A HREF=
"wx195.htm#wxregion">wxRegion
</A>,
<A HREF=
"wx196.htm#wxregioniterator">wxRegionIterator
</A>,
<A HREF=
"wx260.htm#wxwindowonpaint">wxWindow::OnPaint
</A><P>
1104 <A NAME=
"topic1040"></A>
1105 <H3>wxWindow::GetWindowStyleFlag
</H3>
1107 <B>long
</B> <B>GetWindowStyleFlag
</B>()
<B>const
</B><P>
1108 Gets the window style that was passed to the consructor or
<B>Create
</B> member.
<P>
1111 <A NAME=
"wxwindowinitdialog"></A>
1112 <H3>wxWindow::InitDialog
</H3>
1114 <B>void
</B> <B>InitDialog
</B>()
<P>
1115 Sends an
<A HREF=
"wx260.htm#wxwindowoninitdialog">wxWindow::OnInitDialog
</A> event, which
1116 in turn transfers data to the dialog via validators.
<P>
1117 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1118 <A HREF=
"wx260.htm#wxwindowoninitdialog">wxWindow::OnInitDialog
</A><P>
1121 <A NAME=
"wxwindowisenabled"></A>
1122 <H3>wxWindow::IsEnabled
</H3>
1124 <B>virtual bool
</B> <B>IsEnabled
</B>()
<B>const
</B><P>
1125 Returns TRUE if the window is enabled for input, FALSE otherwise.
<P>
1126 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1127 <A HREF=
"wx260.htm#wxwindowenable">wxWindow::Enable
</A><P>
1130 <A NAME=
"wxwindowisretained"></A>
1131 <H3>wxWindow::IsRetained
</H3>
1133 <B>virtual bool
</B> <B>IsRetained
</B>()
<B>const
</B><P>
1134 Returns TRUE if the window is retained, FALSE otherwise.
<P>
1135 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1136 Retained windows are only available on X platforms.
<P>
1139 <A NAME=
"wxwindowisshown"></A>
1140 <H3>wxWindow::IsShown
</H3>
1142 <B>virtual bool
</B> <B>IsShown
</B>()
<B>const
</B><P>
1143 Returns TRUE if the window is shown, FALSE if it has been hidden.
<P>
1146 <A NAME=
"wxwindowlayout"></A>
1147 <H3>wxWindow::Layout
</H3>
1149 <B>void
</B> <B>Layout
</B>()
<P>
1150 Invokes the constraint-based layout algorithm for this window. It is called
1151 automatically by the default
<B>wxWindow::OnSize
</B> member.
<P>
1154 <A NAME=
"wxwindowloadfromresource"></A>
1155 <H3>wxWindow::LoadFromResource
</H3>
1157 <B>virtual bool
</B> <B>LoadFromResource
</B>(
<B>wxWindow*
</B><I>parent
</I>,
1158 <B>const wxString
& </B><I>resourceName
</I>,
<B>const wxResourceTable*
</B><I>resourceTable = NULL
</I>)
<P>
1159 Loads a panel or dialog from a resource file.
<P>
1160 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1161 <I>parent
</I><UL><UL>
1162 Parent window.
</UL></UL>
1164 <I>resourceName
</I><UL><UL>
1165 The name of the resource to load.
</UL></UL>
1167 <I>resourceTable
</I><UL><UL>
1168 The resource table to load it from. If this is NULL, the
1169 default resource table will be used.
</UL></UL>
1171 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
1172 TRUE if the operation succeeded, otherwise FALSE.
<P>
1175 <A NAME=
"wxwindowlower"></A>
1176 <H3>wxWindow::Lower
</H3>
1178 <B>void
</B> <B>Lower
</B>()
<P>
1179 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
1183 <A NAME=
"wxwindowmakemodal"></A>
1184 <H3>wxWindow::MakeModal
</H3>
1186 <B>virtual void
</B> <B>MakeModal
</B>(
<B>const bool
</B><I>flag
</I>)
<P>
1187 Disables all other windows in the application so that
1188 the user can only interact with this window.
<P>
1189 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1191 If TRUE, this call disables all other windows in the application so that
1192 the user can only interact with this window. If FALSE, the effect is reversed.
</UL></UL>
1196 <A NAME=
"wxwindowmove"></A>
1197 <H3>wxWindow::Move
</H3>
1199 <B>void
</B> <B>Move
</B>(
<B>int
</B><I> x
</I>,
<B>int
</B><I> y
</I>)
<P>
1200 <B>void
</B> <B>Move
</B>(
<B>const wxPoint
&</B><I> pt
</I>)
<P>
1201 Moves the window to the given position.
<P>
1202 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1204 Required x position.
</UL></UL>
1207 Required y position.
</UL></UL>
1210 <A HREF=
"wx171.htm#wxpoint">wxPoint
</A> object representing the position.
</UL></UL>
1212 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1213 Implementations of SetSize can also implicitly implement the
1214 wxWindow::Move function, which is defined in the base wxWindow class
1217 SetSize(x, y, -
1, -
1, wxSIZE_USE_EXISTING);
1219 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1220 <A HREF=
"wx260.htm#wxwindowsetsize">wxWindow::SetSize
</A><P>
1221 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1222 In place of a single overloaded method name, wxPython
1223 implements the following methods:
<P>
1244 Accepts a pair of integers
1254 <A NAME=
"wxwindowonactivate"></A>
1255 <H3>wxWindow::OnActivate
</H3>
1257 <B>void
</B> <B>OnActivate
</B>(
<B>wxActivateEvent
&</B><I> event
</I>)
<P>
1258 Called when a window is activated or deactivated.
<P>
1259 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1260 <I>event
</I><UL><UL>
1261 Object containing activation information.
</UL></UL>
1263 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1264 If the window is being activated,
<A HREF=
"wx25.htm#wxactivateeventgetactive">wxActivateEvent::GetActive
</A> returns TRUE,
1265 otherwise it returns FALSE (it is being deactivated).
<P>
1266 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1267 <A HREF=
"wx25.htm#wxactivateevent">wxActivateEvent
</A>,
1268 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1271 <A NAME=
"wxwindowonchar"></A>
1272 <H3>wxWindow::OnChar
</H3>
1274 <B>void
</B> <B>OnChar
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1275 Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
<P>
1276 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1277 <I>event
</I><UL><UL>
1278 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1279 details about this class.
</UL></UL>
1281 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1282 This member function is called in response to a keypress. To intercept this event,
1283 use the EVT_CHAR macro in an event table definition. Your
<B>OnChar
</B> handler may call this
1284 default function to achieve default keypress functionality.
<P>
1285 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
1287 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
1288 keypresses, then you will need to use
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A> or
1289 <A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>.
<P>
1290 Most, but not all, windows allow keypresses to be intercepted.
<P>
1291 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1292 <A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A>,
<A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>,
1293 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1294 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1297 <A NAME=
"wxwindowoncharhook"></A>
1298 <H3>wxWindow::OnCharHook
</H3>
1300 <B>void
</B> <B>OnCharHook
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1301 This member is called to allow the window to intercept keyboard events
1302 before they are processed by child windows.
<P>
1303 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1304 <I>event
</I><UL><UL>
1305 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1306 details about this class.
</UL></UL>
1308 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1309 This member function is called in response to a keypress, if the window is active. To intercept this event,
1310 use the EVT_CHAR_HOOK macro in an event table definition. If you do not process a particular
1311 keypress, call
<A HREF=
"wx84.htm#wxeventskip">wxEvent::Skip
</A> to allow default processing.
<P>
1312 An example of using this function is in the implementation of escape-character processing for wxDialog,
1313 where pressing ESC dismisses the dialog by
<B>OnCharHook
</B> 'forging' a cancel button press event.
<P>
1314 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
1316 This function is only relevant to top-level windows (frames and dialogs), and under
1318 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1319 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1320 <A HREF=
"wx26.htm#wxapponcharhook">wxApp::OnCharHook
</A>,
1321 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1324 <A NAME=
"wxwindowoncommand"></A>
1325 <H3>wxWindow::OnCommand
</H3>
1327 <B>virtual void
</B> <B>OnCommand
</B>(
<B>wxEvtHandler
& </B><I>object
</I>,
<B>wxCommandEvent
& </B><I>event
</I>)
<P>
1328 This virtual member function is called if the control does not handle the command event.
<P>
1329 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1330 <I>object
</I><UL><UL>
1331 Object receiving the command event.
</UL></UL>
1333 <I>event
</I><UL><UL>
1334 Command event
</UL></UL>
1336 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1337 This virtual function is provided mainly for backward compatibility. You can also intercept commands
1338 from child controls by using an event table, with identifiers or identifier ranges to identify
1339 the control(s) in question.
<P>
1340 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1341 <A HREF=
"wx52.htm#wxcommandevent">wxCommandEvent
</A>,
1342 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1345 <A NAME=
"wxwindowonclose"></A>
1346 <H3>wxWindow::OnClose
</H3>
1348 <B>virtual bool
</B> <B>OnClose
</B>()
<P>
1349 Called when the user has tried to close a a frame
1350 or dialog box using the window manager (X) or system menu (Windows).
<P>
1351 <B>Note:
</B> This is an obsolete function.
1352 It is superceded by the
<A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A> event
1354 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
1355 If TRUE is returned by OnClose, the window will be deleted by the system, otherwise the
1356 attempt will be ignored. Do not delete the window from within this handler, although
1357 you may delete other windows.
<P>
1358 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1359 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
1360 <A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A>,
1361 <A HREF=
"wx260.htm#wxwindowonclosewindow">wxWindow::OnCloseWindow
</A>,
1362 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A><P>
1365 <A NAME=
"wxwindowonclosewindow"></A>
1366 <H3>wxWindow::OnCloseWindow
</H3>
1368 <B>void
</B> <B>OnCloseWindow
</B>(
<B>wxCloseEvent
& </B><I>event
</I>)
<P>
1369 This is an event handler function called when the user has tried to close a a frame
1370 or dialog box using the window manager (X) or system menu (Windows). It is
1371 called via the
<A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A> function, so
1372 that the application can also invoke the handler programmatically.
<P>
1373 Use the EVT_CLOSE event table macro to handle close events.
<P>
1374 You should check whether the application is forcing the deletion of the window
1375 using
<A HREF=
"wx45.htm#wxcloseeventgetforce">wxCloseEvent::GetForce
</A>. If this is TRUE,
1376 destroy the window using
<A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>.
1377 If not, it is up to you whether you respond by destroying the window.
<P>
1378 (Note: GetForce is now superceded by CanVeto. So to test whether forced destruction of
1379 the window is required, test for the negative of CanVeto. If CanVeto returns FALSE,
1380 it is not possible to skip window deletion.)
<P>
1381 If you don't destroy the window, you should call
<A HREF=
"wx45.htm#wxcloseeventveto">wxCloseEvent::Veto
</A> to
1382 let the calling code know that you did not destroy the window. This allows the
<A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A> function
1383 to return TRUE or FALSE depending on whether the close instruction was honoured or not.
<P>
1384 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1385 The
<A HREF=
"wx260.htm#wxwindowonclose">wxWindow::OnClose
</A> virtual function remains
1386 for backward compatibility with earlier versions of wxWindows. The
1387 default
<B>OnCloseWindow
</B> handler for wxFrame and wxDialog will call
<B>OnClose
</B>,
1388 destroying the window if it returns TRUE or if the close is being forced.
<P>
1389 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1390 <A HREF=
"wx296.htm#windowdeletionoverview">Window deletion overview
</A>,
1391 <A HREF=
"wx260.htm#wxwindowclose">wxWindow::Close
</A>,
1392 <A HREF=
"wx260.htm#wxwindowonclose">wxWindow::OnClose
</A>,
1393 <A HREF=
"wx260.htm#wxwindowdestroy">wxWindow::Destroy
</A>,
1394 <A HREF=
"wx45.htm#wxcloseevent">wxCloseEvent
</A>,
1395 <A HREF=
"wx26.htm#wxapponqueryendsession">wxApp::OnQueryEndSession
</A>,
1396 <A HREF=
"wx26.htm#wxapponendsession">wxApp::OnEndSession
</A><P>
1399 <A NAME=
"wxwindowondropfiles"></A>
1400 <H3>wxWindow::OnDropFiles
</H3>
1402 <B>void
</B> <B>OnDropFiles
</B>(
<B>wxDropFilesEvent
&</B><I> event
</I>)
<P>
1403 Called when files have been dragged from the file manager to the window.
<P>
1404 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1405 <I>event
</I><UL><UL>
1406 Drop files event. For more information, see
<A HREF=
"wx80.htm#wxdropfilesevent">wxDropFilesEvent
</A>.
</UL></UL>
1408 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1409 The window must have previously been enabled for dropping by calling
1410 <A HREF=
"wx260.htm#wxwindowdragacceptfiles">wxWindow::DragAcceptFiles
</A>.
<P>
1411 This event is only generated under Windows.
<P>
1412 To intercept this event, use the EVT_DROP_FILES macro in an event table definition.
<P>
1413 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1414 <A HREF=
"wx80.htm#wxdropfilesevent">wxDropFilesEvent
</A>,
<A HREF=
"wx260.htm#wxwindowdragacceptfiles">wxWindow::DragAcceptFiles
</A>,
1415 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1418 <A NAME=
"wxwindowonerasebackground"></A>
1419 <H3>wxWindow::OnEraseBackground
</H3>
1421 <B>void
</B> <B>OnEraseBackground
</B>(
<B>wxEraseEvent
&</B><I> event
</I>)
<P>
1422 Called when the background of the window needs to be erased.
<P>
1423 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1424 <I>event
</I><UL><UL>
1425 Erase background event. For more information, see
<A HREF=
"wx83.htm#wxeraseevent">wxEraseEvent
</A>.
</UL></UL>
1427 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1428 This event is only generated under Windows.
<P>
1429 To intercept this event, use the EVT_ERASE_BACKGROUND macro in an event table definition.
<P>
1430 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1431 <A HREF=
"wx83.htm#wxeraseevent">wxEraseEvent
</A>,
<A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1434 <A NAME=
"wxwindowonkeydown"></A>
1435 <H3>wxWindow::OnKeyDown
</H3>
1437 <B>void
</B> <B>OnKeyDown
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1438 Called when the user has pressed a key, before it is translated into an ASCII value using other
1439 modifier keys that might be pressed at the same time.
<P>
1440 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1441 <I>event
</I><UL><UL>
1442 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1443 details about this class.
</UL></UL>
1445 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1446 This member function is called in response to a key down event. To intercept this event,
1447 use the EVT_KEY_DOWN macro in an event table definition. Your
<B>OnKeyDown
</B> handler may call this
1448 default function to achieve default keypress functionality.
<P>
1449 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1450 keys, such as shift, control, and function keys, then you will need to use
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A> or
1451 <A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>.
<P>
1452 Most, but not all, windows allow keypresses to be intercepted.
<P>
1453 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1454 <A HREF=
"wx260.htm#wxwindowonchar">wxWindow::OnChar
</A>,
<A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>,
1455 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1456 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1459 <A NAME=
"wxwindowonkeyup"></A>
1460 <H3>wxWindow::OnKeyUp
</H3>
1462 <B>void
</B> <B>OnKeyUp
</B>(
<B>wxKeyEvent
&</B><I> event
</I>)
<P>
1463 Called when the user has released a key.
<P>
1464 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1465 <I>event
</I><UL><UL>
1466 Object containing keypress information. See
<A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A> for
1467 details about this class.
</UL></UL>
1469 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1470 This member function is called in response to a key up event. To intercept this event,
1471 use the EVT_KEY_UP macro in an event table definition. Your
<B>OnKeyUp
</B> handler may call this
1472 default function to achieve default keypress functionality.
<P>
1473 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1474 keys, such as shift, control, and function keys, then you will need to use
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A> or
1475 <A HREF=
"wx260.htm#wxwindowonkeyup">wxWindow::OnKeyUp
</A>.
<P>
1476 Most, but not all, windows allow key up events to be intercepted.
<P>
1477 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1478 <A HREF=
"wx260.htm#wxwindowonchar">wxWindow::OnChar
</A>,
<A HREF=
"wx260.htm#wxwindowonkeydown">wxWindow::OnKeyDown
</A>,
1479 <A HREF=
"wx124.htm#wxkeyevent">wxKeyEvent
</A>,
<A HREF=
"wx260.htm#wxwindowoncharhook">wxWindow::OnCharHook
</A>,
1480 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1483 <A NAME=
"wxwindowonkillfocus"></A>
1484 <H3>wxWindow::OnKillFocus
</H3>
1486 <B>void
</B> <B>OnKillFocus
</B>(
<B>wxFocusEvent
& </B><I>event
</I>)
<P>
1487 Called when a window's focus is being killed.
<P>
1488 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1489 <I>event
</I><UL><UL>
1490 The focus event. For more information, see
<A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>.
</UL></UL>
1492 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1493 To intercept this event, use the macro EVT_KILL_FOCUS in an event table definition.
<P>
1494 Most, but not all, windows respond to this event.
<P>
1495 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1496 <A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>,
<A HREF=
"wx260.htm#wxwindowonsetfocus">wxWindow::OnSetFocus
</A>,
1497 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1500 <A NAME=
"wxwindowonidle"></A>
1501 <H3>wxWindow::OnIdle
</H3>
1503 <B>void
</B> <B>OnIdle
</B>(
<B>wxIdleEvent
& </B><I>event
</I>)
<P>
1504 Provide this member function for any processing which needs to be done
1505 when the application is idle.
<P>
1506 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1507 <A HREF=
"wx26.htm#wxapponidle">wxApp::OnIdle
</A>,
<A HREF=
"wx113.htm#wxidleevent">wxIdleEvent
</A><P>
1510 <A NAME=
"wxwindowoninitdialog"></A>
1511 <H3>wxWindow::OnInitDialog
</H3>
1513 <B>void
</B> <B>OnInitDialog
</B>(
<B>wxInitDialogEvent
&</B><I> event
</I>)
<P>
1514 Default handler for the wxEVT_INIT_DIALOG event. Calls
<A HREF=
"wx260.htm#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A>.
<P>
1515 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1516 <I>event
</I><UL><UL>
1517 Dialog initialisation event.
</UL></UL>
1519 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1520 Gives the window the default behaviour of transferring data to child controls via
1521 the validator that each control has.
<P>
1522 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1523 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A>,
<A HREF=
"wx260.htm#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A><P>
1526 <A NAME=
"wxwindowonmenuhighlight"></A>
1527 <H3>wxWindow::OnMenuHighlight
</H3>
1529 <B>void
</B> <B>OnMenuHighlight
</B>(
<B>wxMenuEvent
& </B><I>event
</I>)
<P>
1530 Called when a menu select is received from a menu bar: that is, the
1531 mouse cursor is over a menu item, but the left mouse button has not been
1533 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1534 <I>event
</I><UL><UL>
1535 The menu highlight event. For more information, see
<A HREF=
"wx143.htm#wxmenuevent">wxMenuEvent
</A>.
</UL></UL>
1537 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1538 You can choose any member function to receive
1539 menu select events, using the EVT_MENU_HIGHLIGHT macro for individual menu items or EVT_MENU_HIGHLIGHT_ALL macro
1540 for all menu items.
<P>
1541 The default implementation for
<A HREF=
"wx104.htm#wxframeonmenuhighlight">wxFrame::OnMenuHighlight
</A> displays help
1542 text in the first field of the status bar.
<P>
1543 This function was known as
<B>OnMenuSelect
</B> in earlier versions of wxWindows, but this was confusing
1544 since a selection is normally a left-click action.
<P>
1545 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1546 <A HREF=
"wx143.htm#wxmenuevent">wxMenuEvent
</A>,
1547 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1551 <A NAME=
"wxwindowonmouseevent"></A>
1552 <H3>wxWindow::OnMouseEvent
</H3>
1554 <B>void
</B> <B>OnMouseEvent
</B>(
<B>wxMouseEvent
&</B><I> event
</I>)
<P>
1555 Called when the user has initiated an event with the
1557 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1558 <I>event
</I><UL><UL>
1559 The mouse event. See
<A HREF=
"wx150.htm#wxmouseevent">wxMouseEvent
</A> for
1560 more details.
</UL></UL>
1562 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1563 Most, but not all, windows respond to this event.
<P>
1564 To intercept this event, use the EVT_MOUSE_EVENTS macro in an event table definition, or individual
1565 mouse event macros such as EVT_LEFT_DOWN.
<P>
1566 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1567 <A HREF=
"wx150.htm#wxmouseevent">wxMouseEvent
</A>,
1568 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1571 <A NAME=
"wxwindowonmove"></A>
1572 <H3>wxWindow::OnMove
</H3>
1574 <B>void
</B> <B>OnMove
</B>(
<B>wxMoveEvent
& </B><I>event
</I>)
<P>
1575 Called when a window is moved.
<P>
1576 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1577 <I>event
</I><UL><UL>
1578 The move event. For more information, see
<A HREF=
"wx151.htm#wxmoveevent">wxMoveEvent
</A>.
</UL></UL>
1580 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1581 Use the EVT_MOVE macro to intercept move events.
<P>
1582 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1583 Not currently implemented.
<P>
1584 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1585 <A HREF=
"wx151.htm#wxmoveevent">wxMoveEvent
</A>,
1586 <A HREF=
"wx104.htm#wxframeonsize">wxFrame::OnSize
</A>,
1587 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1590 <A NAME=
"wxwindowonpaint"></A>
1591 <H3>wxWindow::OnPaint
</H3>
1593 <B>void
</B> <B>OnPaint
</B>(
<B>wxPaintEvent
& </B><I>event
</I>)
<P>
1594 Sent to the event handler when the window must be refreshed.
<P>
1595 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1596 <I>event
</I><UL><UL>
1597 Paint event. For more information, see
<A HREF=
"wx164.htm#wxpaintevent">wxPaintEvent
</A>.
</UL></UL>
1599 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1600 Use the EVT_PAINT macro in an event table definition to intercept paint events.
<P>
1601 In a paint event handler, the application should always create a
<A HREF=
"wx163.htm#wxpaintdc">wxPaintDC
</A> object.
<P>
1604 void MyWindow::OnPaint(wxPaintEvent& event)
1611 </FONT>You can optimize painting by retrieving the rectangles
1612 that have been damaged and only repainting these. The rectangles are in
1613 terms of the client area, and are unscrolled, so you will need to do
1614 some calculations using the current view position to obtain logical,
1616 Here is an example of using the
<A HREF=
"wx196.htm#wxregioniterator">wxRegionIterator
</A> class:
<P>
1618 // Called when window needs to be repainted.
1619 void MyWindow::OnPaint(wxPaintEvent& event)
1623 // Find Out where the window is scrolled to
1624 int vbX,vbY; // Top left corner of client
1625 ViewStart(&vbX,&vbY);
1627 int vX,vY,vW,vH; // Dimensions of client area in pixels
1628 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1637 // Alternatively we can do this:
1639 // upd.GetRect(&rect);
1641 // Repaint this rectangle
1648 </FONT><B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1649 <A HREF=
"wx164.htm#wxpaintevent">wxPaintEvent
</A>,
1650 <A HREF=
"wx163.htm#wxpaintdc">wxPaintDC
</A>,
1651 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1654 <A NAME=
"wxwindowonscroll"></A>
1655 <H3>wxWindow::OnScroll
</H3>
1657 <B>void
</B> <B>OnScroll
</B>(
<B>wxScrollEvent
& </B><I>event
</I>)
<P>
1658 Called when a scroll event is received from one of the window's built-in scrollbars.
<P>
1659 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1660 <I>event
</I><UL><UL>
1661 Command event. Retrieve the new scroll position by
1662 calling
<A HREF=
"wx202.htm#wxscrolleventgetposition">wxScrollEvent::GetPosition
</A>, and the
1663 scrollbar orientation by calling
<A HREF=
"wx202.htm#wxscrolleventgetorientation">wxScrollEvent::GetOrientation
</A>.
</UL></UL>
1665 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1666 Note that it is not possible to distinguish between horizontal and vertical scrollbars
1667 until the function is executing (you can't have one function for vertical, another
1668 for horizontal events).
<P>
1669 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1670 <A HREF=
"wx202.htm#wxscrollevent">wxScrollEvent
</A>,
1671 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1674 <A NAME=
"wxwindowonsetfocus"></A>
1675 <H3>wxWindow::OnSetFocus
</H3>
1677 <B>void
</B> <B>OnSetFocus
</B>(
<B>wxFocusEvent
& </B><I>event
</I>)
<P>
1678 Called when a window's focus is being set.
<P>
1679 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1680 <I>event
</I><UL><UL>
1681 The focus event. For more information, see
<A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>.
</UL></UL>
1683 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1684 To intercept this event, use the macro EVT_SET_FOCUS in an event table definition.
<P>
1685 Most, but not all, windows respond to this event.
<P>
1686 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1687 <A HREF=
"wx99.htm#wxfocusevent">wxFocusEvent
</A>,
<A HREF=
"wx260.htm#wxwindowonkillfocus">wxWindow::OnKillFocus
</A>,
1688 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1691 <A NAME=
"wxwindowonsize"></A>
1692 <H3>wxWindow::OnSize
</H3>
1694 <B>void
</B> <B>OnSize
</B>(
<B>wxSizeEvent
& </B><I>event
</I>)
<P>
1695 Called when the window has been resized.
<P>
1696 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1697 <I>event
</I><UL><UL>
1698 Size event. For more information, see
<A HREF=
"wx206.htm#wxsizeevent">wxSizeEvent
</A>.
</UL></UL>
1700 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1701 You may wish to use this for frames to resize their child windows as appropriate.
<P>
1702 Note that the size passed is of
1703 the whole window: call
<A HREF=
"wx260.htm#wxwindowgetclientsize">wxWindow::GetClientSize
</A> for the area which may be
1704 used by the application.
<P>
1705 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1706 <A HREF=
"wx206.htm#wxsizeevent">wxSizeEvent
</A>,
1707 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1710 <A NAME=
"wxwindowonsyscolourchanged"></A>
1711 <H3>wxWindow::OnSysColourChanged
</H3>
1713 <B>void
</B> <B>OnSysColourChanged
</B>(
<B>wxOnSysColourChangedEvent
& </B><I>event
</I>)
<P>
1714 Called when the user has changed the system colours.
<P>
1715 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1716 <I>event
</I><UL><UL>
1717 System colour change event. For more information, see
<A HREF=
"wx227.htm#wxsyscolourchangedevent">wxSysColourChangedEvent
</A>.
</UL></UL>
1719 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1720 <A HREF=
"wx227.htm#wxsyscolourchangedevent">wxSysColourChangedEvent
</A>,
1721 <A HREF=
"wx299.htm#eventhandlingoverview">Event handling overview
</A><P>
1724 <A NAME=
"wxwindowpopeventhandler"></A>
1725 <H3>wxWindow::PopEventHandler
</H3>
1727 <B>wxEvtHandler*
</B> <B>PopEventHandler
</B>(
<B>bool
</B><I>deleteHandler = FALSE
</I>)
<B>const
</B><P>
1728 Removes and returns the top-most event handler on the event handler stack.
<P>
1729 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1730 <I>deleteHandler
</I><UL><UL>
1731 If this is TRUE, the handler will be deleted after it is removed. The
1732 default value is FALSE.
</UL></UL>
1734 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1735 <A HREF=
"wx260.htm#wxwindowseteventhandler">wxWindow::SetEventHandler
</A>,
1736 <A HREF=
"wx260.htm#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A>,
1737 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A>,
1738 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
1739 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
1742 <A NAME=
"wxwindowpopupmenu"></A>
1743 <H3>wxWindow::PopupMenu
</H3>
1745 <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>
1746 Pops up the given menu at the specified coordinates, relative to this
1747 window, and returns control when the user has dismissed the menu. If a
1748 menu item is selected, the callback defined for the menu is called with
1749 wxMenu and wxCommandEvent reference arguments. The callback should access
1750 the commandInt member of the event to check the selected menu identifier.
<P>
1751 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1753 Menu to pop up.
</UL></UL>
1756 Required x position for the menu to appear.
</UL></UL>
1759 Required y position for the menu to appear.
</UL></UL>
1761 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1762 <A HREF=
"wx140.htm#wxmenu">wxMenu
</A><P>
1763 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1764 Just before the menu is popped up,
<A HREF=
"wx140.htm#wxmenuupdateui">wxMenu::UpdateUI
</A> is called
1765 to ensure that the menu items are in the correct state.
<P>
1768 <A NAME=
"wxwindowpusheventhandler"></A>
1769 <H3>wxWindow::PushEventHandler
</H3>
1771 <B>void
</B> <B>PushEventHandler
</B>(
<B>wxEvtHandler*
</B><I>handler
</I>)
<P>
1772 Pushes this event handler onto the event stack for the window.
<P>
1773 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1774 <I>handler
</I><UL><UL>
1775 Specifies the handler to be pushed.
</UL></UL>
1777 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1778 An event handler is an object that is capable of processing the events
1779 sent to a window. By default, the window is its own event handler, but
1780 an application may wish to substitute another, for example to allow
1781 central implementation of event-handling for a variety of different
1783 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A> allows
1784 an application to set up a chain of event handlers, where an event not handled by one event handler is
1785 handed to the next one in the chain. Use
<A HREF=
"wx260.htm#wxwindowpopeventhandler">wxWindow::PopEventHandler
</A> to
1786 remove the event handler.
<P>
1787 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1788 <A HREF=
"wx260.htm#wxwindowseteventhandler">wxWindow::SetEventHandler
</A>,
1789 <A HREF=
"wx260.htm#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A>,
1790 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PopEventHandler
</A>,
1791 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
1792 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
1795 <A NAME=
"wxwindowraise"></A>
1796 <H3>wxWindow::Raise
</H3>
1798 <B>void
</B> <B>Raise
</B>()
<P>
1799 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1803 <A NAME=
"wxwindowrefresh"></A>
1804 <H3>wxWindow::Refresh
</H3>
1806 <B>virtual void
</B> <B>Refresh
</B>(
<B>const bool
</B><I> eraseBackground = TRUE
</I>,
<B>const wxRect*
</B><I>rect
1808 Causes a message or event to be generated to repaint the
1810 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1811 <I>eraseBackground
</I><UL><UL>
1812 If TRUE, the background will be
1816 If non-NULL, only the given rectangle will
1817 be treated as damaged.
</UL></UL>
1821 <A NAME=
"wxwindowreleasemouse"></A>
1822 <H3>wxWindow::ReleaseMouse
</H3>
1824 <B>virtual void
</B> <B>ReleaseMouse
</B>()
<P>
1825 Releases mouse input captured with
<A HREF=
"wx260.htm#wxwindowcapturemouse">wxWindow::CaptureMouse
</A>.
<P>
1826 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1827 <A HREF=
"wx260.htm#wxwindowcapturemouse">wxWindow::CaptureMouse
</A><P>
1830 <A NAME=
"wxwindowremovechild"></A>
1831 <H3>wxWindow::RemoveChild
</H3>
1833 <B>virtual void
</B> <B>RemoveChild
</B>(
<B>wxWindow*
</B><I>child
</I>)
<P>
1834 Removes a child window. This is called automatically by window deletion
1835 functions so should not be required by the application programmer.
<P>
1836 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1837 <I>child
</I><UL><UL>
1838 Child window to remove.
</UL></UL>
1842 <A NAME=
"wxwindowscreentoclient"></A>
1843 <H3>wxWindow::ScreenToClient
</H3>
1845 <B>virtual void
</B> <B>ScreenToClient
</B>(
<B>int*
</B><I>x
</I>,
<B>int*
</B><I>y
</I>)
<B>const
</B><P>
1846 <B>virtual wxPoint
</B> <B>ScreenToClient
</B>(
<B>const wxPoint
& </B><I>pt
</I>)
<B>const
</B><P>
1847 Converts from screen to client window coordinates.
<P>
1848 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1850 Stores the screen x coordinate and receives the client x coordinate.
</UL></UL>
1853 Stores the screen x coordinate and receives the client x coordinate.
</UL></UL>
1856 The screen position for the second form of the function.
</UL></UL>
1858 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1859 In place of a single overloaded method name, wxPython
1860 implements the following methods:
<P>
1868 <B>ScreenToClient(point)
</B>
1872 Accepts and returns a wxPoint
1877 <B>ScreenToClientXY(x, y)
</B>
1881 Returns a
2-tuple, (x, y)
1892 <A NAME=
"wxwindowscrollwindow"></A>
1893 <H3>wxWindow::ScrollWindow
</H3>
1895 <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>
1896 Physically scrolls the pixels in the window.
<P>
1897 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1899 Amount to scroll horizontally.
</UL></UL>
1902 Amount to scroll vertically.
</UL></UL>
1905 Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
1906 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
1907 can optimise painting by checking for the invalidated region.
</UL></UL>
1909 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1910 Available only under Windows.
<P>
1911 Use this function to optimise your scrolling implementations, to minimise the area that must be
1915 <A NAME=
"wxwindowsetacceleratortable"></A>
1916 <H3>wxWindow::SetAcceleratorTable
</H3>
1918 <B>virtual void
</B> <B>SetAcceleratorTable
</B>(
<B>const wxAcceleratorTable
&</B><I> accel
</I>)
<P>
1919 Sets the accelerator table for this window. See
<A HREF=
"wx24.htm#wxacceleratortable">wxAcceleratorTable
</A>.
<P>
1922 <A NAME=
"wxwindowsetautolayout"></A>
1923 <H3>wxWindow::SetAutoLayout
</H3>
1925 <B>void
</B> <B>SetAutoLayout
</B>(
<B>const bool
</B><I> autoLayout
</I>)
<P>
1926 Determines whether the
<A HREF=
"wx260.htm#wxwindowlayout">wxWindow::Layout
</A> function will
1927 be called automatically when the window is resized.
<P>
1928 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1929 <I>autoLayout
</I><UL><UL>
1930 Set this to TRUE if you wish the Layout function to be called
1931 from within wxWindow::OnSize functions.
</UL></UL>
1933 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1934 <A HREF=
"wx260.htm#wxwindowsetconstraints">wxWindow::SetConstraints
</A><P>
1937 <A NAME=
"wxwindowsetbackgroundcolour"></A>
1938 <H3>wxWindow::SetBackgroundColour
</H3>
1940 <B>virtual void
</B> <B>SetBackgroundColour
</B>(
<B>const wxColour
& </B><I>colour
</I>)
<P>
1941 Sets the background colour of the window.
<P>
1942 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1943 <I>colour
</I><UL><UL>
1944 The colour to be used as the background colour.
</UL></UL>
1946 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
1947 The background colour is usually painted by the default
1948 <A HREF=
"wx260.htm#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A> event handler function.
<P>
1949 Note that setting the background colour does not cause an immediate refresh, so you
1950 may wish to call
<A HREF=
"wx260.htm#wxwindowclear">wxWindow::Clear
</A> or
<A HREF=
"wx260.htm#wxwindowrefresh">wxWindow::Refresh
</A> after
1951 calling this function.
<P>
1952 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
1953 <A HREF=
"wx260.htm#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A>,
1954 <A HREF=
"wx260.htm#wxwindowsetforegroundcolour">wxWindow::SetForegroundColour
</A>,
1955 <A HREF=
"wx260.htm#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A>,
1956 <A HREF=
"wx260.htm#wxwindowclear">wxWindow::Clear
</A>,
1957 <A HREF=
"wx260.htm#wxwindowrefresh">wxWindow::Refresh
</A>,
1958 <A HREF=
"wx260.htm#wxwindowonerasebackground">wxWindow::OnEraseBackground
</A><P>
1961 <A NAME=
"wxwindowsetclientsize"></A>
1962 <H3>wxWindow::SetClientSize
</H3>
1964 <B>virtual void
</B> <B>SetClientSize
</B>(
<B>int
</B><I> width
</I>,
<B>int
</B><I> height
</I>)
<P>
1965 <B>virtual void
</B> <B>SetClientSize
</B>(
<B>const wxSize
&</B><I> size
</I>)
<P>
1966 This sets the size of the window client area in pixels. Using this function to size a window
1967 tends to be more device-independent than
<A HREF=
"wx260.htm#wxwindowsetsize">wxWindow::SetSize
</A>, since the application need not
1968 worry about what dimensions the border or title bar have when trying to fit the window
1969 around panel items, for example.
<P>
1970 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
1971 <I>width
</I><UL><UL>
1972 The required client area width.
</UL></UL>
1974 <I>height
</I><UL><UL>
1975 The required client area height.
</UL></UL>
1978 The required client size.
</UL></UL>
1980 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
1981 In place of a single overloaded method name, wxPython
1982 implements the following methods:
<P>
1990 <B>SetClientSize(size)
</B>
1999 <B>SetClientSizeWH(width, height)
</B>
2013 <A NAME=
"wxwindowsetcursor"></A>
2014 <H3>wxWindow::SetCursor
</H3>
2016 <B>virtual void
</B> <B>SetCursor
</B>(
<B>const wxCursor
&</B><I>cursor
</I>)
<P>
2017 Sets the window's cursor. Notice that setting the cursor for this window does
2018 not set it for its children so you'll need to explicitly call SetCursor() for
2019 them too if you need it.
<P>
2020 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2021 <I>cursor
</I><UL><UL>
2022 Specifies the cursor that the window should normally display.
</UL></UL>
2024 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2025 <A HREF=
"wx268.htm#wxsetcursor">::wxSetCursor
</A>,
<A HREF=
"wx59.htm#wxcursor">wxCursor
</A><P>
2028 <A NAME=
"wxwindowseteventhandler"></A>
2029 <H3>wxWindow::SetEventHandler
</H3>
2031 <B>void
</B> <B>SetEventHandler
</B>(
<B>wxEvtHandler*
</B><I>handler
</I>)
<P>
2032 Sets the event handler for this window.
<P>
2033 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2034 <I>handler
</I><UL><UL>
2035 Specifies the handler to be set.
</UL></UL>
2037 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2038 An event handler is an object that is capable of processing the events
2039 sent to a window. By default, the window is its own event handler, but
2040 an application may wish to substitute another, for example to allow
2041 central implementation of event-handling for a variety of different
2043 It is usually better to use
<A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A> since
2044 this sets up a chain of event handlers, where an event not handled by one event handler is
2045 handed to the next one in the chain.
<P>
2046 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2047 <A HREF=
"wx260.htm#wxwindowgeteventhandler">wxWindow::GetEventHandler
</A>,
2048 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PushEventHandler
</A>,
2049 <A HREF=
"wx260.htm#wxwindowpusheventhandler">wxWindow::PopEventHandler
</A>,
2050 <A HREF=
"wx85.htm#wxevthandlerprocessevent">wxEvtHandler::ProcessEvent
</A>,
2051 <A HREF=
"wx85.htm#wxevthandler">wxEvtHandler
</A><P>
2054 <A NAME=
"wxwindowsetconstraints"></A>
2055 <H3>wxWindow::SetConstraints
</H3>
2057 <B>void
</B> <B>SetConstraints
</B>(
<B>wxLayoutConstraints*
</B><I>constraints
</I>)
<P>
2058 Sets the window to have the given layout constraints. The window
2059 will then own the object, and will take care of its deletion.
2060 If an existing layout constraints object is already owned by the
2061 window, it will be deleted.
<P>
2062 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2063 <I>constraints
</I><UL><UL>
2064 The constraints to set. Pass NULL to disassociate and delete the window's
2065 constraints.
</UL></UL>
2067 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2068 You must call
<A HREF=
"wx260.htm#wxwindowsetautolayout">wxWindow::SetAutoLayout
</A> to tell a window to use
2069 the constraints automatically in OnSize; otherwise, you must
2070 override OnSize and call Layout explicitly.
<P>
2073 <A NAME=
"wxwindowsetdroptarget"></A>
2074 <H3>wxWindow::SetDropTarget
</H3>
2076 <B>void
</B> <B>SetDropTarget
</B>(
<B>wxDropTarget*
</B><I> target
</I>)
<P>
2077 Associates a drop target with this window.
<P>
2078 If the window already has a drop target, it is deleted.
<P>
2079 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2080 <A HREF=
"wx260.htm#wxwindowgetdroptarget">wxWindow::GetDropTarget
</A>,
2081 <A HREF=
"wx312.htm#wxdndoverview">Drag and drop overview
</A><P>
2084 <A NAME=
"wxwindowsetfocus"></A>
2085 <H3>wxWindow::SetFocus
</H3>
2087 <B>virtual void
</B> <B>SetFocus
</B>()
<P>
2088 This sets the window to receive keyboard input.
<P>
2091 <A NAME=
"wxwindowsetfont"></A>
2092 <H3>wxWindow::SetFont
</H3>
2094 <B>void
</B> <B>SetFont
</B>(
<B>const wxFont
& </B><I>font
</I>)
<P>
2095 Sets the font for this window.
<P>
2096 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2098 Font to associate with this window.
</UL></UL>
2100 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2101 <A HREF=
"wx260.htm#wxwindowgetfont">wxWindow::GetFont
</A><P>
2104 <A NAME=
"wxwindowsetforegroundcolour"></A>
2105 <H3>wxWindow::SetForegroundColour
</H3>
2107 <B>virtual void
</B> <B>SetForegroundColour
</B>(
<B>const wxColour
& </B><I>colour
</I>)
<P>
2108 Sets the foreground colour of the window.
<P>
2109 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2110 <I>colour
</I><UL><UL>
2111 The colour to be used as the foreground colour.
</UL></UL>
2113 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2114 The interpretation of foreground colour is open to interpretation according
2115 to the window class; it may be the text colour or other colour, or it may not
2117 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2118 <A HREF=
"wx260.htm#wxwindowgetforegroundcolour">wxWindow::GetForegroundColour
</A>,
2119 <A HREF=
"wx260.htm#wxwindowsetbackgroundcolour">wxWindow::SetBackgroundColour
</A>,
2120 <A HREF=
"wx260.htm#wxwindowgetbackgroundcolour">wxWindow::GetBackgroundColour
</A><P>
2123 <A NAME=
"wxwindowsetid"></A>
2124 <H3>wxWindow::SetId
</H3>
2126 <B>void
</B> <B>SetId
</B>(
<B>int
</B><I> id
</I>)
<P>
2127 Sets the identifier of the window.
<P>
2128 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2129 Each window has an integer identifier. If the application has not provided one,
2130 an identifier will be generated. Normally, the identifier should be provided
2131 on creation and should not be modified subsequently.
<P>
2132 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2133 <A HREF=
"wx260.htm#wxwindowgetid">wxWindow::GetId
</A>,
2134 <A HREF=
"wx299.htm#windowids">Window identifiers
</A><P>
2137 <A NAME=
"wxwindowsetname"></A>
2138 <H3>wxWindow::SetName
</H3>
2140 <B>virtual void
</B> <B>SetName
</B>(
<B>const wxString
& </B><I>name
</I>)
<P>
2141 Sets the window's name.
<P>
2142 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2144 A name to set for the window.
</UL></UL>
2146 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2147 <A HREF=
"wx260.htm#wxwindowgetname">wxWindow::GetName
</A><P>
2150 <A NAME=
"wxwindowsetpalette"></A>
2151 <H3>wxWindow::SetPalette
</H3>
2153 <B>virtual void
</B> <B>SetPalette
</B>(
<B>wxPalette*
</B><I>palette
</I>)
<P>
2154 Obsolete - use
<A HREF=
"wx65.htm#wxdcsetpalette">wxDC::SetPalette
</A> instead.
<P>
2157 <A NAME=
"wxwindowsetreturncode"></A>
2158 <H3>wxWindow::SetReturnCode
</H3>
2160 <B>void
</B> <B>SetReturnCode
</B>(
<B>int
</B><I>retCode
</I>)
<P>
2161 Sets the return code for this window.
<P>
2162 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2163 <I>retCode
</I><UL><UL>
2164 The integer return code, usually a control identifier.
</UL></UL>
2166 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2167 A return code is normally associated with a modal dialog, where
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A> returns
2168 a code to the application. The function
<A HREF=
"wx71.htm#wxdialogendmodal">wxDialog::EndModal
</A> calls
<B>SetReturnCode
</B>.
<P>
2169 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2170 <A HREF=
"wx260.htm#wxwindowgetreturncode">wxWindow::GetReturnCode
</A>,
<A HREF=
"wx71.htm#wxdialogshowmodal">wxDialog::ShowModal
</A>,
2171 <A HREF=
"wx71.htm#wxdialogendmodal">wxDialog::EndModal
</A><P>
2174 <A NAME=
"wxwindowsetscrollbar"></A>
2175 <H3>wxWindow::SetScrollbar
</H3>
2177 <B>virtual void
</B> <B>SetScrollbar
</B>(
<B>int
</B><I>orientation
</I>,
<B>int
</B><I>position
</I>,
2178 <B>int
</B><I>thumbSize
</I>,
<B>int
</B><I>range
</I>,
2179 <B>const bool
</B><I>refresh = TRUE
</I>)
<P>
2180 Sets the scrollbar properties of a built-in scrollbar.
<P>
2181 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2182 <I>orientation
</I><UL><UL>
2183 Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
</UL></UL>
2185 <I>position
</I><UL><UL>
2186 The position of the scrollbar in scroll units.
</UL></UL>
2188 <I>thumbSize
</I><UL><UL>
2189 The size of the thumb, or visible portion of the scrollbar, in scroll units.
</UL></UL>
2191 <I>range
</I><UL><UL>
2192 The maximum position of the scrollbar.
</UL></UL>
2194 <I>refresh
</I><UL><UL>
2195 TRUE to redraw the scrollbar, FALSE otherwise.
</UL></UL>
2197 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2198 Let's say you wish to display
50 lines of text, using the same font.
2199 The window is sized so that you can only see
16 lines at a time.
<P>
2202 SetScrollbar(wxVERTICAL,
0,
16,
50);
2205 Note that with the window at this size, the thumb position can never go
2206 above
50 minus
16, or
34.
<P>
2207 You can determine how many lines are currently visible by dividing the current view
2208 size by the character height in pixels.
<P>
2209 When defining your own scrollbar behaviour, you will always need to recalculate
2210 the scrollbar settings when the window size changes. You could therefore put your
2211 scrollbar calculations and SetScrollbar
2212 call into a function named AdjustScrollbars, which can be called initially and also
2213 from your
<A HREF=
"wx260.htm#wxwindowonsize">wxWindow::OnSize
</A> event handler function.
<P>
2214 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2215 <A HREF=
"wx297.htm#scrollingoverview">Scrolling overview
</A>,
2216 <A HREF=
"wx201.htm#wxscrollbar">wxScrollBar
</A>,
<A HREF=
"wx203.htm#wxscrolledwindow">wxScrolledWindow
</A><P>
2219 <A NAME=
"wxwindowsetscrollpos"></A>
2220 <H3>wxWindow::SetScrollPos
</H3>
2222 <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>
2223 Sets the position of one of the built-in scrollbars.
<P>
2224 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2225 <I>orientation
</I><UL><UL>
2226 Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.
</UL></UL>
2229 Position in scroll units.
</UL></UL>
2231 <I>refresh
</I><UL><UL>
2232 TRUE to redraw the scrollbar, FALSE otherwise.
</UL></UL>
2234 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2235 This function does not directly affect the contents of the window: it is up to the
2236 application to take note of scrollbar attributes and redraw contents accordingly.
<P>
2237 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2238 <A HREF=
"wx260.htm#wxwindowsetscrollbar">wxWindow::SetScrollbar
</A>,
2239 <A HREF=
"wx260.htm#wxwindowsetscrollpos">wxWindow::GetScrollPos
</A>,
2240 <A HREF=
"wx260.htm#wxwindowgetscrollthumb">wxWindow::GetScrollThumb
</A>,
2241 <A HREF=
"wx201.htm#wxscrollbar">wxScrollBar
</A>,
<A HREF=
"wx203.htm#wxscrolledwindow">wxScrolledWindow
</A><P>
2244 <A NAME=
"wxwindowsetsize"></A>
2245 <H3>wxWindow::SetSize
</H3>
2247 <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>,
2248 <B>int
</B><I> sizeFlags = wxSIZE_AUTO
</I>)
<P>
2249 <B>virtual void
</B> <B>SetSize
</B>(
<B>const wxRect
&</B><I> rect
</I>)
<P>
2250 Sets the size and position of the window in pixels.
<P>
2251 <B>virtual void
</B> <B>SetSize
</B>(
<B>int
</B><I> width
</I>,
<B>int
</B><I> height
</I>)
<P>
2252 <B>virtual void
</B> <B>SetSize
</B>(
<B>const wxSize
&</B><I> size
</I>)
<P>
2253 Sets the size of the window in pixels.
<P>
2254 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2256 Required x position in pixels, or -
1 to indicate that the existing
2257 value should be used.
</UL></UL>
2260 Required y position in pixels, or -
1 to indicate that the existing
2261 value should be used.
</UL></UL>
2263 <I>width
</I><UL><UL>
2264 Required width in pixels, or -
1 to indicate that the existing
2265 value should be used.
</UL></UL>
2267 <I>height
</I><UL><UL>
2268 Required height position in pixels, or -
1 to indicate that the existing
2269 value should be used.
</UL></UL>
2272 <A HREF=
"wx205.htm#wxsize">wxSize
</A> object for setting the size.
</UL></UL>
2275 <A HREF=
"wx193.htm#wxrect">wxRect
</A> object for setting the position and size.
</UL></UL>
2277 <I>sizeFlags
</I><UL><UL>
2278 Indicates the interpretation of other parameters. It is a bit list of the following:
<P>
2279 <B>wxSIZE_AUTO_WIDTH
</B>: a -
1 width value is taken to indicate
2280 a wxWindows-supplied default width.
<BR>
2282 <B>wxSIZE_AUTO_HEIGHT
</B>: a -
1 height value is taken to indicate
2283 a wxWindows-supplied default width.
<BR>
2285 <B>wxSIZE_AUTO
</B>: -
1 size values are taken to indicate
2286 a wxWindows-supplied default size.
<BR>
2288 <B>wxSIZE_USE_EXISTING
</B>: existing dimensions should be used
2289 if -
1 values are supplied.
<BR>
2291 <B>wxSIZE_ALLOW_MINUS_ONE
</B>: allow dimensions of -
1 and less to be interpreted
2292 as real dimensions, not default values.
2295 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2296 The second form is a convenience for calling the first form with default
2297 x and y parameters, and must be used with non-default width and height values.
<P>
2298 The first form sets the position and optionally size, of the window.
2299 Parameters may be -
1 to indicate either that a default should be supplied
2300 by wxWindows, or that the current value of the dimension should be used.
<P>
2301 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2302 <A HREF=
"wx260.htm#wxwindowmove">wxWindow::Move
</A><P>
2303 <B><FONT COLOR=
"#0000C8">wxPython note:
</FONT></B><BR>
2304 In place of a single overloaded method name, wxPython
2305 implements the following methods:
<P>
2313 <B>SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO)
</B>
2322 <B>SetSize(size)
</B>
2331 <B>SetPosition(point)
</B>
2345 <A NAME=
"wxwindowsetsizehints"></A>
2346 <H3>wxWindow::SetSizeHints
</H3>
2348 <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>,
2349 <B>int
</B><I> incW=-
1</I>,
<B>int
</B><I> incH=-
1</I>)
<P>
2350 Allows specification of minimum and maximum window sizes, and window size increments.
2351 If a pair of values is not set (or set to -
1), the default values will be used.
<P>
2352 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2354 Specifies the minimum width allowable.
</UL></UL>
2357 Specifies the minimum height allowable.
</UL></UL>
2360 Specifies the maximum width allowable.
</UL></UL>
2363 Specifies the maximum height allowable.
</UL></UL>
2366 Specifies the increment for sizing the width (Motif/Xt only).
</UL></UL>
2369 Specifies the increment for sizing the height (Motif/Xt only).
</UL></UL>
2371 <B><FONT COLOR=
"#FF0000">Remarks
</FONT></B><P>
2372 If this function is called, the user will not be able to size the window outside the
2374 The resizing increments are only significant under Motif or Xt.
<P>
2377 <A NAME=
"wxwindowsettitle"></A>
2378 <H3>wxWindow::SetTitle
</H3>
2380 <B>virtual void
</B> <B>SetTitle
</B>(
<B>const wxString
& </B><I>title
</I>)
<P>
2381 Sets the window's title. Applicable only to frames and dialogs.
<P>
2382 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2383 <I>title
</I><UL><UL>
2384 The window's title.
</UL></UL>
2386 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2387 <A HREF=
"wx260.htm#wxwindowgettitle">wxWindow::GetTitle
</A><P>
2390 <A NAME=
"topic1041"></A>
2391 <H3>wxWindow::Show
</H3>
2393 <B>virtual bool
</B> <B>Show
</B>(
<B>const bool
</B><I> show
</I>)
<P>
2394 Shows or hides the window.
<P>
2395 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2397 If TRUE, displays the window and brings it to the front. Otherwise,
2398 hides the window.
</UL></UL>
2400 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2401 <A HREF=
"wx260.htm#wxwindowisshown">wxWindow::IsShown
</A><P>
2404 <A NAME=
"wxwindowtransferdatafromwindow"></A>
2405 <H3>wxWindow::TransferDataFromWindow
</H3>
2407 <B>virtual bool
</B> <B>TransferDataFromWindow
</B>()
<P>
2408 Transfers values from child controls to data areas specified by their validators. Returns
2409 FALSE if a transfer failed.
<P>
2410 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2411 <A HREF=
"wx260.htm#wxwindowtransferdatatowindow">wxWindow::TransferDataToWindow
</A>,
2412 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A>,
<A HREF=
"wx260.htm#wxwindowvalidate">wxWindow::Validate
</A><P>
2415 <A NAME=
"wxwindowtransferdatatowindow"></A>
2416 <H3>wxWindow::TransferDataToWindow
</H3>
2418 <B>virtual bool
</B> <B>TransferDataToWindow
</B>()
<P>
2419 Transfers values to child controls from data areas specified by their validators.
<P>
2420 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
2421 Returns FALSE if a transfer failed.
<P>
2422 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2423 <A HREF=
"wx260.htm#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A>,
2424 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A>,
<A HREF=
"wx260.htm#wxwindowvalidate">wxWindow::Validate
</A><P>
2427 <A NAME=
"wxwindowvalidate"></A>
2428 <H3>wxWindow::Validate
</H3>
2430 <B>virtual bool
</B> <B>Validate
</B>()
<P>
2431 Validates the current values of the child controls using their validators.
<P>
2432 <B><FONT COLOR=
"#FF0000">Return value
</FONT></B><P>
2433 Returns FALSE if any of the validations failed.
<P>
2434 <B><FONT COLOR=
"#FF0000">See also
</FONT></B><P>
2435 <A HREF=
"wx260.htm#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A>,
2436 <A HREF=
"wx260.htm#wxwindowtransferdatafromwindow">wxWindow::TransferDataFromWindow
</A>,
2437 <A HREF=
"wx255.htm#wxvalidator">wxValidator
</A><P>
2440 <A NAME=
"wxwindowwarppointer"></A>
2441 <H3>wxWindow::WarpPointer
</H3>
2443 <B>void
</B> <B>WarpPointer
</B>(
<B>int
</B><I> x
</I>,
<B>int
</B><I> y
</I>)
<P>
2444 Moves the pointer to the given position on the window.
<P>
2445 <B><FONT COLOR=
"#FF0000">Parameters
</FONT></B><P>
2447 The new x position for the cursor.
</UL></UL>
2450 The new y position for the cursor.
</UL></UL>