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
144 The actual behaviour depends on the derived window. For a frame or dialog box,
145 centring is relative to the whole display. For a panel item, centring is
146 relative to the panel.
150 \helpref{wxWindow::Center
}{wxwindowcenter
}
152 \membersection{wxWindow::CentreOnParent
}\label{wxwindowcentreonparent
}
154 \func{void
}{CentreOnParent
}{\param{int
}{ direction = wxHORIZONTAL
}}
158 \wxheading{Parameters
}
160 \docparam{direction
}{Specifies the direction for the centering. May be
{\tt wxHORIZONTAL
},
{\tt wxVERTICAL
}\rtfsp
165 This methods provides for a way to center top level windows over their
166 parents instead of the entire screen. If there is no parent or if the
167 window is not a top level window, then behaviour is the same as
168 \helpref{wxWindow::Centre
}{wxwindowcentre
}.
172 \helpref{wxWindow::CenterOnParent
}{wxwindowcenteronparent
}
174 \membersection{wxWindow::Clear
}\label{wxwindowclear
}
176 \func{void
}{Clear
}{\void}
178 Clears the window by filling it with the current background colour. Does not
179 cause an erase background event to be generated.
181 \membersection{wxWindow::ClientToScreen
}
183 \constfunc{virtual void
}{ClientToScreen
}{\param{int*
}{x
},
\param{int*
}{y
}}
185 \constfunc{virtual wxPoint
}{ClientToScreen
}{\param{const wxPoint\&
}{ pt
}}
187 Converts to screen coordinates from coordinates relative to this window.
189 \docparam{x
}{A pointer to a integer value for the x coordinate. Pass the client coordinate in, and
190 a screen coordinate will be passed out.
}
192 \docparam{y
}{A pointer to a integer value for the y coordinate. Pass the client coordinate in, and
193 a screen coordinate will be passed out.
}
195 \docparam{pt
}{The client position for the second form of the function.
}
197 \pythonnote{In place of a single overloaded method name, wxPython
198 implements the following methods:
\par
199 \indented{2cm
}{\begin{twocollist
}
200 \twocolitem{\bf{ClientToScreen(point)
}}{Accepts and returns a wxPoint
}
201 \twocolitem{\bf{ClientToScreenXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
206 \membersection{wxWindow::Close
}\label{wxwindowclose
}
208 \func{virtual bool
}{Close
}{\param{const bool
}{ force = FALSE
}}
210 The purpose of this call is to provide a safer way of destroying a window than using
211 the
{\it delete
} operator.
213 \wxheading{Parameters
}
215 \docparam{force
}{FALSE if the window's close handler should be able to veto the destruction
216 of this window, TRUE if it cannot.
}
220 Close calls the
\helpref{close handler
}{wxcloseevent
} for the window, providing an opportunity for the window to
221 choose whether to destroy the window.
223 The close handler should check whether the window is being deleted forcibly,
224 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}, in which case it should
225 destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
227 Applies to managed windows (wxFrame and wxDialog classes) only.
229 {\it Note
} that calling Close does not guarantee that the window will be destroyed; but it
230 provides a way to simulate a manual close of a window, which may or may not be implemented by
231 destroying the window. The default implementation of wxDialog::OnCloseWindow does not
232 necessarily delete the dialog, since it will simply simulate an wxID
\_CANCEL event which
233 itself only hides the dialog.
235 To guarantee that the window will be destroyed, call
\helpref{wxWindow::Destroy
}{wxwindowdestroy
} instead.
239 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
240 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
241 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
242 \helpref{wxCloseEvent
}{wxcloseevent
}
244 \membersection{wxWindow::ConvertDialogToPixels
}\label{wxwindowconvertdialogtopixels
}
246 \func{wxPoint
}{ConvertDialogToPixels
}{\param{const wxPoint\&
}{ pt
}}
248 \func{wxSize
}{ConvertDialogToPixels
}{\param{const wxSize\&
}{ sz
}}
250 Converts a point or size from dialog units to pixels.
252 For the x dimension, the dialog units are multiplied by the average character width
253 and then divided by
4.
255 For the y dimension, the dialog units are multiplied by the average character height
256 and then divided by
8.
260 Dialog units are used for maintaining a dialog's proportions even if the font changes.
261 Dialogs created using Dialog Editor optionally use dialog units.
263 You can also use these functions programmatically. A convenience macro is defined:
267 #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)
273 \helpref{wxWindow::ConvertPixelsToDialog
}{wxwindowconvertpixelstodialog
}
275 \pythonnote{In place of a single overloaded method name, wxPython
276 implements the following methods:
\par
277 \indented{2cm
}{\begin{twocollist
}
278 \twocolitem{\bf{ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
279 \twocolitem{\bf{ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
282 Additionally, the following helper functions are defined:
\par
283 \indented{2cm
}{\begin{twocollist
}
284 \twocolitem{\bf{wxDLG
\_PNT(win, point)
}}{Converts a wxPoint from dialog
286 \twocolitem{\bf{wxDLG
\_SZE(win, size)
}}{Converts a wxSize from dialog
292 \membersection{wxWindow::ConvertPixelsToDialog
}\label{wxwindowconvertpixelstodialog
}
294 \func{wxPoint
}{ConvertPixelsToDialog
}{\param{const wxPoint\&
}{ pt
}}
296 \func{wxSize
}{ConvertPixelsToDialog
}{\param{const wxSize\&
}{ sz
}}
298 Converts a point or size from pixels to dialog units.
300 For the x dimension, the pixels are multiplied by
4 and then divided by the average
303 For the y dimension, the pixels are multipled by
8 and then divided by the average
308 Dialog units are used for maintaining a dialog's proportions even if the font changes.
309 Dialogs created using Dialog Editor optionally use dialog units.
313 \helpref{wxWindow::ConvertDialogToPixels
}{wxwindowconvertdialogtopixels
}
316 \pythonnote{In place of a single overloaded method name, wxPython
317 implements the following methods:
\par
318 \indented{2cm
}{\begin{twocollist
}
319 \twocolitem{\bf{ConvertDialogPointToPixels(point)
}}{Accepts and returns a wxPoint
}
320 \twocolitem{\bf{ConvertDialogSizeToPixels(size)
}}{Accepts and returns a wxSize
}
324 \membersection{wxWindow::Destroy
}\label{wxwindowdestroy
}
326 \func{virtual bool
}{Destroy
}{\void}
328 Destroys the window safely. Use this function instead of the delete operator, since
329 different window classes can be destroyed differently. Frames and dialogs
330 are not destroyed immediately when this function is called - they are added
331 to a list of windows to be deleted on idle time, when all the window's events
332 have been processed. This prevents problems with events being sent to non-existant
335 \wxheading{Return value
}
337 TRUE if the window has either been successfully deleted, or it has been added
338 to the list of windows pending real deletion.
340 \membersection{wxWindow::DestroyChildren
}
342 \func{virtual void
}{DestroyChildren
}{\void}
344 Destroys all children of a window. Called automatically by the destructor.
346 \membersection{wxWindow::DragAcceptFiles
}\label{wxwindowdragacceptfiles
}
348 \func{virtual void
}{DragAcceptFiles
}{\param{const bool
}{ accept
}}
350 Enables or disables elibility for drop file events (OnDropFiles).
352 \wxheading{Parameters
}
354 \docparam{accept
}{If TRUE, the window is eligible for drop file events. If FALSE, the window
355 will not accept drop file events.
}
363 \helpref{wxWindow::OnDropFiles
}{wxwindowondropfiles
}
365 \membersection{wxWindow::Enable
}\label{wxwindowenable
}
367 \func{virtual void
}{Enable
}{\param{const bool
}{ enable
}}
369 Enable or disable the window for user input.
371 \wxheading{Parameters
}
373 \docparam{enable
}{If TRUE, enables the window for input. If FALSE, disables the window.
}
377 \helpref{wxWindow::IsEnabled
}{wxwindowisenabled
}
379 \membersection{wxWindow::FindFocus
}\label{wxwindowfindfocus
}
381 \func{static wxWindow*
}{FindFocus
}{\void}
383 Finds the window or control which currently has the keyboard focus.
387 Note that this is a static function, so it can be called without needing a wxWindow pointer.
391 \helpref{wxWindow::SetFocus
}{wxwindowsetfocus
}
393 \membersection{wxWindow::FindWindow
}\label{wxwindowfindwindow
}
395 \func{wxWindow*
}{FindWindow
}{\param{long
}{ id
}}
397 Find a child of this window, by identifier.
399 \func{wxWindow*
}{FindWindow
}{\param{const wxString\&
}{ name
}}
401 Find a child of this window, by name.
403 \pythonnote{In place of a single overloaded method name, wxPython
404 implements the following methods:
\par
405 \indented{2cm
}{\begin{twocollist
}
406 \twocolitem{\bf{FindWindowById(id)
}}{Accepts an integer
}
407 \twocolitem{\bf{FindWindowByName(name)
}}{Accepts a string
}
411 \membersection{wxWindow::Fit
}\label{wxwindowfit
}
413 \func{virtual void
}{Fit
}{\void}
415 Sizes the window so that it fits around its subwindows.
417 \membersection{wxWindow::GetBackgroundColour
}\label{wxwindowgetbackgroundcolour
}
419 \constfunc{virtual wxColour
}{GetBackgroundColour
}{\void}
421 Returns the background colour of the window.
425 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
426 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
427 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
428 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
}
430 \membersection{wxWindow::GetCharHeight
}
432 \constfunc{virtual int
}{GetCharHeight
}{\void}
434 Returns the character height for this window.
436 \membersection{wxWindow::GetCharWidth
}
438 \constfunc{virtual int
}{GetCharWidth
}{\void}
440 Returns the average character width for this window.
442 \membersection{wxWindow::GetChildren
}
444 \func{wxList\&
}{GetChildren
}{\void}
446 Returns a reference to the list of the window's children.
448 \membersection{wxWindow::GetClientSize
}\label{wxwindowgetclientsize
}
450 \constfunc{virtual void
}{GetClientSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
452 \constfunc{virtual wxSize
}{GetClientSize
}{\void}
454 This gets the size of the window `client area' in pixels. The client area is the
455 area which may be drawn on by the programmer, excluding title bar, border etc.
457 \wxheading{Parameters
}
459 \docparam{width
}{Receives the client width in pixels.
}
461 \docparam{height
}{Receives the client height in pixels.
}
463 \pythonnote{In place of a single overloaded method name, wxPython
464 implements the following methods:
\par
465 \indented{2cm
}{\begin{twocollist
}
466 \twocolitem{\bf{wxGetClientSizeTuple()
}}{Returns a
2-tuple of (width, height)
}
467 \twocolitem{\bf{wxGetClientSize()
}}{Returns a wxSize object
}
471 \membersection{wxWindow::GetConstraints
}\label{wxwindowgetconstraints
}
473 \constfunc{wxLayoutConstraints*
}{GetConstraints
}{\void}
475 Returns a pointer to the window's layout constraints, or NULL if there are none.
477 \membersection{wxWindow::GetDefaultItem
}\label{wxwindowgetdefaultitem
}
479 \constfunc{wxButton*
}{GetDefaultItem
}{\void}
481 Returns a pointer to the button which is the default for this window, or NULL.
483 \membersection{wxWindow::GetDropTarget
}\label{wxwindowgetdroptarget
}
485 \constfunc{wxDropTarget*
}{GetDropTarget
}{\void}
487 Returns the associated drop target, which may be NULL.
491 \helpref{wxWindow::SetDropTarget
}{wxwindowsetdroptarget
},
492 \helpref{Drag and drop overview
}{wxdndoverview
}
494 \membersection{wxWindow::GetEventHandler
}\label{wxwindowgeteventhandler
}
496 \constfunc{wxEvtHandler*
}{GetEventHandler
}{\void}
498 Returns the event handler for this window. By default, the window is its
503 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
504 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
505 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
506 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
507 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
509 \membersection{wxWindow::GetFont
}\label{wxwindowgetfont
}
511 \constfunc{wxFont\&
}{GetFont
}{\void}
513 Returns a reference to the font for this window.
517 \helpref{wxWindow::SetFont
}{wxwindowsetfont
}
519 \membersection{wxWindow::GetForegroundColour
}\label{wxwindowgetforegroundcolour
}
521 \func{virtual wxColour
}{GetForegroundColour
}{\void}
523 Returns the foreground colour of the window.
527 The interpretation of foreground colour is open to interpretation according
528 to the window class; it may be the text colour or other colour, or it may not
533 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
534 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
535 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
537 \membersection{wxWindow::GetGrandParent
}
539 \constfunc{wxWindow*
}{GetGrandParent
}{\void}
541 Returns the grandparent of a window, or NULL if there isn't one.
543 \membersection{wxWindow::GetHandle
}
545 \constfunc{void*
}{GetHandle
}{\void}
547 Returns the platform-specific handle of the physical window. Cast it to an appropriate
548 handle, such as
{\bf HWND
} for Windows,
{\bf Widget
} for Motif or
{\bf GtkWidget
} for GTK.
550 \membersection{wxWindow::GetId
}\label{wxwindowgetid
}
552 \constfunc{int
}{GetId
}{\void}
554 Returns the identifier of the window.
558 Each window has an integer identifier. If the application has not provided one
559 (or the default Id -
1) an unique identifier with a negative value will be generated.
563 \helpref{wxWindow::SetId
}{wxwindowsetid
}\rtfsp
564 \helpref{Window identifiers
}{windowids
}
566 \membersection{wxWindow::GetPosition
}
568 \constfunc{virtual void
}{GetPosition
}{\param{int*
}{x
},
\param{int*
}{y
}}
570 This gets the position of the window in pixels, relative to the parent window or
571 if no parent, relative to the whole display.
573 \wxheading{Parameters
}
575 \docparam{x
}{Receives the x position of the window.
}
577 \docparam{y
}{Receives the y position of the window.
}
579 \pythonnote{In place of a single overloaded method name, wxPython
580 implements the following methods:
\par
581 \indented{2cm
}{\begin{twocollist
}
582 \twocolitem{\bf{GetPosition()
}}{Returns a wxPoint
}
583 \twocolitem{\bf{GetPositionTuple()
}}{Returns a tuple (x, y)
}
587 \membersection{wxWindow::GetLabel
}
589 \constfunc{virtual wxString
}{GetLabel
}{\void}
591 Generic way of getting a label from any window, for
592 identification purposes.
596 The interpretation of this function differs from class to class.
597 For frames and dialogs, the value returned is the title. For buttons or static text controls, it is
598 the button text. This function can be useful for meta-programs (such as testing
599 tools or special-needs access programs) which need to identify windows
602 \membersection{wxWindow::GetName
}\label{wxwindowgetname
}
604 \constfunc{virtual wxString
}{GetName
}{\void}
606 Returns the window's name.
610 This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate
611 name in the window constructor or via
\helpref{wxWindow::SetName
}{wxwindowsetname
}.
615 \helpref{wxWindow::SetName
}{wxwindowsetname
}
617 \membersection{wxWindow::GetParent
}
619 \constfunc{virtual wxWindow*
}{GetParent
}{\void}
621 Returns the parent of the window, or NULL if there is no parent.
623 \membersection{wxWindow::GetRect
}\label{wxwindowgetrect
}
625 \constfunc{virtual wxRect
}{GetRect
}{\void}
627 Returns the size and position of the window as a
\helpref{wxRect
}{wxrect
} object.
629 \membersection{wxWindow::GetScrollThumb
}\label{wxwindowgetscrollthumb
}
631 \func{virtual int
}{GetScrollThumb
}{\param{int
}{orientation
}}
633 Returns the built-in scrollbar thumb size.
637 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
639 \membersection{wxWindow::GetScrollPos
}\label{wxwindowgetscrollpos
}
641 \func{virtual int
}{GetScrollPos
}{\param{int
}{orientation
}}
643 Returns the built-in scrollbar position.
647 See
\helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
649 \membersection{wxWindow::GetScrollRange
}\label{wxwindowgetscrollrange
}
651 \func{virtual int
}{GetScrollRange
}{\param{int
}{orientation
}}
653 Returns the built-in scrollbar range.
657 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
}
659 \membersection{wxWindow::GetSize
}\label{wxwindowgetsize
}
661 \constfunc{virtual void
}{GetSize
}{\param{int*
}{width
},
\param{int*
}{height
}}
663 \constfunc{virtual wxSize
}{GetSize
}{\void}
665 This gets the size of the entire window in pixels.
667 \wxheading{Parameters
}
669 \docparam{width
}{Receives the window width.
}
671 \docparam{height
}{Receives the window height.
}
673 \pythonnote{In place of a single overloaded method name, wxPython
674 implements the following methods:
\par
675 \indented{2cm
}{\begin{twocollist
}
676 \twocolitem{\bf{GetSize()
}}{Returns a wxSize
}
677 \twocolitem{\bf{GetSizeTuple()
}}{Returns a
2-tuple (width, height)
}
681 \membersection{wxWindow::GetTextExtent
}
683 \constfunc{virtual void
}{GetTextExtent
}{\param{const wxString\&
}{string
},
\param{int*
}{x
},
\param{int*
}{y
},
684 \param{int*
}{descent = NULL
},
\param{int*
}{externalLeading = NULL
},
685 \param{const wxFont*
}{font = NULL
},
\param{const bool
}{ use16 = FALSE
}}
687 Gets the dimensions of the string as it would be drawn on the
688 window with the currently selected font.
690 \wxheading{Parameters
}
692 \docparam{string
}{String whose extent is to be measured.
}
694 \docparam{x
}{Return value for width.
}
696 \docparam{y
}{Return value for height.
}
698 \docparam{descent
}{Return value for descent (optional).
}
700 \docparam{externalLeading
}{Return value for external leading (optional).
}
702 \docparam{font
}{Font to use instead of the current window font (optional).
}
704 \docparam{use16
}{If TRUE,
{\it string
} contains
16-bit characters. The default is FALSE.
}
707 \pythonnote{In place of a single overloaded method name, wxPython
708 implements the following methods:
\par
709 \indented{2cm
}{\begin{twocollist
}
710 \twocolitem{\bf{GetTextExtent(string)
}}{Returns a
2-tuple, (width, height)
}
711 \twocolitem{\bf{GetFullTextExtent(string, font=NULL)
}}{Returns a
712 4-tuple, (width, height, descent, externalLeading)
}
717 \membersection{wxWindow::GetTitle
}\label{wxwindowgettitle
}
719 \func{virtual wxString
}{GetTitle
}{\void}
721 Gets the window's title. Applicable only to frames and dialogs.
725 \helpref{wxWindow::SetTitle
}{wxwindowsettitle
}
727 \membersection{wxWindow::GetUpdateRegion
}\label{wxwindowgetupdateregion
}
729 \constfunc{virtual wxRegion
}{GetUpdateRegion
}{\void}
731 Returns the region specifying which parts of the window have been damaged. Should
732 only be called within an
\helpref{OnPaint
}{wxwindowonpaint
} event handler.
736 \helpref{wxRegion
}{wxregion
},
\helpref{wxRegionIterator
}{wxregioniterator
},
\helpref{wxWindow::OnPaint
}{wxwindowonpaint
}
738 \membersection{wxWindow::GetValidator
}\label{wxwindowgetvalidator
}
740 \constfunc{wxValidator*
}{GetValidator
}{\void}
742 Returns a pointer to the current validator for the window, or NULL if there is none.
744 \membersection{wxWindow::GetWindowStyleFlag
}
746 \constfunc{long
}{GetWindowStyleFlag
}{\void}
748 Gets the window style that was passed to the consructor or
{\bf Create
} member.
749 {\bf GetWindowStyle
} is synonymous.
751 \membersection{wxWindow::InitDialog
}\label{wxwindowinitdialog
}
753 \func{void
}{InitDialog
}{\void}
755 Sends an
\helpref{wxWindow::OnInitDialog
}{wxwindowoninitdialog
} event, which
756 in turn transfers data to the dialog via validators.
760 \helpref{wxWindow::OnInitDialog
}{wxwindowoninitdialog
}
762 \membersection{wxWindow::IsEnabled
}\label{wxwindowisenabled
}
764 \constfunc{virtual bool
}{IsEnabled
}{\void}
766 Returns TRUE if the window is enabled for input, FALSE otherwise.
770 \helpref{wxWindow::Enable
}{wxwindowenable
}
772 \membersection{wxWindow::IsRetained
}\label{wxwindowisretained
}
774 \constfunc{virtual bool
}{IsRetained
}{\void}
776 Returns TRUE if the window is retained, FALSE otherwise.
780 Retained windows are only available on X platforms.
782 \membersection{wxWindow::IsShown
}\label{wxwindowisshown
}
784 \constfunc{virtual bool
}{IsShown
}{\void}
786 Returns TRUE if the window is shown, FALSE if it has been hidden.
788 \membersection{wxWindow::IsTopLevel
}\label{wxwindowistoplevel
}
790 \constfunc{bool
}{IsTopLevel
}{\void}
792 Returns TRUE if the given window is a top-level one. Currently all frames and
793 dialogs are considered to be top-level windows (even if they have a parent
796 \membersection{wxWindow::Layout
}\label{wxwindowlayout
}
798 \func{void
}{Layout
}{\void}
800 Invokes the constraint-based layout algorithm for this window.
802 See
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} on when
803 this function gets called automatically using auto layout.
805 \membersection{wxWindow::LoadFromResource
}\label{wxwindowloadfromresource
}
807 \func{virtual bool
}{LoadFromResource
}{\param{wxWindow*
}{parent
},
\rtfsp
808 \param{const wxString\&
}{resourceName
},
\param{const wxResourceTable*
}{resourceTable = NULL
}}
810 Loads a panel or dialog from a resource file.
812 \wxheading{Parameters
}
814 \docparam{parent
}{Parent window.
}
816 \docparam{resourceName
}{The name of the resource to load.
}
818 \docparam{resourceTable
}{The resource table to load it from. If this is NULL, the
819 default resource table will be used.
}
821 \wxheading{Return value
}
823 TRUE if the operation succeeded, otherwise FALSE.
825 \membersection{wxWindow::Lower
}\label{wxwindowlower
}
827 \func{void
}{Lower
}{\void}
829 Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog
832 \membersection{wxWindow::MakeModal
}\label{wxwindowmakemodal
}
834 \func{virtual void
}{MakeModal
}{\param{const bool
}{flag
}}
836 Disables all other windows in the application so that
837 the user can only interact with this window. (This function
838 is not implemented anywhere).
840 \wxheading{Parameters
}
842 \docparam{flag
}{If TRUE, this call disables all other windows in the application so that
843 the user can only interact with this window. If FALSE, the effect is reversed.
}
845 \membersection{wxWindow::Move
}\label{wxwindowmove
}
847 \func{void
}{Move
}{\param{int
}{ x
},
\param{int
}{ y
}}
849 \func{void
}{Move
}{\param{const wxPoint\&
}{ pt
}}
851 Moves the window to the given position.
853 \wxheading{Parameters
}
855 \docparam{x
}{Required x position.
}
857 \docparam{y
}{Required y position.
}
859 \docparam{pt
}{\helpref{wxPoint
}{wxpoint
} object representing the position.
}
863 Implementations of SetSize can also implicitly implement the
864 wxWindow::Move function, which is defined in the base wxWindow class
868 SetSize(x, y, -
1, -
1, wxSIZE_USE_EXISTING);
873 \helpref{wxWindow::SetSize
}{wxwindowsetsize
}
875 \pythonnote{In place of a single overloaded method name, wxPython
876 implements the following methods:
\par
877 \indented{2cm
}{\begin{twocollist
}
878 \twocolitem{\bf{Move(point)
}}{Accepts a wxPoint
}
879 \twocolitem{\bf{MoveXY(x, y)
}}{Accepts a pair of integers
}
883 \membersection{wxWindow::OnActivate
}\label{wxwindowonactivate
}
885 \func{void
}{OnActivate
}{\param{wxActivateEvent\&
}{ event
}}
887 Called when a window is activated or deactivated.
889 \wxheading{Parameters
}
891 \docparam{event
}{Object containing activation information.
}
895 If the window is being activated,
\helpref{wxActivateEvent::GetActive
}{wxactivateeventgetactive
} returns TRUE,
896 otherwise it returns FALSE (it is being deactivated).
900 \helpref{wxActivateEvent
}{wxactivateevent
},
\rtfsp
901 \helpref{Event handling overview
}{eventhandlingoverview
}
903 \membersection{wxWindow::OnChar
}\label{wxwindowonchar
}
905 \func{void
}{OnChar
}{\param{wxKeyEvent\&
}{ event
}}
907 Called when the user has pressed a key that is not a modifier (SHIFT, CONTROL or ALT).
909 \wxheading{Parameters
}
911 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
912 details about this class.
}
916 This member function is called in response to a keypress. To intercept this event,
917 use the EVT
\_CHAR macro in an event table definition. Your
{\bf OnChar
} handler may call this
918 default function to achieve default keypress functionality.
920 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
923 Note that not all keypresses can be intercepted this way. If you wish to intercept modifier
924 keypresses, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
925 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
927 Most, but not all, windows allow keypresses to be intercepted.
931 \helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
\helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
},
\rtfsp
932 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
933 \helpref{Event handling overview
}{eventhandlingoverview
}
935 \membersection{wxWindow::OnCharHook
}\label{wxwindowoncharhook
}
937 \func{void
}{OnCharHook
}{\param{wxKeyEvent\&
}{ event
}}
939 This member is called to allow the window to intercept keyboard events
940 before they are processed by child windows.
942 \wxheading{Parameters
}
944 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
945 details about this class.
}
949 This member function is called in response to a keypress, if the window is active. To intercept this event,
950 use the EVT
\_CHAR\_HOOK macro in an event table definition. If you do not process a particular
951 keypress, call
\helpref{wxEvent::Skip
}{wxeventskip
} to allow default processing.
953 An example of using this function is in the implementation of escape-character processing for wxDialog,
954 where pressing ESC dismisses the dialog by
{\bf OnCharHook
} 'forging' a cancel button press event.
956 Note that the ASCII values do not have explicit key codes: they are passed as ASCII
959 This function is only relevant to top-level windows (frames and dialogs), and under
960 Windows only. Under GTK the normal EVT
\_CHAR\_ event has the functionality, i.e.
961 you can intercepts it and if you don't call
\helpref{wxEvent::Skip
}{wxeventskip
}
962 the window won't get the event.
966 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
967 \helpref{wxApp::OnCharHook
}{wxapponcharhook
},
\rtfsp
968 \helpref{Event handling overview
}{eventhandlingoverview
}
970 \membersection{wxWindow::OnCommand
}\label{wxwindowoncommand
}
972 \func{virtual void
}{OnCommand
}{\param{wxEvtHandler\&
}{object
},
\param{wxCommandEvent\&
}{event
}}
974 This virtual member function is called if the control does not handle the command event.
976 \wxheading{Parameters
}
978 \docparam{object
}{Object receiving the command event.
}
980 \docparam{event
}{Command event
}
984 This virtual function is provided mainly for backward compatibility. You can also intercept commands
985 from child controls by using an event table, with identifiers or identifier ranges to identify
986 the control(s) in question.
990 \helpref{wxCommandEvent
}{wxcommandevent
},
\rtfsp
991 \helpref{Event handling overview
}{eventhandlingoverview
}
993 \membersection{wxWindow::OnClose
}\label{wxwindowonclose
}
995 \func{virtual bool
}{OnClose
}{\void}
997 Called when the user has tried to close a a frame
998 or dialog box using the window manager (X) or system menu (Windows).
1000 {\bf Note:
} This is an obsolete function.
1001 It is superceded by the
\helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
} event
1004 \wxheading{Return value
}
1006 If TRUE is returned by OnClose, the window will be deleted by the system, otherwise the
1007 attempt will be ignored. Do not delete the window from within this handler, although
1008 you may delete other windows.
1010 \wxheading{See also
}
1012 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
1013 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
1014 \helpref{wxWindow::OnCloseWindow
}{wxwindowonclosewindow
},
\rtfsp
1015 \helpref{wxCloseEvent
}{wxcloseevent
}
1017 \membersection{wxWindow::OnCloseWindow
}\label{wxwindowonclosewindow
}
1019 \func{void
}{OnCloseWindow
}{\param{wxCloseEvent\&
}{event
}}
1021 This is an event handler function called when the user has tried to close a a frame
1022 or dialog box using the window manager (X) or system menu (Windows). It is
1023 called via the
\helpref{wxWindow::Close
}{wxwindowclose
} function, so
1024 that the application can also invoke the handler programmatically.
1026 Use the EVT
\_CLOSE event table macro to handle close events.
1028 You should check whether the application is forcing the deletion of the window
1029 using
\helpref{wxCloseEvent::GetForce
}{wxcloseeventgetforce
}. If this is TRUE,
1030 destroy the window using
\helpref{wxWindow::Destroy
}{wxwindowdestroy
}.
1031 If not, it is up to you whether you respond by destroying the window.
1033 (Note: GetForce is now superceded by CanVeto. So to test whether forced destruction of
1034 the window is required, test for the negative of CanVeto. If CanVeto returns FALSE,
1035 it is not possible to skip window deletion.)
1037 If you don't destroy the window, you should call
\helpref{wxCloseEvent::Veto
}{wxcloseeventveto
} to
1038 let the calling code know that you did not destroy the window. This allows the
\helpref{wxWindow::Close
}{wxwindowclose
} function
1039 to return TRUE or FALSE depending on whether the close instruction was honoured or not.
1043 The
\helpref{wxWindow::OnClose
}{wxwindowonclose
} virtual function remains
1044 for backward compatibility with earlier versions of wxWindows. The
1045 default
{\bf OnCloseWindow
} handler for wxFrame and wxDialog will call
{\bf OnClose
},
1046 destroying the window if it returns TRUE or if the close is being forced.
1048 \wxheading{See also
}
1050 \helpref{Window deletion overview
}{windowdeletionoverview
},
\rtfsp
1051 \helpref{wxWindow::Close
}{wxwindowclose
},
\rtfsp
1052 \helpref{wxWindow::OnClose
}{wxwindowonclose
},
\rtfsp
1053 \helpref{wxWindow::Destroy
}{wxwindowdestroy
},
\rtfsp
1054 \helpref{wxCloseEvent
}{wxcloseevent
},
\rtfsp
1055 \helpref{wxApp::OnQueryEndSession
}{wxapponqueryendsession
},
\rtfsp
1056 \helpref{wxApp::OnEndSession
}{wxapponendsession
}
1058 \membersection{wxWindow::OnDropFiles
}\label{wxwindowondropfiles
}
1060 \func{void
}{OnDropFiles
}{\param{wxDropFilesEvent\&
}{ event
}}
1062 Called when files have been dragged from the file manager to the window.
1064 \wxheading{Parameters
}
1066 \docparam{event
}{Drop files event. For more information, see
\helpref{wxDropFilesEvent
}{wxdropfilesevent
}.
}
1070 The window must have previously been enabled for dropping by calling
1071 \rtfsp\helpref{wxWindow::DragAcceptFiles
}{wxwindowdragacceptfiles
}.
1073 This event is only generated under Windows.
1075 To intercept this event, use the EVT
\_DROP\_FILES macro in an event table definition.
1077 \wxheading{See also
}
1079 \helpref{wxDropFilesEvent
}{wxdropfilesevent
},
\helpref{wxWindow::DragAcceptFiles
}{wxwindowdragacceptfiles
},
\rtfsp
1080 \helpref{Event handling overview
}{eventhandlingoverview
}
1082 \membersection{wxWindow::OnEraseBackground
}\label{wxwindowonerasebackground
}
1084 \func{void
}{OnEraseBackground
}{\param{wxEraseEvent\&
}{ event
}}
1086 Called when the background of the window needs to be erased.
1088 \wxheading{Parameters
}
1090 \docparam{event
}{Erase background event. For more information, see
\helpref{wxEraseEvent
}{wxeraseevent
}.
}
1094 This event is only generated under Windows. It is therefore recommended that
1095 you set the text background colour explicitly in order to prevent flicker.
1096 The default background colour under GTK is grey.
1098 To intercept this event, use the EVT
\_ERASE\_BACKGROUND macro in an event table definition.
1100 \wxheading{See also
}
1102 \helpref{wxEraseEvent
}{wxeraseevent
},
\helpref{Event handling overview
}{eventhandlingoverview
}
1104 \membersection{wxWindow::OnKeyDown
}\label{wxwindowonkeydown
}
1106 \func{void
}{OnKeyDown
}{\param{wxKeyEvent\&
}{ event
}}
1108 Called when the user has pressed a key, before it is translated into an ASCII value using other
1109 modifier keys that might be pressed at the same time.
1111 \wxheading{Parameters
}
1113 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
1114 details about this class.
}
1118 This member function is called in response to a key down event. To intercept this event,
1119 use the EVT
\_KEY\_DOWN macro in an event table definition. Your
{\bf OnKeyDown
} handler may call this
1120 default function to achieve default keypress functionality.
1122 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1123 keys, such as shift, control, and function keys, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
1124 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
1126 Most, but not all, windows allow keypresses to be intercepted.
1128 \wxheading{See also
}
1130 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
\helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
},
\rtfsp
1131 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
1132 \helpref{Event handling overview
}{eventhandlingoverview
}
1134 \membersection{wxWindow::OnKeyUp
}\label{wxwindowonkeyup
}
1136 \func{void
}{OnKeyUp
}{\param{wxKeyEvent\&
}{ event
}}
1138 Called when the user has released a key.
1140 \wxheading{Parameters
}
1142 \docparam{event
}{Object containing keypress information. See
\helpref{wxKeyEvent
}{wxkeyevent
} for
1143 details about this class.
}
1147 This member function is called in response to a key up event. To intercept this event,
1148 use the EVT
\_KEY\_UP macro in an event table definition. Your
{\bf OnKeyUp
} handler may call this
1149 default function to achieve default keypress functionality.
1151 Note that not all keypresses can be intercepted this way. If you wish to intercept special
1152 keys, such as shift, control, and function keys, then you will need to use
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
} or
1153 \helpref{wxWindow::OnKeyUp
}{wxwindowonkeyup
}.
1155 Most, but not all, windows allow key up events to be intercepted.
1157 \wxheading{See also
}
1159 \helpref{wxWindow::OnChar
}{wxwindowonchar
},
\helpref{wxWindow::OnKeyDown
}{wxwindowonkeydown
},
\rtfsp
1160 \helpref{wxKeyEvent
}{wxkeyevent
},
\helpref{wxWindow::OnCharHook
}{wxwindowoncharhook
},
\rtfsp
1161 \helpref{Event handling overview
}{eventhandlingoverview
}
1163 \membersection{wxWindow::OnKillFocus
}\label{wxwindowonkillfocus
}
1165 \func{void
}{OnKillFocus
}{\param{wxFocusEvent\&
}{event
}}
1167 Called when a window's focus is being killed.
1169 \wxheading{Parameters
}
1171 \docparam{event
}{The focus event. For more information, see
\helpref{wxFocusEvent
}{wxfocusevent
}.
}
1175 To intercept this event, use the macro EVT
\_KILL\_FOCUS in an event table definition.
1177 Most, but not all, windows respond to this event.
1179 \wxheading{See also
}
1181 \helpref{wxFocusEvent
}{wxfocusevent
},
\helpref{wxWindow::OnSetFocus
}{wxwindowonsetfocus
},
\rtfsp
1182 \helpref{Event handling overview
}{eventhandlingoverview
}
1184 \membersection{wxWindow::OnIdle
}\label{wxwindowonidle
}
1186 \func{void
}{OnIdle
}{\param{wxIdleEvent\&
}{event
}}
1188 Provide this member function for any processing which needs to be done
1189 when the application is idle.
1191 \wxheading{See also
}
1193 \helpref{wxApp::OnIdle
}{wxapponidle
},
\helpref{wxIdleEvent
}{wxidleevent
}
1195 \membersection{wxWindow::OnInitDialog
}\label{wxwindowoninitdialog
}
1197 \func{void
}{OnInitDialog
}{\param{wxInitDialogEvent\&
}{ event
}}
1199 Default handler for the wxEVT
\_INIT\_DIALOG event. Calls
\helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
}.
1201 \wxheading{Parameters
}
1203 \docparam{event
}{Dialog initialisation event.
}
1207 Gives the window the default behaviour of transferring data to child controls via
1208 the validator that each control has.
1210 \wxheading{See also
}
1212 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
}
1214 \membersection{wxWindow::OnMenuCommand
}\label{wxwindowonmenucommand
}
1216 \func{void
}{OnMenuCommand
}{\param{wxCommandEvent\&
}{event
}}
1218 Called when a menu command is received from a menu bar.
1220 \wxheading{Parameters
}
1222 \docparam{event
}{The menu command event. For more information, see
\helpref{wxCommandEvent
}{wxcommandevent
}.
}
1226 A function with this name doesn't actually exist; you can choose any member function to receive
1227 menu command events, using the EVT
\_COMMAND macro for individual commands or EVT
\_COMMAND\_RANGE for
1228 a range of commands.
1230 \wxheading{See also
}
1232 \helpref{wxCommandEvent
}{wxcommandevent
},
\rtfsp
1233 \helpref{wxWindow::OnMenuHighlight
}{wxwindowonmenuhighlight
},
\rtfsp
1234 \helpref{Event handling overview
}{eventhandlingoverview
}
1236 \membersection{wxWindow::OnMenuHighlight
}\label{wxwindowonmenuhighlight
}
1238 \func{void
}{OnMenuHighlight
}{\param{wxMenuEvent\&
}{event
}}
1240 Called when a menu select is received from a menu bar: that is, the
1241 mouse cursor is over a menu item, but the left mouse button has not been
1244 \wxheading{Parameters
}
1246 \docparam{event
}{The menu highlight event. For more information, see
\helpref{wxMenuEvent
}{wxmenuevent
}.
}
1250 You can choose any member function to receive
1251 menu select events, using the EVT
\_MENU\_HIGHLIGHT macro for individual menu items or EVT
\_MENU\_HIGHLIGHT\_ALL macro
1254 The default implementation for
\helpref{wxFrame::OnMenuHighlight
}{wxframeonmenuhighlight
} displays help
1255 text in the first field of the status bar.
1257 This function was known as
{\bf OnMenuSelect
} in earlier versions of wxWindows, but this was confusing
1258 since a selection is normally a left-click action.
1260 \wxheading{See also
}
1262 \helpref{wxMenuEvent
}{wxmenuevent
},
\rtfsp
1263 \helpref{wxWindow::OnMenuCommand
}{wxwindowonmenucommand
},
\rtfsp
1264 \helpref{Event handling overview
}{eventhandlingoverview
}
1267 \membersection{wxWindow::OnMouseEvent
}\label{wxwindowonmouseevent
}
1269 \func{void
}{OnMouseEvent
}{\param{wxMouseEvent\&
}{ event
}}
1271 Called when the user has initiated an event with the
1274 \wxheading{Parameters
}
1276 \docparam{event
}{The mouse event. See
\helpref{wxMouseEvent
}{wxmouseevent
} for
1281 Most, but not all, windows respond to this event.
1283 To intercept this event, use the EVT
\_MOUSE\_EVENTS macro in an event table definition, or individual
1284 mouse event macros such as EVT
\_LEFT\_DOWN.
1286 \wxheading{See also
}
1288 \helpref{wxMouseEvent
}{wxmouseevent
},
\rtfsp
1289 \helpref{Event handling overview
}{eventhandlingoverview
}
1291 \membersection{wxWindow::OnMove
}\label{wxwindowonmove
}
1293 \func{void
}{OnMove
}{\param{wxMoveEvent\&
}{event
}}
1295 Called when a window is moved.
1297 \wxheading{Parameters
}
1299 \docparam{event
}{The move event. For more information, see
\helpref{wxMoveEvent
}{wxmoveevent
}.
}
1303 Use the EVT
\_MOVE macro to intercept move events.
1307 Not currently implemented.
1309 \wxheading{See also
}
1311 \helpref{wxMoveEvent
}{wxmoveevent
},
\rtfsp
1312 \helpref{wxFrame::OnSize
}{wxframeonsize
},
\rtfsp
1313 \helpref{Event handling overview
}{eventhandlingoverview
}
1315 \membersection{wxWindow::OnPaint
}\label{wxwindowonpaint
}
1317 \func{void
}{OnPaint
}{\param{wxPaintEvent\&
}{event
}}
1319 Sent to the event handler when the window must be refreshed.
1321 \wxheading{Parameters
}
1323 \docparam{event
}{Paint event. For more information, see
\helpref{wxPaintEvent
}{wxpaintevent
}.
}
1327 Use the EVT
\_PAINT macro in an event table definition to intercept paint events.
1329 In a paint event handler, the application should always create a
\helpref{wxPaintDC
}{wxpaintdc
} object.
1335 void MyWindow::OnPaint(wxPaintEvent& event)
1344 You can optimize painting by retrieving the rectangles
1345 that have been damaged and only repainting these. The rectangles are in
1346 terms of the client area, and are unscrolled, so you will need to do
1347 some calculations using the current view position to obtain logical,
1350 Here is an example of using the
\helpref{wxRegionIterator
}{wxregioniterator
} class:
1354 // Called when window needs to be repainted.
1355 void MyWindow::OnPaint(wxPaintEvent& event)
1359 // Find Out where the window is scrolled to
1360 int vbX,vbY; // Top left corner of client
1361 ViewStart(&vbX,&vbY);
1363 int vX,vY,vW,vH; // Dimensions of client area in pixels
1364 wxRegionIterator upd(GetUpdateRegion()); // get the update rect list
1373 // Alternatively we can do this:
1375 // upd.GetRect(&rect);
1377 // Repaint this rectangle
1386 \wxheading{See also
}
1388 \helpref{wxPaintEvent
}{wxpaintevent
},
\rtfsp
1389 \helpref{wxPaintDC
}{wxpaintdc
},
\rtfsp
1390 \helpref{Event handling overview
}{eventhandlingoverview
}
1392 \membersection{wxWindow::OnScroll
}\label{wxwindowonscroll
}
1394 \func{void
}{OnScroll
}{\param{wxScrollEvent\&
}{event
}}
1396 Called when a scroll event is received from one of the window's built-in scrollbars.
1398 \wxheading{Parameters
}
1400 \docparam{event
}{Command event. Retrieve the new scroll position by
1401 calling
\helpref{wxScrollEvent::GetPosition
}{wxscrolleventgetposition
}, and the
1402 scrollbar orientation by calling
\helpref{wxScrollEvent::GetOrientation
}{wxscrolleventgetorientation
}.
}
1406 Note that it is not possible to distinguish between horizontal and vertical scrollbars
1407 until the function is executing (you can't have one function for vertical, another
1408 for horizontal events).
1410 \wxheading{See also
}
1412 \helpref{wxScrollEvent
}{wxscrollevent
},
\rtfsp
1413 \helpref{Event handling overview
}{eventhandlingoverview
}
1415 \membersection{wxWindow::OnSetFocus
}\label{wxwindowonsetfocus
}
1417 \func{void
}{OnSetFocus
}{\param{wxFocusEvent\&
}{event
}}
1419 Called when a window's focus is being set.
1421 \wxheading{Parameters
}
1423 \docparam{event
}{The focus event. For more information, see
\helpref{wxFocusEvent
}{wxfocusevent
}.
}
1427 To intercept this event, use the macro EVT
\_SET\_FOCUS in an event table definition.
1429 Most, but not all, windows respond to this event.
1431 \wxheading{See also
}
1433 \helpref{wxFocusEvent
}{wxfocusevent
},
\helpref{wxWindow::OnKillFocus
}{wxwindowonkillfocus
},
\rtfsp
1434 \helpref{Event handling overview
}{eventhandlingoverview
}
1436 \membersection{wxWindow::OnSize
}\label{wxwindowonsize
}
1438 \func{void
}{OnSize
}{\param{wxSizeEvent\&
}{event
}}
1440 Called when the window has been resized.
1442 \wxheading{Parameters
}
1444 \docparam{event
}{Size event. For more information, see
\helpref{wxSizeEvent
}{wxsizeevent
}.
}
1448 You may wish to use this for frames to resize their child windows as appropriate.
1450 Note that the size passed is of
1451 the whole window: call
\helpref{wxWindow::GetClientSize
}{wxwindowgetclientsize
} for the area which may be
1452 used by the application.
1454 \wxheading{See also
}
1456 \helpref{wxSizeEvent
}{wxsizeevent
},
\rtfsp
1457 \helpref{Event handling overview
}{eventhandlingoverview
}
1459 \membersection{wxWindow::OnSysColourChanged
}\label{wxwindowonsyscolourchanged
}
1461 \func{void
}{OnSysColourChanged
}{\param{wxOnSysColourChangedEvent\&
}{event
}}
1463 Called when the user has changed the system colours. Windows only.
1465 \wxheading{Parameters
}
1467 \docparam{event
}{System colour change event. For more information, see
\helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
}.
}
1469 \wxheading{See also
}
1471 \helpref{wxSysColourChangedEvent
}{wxsyscolourchangedevent
},
\rtfsp
1472 \helpref{Event handling overview
}{eventhandlingoverview
}
1474 \membersection{wxWindow::PopEventHandler
}\label{wxwindowpopeventhandler
}
1476 \constfunc{wxEvtHandler*
}{PopEventHandler
}{\param{bool
}{deleteHandler = FALSE
}}
1478 Removes and returns the top-most event handler on the event handler stack.
1480 \wxheading{Parameters
}
1482 \docparam{deleteHandler
}{If this is TRUE, the handler will be deleted after it is removed. The
1483 default value is FALSE.
}
1485 \wxheading{See also
}
1487 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1488 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1489 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1490 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1491 \helpref{wxEvtHandler
}{wxevthandler
}\rtfsp
1493 \membersection{wxWindow::PopupMenu
}\label{wxwindowpopupmenu
}
1495 \func{virtual bool
}{PopupMenu
}{\param{wxMenu*
}{menu
},
\param{int
}{x
},
\param{int
}{y
}}
1497 Pops up the given menu at the specified coordinates, relative to this
1498 window, and returns control when the user has dismissed the menu. If a
1499 menu item is selected, the callback defined for the menu is called with
1500 wxMenu and wxCommandEvent reference arguments. The callback should access
1501 the commandInt member of the event to check the selected menu identifier.
1503 \wxheading{Parameters
}
1505 \docparam{menu
}{Menu to pop up.
}
1507 \docparam{x
}{Required x position for the menu to appear.
}
1509 \docparam{y
}{Required y position for the menu to appear.
}
1511 \wxheading{See also
}
1513 \helpref{wxMenu
}{wxmenu
}
1517 Just before the menu is popped up,
\helpref{wxMenu::UpdateUI
}{wxmenuupdateui
} is called
1518 to ensure that the menu items are in the correct state.
1520 \membersection{wxWindow::PushEventHandler
}\label{wxwindowpusheventhandler
}
1522 \func{void
}{PushEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1524 Pushes this event handler onto the event stack for the window.
1526 \wxheading{Parameters
}
1528 \docparam{handler
}{Specifies the handler to be pushed.
}
1532 An event handler is an object that is capable of processing the events
1533 sent to a window. By default, the window is its own event handler, but
1534 an application may wish to substitute another, for example to allow
1535 central implementation of event-handling for a variety of different
1538 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} allows
1539 an application to set up a chain of event handlers, where an event not handled by one event handler is
1540 handed to the next one in the chain. Use
\helpref{wxWindow::PopEventHandler
}{wxwindowpopeventhandler
} to
1541 remove the event handler.
1543 \wxheading{See also
}
1545 \helpref{wxWindow::SetEventHandler
}{wxwindowseteventhandler
},
\rtfsp
1546 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1547 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1548 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1549 \helpref{wxEvtHandler
}{wxevthandler
}
1551 \membersection{wxWindow::Raise
}\label{wxwindowraise
}
1553 \func{void
}{Raise
}{\void}
1555 Raises the window to the top of the window hierarchy if it is a managed window (dialog
1558 \membersection{wxWindow::Refresh
}\label{wxwindowrefresh
}
1560 \func{virtual void
}{Refresh
}{\param{const bool
}{ eraseBackground = TRUE
},
\param{const wxRect*
}{rect
1563 Causes a message or event to be generated to repaint the
1566 \wxheading{Parameters
}
1568 \docparam{eraseBackground
}{If TRUE, the background will be
1571 \docparam{rect
}{If non-NULL, only the given rectangle will
1572 be treated as damaged.
}
1574 \membersection{wxWindow::ReleaseMouse
}\label{wxwindowreleasemouse
}
1576 \func{virtual void
}{ReleaseMouse
}{\void}
1578 Releases mouse input captured with
\helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}.
1580 \wxheading{See also
}
1582 \helpref{wxWindow::CaptureMouse
}{wxwindowcapturemouse
}
1584 \membersection{wxWindow::RemoveChild
}\label{wxwindowremovechild
}
1586 \func{virtual void
}{RemoveChild
}{\param{wxWindow*
}{child
}}
1588 Removes a child window. This is called automatically by window deletion
1589 functions so should not be required by the application programmer.
1591 \wxheading{Parameters
}
1593 \docparam{child
}{Child window to remove.
}
1595 \membersection{wxWindow::ScreenToClient
}\label{wxwindowscreentoclient
}
1597 \constfunc{virtual void
}{ScreenToClient
}{\param{int*
}{x
},
\param{int*
}{y
}}
1599 \constfunc{virtual wxPoint
}{ScreenToClient
}{\param{const wxPoint\&
}{pt
}}
1601 Converts from screen to client window coordinates.
1603 \wxheading{Parameters
}
1605 \docparam{x
}{Stores the screen x coordinate and receives the client x coordinate.
}
1607 \docparam{y
}{Stores the screen x coordinate and receives the client x coordinate.
}
1609 \docparam{pt
}{The screen position for the second form of the function.
}
1611 \pythonnote{In place of a single overloaded method name, wxPython
1612 implements the following methods:
\par
1613 \indented{2cm
}{\begin{twocollist
}
1614 \twocolitem{\bf{ScreenToClient(point)
}}{Accepts and returns a wxPoint
}
1615 \twocolitem{\bf{ScreenToClientXY(x, y)
}}{Returns a
2-tuple, (x, y)
}
1620 \membersection{wxWindow::ScrollWindow
}\label{wxwindowscrollwindow
}
1622 \func{virtual void
}{ScrollWindow
}{\param{int
}{dx
},
\param{int
}{dy
},
\param{const wxRect*
}{ rect = NULL
}}
1624 Physically scrolls the pixels in the window and move child windows accordingly.
1626 \wxheading{Parameters
}
1628 \docparam{dx
}{Amount to scroll horizontally.
}
1630 \docparam{dy
}{Amount to scroll vertically.
}
1632 \docparam{rect
}{Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you
1633 pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler
1634 can optimise painting by checking for the invalidated region. This paramter is ignored under GTK,
1635 instead the regions to be invalidated are calculated automatically.
}
1639 Use this function to optimise your scrolling implementations, to minimise the area that must be
1640 redrawn. Note that it is rarely required to call this function from a user program.
1642 \membersection{wxWindow::SetAcceleratorTable
}\label{wxwindowsetacceleratortable
}
1644 \func{virtual void
}{SetAcceleratorTable
}{\param{const wxAcceleratorTable\&
}{ accel
}}
1646 Sets the accelerator table for this window. See
\helpref{wxAcceleratorTable
}{wxacceleratortable
}.
1648 \membersection{wxWindow::SetAutoLayout
}\label{wxwindowsetautolayout
}
1650 \func{void
}{SetAutoLayout
}{\param{const bool
}{ autoLayout
}}
1652 Determines whether the
\helpref{wxWindow::Layout
}{wxwindowlayout
} function will
1653 be called automatically when the window is resized.
1655 \wxheading{Parameters
}
1657 \docparam{autoLayout
}{Set this to TRUE if you wish the Layout function to be called
1658 from within wxWindow::OnSize functions.
}
1662 Note that this function is actually disabled for wxWindow and only indirectly
1663 takes affect for children of wxDialog, wxFrame, wxNotebook and wxSplitterWindow.
1665 \wxheading{See also
}
1667 \helpref{wxWindow::SetConstraints
}{wxwindowsetconstraints
}
1669 \membersection{wxWindow::SetBackgroundColour
}\label{wxwindowsetbackgroundcolour
}
1671 \func{virtual void
}{SetBackgroundColour
}{\param{const wxColour\&
}{colour
}}
1673 Sets the background colour of the window.
1675 \wxheading{Parameters
}
1677 \docparam{colour
}{The colour to be used as the background colour.
}
1681 The background colour is usually painted by the default
\rtfsp
1682 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
} event handler function
1683 under Windows and automatically under GTK.
1685 Note that setting the background colour does not cause an immediate refresh, so you
1686 may wish to call
\helpref{wxWindow::Clear
}{wxwindowclear
} or
\helpref{wxWindow::Refresh
}{wxwindowrefresh
} after
1687 calling this function.
1689 Note that when using this functions under GTK, you will disable the so called "themes",
1690 i.e. the user chosen apperance of windows and controls, including the themes of
1691 their parent windows.
1693 \wxheading{See also
}
1695 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
},
\rtfsp
1696 \helpref{wxWindow::SetForegroundColour
}{wxwindowsetforegroundcolour
},
\rtfsp
1697 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
1698 \helpref{wxWindow::Clear
}{wxwindowclear
},
\rtfsp
1699 \helpref{wxWindow::Refresh
}{wxwindowrefresh
},
\rtfsp
1700 \helpref{wxWindow::OnEraseBackground
}{wxwindowonerasebackground
}
1702 \membersection{wxWindow::SetClientSize
}\label{wxwindowsetclientsize
}
1704 \func{virtual void
}{SetClientSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
1706 \func{virtual void
}{SetClientSize
}{\param{const wxSize\&
}{ size
}}
1708 This sets the size of the window client area in pixels. Using this function to size a window
1709 tends to be more device-independent than
\helpref{wxWindow::SetSize
}{wxwindowsetsize
}, since the application need not
1710 worry about what dimensions the border or title bar have when trying to fit the window
1711 around panel items, for example.
1713 \wxheading{Parameters
}
1715 \docparam{width
}{The required client area width.
}
1717 \docparam{height
}{The required client area height.
}
1719 \docparam{size
}{The required client size.
}
1721 \pythonnote{In place of a single overloaded method name, wxPython
1722 implements the following methods:
\par
1723 \indented{2cm
}{\begin{twocollist
}
1724 \twocolitem{\bf{SetClientSize(size)
}}{Accepts a wxSize
}
1725 \twocolitem{\bf{SetClientSizeWH(width, height)
}}{}
1729 \membersection{wxWindow::SetCursor
}\label{wxwindowsetcursor
}
1731 \func{virtual void
}{SetCursor
}{\param{const wxCursor\&
}{cursor
}}
1733 Sets the window's cursor. Notice that setting the cursor for this window does
1734 not set it for its children so you'll need to explicitly call SetCursor() for
1735 them too if you need it.
1737 \wxheading{Parameters
}
1739 \docparam{cursor
}{Specifies the cursor that the window should normally display.
}
1741 \wxheading{See also
}
1743 \helpref{::wxSetCursor
}{wxsetcursor
},
\helpref{wxCursor
}{wxcursor
}
1745 \membersection{wxWindow::SetEventHandler
}\label{wxwindowseteventhandler
}
1747 \func{void
}{SetEventHandler
}{\param{wxEvtHandler*
}{handler
}}
1749 Sets the event handler for this window.
1751 \wxheading{Parameters
}
1753 \docparam{handler
}{Specifies the handler to be set.
}
1757 An event handler is an object that is capable of processing the events
1758 sent to a window. By default, the window is its own event handler, but
1759 an application may wish to substitute another, for example to allow
1760 central implementation of event-handling for a variety of different
1763 It is usually better to use
\helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
} since
1764 this sets up a chain of event handlers, where an event not handled by one event handler is
1765 handed to the next one in the chain.
1767 \wxheading{See also
}
1769 \helpref{wxWindow::GetEventHandler
}{wxwindowgeteventhandler
},
\rtfsp
1770 \helpref{wxWindow::PushEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1771 \helpref{wxWindow::PopEventHandler
}{wxwindowpusheventhandler
},
\rtfsp
1772 \helpref{wxEvtHandler::ProcessEvent
}{wxevthandlerprocessevent
},
\rtfsp
1773 \helpref{wxEvtHandler
}{wxevthandler
}
1775 \membersection{wxWindow::SetConstraints
}\label{wxwindowsetconstraints
}
1777 \func{void
}{SetConstraints
}{\param{wxLayoutConstraints*
}{constraints
}}
1779 Sets the window to have the given layout constraints. The window
1780 will then own the object, and will take care of its deletion.
1781 If an existing layout constraints object is already owned by the
1782 window, it will be deleted.
1784 \wxheading{Parameters
}
1786 \docparam{constraints
}{The constraints to set. Pass NULL to disassociate and delete the window's
1791 You must call
\helpref{wxWindow::SetAutoLayout
}{wxwindowsetautolayout
} to tell a window to use
1792 the constraints automatically in OnSize; otherwise, you must
1793 override OnSize and call Layout explicitly.
1795 \membersection{wxWindow::SetDropTarget
}\label{wxwindowsetdroptarget
}
1797 \func{void
}{SetDropTarget
}{\param{wxDropTarget*
}{ target
}}
1799 Associates a drop target with this window.
1801 If the window already has a drop target, it is deleted.
1803 \wxheading{See also
}
1805 \helpref{wxWindow::GetDropTarget
}{wxwindowgetdroptarget
},
1806 \helpref{Drag and drop overview
}{wxdndoverview
}
1808 \membersection{wxWindow::SetFocus
}\label{wxwindowsetfocus
}
1810 \func{virtual void
}{SetFocus
}{\void}
1812 This sets the window to receive keyboard input.
1814 \membersection{wxWindow::SetFont
}\label{wxwindowsetfont
}
1816 \func{void
}{SetFont
}{\param{const wxFont\&
}{font
}}
1818 Sets the font for this window.
1820 \wxheading{Parameters
}
1822 \docparam{font
}{Font to associate with this window.
}
1824 \wxheading{See also
}
1826 \helpref{wxWindow::GetFont
}{wxwindowgetfont
}
1828 \membersection{wxWindow::SetForegroundColour
}\label{wxwindowsetforegroundcolour
}
1830 \func{virtual void
}{SetForegroundColour
}{\param{const wxColour\&
}{colour
}}
1832 Sets the foreground colour of the window.
1834 \wxheading{Parameters
}
1836 \docparam{colour
}{The colour to be used as the foreground colour.
}
1840 The interpretation of foreground colour is open to interpretation according
1841 to the window class; it may be the text colour or other colour, or it may not
1844 Note that when using this functions under GTK, you will disable the so called "themes",
1845 i.e. the user chosen apperance of windows and controls, including the themes of
1846 their parent windows.
1848 \wxheading{See also
}
1850 \helpref{wxWindow::GetForegroundColour
}{wxwindowgetforegroundcolour
},
\rtfsp
1851 \helpref{wxWindow::SetBackgroundColour
}{wxwindowsetbackgroundcolour
},
\rtfsp
1852 \helpref{wxWindow::GetBackgroundColour
}{wxwindowgetbackgroundcolour
}
1854 \membersection{wxWindow::SetId
}\label{wxwindowsetid
}
1856 \func{void
}{SetId
}{\param{int
}{ id
}}
1858 Sets the identifier of the window.
1862 Each window has an integer identifier. If the application has not provided one,
1863 an identifier will be generated. Normally, the identifier should be provided
1864 on creation and should not be modified subsequently.
1866 \wxheading{See also
}
1868 \helpref{wxWindow::GetId
}{wxwindowgetid
},
\rtfsp
1869 \helpref{Window identifiers
}{windowids
}
1871 \membersection{wxWindow::SetName
}\label{wxwindowsetname
}
1873 \func{virtual void
}{SetName
}{\param{const wxString\&
}{name
}}
1875 Sets the window's name.
1877 \wxheading{Parameters
}
1879 \docparam{name
}{A name to set for the window.
}
1881 \wxheading{See also
}
1883 \helpref{wxWindow::GetName
}{wxwindowgetname
}
1885 \membersection{wxWindow::SetPalette
}\label{wxwindowsetpalette
}
1887 \func{virtual void
}{SetPalette
}{\param{wxPalette*
}{palette
}}
1889 Obsolete - use
\helpref{wxDC::SetPalette
}{wxdcsetpalette
} instead.
1891 \membersection{wxWindow::SetScrollbar
}\label{wxwindowsetscrollbar
}
1893 \func{virtual void
}{SetScrollbar
}{\param{int
}{orientation
},
\param{int
}{position
},
\rtfsp
1894 \param{int
}{thumbSize
},
\param{int
}{range
},
\rtfsp
1895 \param{const bool
}{refresh = TRUE
}}
1897 Sets the scrollbar properties of a built-in scrollbar.
1899 \wxheading{Parameters
}
1901 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1903 \docparam{position
}{The position of the scrollbar in scroll units.
}
1905 \docparam{thumbSize
}{The size of the thumb, or visible portion of the scrollbar, in scroll units.
}
1907 \docparam{range
}{The maximum position of the scrollbar.
}
1909 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1913 Let's say you wish to display
50 lines of text, using the same font.
1914 The window is sized so that you can only see
16 lines at a time.
1920 SetScrollbar(wxVERTICAL,
0,
16,
50);
1924 Note that with the window at this size, the thumb position can never go
1925 above
50 minus
16, or
34.
1927 You can determine how many lines are currently visible by dividing the current view
1928 size by the character height in pixels.
1930 When defining your own scrollbar behaviour, you will always need to recalculate
1931 the scrollbar settings when the window size changes. You could therefore put your
1932 scrollbar calculations and SetScrollbar
1933 call into a function named AdjustScrollbars, which can be called initially and also
1934 from your
\helpref{wxWindow::OnSize
}{wxwindowonsize
} event handler function.
1936 \wxheading{See also
}
1938 \helpref{Scrolling overview
}{scrollingoverview
},
\rtfsp
1939 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
1942 \membersection{wxWindow::SetScrollPage
}\label{wxwindowsetscrollpage
}
1944 \func{virtual void
}{SetScrollPage
}{\param{int
}{orientation
},
\param{int
}{pageSize
},
\param{const bool
}{refresh = TRUE
}}
1946 Sets the page size of one of the built-in scrollbars.
1948 \wxheading{Parameters
}
1950 \docparam{orientation
}{Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1952 \docparam{pageSize
}{Page size in scroll units.
}
1954 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1958 The page size of a scrollbar is the number of scroll units that the scroll thumb travels when you
1959 click on the area above/left of or below/right of the thumb. Normally you will want a whole visible
1960 page to be scrolled, i.e. the size of the current view (perhaps the window client size). This
1961 value has to be adjusted when the window is resized, since the page size will have changed.
1963 In addition to specifying how far the scroll thumb travels when paging, in Motif and some versions of Windows
1964 the thumb changes size to reflect the page size relative to the length of the
document. When the
1965 document size is only slightly bigger than the current view (window) size, almost all of the scrollbar
1966 will be taken up by the thumb. When the two values become the same, the scrollbar will (on some systems)
1969 Currently, this function should be called before SetPageRange, because of a quirk in the Windows
1970 handling of pages and ranges.
1972 \wxheading{See also
}
1974 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
1975 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
1976 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
1977 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
1980 \membersection{wxWindow::SetScrollPos
}\label{wxwindowsetscrollpos
}
1982 \func{virtual void
}{SetScrollPos
}{\param{int
}{orientation
},
\param{int
}{pos
},
\param{const bool
}{refresh = TRUE
}}
1984 Sets the position of one of the built-in scrollbars.
1986 \wxheading{Parameters
}
1988 \docparam{orientation
}{Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
1990 \docparam{pos
}{Position in scroll units.
}
1992 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
1996 This function does not directly affect the contents of the window: it is up to the
1997 application to take note of scrollbar attributes and redraw contents accordingly.
1999 \wxheading{See also
}
2001 \helpref{wxWindow::SetScrollbar
}{wxwindowsetscrollbar
},
\rtfsp
2002 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2003 \helpref{wxWindow::GetScrollThumb
}{wxwindowgetscrollthumb
},
\rtfsp
2004 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2007 \membersection{wxWindow::SetScrollRange
}\label{wxwindowsetscrollrange
}
2009 \func{virtual void
}{SetScrollRange
}{\param{int
}{orientation
},
\param{int
}{range
},
\param{const bool
}{refresh = TRUE
}}
2011 Sets the range of one of the built-in scrollbars.
2013 \wxheading{Parameters
}
2015 \docparam{orientation
}{Determines the scrollbar whose range is to be set. May be wxHORIZONTAL or wxVERTICAL.
}
2017 \docparam{range
}{Scroll range.
}
2019 \docparam{refresh
}{TRUE to redraw the scrollbar, FALSE otherwise.
}
2023 The range of a scrollbar is the number of steps that the thumb may travel, rather than the total
2024 object length of the scrollbar. If you are implementing a scrolling window, for example, you
2025 would adjust the scroll range when the window is resized, by subtracting the window view size from the
2026 total virtual window size. When the two sizes are the same (all the window is visible), the range goes to zero
2027 and usually the scrollbar will be automatically hidden.
2029 \wxheading{See also
}
2031 \helpref{wxWindow::SetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2032 \helpref{wxWindow::SetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2033 \helpref{wxWindow::GetScrollPos
}{wxwindowsetscrollpos
},
\rtfsp
2034 \helpref{wxWindow::GetScrollPage
}{wxwindowsetscrollpage
},
\rtfsp
2035 \helpref{wxScrollBar
}{wxscrollbar
},
\helpref{wxScrolledWindow
}{wxscrolledwindow
}
2038 \membersection{wxWindow::SetSize
}\label{wxwindowsetsize
}
2040 \func{virtual void
}{SetSize
}{\param{int
}{ x
},
\param{int
}{ y
},
\param{int
}{ width
},
\param{int
}{ height
},
2041 \param{int
}{ sizeFlags = wxSIZE
\_AUTO}}
2043 \func{virtual void
}{SetSize
}{\param{const wxRect\&
}{ rect
}}
2045 Sets the size and position of the window in pixels.
2047 \func{virtual void
}{SetSize
}{\param{int
}{ width
},
\param{int
}{ height
}}
2049 \func{virtual void
}{SetSize
}{\param{const wxSize\&
}{ size
}}
2051 Sets the size of the window in pixels.
2053 \wxheading{Parameters
}
2055 \docparam{x
}{Required x position in pixels, or -
1 to indicate that the existing
2056 value should be used.
}
2058 \docparam{y
}{Required y position in pixels, or -
1 to indicate that the existing
2059 value should be used.
}
2061 \docparam{width
}{Required width in pixels, or -
1 to indicate that the existing
2062 value should be used.
}
2064 \docparam{height
}{Required height position in pixels, or -
1 to indicate that the existing
2065 value should be used.
}
2067 \docparam{size
}{\helpref{wxSize
}{wxsize
} object for setting the size.
}
2069 \docparam{rect
}{\helpref{wxRect
}{wxrect
} object for setting the position and size.
}
2071 \docparam{sizeFlags
}{Indicates the interpretation of other parameters. It is a bit list of the following:
2073 {\bf wxSIZE
\_AUTO\_WIDTH}: a -
1 width value is taken to indicate
2074 a wxWindows-supplied default width.\\
2075 {\bf wxSIZE
\_AUTO\_HEIGHT}: a -
1 height value is taken to indicate
2076 a wxWindows-supplied default width.\\
2077 {\bf wxSIZE
\_AUTO}: -
1 size values are taken to indicate
2078 a wxWindows-supplied default size.\\
2079 {\bf wxSIZE
\_USE\_EXISTING}: existing dimensions should be used
2080 if -
1 values are supplied.\\
2081 {\bf wxSIZE
\_ALLOW\_MINUS\_ONE}: allow dimensions of -
1 and less to be interpreted
2082 as real dimensions, not default values.
2087 The second form is a convenience for calling the first form with default
2088 x and y parameters, and must be used with non-default width and height values.
2090 The first form sets the position and optionally size, of the window.
2091 Parameters may be -
1 to indicate either that a default should be supplied
2092 by wxWindows, or that the current value of the dimension should be used.
2094 \wxheading{See also
}
2096 \helpref{wxWindow::Move
}{wxwindowmove
}
2098 \pythonnote{In place of a single overloaded method name, wxPython
2099 implements the following methods:
\par
2100 \indented{2cm
}{\begin{twocollist
}
2101 \twocolitem{\bf{SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO)
}}{}
2102 \twocolitem{\bf{SetSize(size)
}}{}
2103 \twocolitem{\bf{SetPosition(point)
}}{}
2107 \membersection{wxWindow::SetSizeHints
}\label{wxwindowsetsizehints
}
2109 \func{virtual void
}{SetSizeHints
}{\param{int
}{ minW=-
1},
\param{int
}{ minH=-
1},
\param{int
}{ maxW=-
1},
\param{int
}{ maxH=-
1},
2110 \param{int
}{ incW=-
1},
\param{int
}{ incH=-
1}}
2112 Allows specification of minimum and maximum window sizes, and window size increments.
2113 If a pair of values is not set (or set to -
1), the default values will be used.
2115 \wxheading{Parameters
}
2117 \docparam{minW
}{Specifies the minimum width allowable.
}
2119 \docparam{minH
}{Specifies the minimum height allowable.
}
2121 \docparam{maxW
}{Specifies the maximum width allowable.
}
2123 \docparam{maxH
}{Specifies the maximum height allowable.
}
2125 \docparam{incW
}{Specifies the increment for sizing the width (Motif/Xt only).
}
2127 \docparam{incH
}{Specifies the increment for sizing the height (Motif/Xt only).
}
2131 If this function is called, the user will not be able to size the window outside the
2134 The resizing increments are only significant under Motif or Xt.
2136 \membersection{wxWindow::SetTitle
}\label{wxwindowsettitle
}
2138 \func{virtual void
}{SetTitle
}{\param{const wxString\&
}{title
}}
2140 Sets the window's title. Applicable only to frames and dialogs.
2142 \wxheading{Parameters
}
2144 \docparam{title
}{The window's title.
}
2146 \wxheading{See also
}
2148 \helpref{wxWindow::GetTitle
}{wxwindowgettitle
}
2150 \membersection{wxWindow::SetValidator
}\label{wxwindowsetvalidator
}
2152 \func{virtual void
}{SetValidator
}{\param{const wxValidator\&
}{ validator
}}
2154 Deletes the current validator (if any) and sets the window validator, having called wxValidator::Clone to
2155 create a new validator of this type.
2157 \membersection{wxWindow::Show
}\label{wxwindowshow
}
2159 \func{virtual bool
}{Show
}{\param{const bool
}{ show
}}
2161 Shows or hides the window.
2163 \wxheading{Parameters
}
2165 \docparam{show
}{If TRUE, displays the window and brings it to the front. Otherwise,
2168 \wxheading{See also
}
2170 \helpref{wxWindow::IsShown
}{wxwindowisshown
}
2172 \membersection{wxWindow::TransferDataFromWindow
}\label{wxwindowtransferdatafromwindow
}
2174 \func{virtual bool
}{TransferDataFromWindow
}{\void}
2176 Transfers values from child controls to data areas specified by their validators. Returns
2177 FALSE if a transfer failed.
2179 \wxheading{See also
}
2181 \helpref{wxWindow::TransferDataToWindow
}{wxwindowtransferdatatowindow
},
\rtfsp
2182 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2184 \membersection{wxWindow::TransferDataToWindow
}\label{wxwindowtransferdatatowindow
}
2186 \func{virtual bool
}{TransferDataToWindow
}{\void}
2188 Transfers values to child controls from data areas specified by their validators.
2190 \wxheading{Return value
}
2192 Returns FALSE if a transfer failed.
2194 \wxheading{See also
}
2196 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2197 \helpref{wxValidator
}{wxvalidator
},
\helpref{wxWindow::Validate
}{wxwindowvalidate
}
2199 \membersection{wxWindow::Validate
}\label{wxwindowvalidate
}
2201 \func{virtual bool
}{Validate
}{\void}
2203 Validates the current values of the child controls using their validators.
2205 \wxheading{Return value
}
2207 Returns FALSE if any of the validations failed.
2209 \wxheading{See also
}
2211 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2212 \helpref{wxWindow::TransferDataFromWindow
}{wxwindowtransferdatafromwindow
},
\rtfsp
2213 \helpref{wxValidator
}{wxvalidator
}
2215 \membersection{wxWindow::WarpPointer
}\label{wxwindowwarppointer
}
2217 \func{void
}{WarpPointer
}{\param{int
}{ x
},
\param{int
}{ y
}}
2219 Moves the pointer to the given position on the window.
2221 \wxheading{Parameters
}
2223 \docparam{x
}{The new x position for the cursor.
}
2225 \docparam{y
}{The new y position for the cursor.
}