1 \section{\class{wxWindow
}}\label{wxwindow
}
3 wxWindow is the base class for all windows. Any
4 children of the window will be deleted automatically by the destructor
5 before the window itself is deleted.
7 \wxheading{Derived from
}
9 \helpref{wxEvtHandler
}{wxevthandler
}\\
10 \helpref{wxObject
}{wxobject
}
12 \wxheading{Include files
}
16 \wxheading{Window styles
}
18 The following styles can apply to all windows, although they will not always make sense for a particular
22 \begin{twocollist
}\itemsep=
0pt
23 \twocolitem{\windowstyle{wxSIMPLE
\_BORDER}}{Displays a thin border around the window. wxBORDER is the old name
25 \twocolitem{\windowstyle{wxDOUBLE
\_BORDER}}{Displays a double border. Windows only.
}
26 \twocolitem{\windowstyle{wxSUNKEN
\_BORDER}}{Displays a sunken border.
}
27 \twocolitem{\windowstyle{wxRAISED
\_BORDER}}{Displays a raised border.
}
28 \twocolitem{\windowstyle{wxSTATIC
\_BORDER}}{Displays a border suitable for a static control.
}
29 \twocolitem{\windowstyle{wxTRANSPARENT
\_WINDOW}}{The window is transparent, that is, it will not receive paint
30 events. Windows only.
}
31 \twocolitem{\windowstyle{wxNO
\_3D}}{Prevents the children of this window taking on
3D styles, even though
32 the application-wide policy is for
3D controls. Windows only.
}
33 \twocolitem{\windowstyle{wxTAB
\_TRAVERSAL}}{Use this to enable tab traversal for non-dialog windows.
}
34 \twocolitem{\windowstyle{wxVSCROLL
}}{Use this style to enable a vertical scrollbar.
}
35 \twocolitem{\windowstyle{wxHSCROLL
}}{Use this style to enable a horizontal scrollbar.
}
36 \twocolitem{\windowstyle{wxCLIP
\_CHILDREN}}{Use this style to eliminate flicker caused by the background being
37 repainted, then children being painted over them. Windows-only.
}
40 See also
\helpref{window styles overview
}{windowstyles
}.
44 \helpref{Event handling overview
}{eventhandlingoverview
}
46 \latexignore{\rtfignore{\wxheading{Members
}}}
48 \membersection{wxWindow::wxWindow
}
50 \func{}{wxWindow
}{\void}
54 \func{}{wxWindow
}{\param{wxWindow*
}{ parent
},
\param{wxWindowID
}{id
},
55 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
56 \param{const wxSize\&
}{size = wxDefaultSize
},
57 \param{long
}{style =
0},
58 \param{const wxString\&
}{name = wxPanelNameStr
}}
60 Constructs a window, which can be a child of a frame, dialog or any other non-control window.
62 \wxheading{Parameters
}
64 \docparam{parent
}{Pointer to a parent window.
}
66 \docparam{id
}{Window identifier. If -
1, will automatically create an identifier.
}
68 \docparam{pos
}{Window position. wxDefaultPosition is (-
1, -
1) which indicates that wxWindows
69 should generate a default position for the window. If using the wxWindow class directly, supply
72 \docparam{size
}{Window size. wxDefaultSize is (-
1, -
1) which indicates that wxWindows
73 should generate a default size for the window.
}
75 \docparam{style
}{Window style. For generic window styles, please see
\helpref{wxWindow
}{wxwindow
}.
}
77 \docparam{name
}{Window name.
}
79 \membersection{wxWindow::
\destruct{wxWindow
}}
81 \func{}{\destruct{wxWindow
}}{\void}
83 Destructor. Deletes all subwindows, then deletes itself. Instead of using
84 the
{\bf delete
} operator explicitly, you should normally
85 use
\helpref{wxWindow::Destroy
}{wxwindowdestroy
} so that wxWindows
86 can delete a window only when it is safe to do so, in idle time.
90 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
91 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
92 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
93 \helpref{wxCloseEvent
}{wxcloseevent
}
95 \membersection{wxWindow::AddChild
}
97 \func{virtual void
}{AddChild
}{\param{wxWindow*
}{child
}}
99 Adds a child window. This is called automatically by window creation
100 functions so should not be required by the application programmer.
102 \wxheading{Parameters
}
104 \docparam{child
}{Child window to add.
}
106 \membersection{wxWindow::CaptureMouse
}\label{wxwindowcapturemouse
}
108 \func{virtual void
}{CaptureMouse
}{\void}
110 Directs all mouse input to this window. Call
\helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
} to
115 \helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
}
117 \membersection{wxWindow::Center
}\label{wxwindowcenter
}
119 \func{void
}{Center
}{\param{int
}{ direction
}}
121 A synonym for
\helpref{Centre
}{wxwindowcentre
}.
123 \membersection{wxWindow::Centre
}\label{wxwindowcentre
}
125 \func{virtual void
}{Centre
}{\param{int
}{ direction = wxHORIZONTAL
}}
129 \wxheading{Parameters
}
131 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
136 The actual behaviour depends on the derived window. For a frame or dialog box,
137 centring is relative to the whole display. For a panel item, centring is
138 relative to the panel.
142 \helpref{wxWindow::Center
}{wxwindowcenter
}
144 \membersection{wxWindow::Clear
}\label{wxwindowclear
}
146 \func{void
}{Clear
}{\void}
148 Clears the window by filling it with the current background colour. Does not
149 cause an erase background event to be generated.
151 \membersection{wxWindow::ClientToScreen
}
153 \constfunc{virtual void
}{ClientToScreen
}{\param{int*
}{x
},
\param{int*
}{y
}}
155 \constfunc{virtual wxPoint
}{ClientToScreen
}{\param{const wxPoint\&
}{ pt
}}
157 Converts to screen coordinates from coordinates relative to this window.
159 \docparam{x
}{A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
160 a screen coordinate will be passed out.
}
162 \docparam{y
}{A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
163 a screen coordinate will be passed out.
}
165 \docparam{pt
}{The client position for the second form of the function.
}
167 \pythonnote{In place of a single overloaded method name, wxPython
168 implements the following methods:
\par
169 \indented{2cm
}{\begin{twocollist
}
170 \twocolitem{\bf{ClientToScreen(point)
}}{Accepts and returns a wxPoint
}
171 \twocolitem{\bf{ClientToScreenXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
176 \membersection{wxWindow::Close
}\label{wxwindowclose
}
178 \func{virtual bool
}{Close
}{\param{const bool
}{ force = FALSE
}}
180 The purpose of this call is to provide a safer way of destroying a window than using
181 the
{\it delete
} operator.
183 \wxheading{Parameters
}
185 \docparam{force
}{FALSE if the window's close handler should be able to veto the destruction
186 of this window, TRUE if it cannot.
}
190 Close calls the
\helpref{close handler
}{wxcloseevent
} for the window, providing an opportunity for the window to
191 choose whether to destroy the window.
193 The close handler should check whether the window is being deleted forcibly,
194 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}, in which case it should
195 destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
197 Applies to managed windows (wxFrame and wxDialog classes) only.
201 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
202 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
203 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
204 \helpref{wxCloseEvent
}{wxcloseevent
}
206 \membersection{wxWindow::ConvertDialogToPixels
}\label{wxwindowconvertdialogtopixels
}
208 \func{wxPoint
}{ConvertDialogToPixels
}{\param{const wxPoint\&
}{ pt
}}
210 \func{wxSize
}{ConvertDialogToPixels
}{\param{const wxSize\&
}{ sz
}}
212 Converts a point or size from dialog units to pixels.
214 For the x dimension, the dialog units are multiplied by the average character width
215 and then divided by
4.
217 For the y dimension, the dialog units are multiplied by the average character height
218 and then divided by
8.
222 Dialog units are used for maintaining a dialog's proportions even if the font changes.
223 Dialogs created using Dialog Editor optionally use dialog units.
225 You can also use these functions programmatically. A convenience macro is defined:
229 #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
235 \helpref{wxWindow::ConvertPixelsToDialog
}{wxwindowconvertpixelstodialog
}
237 \pythonnote{In place of a single overloaded method name, wxPython
238 implements the following methods:
\par
239 \indented{2cm
}{\begin{twocollist
}
240 \twocolitem{\bf{ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
241 \twocolitem{\bf{ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
244 Additionally, the following helper functions are defined:
\par
245 \indented{2cm
}{\begin{twocollist
}
246 \twocolitem{\bf{wxDLG_PNT(win, point)
}}{Converts a wxPoint from dialog
248 \twocolitem{\bf{wxDLG_SZE(win, size)
}}{Converts a wxSize from dialog
254 \membersection{wxWindow::ConvertPixelsToDialog
}\label{wxwindowconvertpixelstodialog
}
256 \func{wxPoint
}{ConvertPixelsToDialog
}{\param{const wxPoint\&
}{ pt
}}
258 \func{wxSize
}{ConvertPixelsToDialog
}{\param{const wxSize\&
}{ sz
}}
260 Converts a point or size from pixels to dialog units.
262 For the x dimension, the pixels are multiplied by
4 and then divided by the average
265 For the y dimension, the pixels are multipled by
8 and then divided by the average
270 Dialog units are used for maintaining a dialog's proportions even if the font changes.
271 Dialogs created using Dialog Editor optionally use dialog units.
275 \helpref{wxWindow::ConvertDialogToPixels
}{wxwindowconvertdialogtopixels
}
278 \pythonnote{In place of a single overloaded method name, wxPython
279 implements the following methods:
\par
280 \indented{2cm
}{\begin{twocollist
}
281 \twocolitem{\bf{ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
282 \twocolitem{\bf{ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
286 \membersection{wxWindow::Destroy
}\label{wxwindowdestroy
}
288 \func{virtual bool
}{Destroy
}{\void}
290 Destroys the window safely. Use this function instead of the delete operator, since
291 different window classes can be destroyed differently. Frames and dialogs
292 are not destroyed immediately when this function is called - they are added
293 to a list of windows to be deleted on idle time, when all the window's events
294 have been processed. This prevents problems with events being sent to non-existant
297 \wxheading{Return value
}
299 TRUE if the window has either been successfully deleted, or it has been added
300 to the list of windows pending real deletion.
302 \membersection{wxWindow::DestroyChildren
}
304 \func{virtual void
}{DestroyChildren
}{\void}
306 Destroys all children of a window. Called automatically by the destructor.
308 \membersection{wxWindow::DragAcceptFiles
}\label{wxwindowdragacceptfiles
}
310 \func{virtual void
}{DragAcceptFiles
}{\param{const bool
}{ accept
}}
312 Enables or disables elibility for drop file events (OnDropFiles).
314 \wxheading{Parameters
}
316 \docparam{accept
}{If TRUE, the window is eligible for drop file events. If FALSE, the window
317 will not accept drop file events.
}
325 \helpref{wxWindow::OnDropFiles
}{wxwindowondropfiles
}
327 \membersection{wxWindow::Enable
}\label{wxwindowenable
}
329 \func{virtual void
}{Enable
}{\param{const bool
}{ enable
}}
331 Enable or disable the window for user input.
333 \wxheading{Parameters
}
335 \docparam{enable
}{If TRUE, enables the window for input. If FALSE, disables the window.
}
339 \helpref{wxWindow::IsEnabled
}{wxwindowisenabled
}
341 \membersection{wxWindow::FindFocus
}\label{wxwindowfindfocus
}
343 \func{static wxWindow*
}{FindFocus
}{\void}
345 Finds the window or control which currently has the keyboard focus.
349 Note that this is a static function, so it can be called without needing a wxWindow pointer.
353 \helpref{wxWindow::SetFocus
}{wxwindowsetfocus
}
355 \membersection{wxWindow::FindWindow
}\label{wxwindowfindwindow
}
357 \func{wxWindow*
}{FindWindow
}{\param{long
}{ id
}}
359 Find a child of this window, by identifier.
361 \func{wxWindow*
}{FindWindow
}{\param{const wxString\&
}{ name
}}
363 Find a child of this window, by name.
365 \pythonnote{In place of a single overloaded method name, wxPython
366 implements the following methods:
\par
367 \indented{2cm
}{\begin{twocollist
}
368 \twocolitem{\bf{FindWindowById(id)
}}{Accepts an integer
}
369 \twocolitem{\bf{FindWindowByName(name)
}}{Accepts a string
}
373 \membersection{wxWindow::Fit
}\label{wxwindowfit
}
375 \func{virtual void
}{Fit
}{\void}
377 Sizes the window so that it fits around its subwindows.
379 \membersection{wxWindow::GetBackgroundColour
}\label{wxwindowgetbackgroundcolour
}
381 \constfunc{virtual wxColour
}{GetBackgroundColour
}{\void}
383 Returns the background colour of the window.
387 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
388 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
389 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
390 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
}
392 \membersection{wxWindow::GetCharHeight
}
394 \constfunc{virtual int
}{GetCharHeight
}{\void}
396 Returns the character height for this window.
398 \membersection{wxWindow::GetCharWidth
}
400 \constfunc{virtual int
}{GetCharWidth
}{\void}
402 Returns the average character width for this window.
404 \membersection{wxWindow::GetChildren
}
406 \func{wxList\&
}{GetChildren
}{\void}
408 Returns a reference to the list of the window's children.
410 \membersection{wxWindow::GetClientSize
}\label{wxwindowgetclientsize
}
412 \constfunc{virtual void
}{GetClientSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
414 \constfunc{virtual wxSize
}{GetClientSize
}{\void}
416 This gets the size of the window `client area' in pixels. The client area is the
417 area which may be drawn on by the programmer, excluding title bar, border etc.
419 \wxheading{Parameters
}
421 \docparam{width
}{Receives the client width in pixels.
}
423 \docparam{height
}{Receives the client height in pixels.
}
425 \pythonnote{In place of a single overloaded method name, wxPython
426 implements the following methods:
\par
427 \indented{2cm
}{\begin{twocollist
}
428 \twocolitem{\bf{wxGetClientSizeTuple()
}}{Returns a
2-tuple of (width, height)
}
429 \twocolitem{\bf{wxGetClientSize()
}}{Returns a wxSize object
}
433 \membersection{wxWindow::GetConstraints
}\label{wxwindowgetconstraints
}
435 \constfunc{wxLayoutConstraints*
}{GetConstraints
}{\void}
437 Returns a pointer to the window's layout constraints, or NULL if there are none.
439 \membersection{wxWindow::GetDefaultItem
}\label{wxwindowgetdefaultitem
}
441 \constfunc{wxButton*
}{GetDefaultItem
}{\void}
443 Returns a pointer to the button which is the default for this window, or NULL.
445 \membersection{wxWindow::GetDropTarget
}\label{wxwindowgetdroptarget
}
447 \constfunc{wxDropTarget*
}{GetDropTarget
}{\void}
449 Returns the associated drop target, which may be NULL.
453 \helpref{wxWindow::SetDropTarget
}{wxwindowsetdroptarget
},
454 \helpref{Drag and drop overview
}{wxdndoverview
}
456 \membersection{wxWindow::GetEventHandler
}\label{wxwindowgeteventhandler
}
458 \constfunc{wxEvtHandler*
}{GetEventHandler
}{\void}
460 Returns the event handler for this window. By default, the window is its
465 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
466 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
467 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
468 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
469 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
471 \membersection{wxWindow::GetFont
}\label{wxwindowgetfont
}
473 \constfunc{wxFont\&
}{GetFont
}{\void}
475 Returns a reference to the font for this window.
479 \helpref{wxWindow::SetFont
}{wxwindowsetfont
}
481 \membersection{wxWindow::GetForegroundColour
}\label{wxwindowgetforegroundcolour
}
483 \func{virtual wxColour
}{GetForegroundColour
}{\void}
485 Returns the foreground colour of the window.
489 The interpretation of foreground colour is open to interpretation according
490 to the window class; it may be the text colour or other colour, or it may not
495 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
496 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
497 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
499 \membersection{wxWindow::GetGrandParent
}
501 \constfunc{wxWindow*
}{GetGrandParent
}{\void}
503 Returns the grandparent of a window, or NULL if there isn't one.
505 \membersection{wxWindow::GetHandle
}
507 \constfunc{void*
}{GetHandle
}{\void}
509 Returns the platform-specific handle of the physical window. Cast it to an appropriate
510 handle, such as
{\bf HWND
} for Windows or
{\bf Widget
} for Motif.
512 \membersection{wxWindow::GetId
}\label{wxwindowgetid
}
514 \constfunc{int
}{GetId
}{\void}
516 Returns the identifier of the window.
520 Each window has an integer identifier. If the application has not provided one,
521 an identifier will be generated.
525 \helpref{wxWindow::SetId
}{wxwindowsetid
}\rtfsp
526 \helpref{Window identifiers
}{windowids
}
528 \membersection{wxWindow::GetPosition
}
530 \constfunc{virtual void
}{GetPosition
}{\param{int*
}{x
},
\param{int*
}{y
}}
532 This gets the position of the window in pixels, relative to the parent window or
533 if no parent, relative to the whole display.
535 \wxheading{Parameters
}
537 \docparam{x
}{Receives the x position of the window.
}
539 \docparam{y
}{Receives the y position of the window.
}
541 \pythonnote{In place of a single overloaded method name, wxPython
542 implements the following methods:
\par
543 \indented{2cm
}{\begin{twocollist
}
544 \twocolitem{\bf{GetPosition()
}}{Returns a wxPoint
}
545 \twocolitem{\bf{GetPositionTuple()
}}{Returns a tuple (x, y)
}
549 \membersection{wxWindow::GetLabel
}
551 \constfunc{virtual wxString\&
}{GetLabel
}{\void}
553 Generic way of getting a label from any window, for
554 identification purposes.
558 The interpretation of this function differs from class to class.
559 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
560 the button text. This function can be useful for meta-programs (such as testing
561 tools or special-needs access programs) which need to identify windows
564 \membersection{wxWindow::GetName
}\label{wxwindowgetname
}
566 \constfunc{virtual wxString\&
}{GetName
}{\void}
568 Returns the window's name.
572 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
573 name in the window constructor or via
\helpref{wxWindow::SetName
}{wxwindowsetname
}.
577 \helpref{wxWindow::SetName
}{wxwindowsetname
}
579 \membersection{wxWindow::GetParent
}
581 \constfunc{virtual wxWindow*
}{GetParent
}{\void}
583 Returns the parent of the window, or NULL if there is no parent.
585 \membersection{wxWindow::GetRect
}\label{wxwindowgetrect
}
587 \constfunc{virtual wxRect
}{GetRect
}{\void}
589 Returns the size and position of the window as a
\helpref{wxRect
}{wxrect
} object.
591 \membersection{wxWindow::GetReturnCode
}\label{wxwindowgetreturncode
}
593 \func{int
}{GetReturnCode
}{\void}
595 Gets the return code for this window.
599 A return code is normally associated with a modal dialog, where
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
} returns
600 a code to the application.
604 \helpref{wxWindow::SetReturnCode
}{wxwindowsetreturncode
},
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
},
\rtfsp
605 \helpref{wxDialog::EndModal
}{wxdialogendmodal
}
607 \membersection{wxWindow::GetScrollThumb
}\label{wxwindowgetscrollthumb
}
609 \func{virtual int
}{GetScrollThumb
}{\param{int
}{orientation
}}
611 Returns the built-in scrollbar thumb size.
615 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
617 \membersection{wxWindow::GetScrollPos
}\label{wxwindowgetscrollpos
}
619 \func{virtual int
}{GetScrollPos
}{\param{int
}{orientation
}}
621 Returns the built-in scrollbar position.
625 See
\helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
627 \membersection{wxWindow::GetScrollRange
}\label{wxwindowgetscrollrange
}
629 \func{virtual int
}{GetScrollRange
}{\param{int
}{orientation
}}
631 Returns the built-in scrollbar range.
635 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
637 \membersection{wxWindow::GetSize
}\label{wxwindowgetsize
}
639 \constfunc{virtual void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
641 \constfunc{virtual wxSize
}{GetSize
}{\void}
643 This gets the size of the entire window in pixels.
645 \wxheading{Parameters
}
647 \docparam{width
}{Receives the window width.
}
649 \docparam{height
}{Receives the window height.
}
651 \pythonnote{In place of a single overloaded method name, wxPython
652 implements the following methods:
\par
653 \indented{2cm
}{\begin{twocollist
}
654 \twocolitem{\bf{GetSize()
}}{Returns a wxSize
}
655 \twocolitem{\bf{GetSizeTuple()
}}{Returns a
2-tuple (width, height)
}
659 \membersection{wxWindow::GetTextExtent
}
661 \constfunc{virtual void
}{GetTextExtent
}{\param{const wxString\&
}{string
},
\param{int*
}{x
},
\param{int*
}{y
},
662 \param{int*
}{descent = NULL
},
\param{int*
}{externalLeading = NULL
},
663 \param{const wxFont*
}{font = NULL
},
\param{const bool
}{ use16 = FALSE
}}
665 Gets the dimensions of the string as it would be drawn on the
666 window with the currently selected font.
668 \wxheading{Parameters
}
670 \docparam{string
}{String whose extent is to be measured.
}
672 \docparam{x
}{Return value for width.
}
674 \docparam{y
}{Return value for height.
}
676 \docparam{descent
}{Return value for descent (optional).
}
678 \docparam{externalLeading
}{Return value for external leading (optional).
}
680 \docparam{font
}{Font to use instead of the current window font (optional).
}
682 \docparam{use16
}{If TRUE,
{\it string
} contains
16-bit characters. The default is FALSE.
}
685 \pythonnote{In place of a single overloaded method name, wxPython
686 implements the following methods:
\par
687 \indented{2cm
}{\begin{twocollist
}
688 \twocolitem{\bf{GetTextExtent(string)
}}{Returns a
2-tuple, (width, height)
}
689 \twocolitem{\bf{GetFullTextExtent(string, font=NULL)
}}{Returns a
690 4-tuple, (width, height, descent, externalLeading)
}
695 \membersection{wxWindow::GetTitle
}\label{wxwindowgettitle
}
697 \func{virtual wxString
}{GetTitle
}{\void}
699 Gets the window's title. Applicable only to frames and dialogs.
703 \helpref{wxWindow::SetTitle
}{wxwindowsettitle
}
705 \membersection{wxWindow::GetUpdateRegion
}\label{wxwindowgetupdateregion
}
707 \constfunc{virtual wxRegion
}{GetUpdateRegion
}{\void}
709 Returns the region specifying which parts of the window have been damaged. Should
710 only be called within an
\helpref{OnPaint
}{wxwindowonpaint
} event handler.
714 \helpref{wxRegion
}{wxregion
},
\helpref{wxRegionIterator
}{wxregioniterator
},
\helpref{wxWindow::OnPaint
}{wxwindowonpaint
}
716 \membersection{wxWindow::GetWindowStyleFlag
}
718 \constfunc{long
}{GetWindowStyleFlag
}{\void}
720 Gets the window style that was passed to the consructor or
{\bf Create
} member.
722 \membersection{wxWindow::InitDialog
}\label{wxwindowinitdialog
}
724 \func{void
}{InitDialog
}{\void}
726 Sends an
\helpref{wxWindow::OnInitDialog
}{wxwindowoninitdialog
} event, which
727 in turn transfers data to the dialog via validators.
731 \helpref{wxWindow::OnInitDialog
}{wxwindowoninitdialog
}
733 \membersection{wxWindow::IsEnabled
}\label{wxwindowisenabled
}
735 \constfunc{virtual bool
}{IsEnabled
}{\void}
737 Returns TRUE if the window is enabled for input, FALSE otherwise.
741 \helpref{wxWindow::Enable
}{wxwindowenable
}
743 \membersection{wxWindow::IsRetained
}\label{wxwindowisretained
}
745 \constfunc{virtual bool
}{IsRetained
}{\void}
747 Returns TRUE if the window is retained, FALSE otherwise.
751 Retained windows are only available on X platforms.
753 \membersection{wxWindow::IsShown
}\label{wxwindowisshown
}
755 \constfunc{virtual bool
}{IsShown
}{\void}
757 Returns TRUE if the window is shown, FALSE if it has been hidden.
759 \membersection{wxWindow::Layout
}\label{wxwindowlayout
}
761 \func{void
}{Layout
}{\void}
763 Invokes the constraint-based layout algorithm for this window. It is called
764 automatically by the default
{\bf wxWindow::OnSize
} member.
766 \membersection{wxWindow::LoadFromResource
}\label{wxwindowloadfromresource
}
768 \func{virtual bool
}{LoadFromResource
}{\param{wxWindow*
}{parent
},
\rtfsp
769 \param{const wxString\&
}{resourceName
},
\param{const wxResourceTable*
}{resourceTable = NULL
}}
771 Loads a panel or dialog from a resource file.
773 \wxheading{Parameters
}
775 \docparam{parent
}{Parent window.
}
777 \docparam{resourceName
}{The name of the resource to load.
}
779 \docparam{resourceTable
}{The resource table to load it from. If this is NULL, the
780 default resource table will be used.
}
782 \wxheading{Return value
}
784 TRUE if the operation succeeded, otherwise FALSE.
786 \membersection{wxWindow::Lower
}\label{wxwindowlower
}
788 \func{void
}{Lower
}{\void}
790 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
793 \membersection{wxWindow::MakeModal
}\label{wxwindowmakemodal
}
795 \func{virtual void
}{MakeModal
}{\param{const bool
}{flag
}}
797 Disables all other windows in the application so that
798 the user can only interact with this window.
800 \wxheading{Parameters
}
802 \docparam{flag
}{If TRUE, this call disables all other windows in the application so that
803 the user can only interact with this window. If FALSE, the effect is reversed.
}
805 \membersection{wxWindow::Move
}\label{wxwindowmove
}
807 \func{void
}{Move
}{\param{int
}{ x
},
\param{int
}{ y
}}
809 \func{void
}{Move
}{\param{const wxPoint\&
}{ pt
}}
811 Moves the window to the given position.
813 \wxheading{Parameters
}
815 \docparam{x
}{Required x position.
}
817 \docparam{y
}{Required y position.
}
819 \docparam{pt
}{\helpref{wxPoint
}{wxpoint
} object representing the position.
}
823 Implementations of SetSize can also implicitly implement the
824 wxWindow::Move function, which is defined in the base wxWindow class
828 SetSize(x, y, -
1, -
1, wxSIZE_USE_EXISTING);
833 \helpref{wxWindow::SetSize
}{wxwindowsetsize
}
835 \pythonnote{In place of a single overloaded method name, wxPython
836 implements the following methods:
\par
837 \indented{2cm
}{\begin{twocollist
}
838 \twocolitem{\bf{Move(point)
}}{Accepts a wxPoint
}
839 \twocolitem{\bf{MoveXY(x, y)
}}{Accepts a pair of integers
}
843 \membersection{wxWindow::OnActivate
}\label{wxwindowonactivate
}
845 \func{void
}{OnActivate
}{\param{wxActivateEvent\&
}{ event
}}
847 Called when a window is activated or deactivated.
849 \wxheading{Parameters
}
851 \docparam{event
}{Object containing activation information.
}
855 If the window is being activated,
\helpref{wxActivateEvent::GetActive
}{wxactivateeventgetactive
} returns TRUE,
856 otherwise it returns FALSE (it is being deactivated).
860 \helpref{wxActivateEvent
}{wxactivateevent
},
\rtfsp
861 \helpref{Event handling overview
}{eventhandlingoverview
}
863 \membersection{wxWindow::OnChar
}\label{wxwindowonchar
}
865 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
867 Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
869 \wxheading{Parameters
}
871 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
872 details about this class.
}
876 This member function is called in response to a keypress. To intercept this event,
877 use the EVT
\_CHAR macro in an event table definition. Your
{\bf OnChar
} handler may call this
878 default function to achieve default keypress functionality.
880 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
883 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
884 keypresses, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
885 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
887 Most, but not all, windows allow keypresses to be intercepted.
891 \helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
\helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
},
\rtfsp
892 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
893 \helpref{Event handling overview
}{eventhandlingoverview
}
895 \membersection{wxWindow::OnCharHook
}\label{wxwindowoncharhook
}
897 \func{void
}{OnCharHook
}{\param{wxKeyEvent\&
}{ event
}}
899 This member is called to allow the window to intercept keyboard events
900 before they are processed by child windows.
902 \wxheading{Parameters
}
904 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
905 details about this class.
}
909 This member function is called in response to a keypress, if the window is active. To intercept this event,
910 use the EVT
\_CHAR\_HOOK macro in an event table definition. If you do not process a particular
911 keypress, call
\helpref{wxEvent::Skip
}{wxeventskip
} to allow default processing.
913 An example of using this function is in the implementation of escape-character processing for wxDialog,
914 where pressing ESC dismisses the dialog by
{\bf OnCharHook
} 'forging' a cancel button press event.
916 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
919 This function is only relevant to top-level windows (frames and dialogs), and under
924 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
925 \helpref{wxApp::OnCharHook
}{wxapponcharhook
},
\rtfsp
926 \helpref{Event handling overview
}{eventhandlingoverview
}
928 \membersection{wxWindow::OnCommand
}\label{wxwindowoncommand
}
930 \func{virtual void
}{OnCommand
}{\param{wxEvtHandler\&
}{object
},
\param{wxCommandEvent\&
}{event
}}
932 This virtual member function is called if the control does not handle the command event.
934 \wxheading{Parameters
}
936 \docparam{object
}{Object receiving the command event.
}
938 \docparam{event
}{Command event
}
942 This virtual function is provided mainly for backward compatibility. You can also intercept commands
943 from child controls by using an event table, with identifiers or identifier ranges to identify
944 the control(s) in question.
948 \helpref{wxCommandEvent
}{wxcommandevent
},
\rtfsp
949 \helpref{Event handling overview
}{eventhandlingoverview
}
951 \membersection{wxWindow::OnClose
}\label{wxwindowonclose
}
953 \func{virtual bool
}{OnClose
}{\void}
955 Called when the user has tried to close a a frame
956 or dialog box using the window manager (X) or system menu (Windows).
958 {\bf Note:
} This is an obsolete function.
959 It is superceded by the
\helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
} event
962 \wxheading{Return value
}
964 If TRUE is returned by OnClose, the window will be deleted by the system, otherwise the
965 attempt will be ignored. Do not delete the window from within this handler, although
966 you may delete other windows.
970 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
971 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
972 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
973 \helpref{wxCloseEvent
}{wxcloseevent
}
975 \membersection{wxWindow::OnCloseWindow
}\label{wxwindowonclosewindow
}
977 \func{void
}{OnCloseWindow
}{\param{wxCloseEvent\&
}{event
}}
979 This is an event handler function called when the user has tried to close a a frame
980 or dialog box using the window manager (X) or system menu (Windows). It is
981 called via the
\helpref{wxWindow::Close
}{wxwindowclose
} function, so
982 that the application can also invoke the handler programmatically.
984 Use the EVT
\_CLOSE event table macro to handle close events.
986 You should check whether the application is forcing the deletion of the window
987 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}. If this is TRUE,
988 destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
989 If not, it is up to you whether you respond by destroying the window.
991 (Note: GetForce is now superceded by CanVeto. So to test whether forced destruction of
992 the window is required, test for the negative of CanVeto. If CanVeto returns FALSE,
993 it is not possible to skip window deletion.)
995 If you don't destroy the window, you should call
\helpref{wxCloseEvent::Veto
}{wxcloseeventveto
} to
996 let the calling code know that you did not destroy the window. This allows the
\helpref{wxWindow::Close
}{wxwindowclose
} function
997 to return TRUE or FALSE depending on whether the close instruction was honoured or not.
1001 The
\helpref{wxWindow::OnClose
}{wxwindowonclose
} virtual function remains
1002 for backward compatibility with earlier versions of wxWindows. The
1003 default
{\bf OnCloseWindow
} handler for wxFrame and wxDialog will call
{\bf OnClose
},
1004 destroying the window if it returns TRUE or if the close is being forced.
1006 \wxheading{See also
}
1008 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
1009 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
1010 \helpref{wxWindow::OnClose
}{wxwindowonclose
},
\rtfsp
1011 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
1012 \helpref{wxCloseEvent
}{wxcloseevent
},
\rtfsp
1013 \helpref{wxApp::OnQueryEndSession
}{wxapponqueryendsession
},
\rtfsp
1014 \helpref{wxApp::OnEndSession
}{wxapponendsession
}
1016 \membersection{wxWindow::OnDropFiles
}\label{wxwindowondropfiles
}
1018 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{ event
}}
1020 Called when files have been dragged from the file manager to the window.
1022 \wxheading{Parameters
}
1024 \docparam{event
}{Drop files event. For more information, see
\helpref{wxDropFilesEvent
}{wxdropfilesevent
}.
}
1028 The window must have previously been enabled for dropping by calling
1029 \rtfsp\helpref{wxWindow::DragAcceptFiles
}{wxwindowdragacceptfiles
}.
1031 This event is only generated under Windows.
1033 To intercept this event, use the EVT
\_DROP\_FILES macro in an event table definition.
1035 \wxheading{See also
}
1037 \helpref{wxDropFilesEvent
}{wxdropfilesevent
},
\helpref{wxWindow::DragAcceptFiles
}{wxwindowdragacceptfiles
},
\rtfsp
1038 \helpref{Event handling overview
}{eventhandlingoverview
}
1040 \membersection{wxWindow::OnEraseBackground
}\label{wxwindowonerasebackground
}
1042 \func{void
}{OnEraseBackground
}{\param{wxEraseEvent\&
}{ event
}}
1044 Called when the background of the window needs to be erased.
1046 \wxheading{Parameters
}
1048 \docparam{event
}{Erase background event. For more information, see
\helpref{wxEraseEvent
}{wxeraseevent
}.
}
1052 This event is only generated under Windows.
1054 To intercept this event, use the EVT
\_ERASE\_BACKGROUND macro in an event table definition.
1056 \wxheading{See also
}
1058 \helpref{wxEraseEvent
}{wxeraseevent
},
\helpref{Event handling overview
}{eventhandlingoverview
}
1060 \membersection{wxWindow::OnKeyDown
}\label{wxwindowonkeydown
}
1062 \func{void
}{OnKeyDown
}{\param{wxKeyEvent\&
}{ event
}}
1064 Called when the user has pressed a key, before it is translated into an ASCII value using other
1065 modifier keys that might be pressed at the same time.
1067 \wxheading{Parameters
}
1069 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
1070 details about this class.
}
1074 This member function is called in response to a key down event. To intercept this event,
1075 use the EVT
\_KEY\_DOWN macro in an event table definition. Your
{\bf OnKeyDown
} handler may call this
1076 default function to achieve default keypress functionality.
1078 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1079 keys, such as shift, control, and function keys, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
1080 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
1082 Most, but not all, windows allow keypresses to be intercepted.
1084 \wxheading{See also
}
1086 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
\helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
},
\rtfsp
1087 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
1088 \helpref{Event handling overview
}{eventhandlingoverview
}
1090 \membersection{wxWindow::OnKeyUp
}\label{wxwindowonkeyup
}
1092 \func{void
}{OnKeyUp
}{\param{wxKeyEvent\&
}{ event
}}
1094 Called when the user has released a key.
1096 \wxheading{Parameters
}
1098 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
1099 details about this class.
}
1103 This member function is called in response to a key up event. To intercept this event,
1104 use the EVT
\_KEY\_UP macro in an event table definition. Your
{\bf OnKeyUp
} handler may call this
1105 default function to achieve default keypress functionality.
1107 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1108 keys, such as shift, control, and function keys, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
1109 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
1111 Most, but not all, windows allow key up events to be intercepted.
1113 \wxheading{See also
}
1115 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
\rtfsp
1116 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
1117 \helpref{Event handling overview
}{eventhandlingoverview
}
1119 \membersection{wxWindow::OnKillFocus
}\label{wxwindowonkillfocus
}
1121 \func{void
}{OnKillFocus
}{\param{wxFocusEvent\&
}{event
}}
1123 Called when a window's focus is being killed.
1125 \wxheading{Parameters
}
1127 \docparam{event
}{The focus event. For more information, see
\helpref{wxFocusEvent
}{wxfocusevent
}.
}
1131 To intercept this event, use the macro EVT
\_KILL\_FOCUS in an event table definition.
1133 Most, but not all, windows respond to this event.
1135 \wxheading{See also
}
1137 \helpref{wxFocusEvent
}{wxfocusevent
},
\helpref{wxWindow::OnSetFocus
}{wxwindowonsetfocus
},
\rtfsp
1138 \helpref{Event handling overview
}{eventhandlingoverview
}
1140 \membersection{wxWindow::OnIdle
}\label{wxwindowonidle
}
1142 \func{void
}{OnIdle
}{\param{wxIdleEvent\&
}{event
}}
1144 Provide this member function for any processing which needs to be done
1145 when the application is idle.
1147 \wxheading{See also
}
1149 \helpref{wxApp::OnIdle
}{wxapponidle
},
\helpref{wxIdleEvent
}{wxidleevent
}
1151 \membersection{wxWindow::OnInitDialog
}\label{wxwindowoninitdialog
}
1153 \func{void
}{OnInitDialog
}{\param{wxInitDialogEvent\&
}{ event
}}
1155 Default handler for the wxEVT
\_INIT\_DIALOG event. Calls
\helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
}.
1157 \wxheading{Parameters
}
1159 \docparam{event
}{Dialog initialisation event.
}
1163 Gives the window the default behaviour of transferring data to child controls via
1164 the validator that each control has.
1166 \wxheading{See also
}
1168 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
}
1170 \membersection{wxWindow::OnMenuCommand
}\label{wxwindowonmenucommand
}
1172 \func{void
}{OnMenuCommand
}{\param{wxCommandEvent\&
}{event
}}
1174 Called when a menu command is received from a menu bar.
1176 \wxheading{Parameters
}
1178 \docparam{event
}{The menu command event. For more information, see
\helpref{wxCommandEvent
}{wxcommandevent
}.
}
1182 A function with this name doesn't actually exist; you can choose any member function to receive
1183 menu command events, using the EVT
\_COMMAND macro for individual commands or EVT
\_COMMAND\_RANGE for
1184 a range of commands.
1186 \wxheading{See also
}
1188 \helpref{wxCommandEvent
}{wxcommandevent
},
\rtfsp
1189 \helpref{wxWindow::OnMenuHighlight
}{wxwindowonmenuhighlight
},
\rtfsp
1190 \helpref{Event handling overview
}{eventhandlingoverview
}
1192 \membersection{wxWindow::OnMenuHighlight
}\label{wxwindowonmenuhighlight
}
1194 \func{void
}{OnMenuHighlight
}{\param{wxMenuEvent\&
}{event
}}
1196 Called when a menu select is received from a menu bar: that is, the
1197 mouse cursor is over a menu item, but the left mouse button has not been
1200 \wxheading{Parameters
}
1202 \docparam{event
}{The menu highlight event. For more information, see
\helpref{wxMenuEvent
}{wxmenuevent
}.
}
1206 You can choose any member function to receive
1207 menu select events, using the EVT
\_MENU\_HIGHLIGHT macro for individual menu items or EVT
\_MENU\_HIGHLIGHT\_ALL macro
1210 The default implementation for
\helpref{wxFrame::OnMenuHighlight
}{wxframeonmenuhighlight
} displays help
1211 text in the first field of the status bar.
1213 This function was known as
{\bf OnMenuSelect
} in earlier versions of wxWindows, but this was confusing
1214 since a selection is normally a left-click action.
1216 \wxheading{See also
}
1218 \helpref{wxMenuEvent
}{wxmenuevent
},
\rtfsp
1219 \helpref{wxWindow::OnMenuCommand
}{wxwindowonmenucommand
},
\rtfsp
1220 \helpref{Event handling overview
}{eventhandlingoverview
}
1223 \membersection{wxWindow::OnMouseEvent
}\label{wxwindowonmouseevent
}
1225 \func{void
}{OnMouseEvent
}{\param{wxMouseEvent\&
}{ event
}}
1227 Called when the user has initiated an event with the
1230 \wxheading{Parameters
}
1232 \docparam{event
}{The mouse event. See
\helpref{wxMouseEvent
}{wxmouseevent
} for
1237 Most, but not all, windows respond to this event.
1239 To intercept this event, use the EVT
\_MOUSE\_EVENTS macro in an event table definition, or individual
1240 mouse event macros such as EVT
\_LEFT\_DOWN.
1242 \wxheading{See also
}
1244 \helpref{wxMouseEvent
}{wxmouseevent
},
\rtfsp
1245 \helpref{Event handling overview
}{eventhandlingoverview
}
1247 \membersection{wxWindow::OnMove
}\label{wxwindowonmove
}
1249 \func{void
}{OnMove
}{\param{wxMoveEvent\&
}{event
}}
1251 Called when a window is moved.
1253 \wxheading{Parameters
}
1255 \docparam{event
}{The move event. For more information, see
\helpref{wxMoveEvent
}{wxmoveevent
}.
}
1259 Use the EVT
\_MOVE macro to intercept move events.
1263 Not currently implemented.
1265 \wxheading{See also
}
1267 \helpref{wxMoveEvent
}{wxmoveevent
},
\rtfsp
1268 \helpref{wxFrame::OnSize
}{wxframeonsize
},
\rtfsp
1269 \helpref{Event handling overview
}{eventhandlingoverview
}
1271 \membersection{wxWindow::OnPaint
}\label{wxwindowonpaint
}
1273 \func{void
}{OnPaint
}{\param{wxPaintEvent\&
}{event
}}
1275 Sent to the event handler when the window must be refreshed.
1277 \wxheading{Parameters
}
1279 \docparam{event
}{Paint event. For more information, see
\helpref{wxPaintEvent
}{wxpaintevent
}.
}
1283 Use the EVT
\_PAINT macro in an event table definition to intercept paint events.
1285 In a paint event handler, the application should always create a
\helpref{wxPaintDC
}{wxpaintdc
} object.
1291 void MyWindow::OnPaint(wxPaintEvent& event)
1300 You can optimize painting by retrieving the rectangles
1301 that have been damaged and only repainting these. The rectangles are in
1302 terms of the client area, and are unscrolled, so you will need to do
1303 some calculations using the current view position to obtain logical,
1306 Here is an example of using the
\helpref{wxRegionIterator
}{wxregioniterator
} class:
1310 // Called when window needs to be repainted.
1311 void MyWindow::OnPaint(wxPaintEvent& event)
1315 // Find Out where the window is scrolled to
1316 int vbX,vbY; // Top left corner of client
1317 ViewStart(&vbX,&vbY);
1319 int vX,vY,vW,vH; // Dimensions of client area in pixels
1320 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1329 // Alternatively we can do this:
1331 // upd.GetRect(&rect);
1333 // Repaint this rectangle
1342 \wxheading{See also
}
1344 \helpref{wxPaintEvent
}{wxpaintevent
},
\rtfsp
1345 \helpref{wxPaintDC
}{wxpaintdc
},
\rtfsp
1346 \helpref{Event handling overview
}{eventhandlingoverview
}
1348 \membersection{wxWindow::OnScroll
}\label{wxwindowonscroll
}
1350 \func{void
}{OnScroll
}{\param{wxScrollEvent\&
}{event
}}
1352 Called when a scroll event is received from one of the window's built-in scrollbars.
1354 \wxheading{Parameters
}
1356 \docparam{event
}{Command event. Retrieve the new scroll position by
1357 calling
\helpref{wxScrollEvent::GetPosition
}{wxscrolleventgetposition
}, and the
1358 scrollbar orientation by calling
\helpref{wxScrollEvent::GetOrientation
}{wxscrolleventgetorientation
}.
}
1362 Note that it is not possible to distinguish between horizontal and vertical scrollbars
1363 until the function is executing (you can't have one function for vertical, another
1364 for horizontal events).
1366 \wxheading{See also
}
1368 \helpref{wxScrollEvent
}{wxscrollevent
},
\rtfsp
1369 \helpref{Event handling overview
}{eventhandlingoverview
}
1371 \membersection{wxWindow::OnSetFocus
}\label{wxwindowonsetfocus
}
1373 \func{void
}{OnSetFocus
}{\param{wxFocusEvent\&
}{event
}}
1375 Called when a window's focus is being set.
1377 \wxheading{Parameters
}
1379 \docparam{event
}{The focus event. For more information, see
\helpref{wxFocusEvent
}{wxfocusevent
}.
}
1383 To intercept this event, use the macro EVT
\_SET\_FOCUS in an event table definition.
1385 Most, but not all, windows respond to this event.
1387 \wxheading{See also
}
1389 \helpref{wxFocusEvent
}{wxfocusevent
},
\helpref{wxWindow::OnKillFocus
}{wxwindowonkillfocus
},
\rtfsp
1390 \helpref{Event handling overview
}{eventhandlingoverview
}
1392 \membersection{wxWindow::OnSize
}\label{wxwindowonsize
}
1394 \func{void
}{OnSize
}{\param{wxSizeEvent\&
}{event
}}
1396 Called when the window has been resized.
1398 \wxheading{Parameters
}
1400 \docparam{event
}{Size event. For more information, see
\helpref{wxSizeEvent
}{wxsizeevent
}.
}
1404 You may wish to use this for frames to resize their child windows as appropriate.
1406 Note that the size passed is of
1407 the whole window: call
\helpref{wxWindow::GetClientSize
}{wxwindowgetclientsize
} for the area which may be
1408 used by the application.
1410 \wxheading{See also
}
1412 \helpref{wxSizeEvent
}{wxsizeevent
},
\rtfsp
1413 \helpref{Event handling overview
}{eventhandlingoverview
}
1415 \membersection{wxWindow::OnSysColourChanged
}\label{wxwindowonsyscolourchanged
}
1417 \func{void
}{OnSysColourChanged
}{\param{wxOnSysColourChangedEvent\&
}{event
}}
1419 Called when the user has changed the system colours.
1421 \wxheading{Parameters
}
1423 \docparam{event
}{System colour change event. For more information, see
\helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
}.
}
1425 \wxheading{See also
}
1427 \helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
},
\rtfsp
1428 \helpref{Event handling overview
}{eventhandlingoverview
}
1430 \membersection{wxWindow::PopEventHandler
}\label{wxwindowpopeventhandler
}
1432 \constfunc{wxEvtHandler*
}{PopEventHandler
}{\param{bool
}{deleteHandler = FALSE
}}
1434 Removes and returns the top-most event handler on the event handler stack.
1436 \wxheading{Parameters
}
1438 \docparam{deleteHandler
}{If this is TRUE, the handler will be deleted after it is removed. The
1439 default value is FALSE.
}
1441 \wxheading{See also
}
1443 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1444 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1445 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1446 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1447 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
1449 \membersection{wxWindow::PopupMenu
}\label{wxwindowpopupmenu
}
1451 \func{virtual bool
}{PopupMenu
}{\param{wxMenu*
}{menu
},
\param{int
}{x
},
\param{int
}{y
}}
1453 Pops up the given menu at the specified coordinates, relative to this
1454 window, and returns control when the user has dismissed the menu. If a
1455 menu item is selected, the callback defined for the menu is called with
1456 wxMenu and wxCommandEvent reference arguments. The callback should access
1457 the commandInt member of the event to check the selected menu identifier.
1459 \wxheading{Parameters
}
1461 \docparam{menu
}{Menu to pop up.
}
1463 \docparam{x
}{Required x position for the menu to appear.
}
1465 \docparam{y
}{Required y position for the menu to appear.
}
1467 \wxheading{See also
}
1469 \helpref{wxMenu
}{wxmenu
}
1473 Just before the menu is popped up,
\helpref{wxMenu::UpdateUI
}{wxmenuupdateui
} is called
1474 to ensure that the menu items are in the correct state.
1476 \membersection{wxWindow::PushEventHandler
}\label{wxwindowpusheventhandler
}
1478 \func{void
}{PushEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1480 Pushes this event handler onto the event stack for the window.
1482 \wxheading{Parameters
}
1484 \docparam{handler
}{Specifies the handler to be pushed.
}
1488 An event handler is an object that is capable of processing the events
1489 sent to a window. By default, the window is its own event handler, but
1490 an application may wish to substitute another, for example to allow
1491 central implementation of event-handling for a variety of different
1494 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} allows
1495 an application to set up a chain of event handlers, where an event not handled by one event handler is
1496 handed to the next one in the chain. Use
\helpref{wxWindow::PopEventHandler
}{wxwindowpopeventhandler
} to
1497 remove the event handler.
1499 \wxheading{See also
}
1501 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1502 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1503 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1504 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1505 \helpref{wxEvtHandler
}{wxevthandler
}
1507 \membersection{wxWindow::Raise
}\label{wxwindowraise
}
1509 \func{void
}{Raise
}{\void}
1511 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1514 \membersection{wxWindow::Refresh
}\label{wxwindowrefresh
}
1516 \func{virtual void
}{Refresh
}{\param{const bool
}{ eraseBackground = TRUE
},
\param{const wxRect*
}{rect
1519 Causes a message or event to be generated to repaint the
1522 \wxheading{Parameters
}
1524 \docparam{eraseBackground
}{If TRUE, the background will be
1527 \docparam{rect
}{If non-NULL, only the given rectangle will
1528 be treated as damaged.
}
1530 \membersection{wxWindow::ReleaseMouse
}\label{wxwindowreleasemouse
}
1532 \func{virtual void
}{ReleaseMouse
}{\void}
1534 Releases mouse input captured with
\helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}.
1536 \wxheading{See also
}
1538 \helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}
1540 \membersection{wxWindow::RemoveChild
}\label{wxwindowremovechild
}
1542 \func{virtual void
}{RemoveChild
}{\param{wxWindow*
}{child
}}
1544 Removes a child window. This is called automatically by window deletion
1545 functions so should not be required by the application programmer.
1547 \wxheading{Parameters
}
1549 \docparam{child
}{Child window to remove.
}
1551 \membersection{wxWindow::ScreenToClient
}\label{wxwindowscreentoclient
}
1553 \constfunc{virtual void
}{ScreenToClient
}{\param{int*
}{x
},
\param{int*
}{y
}}
1555 \constfunc{virtual wxPoint
}{ScreenToClient
}{\param{const wxPoint\&
}{pt
}}
1557 Converts from screen to client window coordinates.
1559 \wxheading{Parameters
}
1561 \docparam{x
}{Stores the screen x coordinate and receives the client x coordinate.
}
1563 \docparam{y
}{Stores the screen x coordinate and receives the client x coordinate.
}
1565 \docparam{pt
}{The screen position for the second form of the function.
}
1567 \pythonnote{In place of a single overloaded method name, wxPython
1568 implements the following methods:
\par
1569 \indented{2cm
}{\begin{twocollist
}
1570 \twocolitem{\bf{ScreenToClient(point)
}}{Accepts and returns a wxPoint
}
1571 \twocolitem{\bf{ScreenToClientXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
1576 \membersection{wxWindow::ScrollWindow
}\label{wxwindowscrollwindow
}
1578 \func{virtual void
}{ScrollWindow
}{\param{int
}{dx
},
\param{int
}{dy
},
\param{const wxRect*
}{ rect = NULL
}}
1580 Physically scrolls the pixels in the window.
1582 \wxheading{Parameters
}
1584 \docparam{dx
}{Amount to scroll horizontally.
}
1586 \docparam{dy
}{Amount to scroll vertically.
}
1588 \docparam{rect
}{Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
1589 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
1590 can optimise painting by checking for the invalidated region.
}
1594 Available only under Windows.
1596 Use this function to optimise your scrolling implementations, to minimise the area that must be
1599 \membersection{wxWindow::SetAcceleratorTable
}\label{wxwindowsetacceleratortable
}
1601 \func{virtual void
}{SetAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{ accel
}}
1603 Sets the accelerator table for this window. See
\helpref{wxAcceleratorTable
}{wxacceleratortable
}.
1605 \membersection{wxWindow::SetAutoLayout
}\label{wxwindowsetautolayout
}
1607 \func{void
}{SetAutoLayout
}{\param{const bool
}{ autoLayout
}}
1609 Determines whether the
\helpref{wxWindow::Layout
}{wxwindowlayout
} function will
1610 be called automatically when the window is resized.
1612 \wxheading{Parameters
}
1614 \docparam{autoLayout
}{Set this to TRUE if you wish the Layout function to be called
1615 from within wxWindow::OnSize functions.
}
1617 \wxheading{See also
}
1619 \helpref{wxWindow::SetConstraints
}{wxwindowsetconstraints
}
1621 \membersection{wxWindow::SetBackgroundColour
}\label{wxwindowsetbackgroundcolour
}
1623 \func{virtual void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colour
}}
1625 Sets the background colour of the window.
1627 \wxheading{Parameters
}
1629 \docparam{colour
}{The colour to be used as the background colour.
}
1633 The background colour is usually painted by the default
\rtfsp
1634 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
} event handler function.
1636 Note that setting the background colour does not cause an immediate refresh, so you
1637 may wish to call
\helpref{wxWindow::Clear
}{wxwindowclear
} or
\helpref{wxWindow::Refresh
}{wxwindowrefresh
} after
1638 calling this function.
1640 \wxheading{See also
}
1642 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
},
\rtfsp
1643 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
1644 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
1645 \helpref{wxWindow::Clear
}{wxwindowclear
},
\rtfsp
1646 \helpref{wxWindow::Refresh
}{wxwindowrefresh
},
\rtfsp
1647 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
}
1649 \membersection{wxWindow::SetClientSize
}\label{wxwindowsetclientsize
}
1651 \func{virtual void
}{SetClientSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
1653 \func{virtual void
}{SetClientSize
}{\param{const wxSize\&
}{ size
}}
1655 This sets the size of the window client area in pixels. Using this function to size a window
1656 tends to be more device-independent than
\helpref{wxWindow::SetSize
}{wxwindowsetsize
}, since the application need not
1657 worry about what dimensions the border or title bar have when trying to fit the window
1658 around panel items, for example.
1660 \wxheading{Parameters
}
1662 \docparam{width
}{The required client area width.
}
1664 \docparam{height
}{The required client area height.
}
1666 \docparam{size
}{The required client size.
}
1668 \pythonnote{In place of a single overloaded method name, wxPython
1669 implements the following methods:
\par
1670 \indented{2cm
}{\begin{twocollist
}
1671 \twocolitem{\bf{SetClientSize(size)
}}{Accepts a wxSize
}
1672 \twocolitem{\bf{SetClientSizeWH(width, height)
}}{}
1676 \membersection{wxWindow::SetCursor
}\label{wxwindowsetcursor
}
1678 \func{virtual void
}{SetCursor
}{\param{const wxCursor\&
}{cursor
}}
1680 Sets the window's cursor.
1682 \wxheading{Parameters
}
1684 \docparam{cursor
}{Specifies the cursor that the window should normally display.
}
1688 Under Windows, you sometimes need to call ::wxSetCursor in addition to this
1689 function if you want the cursor to change immediately, because under Windows,
1690 wxWindows only sets the global cursor when it detects mouse movement.
1692 \wxheading{See also
}
1694 \helpref{::wxSetCursor
}{wxsetcursor
},
\helpref{wxCursor
}{wxcursor
}
1696 \membersection{wxWindow::SetEventHandler
}\label{wxwindowseteventhandler
}
1698 \func{void
}{SetEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1700 Sets the event handler for this window.
1702 \wxheading{Parameters
}
1704 \docparam{handler
}{Specifies the handler to be set.
}
1708 An event handler is an object that is capable of processing the events
1709 sent to a window. By default, the window is its own event handler, but
1710 an application may wish to substitute another, for example to allow
1711 central implementation of event-handling for a variety of different
1714 It is usually better to use
\helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} since
1715 this sets up a chain of event handlers, where an event not handled by one event handler is
1716 handed to the next one in the chain.
1718 \wxheading{See also
}
1720 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1721 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1722 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1723 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1724 \helpref{wxEvtHandler
}{wxevthandler
}
1726 \membersection{wxWindow::SetConstraints
}\label{wxwindowsetconstraints
}
1728 \func{void
}{SetConstraints
}{\param{wxLayoutConstraints*
}{constraints
}}
1730 Sets the window to have the given layout constraints. The window
1731 will then own the object, and will take care of its deletion.
1732 If an existing layout constraints object is already owned by the
1733 window, it will be deleted.
1735 \wxheading{Parameters
}
1737 \docparam{constraints
}{The constraints to set. Pass NULL to disassociate and delete the window's
1742 You must call
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} to tell a window to use
1743 the constraints automatically in OnSize; otherwise, you must
1744 override OnSize and call Layout explicitly.
1746 \membersection{wxWindow::SetDropTarget
}\label{wxwindowsetdroptarget
}
1748 \func{void
}{SetDropTarget
}{\param{wxDropTarget*
}{ target
}}
1750 Associates a drop target with this window.
1752 If the window already has a drop target, it is deleted.
1754 \wxheading{See also
}
1756 \helpref{wxWindow::GetDropTarget
}{wxwindowgetdroptarget
},
1757 \helpref{Drag and drop overview
}{wxdndoverview
}
1759 \membersection{wxWindow::SetFocus
}\label{wxwindowsetfocus
}
1761 \func{virtual void
}{SetFocus
}{\void}
1763 This sets the window to receive keyboard input.
1765 \membersection{wxWindow::SetFont
}\label{wxwindowsetfont
}
1767 \func{void
}{SetFont
}{\param{const wxFont\&
}{font
}}
1769 Sets the font for this window.
1771 \wxheading{Parameters
}
1773 \docparam{font
}{Font to associate with this window.
}
1775 \wxheading{See also
}
1777 \helpref{wxWindow::GetFont
}{wxwindowgetfont
}
1779 \membersection{wxWindow::SetForegroundColour
}\label{wxwindowsetforegroundcolour
}
1781 \func{virtual void
}{SetForegroundColour
}{\param{const wxColour\&
}{colour
}}
1783 Sets the foreground colour of the window.
1785 \wxheading{Parameters
}
1787 \docparam{colour
}{The colour to be used as the foreground colour.
}
1791 The interpretation of foreground colour is open to interpretation according
1792 to the window class; it may be the text colour or other colour, or it may not
1795 \wxheading{See also
}
1797 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
1798 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
1799 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
1801 \membersection{wxWindow::SetId
}\label{wxwindowsetid
}
1803 \func{void
}{SetId
}{\param{int
}{ id
}}
1805 Sets the identifier of the window.
1809 Each window has an integer identifier. If the application has not provided one,
1810 an identifier will be generated. Normally, the identifier should be provided
1811 on creation and should not be modified subsequently.
1813 \wxheading{See also
}
1815 \helpref{wxWindow::GetId
}{wxwindowgetid
},
\rtfsp
1816 \helpref{Window identifiers
}{windowids
}
1818 \membersection{wxWindow::SetName
}\label{wxwindowsetname
}
1820 \func{virtual void
}{SetName
}{\param{const wxString\&
}{name
}}
1822 Sets the window's name.
1824 \wxheading{Parameters
}
1826 \docparam{name
}{A name to set for the window.
}
1828 \wxheading{See also
}
1830 \helpref{wxWindow::GetName
}{wxwindowgetname
}
1832 \membersection{wxWindow::SetPalette
}\label{wxwindowsetpalette
}
1834 \func{virtual void
}{SetPalette
}{\param{wxPalette*
}{palette
}}
1836 Obsolete - use
\helpref{wxDC::SetPalette
}{wxdcsetpalette
} instead.
1838 \membersection{wxWindow::SetReturnCode
}\label{wxwindowsetreturncode
}
1840 \func{void
}{SetReturnCode
}{\param{int
}{retCode
}}
1842 Sets the return code for this window.
1844 \wxheading{Parameters
}
1846 \docparam{retCode
}{The integer return code, usually a control identifier.
}
1850 A return code is normally associated with a modal dialog, where
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
} returns
1851 a code to the application. The function
\helpref{wxDialog::EndModal
}{wxdialogendmodal
} calls
{\bf SetReturnCode
}.
1853 \wxheading{See also
}
1855 \helpref{wxWindow::GetReturnCode
}{wxwindowgetreturncode
},
\helpref{wxDialog::ShowModal
}{wxdialogshowmodal
},
\rtfsp
1856 \helpref{wxDialog::EndModal
}{wxdialogendmodal
}
1858 \membersection{wxWindow::SetScrollbar
}\label{wxwindowsetscrollbar
}
1860 \func{virtual void
}{SetScrollbar
}{\param{int
}{orientation
},
\param{int
}{position
},
\rtfsp
1861 \param{int
}{thumbSize
},
\param{int
}{range
},
\rtfsp
1862 \param{const bool
}{refresh = TRUE
}}
1864 Sets the scrollbar properties of a built-in scrollbar.
1866 \wxheading{Parameters
}
1868 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1870 \docparam{position
}{The position of the scrollbar in scroll units.
}
1872 \docparam{thumbSize
}{The size of the thumb, or visible portion of the scrollbar, in scroll units.
}
1874 \docparam{range
}{The maximum position of the scrollbar.
}
1876 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1880 Let's say you wish to display
50 lines of text, using the same font.
1881 The window is sized so that you can only see
16 lines at a time.
1887 SetScrollbar(wxVERTICAL,
0,
16,
50);
1891 Note that with the window at this size, the thumb position can never go
1892 above
50 minus
16, or
34.
1894 You can determine how many lines are currently visible by dividing the current view
1895 size by the character height in pixels.
1897 When defining your own scrollbar behaviour, you will always need to recalculate
1898 the scrollbar settings when the window size changes. You could therefore put your
1899 scrollbar calculations and SetScrollbar
1900 call into a function named AdjustScrollbars, which can be called initially and also
1901 from your
\helpref{wxWindow::OnSize
}{wxwindowonsize
} event handler function.
1903 \wxheading{See also
}
1905 \helpref{Scrolling overview
}{scrollingoverview
},
\rtfsp
1906 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
1909 \membersection{wxWindow::SetScrollPage
}\label{wxwindowsetscrollpage
}
1911 \func{virtual void
}{SetScrollPage
}{\param{int
}{orientation
},
\param{int
}{pageSize
},
\param{const bool
}{refresh = TRUE
}}
1913 Sets the page size of one of the built-in scrollbars.
1915 \wxheading{Parameters
}
1917 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1919 \docparam{pageSize
}{Page size in scroll units.
}
1921 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1925 The page size of a scrollbar is the number of scroll units that the scroll thumb travels when you
1926 click on the area above/left of or below/right of the thumb. Normally you will want a whole visible
1927 page to be scrolled, i.e. the size of the current view (perhaps the window client size). This
1928 value has to be adjusted when the window is resized, since the page size will have changed.
1930 In addition to specifying how far the scroll thumb travels when paging, in Motif and some versions of Windows
1931 the thumb changes size to reflect the page size relative to the length of the
document. When the
1932 document size is only slightly bigger than the current view (window) size, almost all of the scrollbar
1933 will be taken up by the thumb. When the two values become the same, the scrollbar will (on some systems)
1936 Currently, this function should be called before SetPageRange, because of a quirk in the Windows
1937 handling of pages and ranges.
1939 \wxheading{See also
}
1941 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
1942 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
1943 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
1944 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
1947 \membersection{wxWindow::SetScrollPos
}\label{wxwindowsetscrollpos
}
1949 \func{virtual void
}{SetScrollPos
}{\param{int
}{orientation
},
\param{int
}{pos
},
\param{const bool
}{refresh = TRUE
}}
1951 Sets the position of one of the built-in scrollbars.
1953 \wxheading{Parameters
}
1955 \docparam{orientation
}{Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1957 \docparam{pos
}{Position in scroll units.
}
1959 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1963 This function does not directly affect the contents of the window: it is up to the
1964 application to take note of scrollbar attributes and redraw contents accordingly.
1966 \wxheading{See also
}
1968 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
},
\rtfsp
1969 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
1970 \helpref{wxWindow::GetScrollThumb
}{wxwindowgetscrollthumb
},
\rtfsp
1971 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
1974 \membersection{wxWindow::SetScrollRange
}\label{wxwindowsetscrollrange
}
1976 \func{virtual void
}{SetScrollRange
}{\param{int
}{orientation
},
\param{int
}{range
},
\param{const bool
}{refresh = TRUE
}}
1978 Sets the range of one of the built-in scrollbars.
1980 \wxheading{Parameters
}
1982 \docparam{orientation
}{Determines the scrollbar whose range is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1984 \docparam{range
}{Scroll range.
}
1986 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1990 The range of a scrollbar is the number of steps that the thumb may travel, rather than the total
1991 object length of the scrollbar. If you are implementing a scrolling window, for example, you
1992 would adjust the scroll range when the window is resized, by subtracting the window view size from the
1993 total virtual window size. When the two sizes are the same (all the window is visible), the range goes to zero
1994 and usually the scrollbar will be automatically hidden.
1996 \wxheading{See also
}
1998 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
1999 \helpref{wxWindow::SetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2000 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2001 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2002 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2005 \membersection{wxWindow::SetSize
}\label{wxwindowsetsize
}
2007 \func{virtual void
}{SetSize
}{\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
},
2008 \param{int
}{ sizeFlags = wxSIZE
\_AUTO}}
2010 \func{virtual void
}{SetSize
}{\param{const wxRect\&
}{ rect
}}
2012 Sets the size and position of the window in pixels.
2014 \func{virtual void
}{SetSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
2016 \func{virtual void
}{SetSize
}{\param{const wxSize\&
}{ size
}}
2018 Sets the size of the window in pixels.
2020 \wxheading{Parameters
}
2022 \docparam{x
}{Required x position in pixels, or -
1 to indicate that the existing
2023 value should be used.
}
2025 \docparam{y
}{Required y position in pixels, or -
1 to indicate that the existing
2026 value should be used.
}
2028 \docparam{width
}{Required width in pixels, or -
1 to indicate that the existing
2029 value should be used.
}
2031 \docparam{height
}{Required height position in pixels, or -
1 to indicate that the existing
2032 value should be used.
}
2034 \docparam{size
}{\helpref{wxSize
}{wxsize
} object for setting the size.
}
2036 \docparam{rect
}{\helpref{wxRect
}{wxrect
} object for setting the position and size.
}
2038 \docparam{sizeFlags
}{Indicates the interpretation of other parameters. It is a bit list of the following:
2040 {\bf wxSIZE
\_AUTO\_WIDTH}: a -
1 width value is taken to indicate
2041 a wxWindows-supplied default width.\\
2042 {\bf wxSIZE
\_AUTO\_HEIGHT}: a -
1 height value is taken to indicate
2043 a wxWindows-supplied default width.\\
2044 {\bf wxSIZE
\_AUTO}: -
1 size values are taken to indicate
2045 a wxWindows-supplied default size.\\
2046 {\bf wxSIZE
\_USE\_EXISTING}: existing dimensions should be used
2047 if -
1 values are supplied.\\
2048 {\bf wxSIZE
\_ALLOW\_MINUS\_ONE}: allow dimensions of -
1 and less to be interpreted
2049 as real dimensions, not default values.
2054 The second form is a convenience for calling the first form with default
2055 x and y parameters, and must be used with non-default width and height values.
2057 The first form sets the position and optionally size, of the window.
2058 Parameters may be -
1 to indicate either that a default should be supplied
2059 by wxWindows, or that the current value of the dimension should be used.
2061 \wxheading{See also
}
2063 \helpref{wxWindow::Move
}{wxwindowmove
}
2065 \pythonnote{In place of a single overloaded method name, wxPython
2066 implements the following methods:
\par
2067 \indented{2cm
}{\begin{twocollist
}
2068 \twocolitem{\bf{SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO)
}}{}
2069 \twocolitem{\bf{SetSize(size)
}}{}
2070 \twocolitem{\bf{SetPosition(point)
}}{}
2074 \membersection{wxWindow::SetSizeHints
}\label{wxwindowsetsizehints
}
2076 \func{virtual void
}{SetSizeHints
}{\param{int
}{ minW=-
1},
\param{int
}{ minH=-
1},
\param{int
}{ maxW=-
1},
\param{int
}{ maxH=-
1},
2077 \param{int
}{ incW=-
1},
\param{int
}{ incH=-
1}}
2079 Allows specification of minimum and maximum window sizes, and window size increments.
2080 If a pair of values is not set (or set to -
1), the default values will be used.
2082 \wxheading{Parameters
}
2084 \docparam{minW
}{Specifies the minimum width allowable.
}
2086 \docparam{minH
}{Specifies the minimum height allowable.
}
2088 \docparam{maxW
}{Specifies the maximum width allowable.
}
2090 \docparam{maxH
}{Specifies the maximum height allowable.
}
2092 \docparam{incW
}{Specifies the increment for sizing the width (Motif/Xt only).
}
2094 \docparam{incH
}{Specifies the increment for sizing the height (Motif/Xt only).
}
2098 If this function is called, the user will not be able to size the window outside the
2101 The resizing increments are only significant under Motif or Xt.
2103 \membersection{wxWindow::SetTitle
}\label{wxwindowsettitle
}
2105 \func{virtual void
}{SetTitle
}{\param{const wxString\&
}{title
}}
2107 Sets the window's title. Applicable only to frames and dialogs.
2109 \wxheading{Parameters
}
2111 \docparam{title
}{The window's title.
}
2113 \wxheading{See also
}
2115 \helpref{wxWindow::GetTitle
}{wxwindowgettitle
}
2117 \membersection{wxWindow::Show
}
2119 \func{virtual bool
}{Show
}{\param{const bool
}{ show
}}
2121 Shows or hides the window.
2123 \wxheading{Parameters
}
2125 \docparam{show
}{If TRUE, displays the window and brings it to the front. Otherwise,
2128 \wxheading{See also
}
2130 \helpref{wxWindow::IsShown
}{wxwindowisshown
}
2132 \membersection{wxWindow::TransferDataFromWindow
}\label{wxwindowtransferdatafromwindow
}
2134 \func{virtual bool
}{TransferDataFromWindow
}{\void}
2136 Transfers values from child controls to data areas specified by their validators. Returns
2137 FALSE if a transfer failed.
2139 \wxheading{See also
}
2141 \helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
},
\rtfsp
2142 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2144 \membersection{wxWindow::TransferDataToWindow
}\label{wxwindowtransferdatatowindow
}
2146 \func{virtual bool
}{TransferDataToWindow
}{\void}
2148 Transfers values to child controls from data areas specified by their validators.
2150 \wxheading{Return value
}
2152 Returns FALSE if a transfer failed.
2154 \wxheading{See also
}
2156 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2157 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2159 \membersection{wxWindow::Validate
}\label{wxwindowvalidate
}
2161 \func{virtual bool
}{Validate
}{\void}
2163 Validates the current values of the child controls using their validators.
2165 \wxheading{Return value
}
2167 Returns FALSE if any of the validations failed.
2169 \wxheading{See also
}
2171 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2172 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2173 \helpref{wxValidator
}{wxvalidator
}
2175 \membersection{wxWindow::WarpPointer
}\label{wxwindowwarppointer
}
2177 \func{void
}{WarpPointer
}{\param{int
}{ x
},
\param{int
}{ y
}}
2179 Moves the pointer to the given position on the window.
2181 \wxheading{Parameters
}
2183 \docparam{x
}{The new x position for the cursor.
}
2185 \docparam{y
}{The new y position for the cursor.
}