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
24 for this style. Windows only.
}
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. Windows only.
}
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. (Still used?)
}
35 \twocolitem{\windowstyle{wxHSCROLL
}}{Use this style to enable a horizontal scrollbar. (Still used?)
}
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. If no suitable size can be found, the
74 window will be sized to
20x20 pixels so that the window is visible but obviously not
77 \docparam{style
}{Window style. For generic window styles, please see
\helpref{wxWindow
}{wxwindow
}.
}
79 \docparam{name
}{Window name.
}
81 \membersection{wxWindow::
\destruct{wxWindow
}}
83 \func{}{\destruct{wxWindow
}}{\void}
85 Destructor. Deletes all subwindows, then deletes itself. Instead of using
86 the
{\bf delete
} operator explicitly, you should normally
87 use
\helpref{wxWindow::Destroy
}{wxwindowdestroy
} so that wxWindows
88 can delete a window only when it is safe to do so, in idle time.
92 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
93 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
94 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
95 \helpref{wxCloseEvent
}{wxcloseevent
}
97 \membersection{wxWindow::AddChild
}
99 \func{virtual void
}{AddChild
}{\param{wxWindow*
}{child
}}
101 Adds a child window. This is called automatically by window creation
102 functions so should not be required by the application programmer.
104 \wxheading{Parameters
}
106 \docparam{child
}{Child window to add.
}
108 \membersection{wxWindow::CaptureMouse
}\label{wxwindowcapturemouse
}
110 \func{virtual void
}{CaptureMouse
}{\void}
112 Directs all mouse input to this window. Call
\helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
} to
117 \helpref{wxWindow::ReleaseMouse
}{wxwindowreleasemouse
}
119 \membersection{wxWindow::Center
}\label{wxwindowcenter
}
121 \func{void
}{Center
}{\param{int
}{ direction
}}
123 A synonym for
\helpref{Centre
}{wxwindowcentre
}.
125 \membersection{wxWindow::CenterOnParent
}\label{wxwindowcenteronparent
}
127 \func{void
}{CenterOnParent
}{\param{int
}{ direction
}}
129 A synonym for
\helpref{CentreOnParent
}{wxwindowcentreonparent
}.
131 \membersection{wxWindow::Centre
}\label{wxwindowcentre
}
133 \func{void
}{Centre
}{\param{int
}{ direction = wxHORIZONTAL
}}
137 \wxheading{Parameters
}
139 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
140 or
{\tt wxBOTH
}. It may also include
{\tt wxCENTRE
\_ON\_SCREEN} flag
141 if you want to center the window on the entire screen and not on its
144 The flag
{\tt wxCENTRE
\_FRAME} is obsolete and should not be used any longer.
148 If the window is a top level one (i.e. doesn't have a parent), it will be
149 centered relative to the screen anyhow.
153 \helpref{wxWindow::Center
}{wxwindowcenter
}
155 \membersection{wxWindow::CentreOnParent
}\label{wxwindowcentreonparent
}
157 \func{void
}{CentreOnParent
}{\param{int
}{ direction = wxHORIZONTAL
}}
161 \wxheading{Parameters
}
163 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
168 This methods provides for a way to center top level windows over their
169 parents instead of the entire screen. If there is no parent or if the
170 window is not a top level window, then behaviour is the same as
171 \helpref{wxWindow::Centre
}{wxwindowcentre
}.
175 \helpref{wxWindow::CenterOnParent
}{wxwindowcenteronparent
}
177 \membersection{wxWindow::Clear
}\label{wxwindowclear
}
179 \func{void
}{Clear
}{\void}
181 Clears the window by filling it with the current background colour. Does not
182 cause an erase background event to be generated.
184 \membersection{wxWindow::ClientToScreen
}
186 \constfunc{virtual void
}{ClientToScreen
}{\param{int*
}{x
},
\param{int*
}{y
}}
188 \constfunc{virtual wxPoint
}{ClientToScreen
}{\param{const wxPoint\&
}{ pt
}}
190 Converts to screen coordinates from coordinates relative to this window.
192 \docparam{x
}{A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
193 a screen coordinate will be passed out.
}
195 \docparam{y
}{A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
196 a screen coordinate will be passed out.
}
198 \docparam{pt
}{The client position for the second form of the function.
}
200 \pythonnote{In place of a single overloaded method name, wxPython
201 implements the following methods:
\par
202 \indented{2cm
}{\begin{twocollist
}
203 \twocolitem{\bf{ClientToScreen(point)
}}{Accepts and returns a wxPoint
}
204 \twocolitem{\bf{ClientToScreenXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
209 \membersection{wxWindow::Close
}\label{wxwindowclose
}
211 \func{virtual bool
}{Close
}{\param{const bool
}{ force = FALSE
}}
213 The purpose of this call is to provide a safer way of destroying a window than using
214 the
{\it delete
} operator.
216 \wxheading{Parameters
}
218 \docparam{force
}{FALSE if the window's close handler should be able to veto the destruction
219 of this window, TRUE if it cannot.
}
223 Close calls the
\helpref{close handler
}{wxcloseevent
} for the window, providing an opportunity for the window to
224 choose whether to destroy the window.
226 The close handler should check whether the window is being deleted forcibly,
227 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}, in which case it should
228 destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
230 Applies to managed windows (wxFrame and wxDialog classes) only.
232 {\it Note
} that calling Close does not guarantee that the window will be destroyed; but it
233 provides a way to simulate a manual close of a window, which may or may not be implemented by
234 destroying the window. The default implementation of wxDialog::OnCloseWindow does not
235 necessarily delete the dialog, since it will simply simulate an wxID
\_CANCEL event which
236 itself only hides the dialog.
238 To guarantee that the window will be destroyed, call
\helpref{wxWindow::Destroy
}{wxwindowdestroy
} instead.
242 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
243 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
244 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
245 \helpref{wxCloseEvent
}{wxcloseevent
}
247 \membersection{wxWindow::ConvertDialogToPixels
}\label{wxwindowconvertdialogtopixels
}
249 \func{wxPoint
}{ConvertDialogToPixels
}{\param{const wxPoint\&
}{ pt
}}
251 \func{wxSize
}{ConvertDialogToPixels
}{\param{const wxSize\&
}{ sz
}}
253 Converts a point or size from dialog units to pixels.
255 For the x dimension, the dialog units are multiplied by the average character width
256 and then divided by
4.
258 For the y dimension, the dialog units are multiplied by the average character height
259 and then divided by
8.
263 Dialog units are used for maintaining a dialog's proportions even if the font changes.
264 Dialogs created using Dialog Editor optionally use dialog units.
266 You can also use these functions programmatically. A convenience macro is defined:
270 #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
276 \helpref{wxWindow::ConvertPixelsToDialog
}{wxwindowconvertpixelstodialog
}
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
}
285 Additionally, the following helper functions are defined:
\par
286 \indented{2cm
}{\begin{twocollist
}
287 \twocolitem{\bf{wxDLG
\_PNT(win, point)
}}{Converts a wxPoint from dialog
289 \twocolitem{\bf{wxDLG
\_SZE(win, size)
}}{Converts a wxSize from dialog
295 \membersection{wxWindow::ConvertPixelsToDialog
}\label{wxwindowconvertpixelstodialog
}
297 \func{wxPoint
}{ConvertPixelsToDialog
}{\param{const wxPoint\&
}{ pt
}}
299 \func{wxSize
}{ConvertPixelsToDialog
}{\param{const wxSize\&
}{ sz
}}
301 Converts a point or size from pixels to dialog units.
303 For the x dimension, the pixels are multiplied by
4 and then divided by the average
306 For the y dimension, the pixels are multipled by
8 and then divided by the average
311 Dialog units are used for maintaining a dialog's proportions even if the font changes.
312 Dialogs created using Dialog Editor optionally use dialog units.
316 \helpref{wxWindow::ConvertDialogToPixels
}{wxwindowconvertdialogtopixels
}
319 \pythonnote{In place of a single overloaded method name, wxPython
320 implements the following methods:
\par
321 \indented{2cm
}{\begin{twocollist
}
322 \twocolitem{\bf{ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
323 \twocolitem{\bf{ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
327 \membersection{wxWindow::Destroy
}\label{wxwindowdestroy
}
329 \func{virtual bool
}{Destroy
}{\void}
331 Destroys the window safely. Use this function instead of the delete operator, since
332 different window classes can be destroyed differently. Frames and dialogs
333 are not destroyed immediately when this function is called - they are added
334 to a list of windows to be deleted on idle time, when all the window's events
335 have been processed. This prevents problems with events being sent to non-existant
338 \wxheading{Return value
}
340 TRUE if the window has either been successfully deleted, or it has been added
341 to the list of windows pending real deletion.
343 \membersection{wxWindow::DestroyChildren
}
345 \func{virtual void
}{DestroyChildren
}{\void}
347 Destroys all children of a window. Called automatically by the destructor.
349 \membersection{wxWindow::DragAcceptFiles
}\label{wxwindowdragacceptfiles
}
351 \func{virtual void
}{DragAcceptFiles
}{\param{const bool
}{ accept
}}
353 Enables or disables elibility for drop file events (OnDropFiles).
355 \wxheading{Parameters
}
357 \docparam{accept
}{If TRUE, the window is eligible for drop file events. If FALSE, the window
358 will not accept drop file events.
}
366 \helpref{wxWindow::OnDropFiles
}{wxwindowondropfiles
}
368 \membersection{wxWindow::Enable
}\label{wxwindowenable
}
370 \func{virtual void
}{Enable
}{\param{const bool
}{ enable
}}
372 Enable or disable the window for user input.
374 \wxheading{Parameters
}
376 \docparam{enable
}{If TRUE, enables the window for input. If FALSE, disables the window.
}
380 \helpref{wxWindow::IsEnabled
}{wxwindowisenabled
}
382 \membersection{wxWindow::FindFocus
}\label{wxwindowfindfocus
}
384 \func{static wxWindow*
}{FindFocus
}{\void}
386 Finds the window or control which currently has the keyboard focus.
390 Note that this is a static function, so it can be called without needing a wxWindow pointer.
394 \helpref{wxWindow::SetFocus
}{wxwindowsetfocus
}
396 \membersection{wxWindow::FindWindow
}\label{wxwindowfindwindow
}
398 \func{wxWindow*
}{FindWindow
}{\param{long
}{ id
}}
400 Find a child of this window, by identifier.
402 \func{wxWindow*
}{FindWindow
}{\param{const wxString\&
}{ name
}}
404 Find a child of this window, by name.
406 \pythonnote{In place of a single overloaded method name, wxPython
407 implements the following methods:
\par
408 \indented{2cm
}{\begin{twocollist
}
409 \twocolitem{\bf{FindWindowById(id)
}}{Accepts an integer
}
410 \twocolitem{\bf{FindWindowByName(name)
}}{Accepts a string
}
414 \membersection{wxWindow::Fit
}\label{wxwindowfit
}
416 \func{virtual void
}{Fit
}{\void}
418 Sizes the window so that it fits around its subwindows.
420 \membersection{wxWindow::GetBackgroundColour
}\label{wxwindowgetbackgroundcolour
}
422 \constfunc{virtual wxColour
}{GetBackgroundColour
}{\void}
424 Returns the background colour of the window.
428 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
429 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
430 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
431 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
}
433 \membersection{wxWindow::GetCharHeight
}
435 \constfunc{virtual int
}{GetCharHeight
}{\void}
437 Returns the character height for this window.
439 \membersection{wxWindow::GetCharWidth
}
441 \constfunc{virtual int
}{GetCharWidth
}{\void}
443 Returns the average character width for this window.
445 \membersection{wxWindow::GetChildren
}
447 \func{wxList\&
}{GetChildren
}{\void}
449 Returns a reference to the list of the window's children.
451 \membersection{wxWindow::GetClientSize
}\label{wxwindowgetclientsize
}
453 \constfunc{virtual void
}{GetClientSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
455 \constfunc{virtual wxSize
}{GetClientSize
}{\void}
457 This gets the size of the window `client area' in pixels. The client area is the
458 area which may be drawn on by the programmer, excluding title bar, border etc.
460 \wxheading{Parameters
}
462 \docparam{width
}{Receives the client width in pixels.
}
464 \docparam{height
}{Receives the client height in pixels.
}
466 \pythonnote{In place of a single overloaded method name, wxPython
467 implements the following methods:
\par
468 \indented{2cm
}{\begin{twocollist
}
469 \twocolitem{\bf{wxGetClientSizeTuple()
}}{Returns a
2-tuple of (width, height)
}
470 \twocolitem{\bf{wxGetClientSize()
}}{Returns a wxSize object
}
474 \membersection{wxWindow::GetConstraints
}\label{wxwindowgetconstraints
}
476 \constfunc{wxLayoutConstraints*
}{GetConstraints
}{\void}
478 Returns a pointer to the window's layout constraints, or NULL if there are none.
480 \membersection{wxWindow::GetDefaultItem
}\label{wxwindowgetdefaultitem
}
482 \constfunc{wxButton*
}{GetDefaultItem
}{\void}
484 Returns a pointer to the button which is the default for this window, or NULL.
486 \membersection{wxWindow::GetDropTarget
}\label{wxwindowgetdroptarget
}
488 \constfunc{wxDropTarget*
}{GetDropTarget
}{\void}
490 Returns the associated drop target, which may be NULL.
494 \helpref{wxWindow::SetDropTarget
}{wxwindowsetdroptarget
},
495 \helpref{Drag and drop overview
}{wxdndoverview
}
497 \membersection{wxWindow::GetEventHandler
}\label{wxwindowgeteventhandler
}
499 \constfunc{wxEvtHandler*
}{GetEventHandler
}{\void}
501 Returns the event handler for this window. By default, the window is its
506 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
507 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
508 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
509 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
510 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
512 \membersection{wxWindow::GetFont
}\label{wxwindowgetfont
}
514 \constfunc{wxFont\&
}{GetFont
}{\void}
516 Returns a reference to the font for this window.
520 \helpref{wxWindow::SetFont
}{wxwindowsetfont
}
522 \membersection{wxWindow::GetForegroundColour
}\label{wxwindowgetforegroundcolour
}
524 \func{virtual wxColour
}{GetForegroundColour
}{\void}
526 Returns the foreground colour of the window.
530 The interpretation of foreground colour is open to interpretation according
531 to the window class; it may be the text colour or other colour, or it may not
536 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
537 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
538 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
540 \membersection{wxWindow::GetGrandParent
}
542 \constfunc{wxWindow*
}{GetGrandParent
}{\void}
544 Returns the grandparent of a window, or NULL if there isn't one.
546 \membersection{wxWindow::GetHandle
}
548 \constfunc{void*
}{GetHandle
}{\void}
550 Returns the platform-specific handle of the physical window. Cast it to an appropriate
551 handle, such as
{\bf HWND
} for Windows,
{\bf Widget
} for Motif or
{\bf GtkWidget
} for GTK.
553 \membersection{wxWindow::GetId
}\label{wxwindowgetid
}
555 \constfunc{int
}{GetId
}{\void}
557 Returns the identifier of the window.
561 Each window has an integer identifier. If the application has not provided one
562 (or the default Id -
1) an unique identifier with a negative value will be generated.
566 \helpref{wxWindow::SetId
}{wxwindowsetid
}\rtfsp
567 \helpref{Window identifiers
}{windowids
}
569 \membersection{wxWindow::GetPosition
}
571 \constfunc{virtual void
}{GetPosition
}{\param{int*
}{x
},
\param{int*
}{y
}}
573 This gets the position of the window in pixels, relative to the parent window or
574 if no parent, relative to the whole display.
576 \wxheading{Parameters
}
578 \docparam{x
}{Receives the x position of the window.
}
580 \docparam{y
}{Receives the y position of the window.
}
582 \pythonnote{In place of a single overloaded method name, wxPython
583 implements the following methods:
\par
584 \indented{2cm
}{\begin{twocollist
}
585 \twocolitem{\bf{GetPosition()
}}{Returns a wxPoint
}
586 \twocolitem{\bf{GetPositionTuple()
}}{Returns a tuple (x, y)
}
590 \membersection{wxWindow::GetLabel
}
592 \constfunc{virtual wxString
}{GetLabel
}{\void}
594 Generic way of getting a label from any window, for
595 identification purposes.
599 The interpretation of this function differs from class to class.
600 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
601 the button text. This function can be useful for meta-programs (such as testing
602 tools or special-needs access programs) which need to identify windows
605 \membersection{wxWindow::GetName
}\label{wxwindowgetname
}
607 \constfunc{virtual wxString
}{GetName
}{\void}
609 Returns the window's name.
613 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
614 name in the window constructor or via
\helpref{wxWindow::SetName
}{wxwindowsetname
}.
618 \helpref{wxWindow::SetName
}{wxwindowsetname
}
620 \membersection{wxWindow::GetParent
}
622 \constfunc{virtual wxWindow*
}{GetParent
}{\void}
624 Returns the parent of the window, or NULL if there is no parent.
626 \membersection{wxWindow::GetRect
}\label{wxwindowgetrect
}
628 \constfunc{virtual wxRect
}{GetRect
}{\void}
630 Returns the size and position of the window as a
\helpref{wxRect
}{wxrect
} object.
632 \membersection{wxWindow::GetScrollThumb
}\label{wxwindowgetscrollthumb
}
634 \func{virtual int
}{GetScrollThumb
}{\param{int
}{orientation
}}
636 Returns the built-in scrollbar thumb size.
640 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
642 \membersection{wxWindow::GetScrollPos
}\label{wxwindowgetscrollpos
}
644 \func{virtual int
}{GetScrollPos
}{\param{int
}{orientation
}}
646 Returns the built-in scrollbar position.
650 See
\helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
652 \membersection{wxWindow::GetScrollRange
}\label{wxwindowgetscrollrange
}
654 \func{virtual int
}{GetScrollRange
}{\param{int
}{orientation
}}
656 Returns the built-in scrollbar range.
660 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
662 \membersection{wxWindow::GetSize
}\label{wxwindowgetsize
}
664 \constfunc{virtual void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
666 \constfunc{virtual wxSize
}{GetSize
}{\void}
668 This gets the size of the entire window in pixels.
670 \wxheading{Parameters
}
672 \docparam{width
}{Receives the window width.
}
674 \docparam{height
}{Receives the window height.
}
676 \pythonnote{In place of a single overloaded method name, wxPython
677 implements the following methods:
\par
678 \indented{2cm
}{\begin{twocollist
}
679 \twocolitem{\bf{GetSize()
}}{Returns a wxSize
}
680 \twocolitem{\bf{GetSizeTuple()
}}{Returns a
2-tuple (width, height)
}
684 \membersection{wxWindow::GetTextExtent
}
686 \constfunc{virtual void
}{GetTextExtent
}{\param{const wxString\&
}{string
},
\param{int*
}{x
},
\param{int*
}{y
},
687 \param{int*
}{descent = NULL
},
\param{int*
}{externalLeading = NULL
},
688 \param{const wxFont*
}{font = NULL
},
\param{const bool
}{ use16 = FALSE
}}
690 Gets the dimensions of the string as it would be drawn on the
691 window with the currently selected font.
693 \wxheading{Parameters
}
695 \docparam{string
}{String whose extent is to be measured.
}
697 \docparam{x
}{Return value for width.
}
699 \docparam{y
}{Return value for height.
}
701 \docparam{descent
}{Return value for descent (optional).
}
703 \docparam{externalLeading
}{Return value for external leading (optional).
}
705 \docparam{font
}{Font to use instead of the current window font (optional).
}
707 \docparam{use16
}{If TRUE,
{\it string
} contains
16-bit characters. The default is FALSE.
}
710 \pythonnote{In place of a single overloaded method name, wxPython
711 implements the following methods:
\par
712 \indented{2cm
}{\begin{twocollist
}
713 \twocolitem{\bf{GetTextExtent(string)
}}{Returns a
2-tuple, (width, height)
}
714 \twocolitem{\bf{GetFullTextExtent(string, font=NULL)
}}{Returns a
715 4-tuple, (width, height, descent, externalLeading)
}
720 \membersection{wxWindow::GetTitle
}\label{wxwindowgettitle
}
722 \func{virtual wxString
}{GetTitle
}{\void}
724 Gets the window's title. Applicable only to frames and dialogs.
728 \helpref{wxWindow::SetTitle
}{wxwindowsettitle
}
730 \membersection{wxWindow::GetUpdateRegion
}\label{wxwindowgetupdateregion
}
732 \constfunc{virtual wxRegion
}{GetUpdateRegion
}{\void}
734 Returns the region specifying which parts of the window have been damaged. Should
735 only be called within an
\helpref{OnPaint
}{wxwindowonpaint
} event handler.
739 \helpref{wxRegion
}{wxregion
},
\helpref{wxRegionIterator
}{wxregioniterator
},
\helpref{wxWindow::OnPaint
}{wxwindowonpaint
}
741 \membersection{wxWindow::GetValidator
}\label{wxwindowgetvalidator
}
743 \constfunc{wxValidator*
}{GetValidator
}{\void}
745 Returns a pointer to the current validator for the window, or NULL if there is none.
747 \membersection{wxWindow::GetWindowStyleFlag
}
749 \constfunc{long
}{GetWindowStyleFlag
}{\void}
751 Gets the window style that was passed to the consructor or
{\bf Create
} member.
752 {\bf GetWindowStyle
} is synonymous.
754 \membersection{wxWindow::InitDialog
}\label{wxwindowinitdialog
}
756 \func{void
}{InitDialog
}{\void}
758 Sends an
\helpref{wxWindow::OnInitDialog
}{wxwindowoninitdialog
} event, which
759 in turn transfers data to the dialog via validators.
763 \helpref{wxWindow::OnInitDialog
}{wxwindowoninitdialog
}
765 \membersection{wxWindow::IsEnabled
}\label{wxwindowisenabled
}
767 \constfunc{virtual bool
}{IsEnabled
}{\void}
769 Returns TRUE if the window is enabled for input, FALSE otherwise.
773 \helpref{wxWindow::Enable
}{wxwindowenable
}
775 \memebersection{wxWindow:IsExposed
}\label{wxwindowisexposed
}
777 \constfunc{bool
}{IsExposed
}{\param{int
}{x
},
\param{int
}{y
}}
779 \constfunc{bool
}{IsExposed
}{\param{int
}{x
},
\param{int
}{y
},
\param{int
}{w
},
\param{int
}{h
}}
781 Returns TRUE if the given point or rectange area has been exposed since the
782 last repaint. Call this in an paint event handler to optimize redrawing by
783 only redrawing those area, which have been exposed.
785 \membersection{wxWindow::IsRetained
}\label{wxwindowisretained
}
787 \constfunc{virtual bool
}{IsRetained
}{\void}
789 Returns TRUE if the window is retained, FALSE otherwise.
793 Retained windows are only available on X platforms.
795 \membersection{wxWindow::IsShown
}\label{wxwindowisshown
}
797 \constfunc{virtual bool
}{IsShown
}{\void}
799 Returns TRUE if the window is shown, FALSE if it has been hidden.
801 \membersection{wxWindow::IsTopLevel
}\label{wxwindowistoplevel
}
803 \constfunc{bool
}{IsTopLevel
}{\void}
805 Returns TRUE if the given window is a top-level one. Currently all frames and
806 dialogs are considered to be top-level windows (even if they have a parent
809 \membersection{wxWindow::Layout
}\label{wxwindowlayout
}
811 \func{void
}{Layout
}{\void}
813 Invokes the constraint-based layout algorithm for this window.
815 See
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} on when
816 this function gets called automatically using auto layout.
818 \membersection{wxWindow::LoadFromResource
}\label{wxwindowloadfromresource
}
820 \func{virtual bool
}{LoadFromResource
}{\param{wxWindow*
}{parent
},
\rtfsp
821 \param{const wxString\&
}{resourceName
},
\param{const wxResourceTable*
}{resourceTable = NULL
}}
823 Loads a panel or dialog from a resource file.
825 \wxheading{Parameters
}
827 \docparam{parent
}{Parent window.
}
829 \docparam{resourceName
}{The name of the resource to load.
}
831 \docparam{resourceTable
}{The resource table to load it from. If this is NULL, the
832 default resource table will be used.
}
834 \wxheading{Return value
}
836 TRUE if the operation succeeded, otherwise FALSE.
838 \membersection{wxWindow::Lower
}\label{wxwindowlower
}
840 \func{void
}{Lower
}{\void}
842 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
845 \membersection{wxWindow::MakeModal
}\label{wxwindowmakemodal
}
847 \func{virtual void
}{MakeModal
}{\param{const bool
}{flag
}}
849 Disables all other windows in the application so that
850 the user can only interact with this window. (This function
851 is not implemented anywhere).
853 \wxheading{Parameters
}
855 \docparam{flag
}{If TRUE, this call disables all other windows in the application so that
856 the user can only interact with this window. If FALSE, the effect is reversed.
}
858 \membersection{wxWindow::Move
}\label{wxwindowmove
}
860 \func{void
}{Move
}{\param{int
}{ x
},
\param{int
}{ y
}}
862 \func{void
}{Move
}{\param{const wxPoint\&
}{ pt
}}
864 Moves the window to the given position.
866 \wxheading{Parameters
}
868 \docparam{x
}{Required x position.
}
870 \docparam{y
}{Required y position.
}
872 \docparam{pt
}{\helpref{wxPoint
}{wxpoint
} object representing the position.
}
876 Implementations of SetSize can also implicitly implement the
877 wxWindow::Move function, which is defined in the base wxWindow class
881 SetSize(x, y, -
1, -
1, wxSIZE_USE_EXISTING);
886 \helpref{wxWindow::SetSize
}{wxwindowsetsize
}
888 \pythonnote{In place of a single overloaded method name, wxPython
889 implements the following methods:
\par
890 \indented{2cm
}{\begin{twocollist
}
891 \twocolitem{\bf{Move(point)
}}{Accepts a wxPoint
}
892 \twocolitem{\bf{MoveXY(x, y)
}}{Accepts a pair of integers
}
896 \membersection{wxWindow::OnActivate
}\label{wxwindowonactivate
}
898 \func{void
}{OnActivate
}{\param{wxActivateEvent\&
}{ event
}}
900 Called when a window is activated or deactivated.
902 \wxheading{Parameters
}
904 \docparam{event
}{Object containing activation information.
}
908 If the window is being activated,
\helpref{wxActivateEvent::GetActive
}{wxactivateeventgetactive
} returns TRUE,
909 otherwise it returns FALSE (it is being deactivated).
913 \helpref{wxActivateEvent
}{wxactivateevent
},
\rtfsp
914 \helpref{Event handling overview
}{eventhandlingoverview
}
916 \membersection{wxWindow::OnChar
}\label{wxwindowonchar
}
918 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
920 Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
922 \wxheading{Parameters
}
924 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
925 details about this class.
}
929 This member function is called in response to a keypress. To intercept this event,
930 use the EVT
\_CHAR macro in an event table definition. Your
{\bf OnChar
} handler may call this
931 default function to achieve default keypress functionality.
933 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
936 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
937 keypresses, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
938 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
940 Most, but not all, windows allow keypresses to be intercepted.
944 \helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
\helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
},
\rtfsp
945 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
946 \helpref{Event handling overview
}{eventhandlingoverview
}
948 \membersection{wxWindow::OnCharHook
}\label{wxwindowoncharhook
}
950 \func{void
}{OnCharHook
}{\param{wxKeyEvent\&
}{ event
}}
952 This member is called to allow the window to intercept keyboard events
953 before they are processed by child windows.
955 \wxheading{Parameters
}
957 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
958 details about this class.
}
962 This member function is called in response to a keypress, if the window is active. To intercept this event,
963 use the EVT
\_CHAR\_HOOK macro in an event table definition. If you do not process a particular
964 keypress, call
\helpref{wxEvent::Skip
}{wxeventskip
} to allow default processing.
966 An example of using this function is in the implementation of escape-character processing for wxDialog,
967 where pressing ESC dismisses the dialog by
{\bf OnCharHook
} 'forging' a cancel button press event.
969 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
972 This function is only relevant to top-level windows (frames and dialogs), and under
973 Windows only. Under GTK the normal EVT
\_CHAR\_ event has the functionality, i.e.
974 you can intercepts it and if you don't call
\helpref{wxEvent::Skip
}{wxeventskip
}
975 the window won't get the event.
979 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
980 \helpref{wxApp::OnCharHook
}{wxapponcharhook
},
\rtfsp
981 \helpref{Event handling overview
}{eventhandlingoverview
}
983 \membersection{wxWindow::OnCommand
}\label{wxwindowoncommand
}
985 \func{virtual void
}{OnCommand
}{\param{wxEvtHandler\&
}{object
},
\param{wxCommandEvent\&
}{event
}}
987 This virtual member function is called if the control does not handle the command event.
989 \wxheading{Parameters
}
991 \docparam{object
}{Object receiving the command event.
}
993 \docparam{event
}{Command event
}
997 This virtual function is provided mainly for backward compatibility. You can also intercept commands
998 from child controls by using an event table, with identifiers or identifier ranges to identify
999 the control(s) in question.
1001 \wxheading{See also
}
1003 \helpref{wxCommandEvent
}{wxcommandevent
},
\rtfsp
1004 \helpref{Event handling overview
}{eventhandlingoverview
}
1006 \membersection{wxWindow::OnClose
}\label{wxwindowonclose
}
1008 \func{virtual bool
}{OnClose
}{\void}
1010 Called when the user has tried to close a a frame
1011 or dialog box using the window manager (X) or system menu (Windows).
1013 {\bf Note:
} This is an obsolete function.
1014 It is superceded by the
\helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
} event
1017 \wxheading{Return value
}
1019 If TRUE is returned by OnClose, the window will be deleted by the system, otherwise the
1020 attempt will be ignored. Do not delete the window from within this handler, although
1021 you may delete other windows.
1023 \wxheading{See also
}
1025 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
1026 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
1027 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
1028 \helpref{wxCloseEvent
}{wxcloseevent
}
1030 \membersection{wxWindow::OnCloseWindow
}\label{wxwindowonclosewindow
}
1032 \func{void
}{OnCloseWindow
}{\param{wxCloseEvent\&
}{event
}}
1034 This is an event handler function called when the user has tried to close a a frame
1035 or dialog box using the window manager (X) or system menu (Windows). It is
1036 called via the
\helpref{wxWindow::Close
}{wxwindowclose
} function, so
1037 that the application can also invoke the handler programmatically.
1039 Use the EVT
\_CLOSE event table macro to handle close events.
1041 You should check whether the application is forcing the deletion of the window
1042 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}. If this is TRUE,
1043 destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
1044 If not, it is up to you whether you respond by destroying the window.
1046 (Note: GetForce is now superceded by CanVeto. So to test whether forced destruction of
1047 the window is required, test for the negative of CanVeto. If CanVeto returns FALSE,
1048 it is not possible to skip window deletion.)
1050 If you don't destroy the window, you should call
\helpref{wxCloseEvent::Veto
}{wxcloseeventveto
} to
1051 let the calling code know that you did not destroy the window. This allows the
\helpref{wxWindow::Close
}{wxwindowclose
} function
1052 to return TRUE or FALSE depending on whether the close instruction was honoured or not.
1056 The
\helpref{wxWindow::OnClose
}{wxwindowonclose
} virtual function remains
1057 for backward compatibility with earlier versions of wxWindows. The
1058 default
{\bf OnCloseWindow
} handler for wxFrame and wxDialog will call
{\bf OnClose
},
1059 destroying the window if it returns TRUE or if the close is being forced.
1061 \wxheading{See also
}
1063 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
1064 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
1065 \helpref{wxWindow::OnClose
}{wxwindowonclose
},
\rtfsp
1066 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
1067 \helpref{wxCloseEvent
}{wxcloseevent
},
\rtfsp
1068 \helpref{wxApp::OnQueryEndSession
}{wxapponqueryendsession
},
\rtfsp
1069 \helpref{wxApp::OnEndSession
}{wxapponendsession
}
1071 \membersection{wxWindow::OnDropFiles
}\label{wxwindowondropfiles
}
1073 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{ event
}}
1075 Called when files have been dragged from the file manager to the window.
1077 \wxheading{Parameters
}
1079 \docparam{event
}{Drop files event. For more information, see
\helpref{wxDropFilesEvent
}{wxdropfilesevent
}.
}
1083 The window must have previously been enabled for dropping by calling
1084 \rtfsp\helpref{wxWindow::DragAcceptFiles
}{wxwindowdragacceptfiles
}.
1086 This event is only generated under Windows.
1088 To intercept this event, use the EVT
\_DROP\_FILES macro in an event table definition.
1090 \wxheading{See also
}
1092 \helpref{wxDropFilesEvent
}{wxdropfilesevent
},
\helpref{wxWindow::DragAcceptFiles
}{wxwindowdragacceptfiles
},
\rtfsp
1093 \helpref{Event handling overview
}{eventhandlingoverview
}
1095 \membersection{wxWindow::OnEraseBackground
}\label{wxwindowonerasebackground
}
1097 \func{void
}{OnEraseBackground
}{\param{wxEraseEvent\&
}{ event
}}
1099 Called when the background of the window needs to be erased.
1101 \wxheading{Parameters
}
1103 \docparam{event
}{Erase background event. For more information, see
\helpref{wxEraseEvent
}{wxeraseevent
}.
}
1107 This event is only generated under Windows. It is therefore recommended that
1108 you set the text background colour explicitly in order to prevent flicker.
1109 The default background colour under GTK is grey.
1111 To intercept this event, use the EVT
\_ERASE\_BACKGROUND macro in an event table definition.
1113 \wxheading{See also
}
1115 \helpref{wxEraseEvent
}{wxeraseevent
},
\helpref{Event handling overview
}{eventhandlingoverview
}
1117 \membersection{wxWindow::OnKeyDown
}\label{wxwindowonkeydown
}
1119 \func{void
}{OnKeyDown
}{\param{wxKeyEvent\&
}{ event
}}
1121 Called when the user has pressed a key, before it is translated into an ASCII value using other
1122 modifier keys that might be pressed at the same time.
1124 \wxheading{Parameters
}
1126 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
1127 details about this class.
}
1131 This member function is called in response to a key down event. To intercept this event,
1132 use the EVT
\_KEY\_DOWN macro in an event table definition. Your
{\bf OnKeyDown
} handler may call this
1133 default function to achieve default keypress functionality.
1135 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1136 keys, such as shift, control, and function keys, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
1137 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
1139 Most, but not all, windows allow keypresses to be intercepted.
1141 \wxheading{See also
}
1143 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
\helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
},
\rtfsp
1144 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
1145 \helpref{Event handling overview
}{eventhandlingoverview
}
1147 \membersection{wxWindow::OnKeyUp
}\label{wxwindowonkeyup
}
1149 \func{void
}{OnKeyUp
}{\param{wxKeyEvent\&
}{ event
}}
1151 Called when the user has released a key.
1153 \wxheading{Parameters
}
1155 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
1156 details about this class.
}
1160 This member function is called in response to a key up event. To intercept this event,
1161 use the EVT
\_KEY\_UP macro in an event table definition. Your
{\bf OnKeyUp
} handler may call this
1162 default function to achieve default keypress functionality.
1164 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1165 keys, such as shift, control, and function keys, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
1166 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
1168 Most, but not all, windows allow key up events to be intercepted.
1170 \wxheading{See also
}
1172 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
\rtfsp
1173 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
1174 \helpref{Event handling overview
}{eventhandlingoverview
}
1176 \membersection{wxWindow::OnKillFocus
}\label{wxwindowonkillfocus
}
1178 \func{void
}{OnKillFocus
}{\param{wxFocusEvent\&
}{event
}}
1180 Called when a window's focus is being killed.
1182 \wxheading{Parameters
}
1184 \docparam{event
}{The focus event. For more information, see
\helpref{wxFocusEvent
}{wxfocusevent
}.
}
1188 To intercept this event, use the macro EVT
\_KILL\_FOCUS in an event table definition.
1190 Most, but not all, windows respond to this event.
1192 \wxheading{See also
}
1194 \helpref{wxFocusEvent
}{wxfocusevent
},
\helpref{wxWindow::OnSetFocus
}{wxwindowonsetfocus
},
\rtfsp
1195 \helpref{Event handling overview
}{eventhandlingoverview
}
1197 \membersection{wxWindow::OnIdle
}\label{wxwindowonidle
}
1199 \func{void
}{OnIdle
}{\param{wxIdleEvent\&
}{event
}}
1201 Provide this member function for any processing which needs to be done
1202 when the application is idle.
1204 \wxheading{See also
}
1206 \helpref{wxApp::OnIdle
}{wxapponidle
},
\helpref{wxIdleEvent
}{wxidleevent
}
1208 \membersection{wxWindow::OnInitDialog
}\label{wxwindowoninitdialog
}
1210 \func{void
}{OnInitDialog
}{\param{wxInitDialogEvent\&
}{ event
}}
1212 Default handler for the wxEVT
\_INIT\_DIALOG event. Calls
\helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
}.
1214 \wxheading{Parameters
}
1216 \docparam{event
}{Dialog initialisation event.
}
1220 Gives the window the default behaviour of transferring data to child controls via
1221 the validator that each control has.
1223 \wxheading{See also
}
1225 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
}
1227 \membersection{wxWindow::OnMenuCommand
}\label{wxwindowonmenucommand
}
1229 \func{void
}{OnMenuCommand
}{\param{wxCommandEvent\&
}{event
}}
1231 Called when a menu command is received from a menu bar.
1233 \wxheading{Parameters
}
1235 \docparam{event
}{The menu command event. For more information, see
\helpref{wxCommandEvent
}{wxcommandevent
}.
}
1239 A function with this name doesn't actually exist; you can choose any member function to receive
1240 menu command events, using the EVT
\_COMMAND macro for individual commands or EVT
\_COMMAND\_RANGE for
1241 a range of commands.
1243 \wxheading{See also
}
1245 \helpref{wxCommandEvent
}{wxcommandevent
},
\rtfsp
1246 \helpref{wxWindow::OnMenuHighlight
}{wxwindowonmenuhighlight
},
\rtfsp
1247 \helpref{Event handling overview
}{eventhandlingoverview
}
1249 \membersection{wxWindow::OnMenuHighlight
}\label{wxwindowonmenuhighlight
}
1251 \func{void
}{OnMenuHighlight
}{\param{wxMenuEvent\&
}{event
}}
1253 Called when a menu select is received from a menu bar: that is, the
1254 mouse cursor is over a menu item, but the left mouse button has not been
1257 \wxheading{Parameters
}
1259 \docparam{event
}{The menu highlight event. For more information, see
\helpref{wxMenuEvent
}{wxmenuevent
}.
}
1263 You can choose any member function to receive
1264 menu select events, using the EVT
\_MENU\_HIGHLIGHT macro for individual menu items or EVT
\_MENU\_HIGHLIGHT\_ALL macro
1267 The default implementation for
\helpref{wxFrame::OnMenuHighlight
}{wxframeonmenuhighlight
} displays help
1268 text in the first field of the status bar.
1270 This function was known as
{\bf OnMenuSelect
} in earlier versions of wxWindows, but this was confusing
1271 since a selection is normally a left-click action.
1273 \wxheading{See also
}
1275 \helpref{wxMenuEvent
}{wxmenuevent
},
\rtfsp
1276 \helpref{wxWindow::OnMenuCommand
}{wxwindowonmenucommand
},
\rtfsp
1277 \helpref{Event handling overview
}{eventhandlingoverview
}
1280 \membersection{wxWindow::OnMouseEvent
}\label{wxwindowonmouseevent
}
1282 \func{void
}{OnMouseEvent
}{\param{wxMouseEvent\&
}{ event
}}
1284 Called when the user has initiated an event with the
1287 \wxheading{Parameters
}
1289 \docparam{event
}{The mouse event. See
\helpref{wxMouseEvent
}{wxmouseevent
} for
1294 Most, but not all, windows respond to this event.
1296 To intercept this event, use the EVT
\_MOUSE\_EVENTS macro in an event table definition, or individual
1297 mouse event macros such as EVT
\_LEFT\_DOWN.
1299 \wxheading{See also
}
1301 \helpref{wxMouseEvent
}{wxmouseevent
},
\rtfsp
1302 \helpref{Event handling overview
}{eventhandlingoverview
}
1304 \membersection{wxWindow::OnMove
}\label{wxwindowonmove
}
1306 \func{void
}{OnMove
}{\param{wxMoveEvent\&
}{event
}}
1308 Called when a window is moved.
1310 \wxheading{Parameters
}
1312 \docparam{event
}{The move event. For more information, see
\helpref{wxMoveEvent
}{wxmoveevent
}.
}
1316 Use the EVT
\_MOVE macro to intercept move events.
1320 Not currently implemented.
1322 \wxheading{See also
}
1324 \helpref{wxMoveEvent
}{wxmoveevent
},
\rtfsp
1325 \helpref{wxFrame::OnSize
}{wxframeonsize
},
\rtfsp
1326 \helpref{Event handling overview
}{eventhandlingoverview
}
1328 \membersection{wxWindow::OnPaint
}\label{wxwindowonpaint
}
1330 \func{void
}{OnPaint
}{\param{wxPaintEvent\&
}{event
}}
1332 Sent to the event handler when the window must be refreshed.
1334 \wxheading{Parameters
}
1336 \docparam{event
}{Paint event. For more information, see
\helpref{wxPaintEvent
}{wxpaintevent
}.
}
1340 Use the EVT
\_PAINT macro in an event table definition to intercept paint events.
1342 In a paint event handler, the application should always create a
\helpref{wxPaintDC
}{wxpaintdc
} object.
1348 void MyWindow::OnPaint(wxPaintEvent& event)
1357 You can optimize painting by retrieving the rectangles
1358 that have been damaged and only repainting these. The rectangles are in
1359 terms of the client area, and are unscrolled, so you will need to do
1360 some calculations using the current view position to obtain logical,
1363 Here is an example of using the
\helpref{wxRegionIterator
}{wxregioniterator
} class:
1367 // Called when window needs to be repainted.
1368 void MyWindow::OnPaint(wxPaintEvent& event)
1372 // Find Out where the window is scrolled to
1373 int vbX,vbY; // Top left corner of client
1374 ViewStart(&vbX,&vbY);
1376 int vX,vY,vW,vH; // Dimensions of client area in pixels
1377 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1386 // Alternatively we can do this:
1388 // upd.GetRect(&rect);
1390 // Repaint this rectangle
1399 \wxheading{See also
}
1401 \helpref{wxPaintEvent
}{wxpaintevent
},
\rtfsp
1402 \helpref{wxPaintDC
}{wxpaintdc
},
\rtfsp
1403 \helpref{Event handling overview
}{eventhandlingoverview
}
1405 \membersection{wxWindow::OnScroll
}\label{wxwindowonscroll
}
1407 \func{void
}{OnScroll
}{\param{wxScrollWinEvent\&
}{event
}}
1409 Called when a scroll window event is received from one of the window's built-in scrollbars.
1411 \wxheading{Parameters
}
1413 \docparam{event
}{Command event. Retrieve the new scroll position by
1414 calling
\helpref{wxScrollEvent::GetPosition
}{wxscrolleventgetposition
}, and the
1415 scrollbar orientation by calling
\helpref{wxScrollEvent::GetOrientation
}{wxscrolleventgetorientation
}.
}
1419 Note that it is not possible to distinguish between horizontal and vertical scrollbars
1420 until the function is executing (you can't have one function for vertical, another
1421 for horizontal events).
1423 \wxheading{See also
}
1425 \helpref{wxScrollWinEvent
}{wxscrollwinevent
},
\rtfsp
1426 \helpref{Event handling overview
}{eventhandlingoverview
}
1428 \membersection{wxWindow::OnSetFocus
}\label{wxwindowonsetfocus
}
1430 \func{void
}{OnSetFocus
}{\param{wxFocusEvent\&
}{event
}}
1432 Called when a window's focus is being set.
1434 \wxheading{Parameters
}
1436 \docparam{event
}{The focus event. For more information, see
\helpref{wxFocusEvent
}{wxfocusevent
}.
}
1440 To intercept this event, use the macro EVT
\_SET\_FOCUS in an event table definition.
1442 Most, but not all, windows respond to this event.
1444 \wxheading{See also
}
1446 \helpref{wxFocusEvent
}{wxfocusevent
},
\helpref{wxWindow::OnKillFocus
}{wxwindowonkillfocus
},
\rtfsp
1447 \helpref{Event handling overview
}{eventhandlingoverview
}
1449 \membersection{wxWindow::OnSize
}\label{wxwindowonsize
}
1451 \func{void
}{OnSize
}{\param{wxSizeEvent\&
}{event
}}
1453 Called when the window has been resized.
1455 \wxheading{Parameters
}
1457 \docparam{event
}{Size event. For more information, see
\helpref{wxSizeEvent
}{wxsizeevent
}.
}
1461 You may wish to use this for frames to resize their child windows as appropriate.
1463 Note that the size passed is of
1464 the whole window: call
\helpref{wxWindow::GetClientSize
}{wxwindowgetclientsize
} for the area which may be
1465 used by the application.
1467 \wxheading{See also
}
1469 \helpref{wxSizeEvent
}{wxsizeevent
},
\rtfsp
1470 \helpref{Event handling overview
}{eventhandlingoverview
}
1472 \membersection{wxWindow::OnSysColourChanged
}\label{wxwindowonsyscolourchanged
}
1474 \func{void
}{OnSysColourChanged
}{\param{wxOnSysColourChangedEvent\&
}{event
}}
1476 Called when the user has changed the system colours. Windows only.
1478 \wxheading{Parameters
}
1480 \docparam{event
}{System colour change event. For more information, see
\helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
}.
}
1482 \wxheading{See also
}
1484 \helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
},
\rtfsp
1485 \helpref{Event handling overview
}{eventhandlingoverview
}
1487 \membersection{wxWindow::PopEventHandler
}\label{wxwindowpopeventhandler
}
1489 \constfunc{wxEvtHandler*
}{PopEventHandler
}{\param{bool
}{deleteHandler = FALSE
}}
1491 Removes and returns the top-most event handler on the event handler stack.
1493 \wxheading{Parameters
}
1495 \docparam{deleteHandler
}{If this is TRUE, the handler will be deleted after it is removed. The
1496 default value is FALSE.
}
1498 \wxheading{See also
}
1500 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1501 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1502 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1503 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1504 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
1506 \membersection{wxWindow::PopupMenu
}\label{wxwindowpopupmenu
}
1508 \func{bool
}{PopupMenu
}{\param{wxMenu*
}{menu
},
\param{const wxPoint&
}{pos
}}
1510 \func{bool
}{PopupMenu
}{\param{wxMenu*
}{menu
},
\param{int
}{x
},
\param{int
}{y
}}
1512 Pops up the given menu at the specified coordinates, relative to this
1513 window, and returns control when the user has dismissed the menu. If a
1514 menu item is selected, the corresponding menu event is generated and will be
1515 processed as usually.
1517 \wxheading{Parameters
}
1519 \docparam{menu
}{Menu to pop up.
}
1521 \docparam{pos
}{The position where the menu will appear.
}
1523 \docparam{x
}{Required x position for the menu to appear.
}
1525 \docparam{y
}{Required y position for the menu to appear.
}
1527 \wxheading{See also
}
1529 \helpref{wxMenu
}{wxmenu
}
1533 Just before the menu is popped up,
\helpref{wxMenu::UpdateUI
}{wxmenuupdateui
} is called
1534 to ensure that the menu items are in the correct state. The menu does not get deleted
1537 \pythonnote{In place of a single overloaded method name, wxPython
1538 implements the following methods:
\par
1539 \indented{2cm
}{\begin{twocollist
}
1540 \twocolitem{\bf{PopupMenu(menu, point)
}}{Specifies position with a wxPoint
}
1541 \twocolitem{\bf{PopupMenuXY(menu, x, y)
}}{Specifies position with two integers (x, y)
}
1545 \membersection{wxWindow::PushEventHandler
}\label{wxwindowpusheventhandler
}
1547 \func{void
}{PushEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1549 Pushes this event handler onto the event stack for the window.
1551 \wxheading{Parameters
}
1553 \docparam{handler
}{Specifies the handler to be pushed.
}
1557 An event handler is an object that is capable of processing the events
1558 sent to a window. By default, the window is its own event handler, but
1559 an application may wish to substitute another, for example to allow
1560 central implementation of event-handling for a variety of different
1563 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} allows
1564 an application to set up a chain of event handlers, where an event not handled by one event handler is
1565 handed to the next one in the chain. Use
\helpref{wxWindow::PopEventHandler
}{wxwindowpopeventhandler
} to
1566 remove the event handler.
1568 \wxheading{See also
}
1570 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1571 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1572 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1573 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1574 \helpref{wxEvtHandler
}{wxevthandler
}
1576 \membersection{wxWindow::Raise
}\label{wxwindowraise
}
1578 \func{void
}{Raise
}{\void}
1580 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1583 \membersection{wxWindow::Refresh
}\label{wxwindowrefresh
}
1585 \func{virtual void
}{Refresh
}{\param{const bool
}{ eraseBackground = TRUE
},
\param{const wxRect*
}{rect
1588 Causes a message or event to be generated to repaint the
1591 \wxheading{Parameters
}
1593 \docparam{eraseBackground
}{If TRUE, the background will be
1596 \docparam{rect
}{If non-NULL, only the given rectangle will
1597 be treated as damaged.
}
1599 \membersection{wxWindow::ReleaseMouse
}\label{wxwindowreleasemouse
}
1601 \func{virtual void
}{ReleaseMouse
}{\void}
1603 Releases mouse input captured with
\helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}.
1605 \wxheading{See also
}
1607 \helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}
1609 \membersection{wxWindow::RemoveChild
}\label{wxwindowremovechild
}
1611 \func{virtual void
}{RemoveChild
}{\param{wxWindow*
}{child
}}
1613 Removes a child window. This is called automatically by window deletion
1614 functions so should not be required by the application programmer.
1616 \wxheading{Parameters
}
1618 \docparam{child
}{Child window to remove.
}
1620 \membersection{wxWindow::Reparent
}\label{wxwindowreparent
}
1622 \func{virtual bool
}{Reparent
}{\param{wxWindow*
}{newParent
}}
1624 Reparents the window, i.e the window will be removed from its
1625 current parent window (e.g. a non-standard toolbar in a wxFrame)
1626 and then re-inserted into another (e.g. a wxMiniFrame for a
1627 floating toolbar). Available on Windows and GTK+.
1629 \wxheading{Parameters
}
1631 \docparam{newParent
}{New parent.
}
1633 \membersection{wxWindow::ScreenToClient
}\label{wxwindowscreentoclient
}
1635 \constfunc{virtual void
}{ScreenToClient
}{\param{int*
}{x
},
\param{int*
}{y
}}
1637 \constfunc{virtual wxPoint
}{ScreenToClient
}{\param{const wxPoint\&
}{pt
}}
1639 Converts from screen to client window coordinates.
1641 \wxheading{Parameters
}
1643 \docparam{x
}{Stores the screen x coordinate and receives the client x coordinate.
}
1645 \docparam{y
}{Stores the screen x coordinate and receives the client x coordinate.
}
1647 \docparam{pt
}{The screen position for the second form of the function.
}
1649 \pythonnote{In place of a single overloaded method name, wxPython
1650 implements the following methods:
\par
1651 \indented{2cm
}{\begin{twocollist
}
1652 \twocolitem{\bf{ScreenToClient(point)
}}{Accepts and returns a wxPoint
}
1653 \twocolitem{\bf{ScreenToClientXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
1658 \membersection{wxWindow::ScrollWindow
}\label{wxwindowscrollwindow
}
1660 \func{virtual void
}{ScrollWindow
}{\param{int
}{dx
},
\param{int
}{dy
},
\param{const wxRect*
}{ rect = NULL
}}
1662 Physically scrolls the pixels in the window and move child windows accordingly.
1664 \wxheading{Parameters
}
1666 \docparam{dx
}{Amount to scroll horizontally.
}
1668 \docparam{dy
}{Amount to scroll vertically.
}
1670 \docparam{rect
}{Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
1671 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
1672 can optimise painting by checking for the invalidated region. This paramter is ignored under GTK,
1673 instead the regions to be invalidated are calculated automatically.
}
1677 Use this function to optimise your scrolling implementations, to minimise the area that must be
1678 redrawn. Note that it is rarely required to call this function from a user program.
1680 \membersection{wxWindow::SetAcceleratorTable
}\label{wxwindowsetacceleratortable
}
1682 \func{virtual void
}{SetAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{ accel
}}
1684 Sets the accelerator table for this window. See
\helpref{wxAcceleratorTable
}{wxacceleratortable
}.
1686 \membersection{wxWindow::SetAutoLayout
}\label{wxwindowsetautolayout
}
1688 \func{void
}{SetAutoLayout
}{\param{const bool
}{ autoLayout
}}
1690 Determines whether the
\helpref{wxWindow::Layout
}{wxwindowlayout
} function will
1691 be called automatically when the window is resized.
1693 \wxheading{Parameters
}
1695 \docparam{autoLayout
}{Set this to TRUE if you wish the Layout function to be called
1696 from within wxWindow::OnSize functions.
}
1700 Note that this function is actually disabled for wxWindow and only indirectly
1701 takes affect for children of wxDialog, wxFrame, wxNotebook and wxSplitterWindow.
1703 \wxheading{See also
}
1705 \helpref{wxWindow::SetConstraints
}{wxwindowsetconstraints
}
1707 \membersection{wxWindow::SetBackgroundColour
}\label{wxwindowsetbackgroundcolour
}
1709 \func{virtual void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colour
}}
1711 Sets the background colour of the window.
1713 \wxheading{Parameters
}
1715 \docparam{colour
}{The colour to be used as the background colour.
}
1719 The background colour is usually painted by the default
\rtfsp
1720 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
} event handler function
1721 under Windows and automatically under GTK.
1723 Note that setting the background colour does not cause an immediate refresh, so you
1724 may wish to call
\helpref{wxWindow::Clear
}{wxwindowclear
} or
\helpref{wxWindow::Refresh
}{wxwindowrefresh
} after
1725 calling this function.
1727 Note that when using this functions under GTK, you will disable the so called "themes",
1728 i.e. the user chosen apperance of windows and controls, including the themes of
1729 their parent windows.
1731 \wxheading{See also
}
1733 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
},
\rtfsp
1734 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
1735 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
1736 \helpref{wxWindow::Clear
}{wxwindowclear
},
\rtfsp
1737 \helpref{wxWindow::Refresh
}{wxwindowrefresh
},
\rtfsp
1738 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
}
1740 \membersection{wxWindow::SetClientSize
}\label{wxwindowsetclientsize
}
1742 \func{virtual void
}{SetClientSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
1744 \func{virtual void
}{SetClientSize
}{\param{const wxSize\&
}{ size
}}
1746 This sets the size of the window client area in pixels. Using this function to size a window
1747 tends to be more device-independent than
\helpref{wxWindow::SetSize
}{wxwindowsetsize
}, since the application need not
1748 worry about what dimensions the border or title bar have when trying to fit the window
1749 around panel items, for example.
1751 \wxheading{Parameters
}
1753 \docparam{width
}{The required client area width.
}
1755 \docparam{height
}{The required client area height.
}
1757 \docparam{size
}{The required client size.
}
1759 \pythonnote{In place of a single overloaded method name, wxPython
1760 implements the following methods:
\par
1761 \indented{2cm
}{\begin{twocollist
}
1762 \twocolitem{\bf{SetClientSize(size)
}}{Accepts a wxSize
}
1763 \twocolitem{\bf{SetClientSizeWH(width, height)
}}{}
1767 \membersection{wxWindow::SetCursor
}\label{wxwindowsetcursor
}
1769 \func{virtual void
}{SetCursor
}{\param{const wxCursor\&
}{cursor
}}
1771 Sets the window's cursor. Notice that setting the cursor for this window does
1772 not set it for its children so you'll need to explicitly call SetCursor() for
1773 them too if you need it.
1775 \wxheading{Parameters
}
1777 \docparam{cursor
}{Specifies the cursor that the window should normally display.
}
1779 \wxheading{See also
}
1781 \helpref{::wxSetCursor
}{wxsetcursor
},
\helpref{wxCursor
}{wxcursor
}
1783 \membersection{wxWindow::SetEventHandler
}\label{wxwindowseteventhandler
}
1785 \func{void
}{SetEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1787 Sets the event handler for this window.
1789 \wxheading{Parameters
}
1791 \docparam{handler
}{Specifies the handler to be set.
}
1795 An event handler is an object that is capable of processing the events
1796 sent to a window. By default, the window is its own event handler, but
1797 an application may wish to substitute another, for example to allow
1798 central implementation of event-handling for a variety of different
1801 It is usually better to use
\helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} since
1802 this sets up a chain of event handlers, where an event not handled by one event handler is
1803 handed to the next one in the chain.
1805 \wxheading{See also
}
1807 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1808 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1809 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1810 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1811 \helpref{wxEvtHandler
}{wxevthandler
}
1813 \membersection{wxWindow::SetConstraints
}\label{wxwindowsetconstraints
}
1815 \func{void
}{SetConstraints
}{\param{wxLayoutConstraints*
}{constraints
}}
1817 Sets the window to have the given layout constraints. The window
1818 will then own the object, and will take care of its deletion.
1819 If an existing layout constraints object is already owned by the
1820 window, it will be deleted.
1822 \wxheading{Parameters
}
1824 \docparam{constraints
}{The constraints to set. Pass NULL to disassociate and delete the window's
1829 You must call
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} to tell a window to use
1830 the constraints automatically in OnSize; otherwise, you must
1831 override OnSize and call Layout explicitly.
1833 \membersection{wxWindow::SetDropTarget
}\label{wxwindowsetdroptarget
}
1835 \func{void
}{SetDropTarget
}{\param{wxDropTarget*
}{ target
}}
1837 Associates a drop target with this window.
1839 If the window already has a drop target, it is deleted.
1841 \wxheading{See also
}
1843 \helpref{wxWindow::GetDropTarget
}{wxwindowgetdroptarget
},
1844 \helpref{Drag and drop overview
}{wxdndoverview
}
1846 \membersection{wxWindow::SetFocus
}\label{wxwindowsetfocus
}
1848 \func{virtual void
}{SetFocus
}{\void}
1850 This sets the window to receive keyboard input.
1852 \membersection{wxWindow::SetFont
}\label{wxwindowsetfont
}
1854 \func{void
}{SetFont
}{\param{const wxFont\&
}{font
}}
1856 Sets the font for this window.
1858 \wxheading{Parameters
}
1860 \docparam{font
}{Font to associate with this window.
}
1862 \wxheading{See also
}
1864 \helpref{wxWindow::GetFont
}{wxwindowgetfont
}
1866 \membersection{wxWindow::SetForegroundColour
}\label{wxwindowsetforegroundcolour
}
1868 \func{virtual void
}{SetForegroundColour
}{\param{const wxColour\&
}{colour
}}
1870 Sets the foreground colour of the window.
1872 \wxheading{Parameters
}
1874 \docparam{colour
}{The colour to be used as the foreground colour.
}
1878 The interpretation of foreground colour is open to interpretation according
1879 to the window class; it may be the text colour or other colour, or it may not
1882 Note that when using this functions under GTK, you will disable the so called "themes",
1883 i.e. the user chosen apperance of windows and controls, including the themes of
1884 their parent windows.
1886 \wxheading{See also
}
1888 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
1889 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
1890 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
1892 \membersection{wxWindow::SetId
}\label{wxwindowsetid
}
1894 \func{void
}{SetId
}{\param{int
}{ id
}}
1896 Sets the identifier of the window.
1900 Each window has an integer identifier. If the application has not provided one,
1901 an identifier will be generated. Normally, the identifier should be provided
1902 on creation and should not be modified subsequently.
1904 \wxheading{See also
}
1906 \helpref{wxWindow::GetId
}{wxwindowgetid
},
\rtfsp
1907 \helpref{Window identifiers
}{windowids
}
1909 \membersection{wxWindow::SetName
}\label{wxwindowsetname
}
1911 \func{virtual void
}{SetName
}{\param{const wxString\&
}{name
}}
1913 Sets the window's name.
1915 \wxheading{Parameters
}
1917 \docparam{name
}{A name to set for the window.
}
1919 \wxheading{See also
}
1921 \helpref{wxWindow::GetName
}{wxwindowgetname
}
1923 \membersection{wxWindow::SetPalette
}\label{wxwindowsetpalette
}
1925 \func{virtual void
}{SetPalette
}{\param{wxPalette*
}{palette
}}
1927 Obsolete - use
\helpref{wxDC::SetPalette
}{wxdcsetpalette
} instead.
1929 \membersection{wxWindow::SetScrollbar
}\label{wxwindowsetscrollbar
}
1931 \func{virtual void
}{SetScrollbar
}{\param{int
}{orientation
},
\param{int
}{position
},
\rtfsp
1932 \param{int
}{thumbSize
},
\param{int
}{range
},
\rtfsp
1933 \param{const bool
}{refresh = TRUE
}}
1935 Sets the scrollbar properties of a built-in scrollbar.
1937 \wxheading{Parameters
}
1939 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1941 \docparam{position
}{The position of the scrollbar in scroll units.
}
1943 \docparam{thumbSize
}{The size of the thumb, or visible portion of the scrollbar, in scroll units.
}
1945 \docparam{range
}{The maximum position of the scrollbar.
}
1947 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1951 Let's say you wish to display
50 lines of text, using the same font.
1952 The window is sized so that you can only see
16 lines at a time.
1958 SetScrollbar(wxVERTICAL,
0,
16,
50);
1962 Note that with the window at this size, the thumb position can never go
1963 above
50 minus
16, or
34.
1965 You can determine how many lines are currently visible by dividing the current view
1966 size by the character height in pixels.
1968 When defining your own scrollbar behaviour, you will always need to recalculate
1969 the scrollbar settings when the window size changes. You could therefore put your
1970 scrollbar calculations and SetScrollbar
1971 call into a function named AdjustScrollbars, which can be called initially and also
1972 from your
\helpref{wxWindow::OnSize
}{wxwindowonsize
} event handler function.
1974 \wxheading{See also
}
1976 \helpref{Scrolling overview
}{scrollingoverview
},
\rtfsp
1977 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
1980 \membersection{wxWindow::SetScrollPage
}\label{wxwindowsetscrollpage
}
1982 \func{virtual void
}{SetScrollPage
}{\param{int
}{orientation
},
\param{int
}{pageSize
},
\param{const bool
}{refresh = TRUE
}}
1984 Sets the page size of one of the built-in scrollbars.
1986 \wxheading{Parameters
}
1988 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1990 \docparam{pageSize
}{Page size in scroll units.
}
1992 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1996 The page size of a scrollbar is the number of scroll units that the scroll thumb travels when you
1997 click on the area above/left of or below/right of the thumb. Normally you will want a whole visible
1998 page to be scrolled, i.e. the size of the current view (perhaps the window client size). This
1999 value has to be adjusted when the window is resized, since the page size will have changed.
2001 In addition to specifying how far the scroll thumb travels when paging, in Motif and some versions of Windows
2002 the thumb changes size to reflect the page size relative to the length of the
document. When the
2003 document size is only slightly bigger than the current view (window) size, almost all of the scrollbar
2004 will be taken up by the thumb. When the two values become the same, the scrollbar will (on some systems)
2007 Currently, this function should be called before SetPageRange, because of a quirk in the Windows
2008 handling of pages and ranges.
2010 \wxheading{See also
}
2012 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2013 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2014 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2015 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2018 \membersection{wxWindow::SetScrollPos
}\label{wxwindowsetscrollpos
}
2020 \func{virtual void
}{SetScrollPos
}{\param{int
}{orientation
},
\param{int
}{pos
},
\param{const bool
}{refresh = TRUE
}}
2022 Sets the position of one of the built-in scrollbars.
2024 \wxheading{Parameters
}
2026 \docparam{orientation
}{Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2028 \docparam{pos
}{Position in scroll units.
}
2030 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
2034 This function does not directly affect the contents of the window: it is up to the
2035 application to take note of scrollbar attributes and redraw contents accordingly.
2037 \wxheading{See also
}
2039 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
},
\rtfsp
2040 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2041 \helpref{wxWindow::GetScrollThumb
}{wxwindowgetscrollthumb
},
\rtfsp
2042 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2045 \membersection{wxWindow::SetScrollRange
}\label{wxwindowsetscrollrange
}
2047 \func{virtual void
}{SetScrollRange
}{\param{int
}{orientation
},
\param{int
}{range
},
\param{const bool
}{refresh = TRUE
}}
2049 Sets the range of one of the built-in scrollbars.
2051 \wxheading{Parameters
}
2053 \docparam{orientation
}{Determines the scrollbar whose range is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2055 \docparam{range
}{Scroll range.
}
2057 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
2061 The range of a scrollbar is the number of steps that the thumb may travel, rather than the total
2062 object length of the scrollbar. If you are implementing a scrolling window, for example, you
2063 would adjust the scroll range when the window is resized, by subtracting the window view size from the
2064 total virtual window size. When the two sizes are the same (all the window is visible), the range goes to zero
2065 and usually the scrollbar will be automatically hidden.
2067 \wxheading{See also
}
2069 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2070 \helpref{wxWindow::SetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2071 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2072 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2073 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2076 \membersection{wxWindow::SetSize
}\label{wxwindowsetsize
}
2078 \func{virtual void
}{SetSize
}{\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
},
2079 \param{int
}{ sizeFlags = wxSIZE
\_AUTO}}
2081 \func{virtual void
}{SetSize
}{\param{const wxRect\&
}{ rect
}}
2083 Sets the size and position of the window in pixels.
2085 \func{virtual void
}{SetSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
2087 \func{virtual void
}{SetSize
}{\param{const wxSize\&
}{ size
}}
2089 Sets the size of the window in pixels.
2091 \wxheading{Parameters
}
2093 \docparam{x
}{Required x position in pixels, or -
1 to indicate that the existing
2094 value should be used.
}
2096 \docparam{y
}{Required y position in pixels, or -
1 to indicate that the existing
2097 value should be used.
}
2099 \docparam{width
}{Required width in pixels, or -
1 to indicate that the existing
2100 value should be used.
}
2102 \docparam{height
}{Required height position in pixels, or -
1 to indicate that the existing
2103 value should be used.
}
2105 \docparam{size
}{\helpref{wxSize
}{wxsize
} object for setting the size.
}
2107 \docparam{rect
}{\helpref{wxRect
}{wxrect
} object for setting the position and size.
}
2109 \docparam{sizeFlags
}{Indicates the interpretation of other parameters. It is a bit list of the following:
2111 {\bf wxSIZE
\_AUTO\_WIDTH}: a -
1 width value is taken to indicate
2112 a wxWindows-supplied default width.\\
2113 {\bf wxSIZE
\_AUTO\_HEIGHT}: a -
1 height value is taken to indicate
2114 a wxWindows-supplied default width.\\
2115 {\bf wxSIZE
\_AUTO}: -
1 size values are taken to indicate
2116 a wxWindows-supplied default size.\\
2117 {\bf wxSIZE
\_USE\_EXISTING}: existing dimensions should be used
2118 if -
1 values are supplied.\\
2119 {\bf wxSIZE
\_ALLOW\_MINUS\_ONE}: allow dimensions of -
1 and less to be interpreted
2120 as real dimensions, not default values.
2125 The second form is a convenience for calling the first form with default
2126 x and y parameters, and must be used with non-default width and height values.
2128 The first form sets the position and optionally size, of the window.
2129 Parameters may be -
1 to indicate either that a default should be supplied
2130 by wxWindows, or that the current value of the dimension should be used.
2132 \wxheading{See also
}
2134 \helpref{wxWindow::Move
}{wxwindowmove
}
2136 \pythonnote{In place of a single overloaded method name, wxPython
2137 implements the following methods:
\par
2138 \indented{2cm
}{\begin{twocollist
}
2139 \twocolitem{\bf{SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO)
}}{}
2140 \twocolitem{\bf{SetSize(size)
}}{}
2141 \twocolitem{\bf{SetPosition(point)
}}{}
2145 \membersection{wxWindow::SetSizeHints
}\label{wxwindowsetsizehints
}
2147 \func{virtual void
}{SetSizeHints
}{\param{int
}{ minW=-
1},
\param{int
}{ minH=-
1},
\param{int
}{ maxW=-
1},
\param{int
}{ maxH=-
1},
2148 \param{int
}{ incW=-
1},
\param{int
}{ incH=-
1}}
2150 Allows specification of minimum and maximum window sizes, and window size increments.
2151 If a pair of values is not set (or set to -
1), the default values will be used.
2153 \wxheading{Parameters
}
2155 \docparam{minW
}{Specifies the minimum width allowable.
}
2157 \docparam{minH
}{Specifies the minimum height allowable.
}
2159 \docparam{maxW
}{Specifies the maximum width allowable.
}
2161 \docparam{maxH
}{Specifies the maximum height allowable.
}
2163 \docparam{incW
}{Specifies the increment for sizing the width (Motif/Xt only).
}
2165 \docparam{incH
}{Specifies the increment for sizing the height (Motif/Xt only).
}
2169 If this function is called, the user will not be able to size the window outside the
2172 The resizing increments are only significant under Motif or Xt.
2174 \membersection{wxWindow::SetTitle
}\label{wxwindowsettitle
}
2176 \func{virtual void
}{SetTitle
}{\param{const wxString\&
}{title
}}
2178 Sets the window's title. Applicable only to frames and dialogs.
2180 \wxheading{Parameters
}
2182 \docparam{title
}{The window's title.
}
2184 \wxheading{See also
}
2186 \helpref{wxWindow::GetTitle
}{wxwindowgettitle
}
2188 \membersection{wxWindow::SetValidator
}\label{wxwindowsetvalidator
}
2190 \func{virtual void
}{SetValidator
}{\param{const wxValidator\&
}{ validator
}}
2192 Deletes the current validator (if any) and sets the window validator, having called wxValidator::Clone to
2193 create a new validator of this type.
2195 \membersection{wxWindow::Show
}\label{wxwindowshow
}
2197 \func{virtual bool
}{Show
}{\param{const bool
}{ show
}}
2199 Shows or hides the window.
2201 \wxheading{Parameters
}
2203 \docparam{show
}{If TRUE, displays the window and brings it to the front. Otherwise,
2206 \wxheading{See also
}
2208 \helpref{wxWindow::IsShown
}{wxwindowisshown
}
2210 \membersection{wxWindow::TransferDataFromWindow
}\label{wxwindowtransferdatafromwindow
}
2212 \func{virtual bool
}{TransferDataFromWindow
}{\void}
2214 Transfers values from child controls to data areas specified by their validators. Returns
2215 FALSE if a transfer failed.
2217 \wxheading{See also
}
2219 \helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
},
\rtfsp
2220 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2222 \membersection{wxWindow::TransferDataToWindow
}\label{wxwindowtransferdatatowindow
}
2224 \func{virtual bool
}{TransferDataToWindow
}{\void}
2226 Transfers values to child controls from data areas specified by their validators.
2228 \wxheading{Return value
}
2230 Returns FALSE if a transfer failed.
2232 \wxheading{See also
}
2234 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2235 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2237 \membersection{wxWindow::Validate
}\label{wxwindowvalidate
}
2239 \func{virtual bool
}{Validate
}{\void}
2241 Validates the current values of the child controls using their validators.
2243 \wxheading{Return value
}
2245 Returns FALSE if any of the validations failed.
2247 \wxheading{See also
}
2249 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2250 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2251 \helpref{wxValidator
}{wxvalidator
}
2253 \membersection{wxWindow::WarpPointer
}\label{wxwindowwarppointer
}
2255 \func{void
}{WarpPointer
}{\param{int
}{ x
},
\param{int
}{ y
}}
2257 Moves the pointer to the given position on the window.
2259 \wxheading{Parameters
}
2261 \docparam{x
}{The new x position for the cursor.
}
2263 \docparam{y
}{The new y position for the cursor.
}