## wxWindow

wxWindow is the base class for all windows. Any children of the window will be deleted automatically by the destructor before the window itself is deleted.

Derived from

wxEvtHandler
wxObject

Include files

<wx/window.h>

Window styles

The following styles can apply to all windows, although they will not always make sense for a particular window class or on all platforms.

wxSIMPLE_BORDER | Displays a thin border around the window. wxBORDER is the old name for this style.
wxDOUBLE_BORDER | Displays a double border. Windows only.
wxSUNKEN_BORDER | Displays a sunken border.
wxRAISED_BORDER | Displays a raised border. GTK only.
wxSTATIC_BORDER | Displays a border suitable for a static control. Windows only.
wxTRANSPARENT_WINDOW | The window is transparent, that is, it will not receive paint events. Windows only.
wxNO_3D | Prevents the children of this window taking on 3D styles, even though the application-wide policy is for 3D controls. Windows only.
wxTAB_TRAVERSAL | Use this to enable tab traversal for non-dialog windows.
wxWANTS_CHARS | Use this to indicate that the window wants to get all char events - even for keys like TAB or ENTER which are usually used for dialog navigation and which wouldn't be generated without this style
wxNO_FULL_REPAINT_ON_RESIZE | Disables repainting the window completely when its size is changed - you will have to repaint the new window area manually if you use this style. Currently only has an effect for Windows.
wxVSCROLL | Use this style to enable a vertical scrollbar. (Still used?)
wxHSCROLL | Use this style to enable a horizontal scrollbar. (Still used?)
wxCLIP_CHILDREN | Use this style to eliminate flicker caused by the background being repainted, then children being painted over them. Windows only.

See also window styles overview.

See also

Event handling overview

Members

wxWindow::wxWindow
wxWindow::~wxWindow
wxWindow::AddChild
wxWindow::CaptureMouse
wxWindow::Center
wxWindow::CenterOnParent
wxWindow::CenterOnScreen
wxWindow::Centre
wxWindow::CentreOnParent
wxWindow::CentreOnScreen
wxWindow::Clear
wxWindow::ClientToScreen
wxWindow::Close
wxWindow::ConvertDialogToPixels
wxWindow::ConvertPixelsToDialog
wxWindow::Destroy
wxWindow::DestroyChildren
wxWindow::Disable
wxWindow::DragAcceptFiles
wxWindow::Enable
wxWindow::FindFocus
wxWindow::FindWindow
wxWindow::FindWindowById
wxWindow::FindWindowByName
wxWindow::FindWindowByLabel
wxWindow::Fit
wxWindow::FitInside
wxWindow::Freeze
wxWindow::GetAdjustedBestSize
wxWindow::GetBackgroundColour
wxWindow::GetBestSize
wxWindow::GetCaret
wxWindow::GetCapture
wxWindow::GetCharHeight
wxWindow::GetCharWidth
wxWindow::GetChildren
wxWindow::GetClientSize
wxWindow::GetConstraints
wxWindow::GetContainingSizer
wxWindow::GetDropTarget
wxWindow::GetEventHandler
wxWindow::GetExtraStyle
wxWindow::GetFont
wxWindow::GetForegroundColour
wxWindow::GetGrandParent
wxWindow::GetHandle
wxWindow::GetHelpText
wxWindow::GetId
wxWindow::GetLabel
wxWindow::GetName
wxWindow::GetParent
wxWindow::GetPosition
wxWindow::GetRect
wxWindow::GetScrollThumb
wxWindow::GetScrollPos
wxWindow::GetScrollRange
wxWindow::GetSize
wxWindow::GetSizer
wxWindow::GetTextExtent
wxWindow::GetTitle
wxWindow::GetUpdateRegion
wxWindow::GetToolTip
wxWindow::GetValidator
wxWindow::GetVirtualSize
wxWindow::GetWindowStyleFlag
wxWindow::HasCapture
wxWindow::Hide
wxWindow::InitDialog
wxWindow::IsEnabled
wxWindow:IsExposed
wxWindow::IsRetained
wxWindow::IsShown
wxWindow::IsTopLevel
wxWindow::Layout
wxWindow::LoadFromResource
wxWindow::Lower
wxWindow::MakeModal
wxWindow::Move
wxWindow::PopEventHandler
wxWindow::PopupMenu
wxWindow::PushEventHandler
wxWindow::Raise
wxWindow::Refresh
wxWindow::RefreshRect
wxWindow::ReleaseMouse
wxWindow::RemoveChild
wxWindow::RemoveEventHandler
wxWindow::Reparent
wxWindow::ScreenToClient
wxWindow::ScrollLines
wxWindow::ScrollPages
wxWindow::ScrollWindow
wxWindow::SetAcceleratorTable
wxWindow::SetAutoLayout
wxWindow::SetBackgroundColour
wxWindow::SetCaret
wxWindow::SetClientSize
wxWindow::SetContainingSizer
wxWindow::SetCursor
wxWindow::SetConstraints
wxWindow::SetDropTarget
wxWindow::SetEventHandler
wxWindow::SetExtraStyle
wxWindow::SetFocus
wxWindow::SetFocusFromKbd
wxWindow::SetFont
wxWindow::SetForegroundColour
wxWindow::SetHelpText
wxWindow::SetId
wxWindow::SetName
wxWindow::SetPalette
wxWindow::SetScrollbar
wxWindow::SetScrollPos
wxWindow::SetSize
wxWindow::SetSizeHints
wxWindow::SetSizer
wxWindow::SetSizerAndFit
wxWindow::SetTitle
wxWindow::SetThemeEnabled
wxWindow::SetValidator
wxWindow::SetToolTip
wxWindow::SetVirtualSize
wxWindow::SetVirtualSizeHints
wxWindow::SetWindowStyle
wxWindow::SetWindowStyleFlag
wxWindow::Show
wxWindow::Thaw
wxWindow::TransferDataFromWindow
wxWindow::TransferDataToWindow
wxWindow::Update
wxWindow::Validate
wxWindow::WarpPointer

### wxWindow::wxWindow

wxWindow()

Default constructor.

wxWindow(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr)

Constructs a window, which can be a child of a frame, dialog or any other non-control window.

Parameters

parent

Pointer to a parent window.

id

Window identifier. If -1, will automatically create an identifier.

pos

Window position. wxDefaultPosition is (-1, -1) which indicates that wxWindows should generate a default position for the window. If using the wxWindow class directly, supply an actual position.

size

Window size. wxDefaultSize is (-1, -1) which indicates that wxWindows should generate a default size for the window. If no suitable size can be found, the window will be sized to 20x20 pixels so that the window is visible but obviously not correctly sized.

style

Window style. For generic window styles, please see wxWindow.

name

Window name.

### wxWindow::~wxWindow

~wxWindow()

Destructor. Deletes all subwindows, then deletes itself. Instead of using the delete operator explicitly, you should normally use wxWindow::Destroy so that wxWindows can delete a window only when it is safe to do so, in idle time.

See also

Window deletion overview, wxWindow::Destroy, wxCloseEvent

### wxWindow::AddChild

virtual void AddChild(wxWindow* child)

Adds a child window. This is called automatically by window creation functions so should not be required by the application programmer.

Parameters

child

Child window to add.

### wxWindow::CaptureMouse

virtual void CaptureMouse()

Directs all mouse input to this window. Call wxWindow::ReleaseMouse to release the capture.

Note that wxWindows maintains the stack of windows having captured the mouse and when the mouse is released the capture returns to the window which had had captured it previously and it is only really released if there were no previous window. In particular, this means that you must release the mouse as many times as you capture it.

See also

wxWindow::ReleaseMouse

### wxWindow::Center

void Center(int direction)

A synonym for Centre.

### wxWindow::CenterOnParent

void CenterOnParent(int direction)

A synonym for CentreOnParent.

### wxWindow::CenterOnScreen

void CenterOnScreen(int direction)

A synonym for CentreOnScreen.

### wxWindow::Centre

void Centre(int direction = wxBOTH)

Centres the window.

Parameters

direction

Specifies the direction for the centering. May be `wxHORIZONTAL`, `wxVERTICAL` or `wxBOTH`. It may also include `wxCENTRE_ON_SCREEN` flag if you want to center the window on the entire screen and not on its parent window.

The flag `wxCENTRE_FRAME` is obsolete and should not be used any longer (it has no effect).

Remarks

If the window is a top level one (i.e. doesn't have a parent), it will be centered relative to the screen anyhow.

See also

wxWindow::Center

### wxWindow::CentreOnParent

void CentreOnParent(int direction = wxBOTH)

Centres the window on its parent. This is a more readable synonym for Centre.

Parameters

direction

Specifies the direction for the centering. May be `wxHORIZONTAL`, `wxVERTICAL` or `wxBOTH`.

Remarks

This methods provides for a way to center top level windows over their parents instead of the entire screen. If there is no parent or if the window is not a top level window, then behaviour is the same as wxWindow::Centre.

See also

wxWindow::CentreOnScreen

### wxWindow::CentreOnScreen

void CentreOnScreen(int direction = wxBOTH)

Centres the window on screen. This only works for top level windows - otherwise, the window will still be centered on its parent.

Parameters

direction

Specifies the direction for the centering. May be `wxHORIZONTAL`, `wxVERTICAL` or `wxBOTH`.

See also

wxWindow::CentreOnParent

### wxWindow::Clear

void Clear()

Clears the window by filling it with the current background colour. Does not cause an erase background event to be generated.

### wxWindow::ClientToScreen

virtual void ClientToScreen(int* x, int* y) const

wxPerl note: In wxPerl this method returns a 2-element list instead of modifying its parameters.

virtual wxPoint ClientToScreen(const wxPoint& pt) const

Converts to screen coordinates from coordinates relative to this window.

x

A pointer to a integer value for the x coordinate. Pass the client coordinate in, and a screen coordinate will be passed out.

y

A pointer to a integer value for the y coordinate. Pass the client coordinate in, and a screen coordinate will be passed out.

pt

The client position for the second form of the function.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

ClientToScreen(point) | Accepts and returns a wxPoint
ClientToScreenXY(x, y) | Returns a 2-tuple, (x, y)

### wxWindow::Close

virtual bool Close(bool force = `FALSE`)

The purpose of this call is to provide a safer way of destroying a window than using the delete operator.

Parameters

force

`FALSE` if the window's close handler should be able to veto the destruction of this window, `TRUE` if it cannot.

Remarks

Close calls the close handler for the window, providing an opportunity for the window to choose whether to destroy the window.

The close handler should check whether the window is being deleted forcibly, using wxCloseEvent::GetForce, in which case it should destroy the window using wxWindow::Destroy.

Applies to managed windows (wxFrame and wxDialog classes) only.

Note that calling Close does not guarantee that the window will be destroyed; but it provides a way to simulate a manual close of a window, which may or may not be implemented by destroying the window. The default implementation of wxDialog::OnCloseWindow does not necessarily delete the dialog, since it will simply simulate an wxID_CANCEL event which itself only hides the dialog.

To guarantee that the window will be destroyed, call wxWindow::Destroy instead.

See also

Window deletion overview, wxWindow::Destroy, wxCloseEvent

### wxWindow::ConvertDialogToPixels

wxPoint ConvertDialogToPixels(const wxPoint& pt)

wxSize ConvertDialogToPixels(const wxSize& sz)

Converts a point or size from dialog units to pixels.

For the x dimension, the dialog units are multiplied by the average character width and then divided by 4.

For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.

Remarks

Dialog units are used for maintaining a dialog's proportions even if the font changes. Dialogs created using Dialog Editor optionally use dialog units.

You can also use these functions programmatically. A convenience macro is defined:

    #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt)

See also

wxWindow::ConvertPixelsToDialog

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

ConvertDialogPointToPixels(point) | Accepts and returns a wxPoint
ConvertDialogSizeToPixels(size) | Accepts and returns a wxSize

Additionally, the following helper functions are defined:

wxDLG_PNT(win, point) | Converts a wxPoint from dialog units to pixels
wxDLG_SZE(win, size) | Converts a wxSize from dialog units to pixels

### wxWindow::ConvertPixelsToDialog

wxPoint ConvertPixelsToDialog(const wxPoint& pt)

wxSize ConvertPixelsToDialog(const wxSize& sz)

Converts a point or size from pixels to dialog units.

For the x dimension, the pixels are multiplied by 4 and then divided by the average character width.

For the y dimension, the pixels are multiplied by 8 and then divided by the average character height.

Remarks

Dialog units are used for maintaining a dialog's proportions even if the font changes. Dialogs created using Dialog Editor optionally use dialog units.

See also

wxWindow::ConvertDialogToPixels

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

ConvertDialogPointToPixels(point) | Accepts and returns a wxPoint
ConvertDialogSizeToPixels(size) | Accepts and returns a wxSize

### wxWindow::Destroy

virtual bool Destroy()

Destroys the window safely. Use this function instead of the delete operator, since different window classes can be destroyed differently. Frames and dialogs are not destroyed immediately when this function is called - they are added to a list of windows to be deleted on idle time, when all the window's events have been processed. This prevents problems with events being sent to non-existent windows.

Return value

`TRUE` if the window has either been successfully deleted, or it has been added to the list of windows pending real deletion.

### wxWindow::DestroyChildren

virtual void DestroyChildren()

Destroys all children of a window. Called automatically by the destructor.

### wxWindow::Disable

void Disable()

Disables the window, same as Enable(`FALSE`).

Return value

Returns `TRUE` if the window has been disabled, `FALSE` if it had been already disabled before the call to this function.

### wxWindow::DragAcceptFiles

virtual void DragAcceptFiles(bool accept)

Enables or disables eligibility for drop file events (OnDropFiles).

Parameters

accept

If `TRUE`, the window is eligible for drop file events. If `FALSE`, the window will not accept drop file events.

Remarks

Windows only.

### wxWindow::Enable

virtual bool Enable(bool enable = `TRUE`)

Enable or disable the window for user input. Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is.

Parameters

enable

If `TRUE`, enables the window for input. If `FALSE`, disables the window.

Return value

Returns `TRUE` if the window has been enabled or disabled, `FALSE` if nothing was done, i.e. if the window had already been in the specified state.

See also

wxWindow::IsEnabled, wxWindow::Disable

### wxWindow::FindFocus

static wxWindow* FindFocus()

Finds the window or control which currently has the keyboard focus.

Remarks

Note that this is a static function, so it can be called without needing a wxWindow pointer.

See also

wxWindow::SetFocus

### wxWindow::FindWindow

wxWindow* FindWindow(long id)

Find a child of this window, by identifier.

wxWindow* FindWindow(const wxString& name)

Find a child of this window, by name.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

FindWindowById(id) | Accepts an integer
FindWindowByName(name) | Accepts a string

### wxWindow::FindWindowById

static wxWindow* FindWindowById(long id, wxWindow* parent = NULL)

Find the first window with the given id.

If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases.

See also

FindWindow

### wxWindow::FindWindowByName

static wxWindow* FindWindowByName(const wxString& name, wxWindow* parent = NULL)

Find a window by its name (as given in a window constructor or Create function call). If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases.

If no window with such name is found, FindWindowByLabel is called.

See also

FindWindow

### wxWindow::FindWindowByLabel

static wxWindow* FindWindowByLabel(const wxString& label, wxWindow* parent = NULL)

Find a window by its label. Depending on the type of window, the label may be a window title or panel item label. If parent is NULL, the search will start from all top-level frames and dialog boxes; if non-NULL, the search will be limited to the given window hierarchy. The search is recursive in both cases.

See also

FindWindow

### wxWindow::Fit

virtual void Fit()

Sizes the window so that it fits around its subwindows. This function won't do anything if there are no subwindows.

### wxWindow::FitInside

virtual void FitInside()

Similar to Fit, but sizes the interior (virtual) size of a window. Mainly useful with scrolled windows to reset scrollbars after sizing changes that do not trigger a size event, and/or scrolled windows without an interior sizer. This function similarly won't do anything if there are no subwindows.

### wxWindow::Freeze

virtual void Freeze()

Freezes the window or, in other words, prevents any updates from taking place on screen, the window is not redrawn at all. Thaw must be called to reenable window redrawing.

This method is useful for visual appearance optimization (for example, it is a good idea to use it before inserting large amount of text into a wxTextCtrl under wxGTK) but is not implemented on all platforms nor for all controls so it is mostly just a hint to wxWindows and not a mandatory directive.

### wxWindow::GetAdjustedBestSize

wxSize GetAdjustedBestSize() const

This method is similar to GetBestSize, except in one thing. GetBestSize should return the minimum untruncated size of the window, while this method will return the largest of BestSize and any user specified minimum size. ie. it is the minimum size the window should currently be drawn at, not the minimal size it can possibly tolerate.

### wxWindow::GetBackgroundColour

virtual wxColour GetBackgroundColour() const

Returns the background colour of the window.

See also

wxWindow::SetBackgroundColour, wxWindow::SetForegroundColour, wxWindow::GetForegroundColour

### wxWindow::GetBestSize

virtual wxSize GetBestSize() const

This functions returns the best acceptable minimal size for the window. For example, for a static control, it will be the minimal size such that the control label is not truncated. For windows containing subwindows (typically wxPanel), the size returned by this function will be the same as the size the window would have had after calling Fit.

### wxWindow::GetCaret

wxCaret * GetCaret() const

Returns the caret associated with the window.

### wxWindow::GetCapture

static wxWindow * GetCapture()

Returns the currently captured window.

See also

wxWindow::HasCapture, wxWindow::CaptureMouse, wxWindow::ReleaseMouse, wxMouseCaptureChangedEvent

### wxWindow::GetCharHeight

virtual int GetCharHeight() const

Returns the character height for this window.

### wxWindow::GetCharWidth

virtual int GetCharWidth() const

Returns the average character width for this window.

### wxWindow::GetChildren

wxList& GetChildren()

Returns a reference to the list of the window's children.

### wxWindow::GetClientSize

virtual void GetClientSize(int* width, int* height) const

wxPerl note: In wxPerl this method takes no parameter and returns a 2-element list `( width, height )`.

virtual wxSize GetClientSize() const

This gets the size of the window 'client area' in pixels. The client area is the area which may be drawn on by the programmer, excluding title bar, border, scrollbars, etc.

Parameters

width

Receives the client width in pixels.

height

Receives the client height in pixels.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

GetClientSizeTuple() | Returns a 2-tuple of (width, height)
GetClientSize() | Returns a wxSize object

See also

GetSize GetVirtualSize

### wxWindow::GetConstraints

wxLayoutConstraints* GetConstraints() const

Returns a pointer to the window's layout constraints, or NULL if there are none.

### wxWindow::GetContainingSizer

const wxSizer * GetContainingSizer() const

Return the sizer that this window is a member of, if any, otherwise `NULL`.

### wxWindow::GetDropTarget

wxDropTarget* GetDropTarget() const

Returns the associated drop target, which may be NULL.

See also

wxWindow::SetDropTarget, Drag and drop overview

### wxWindow::GetEventHandler

wxEvtHandler* GetEventHandler() const

Returns the event handler for this window. By default, the window is its own event handler.

See also

wxWindow::SetEventHandler, wxWindow::PushEventHandler, wxWindow::PopEventHandler, wxEvtHandler::ProcessEvent, wxEvtHandler

### wxWindow::GetExtraStyle

long GetExtraStyle() const

Returns the extra style bits for the window.

### wxWindow::GetFont

wxFont& GetFont() const

Returns a reference to the font for this window.

See also

wxWindow::SetFont

### wxWindow::GetForegroundColour

virtual wxColour GetForegroundColour()

Returns the foreground colour of the window.

Remarks

The interpretation of foreground colour is open to interpretation according to the window class; it may be the text colour or other colour, or it may not be used at all.

See also

wxWindow::SetForegroundColour, wxWindow::SetBackgroundColour, wxWindow::GetBackgroundColour

### wxWindow::GetGrandParent

wxWindow* GetGrandParent() const

Returns the grandparent of a window, or NULL if there isn't one.

### wxWindow::GetHandle

void* GetHandle() const

Returns the platform-specific handle of the physical window. Cast it to an appropriate handle, such as HWND for Windows, Widget for Motif or GtkWidget for GTK.

wxPython note: This method will return an integer in wxPython.

wxPerl note: This method will return an integer in wxPerl.

### wxWindow::GetHelpText

virtual wxString GetHelpText() const

Gets the help text to be used as context-sensitive help for this window.

Note that the text is actually stored by the current wxHelpProvider implementation, and not in the window object itself.

See also

SetHelpText, wxHelpProvider

### wxWindow::GetId

int GetId() const

Returns the identifier of the window.

Remarks

Each window has an integer identifier. If the application has not provided one (or the default Id -1) an unique identifier with a negative value will be generated.

See also

wxWindow::SetId, Window identifiers

### wxWindow::GetLabel

virtual wxString GetLabel() const

Generic way of getting a label from any window, for identification purposes.

Remarks

The interpretation of this function differs from class to class. For frames and dialogs, the value returned is the title. For buttons or static text controls, it is the button text. This function can be useful for meta-programs (such as testing tools or special-needs access programs) which need to identify windows by name.

### wxWindow::GetName

virtual wxString GetName() const

Returns the window's name.

Remarks

This name is not guaranteed to be unique; it is up to the programmer to supply an appropriate name in the window constructor or via wxWindow::SetName.

See also

wxWindow::SetName

### wxWindow::GetParent

virtual wxWindow* GetParent() const

Returns the parent of the window, or NULL if there is no parent.

### wxWindow::GetPosition

virtual void GetPosition(int* x, int* y) const

wxPoint GetPosition() const

This gets the position of the window in pixels, relative to the parent window for the child windows or relative to the display origin for the top level windows.

Parameters

x

Receives the x position of the window.

y

Receives the y position of the window.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

GetPosition() | Returns a wxPoint
GetPositionTuple() | Returns a tuple (x, y)

wxPerl note: In wxPerl there are two methods instead of a single overloaded method:

GetPosition() | Returns a Wx::Point
GetPositionXY() | Returns a 2-element list `( x, y )`

### wxWindow::GetRect

virtual wxRect GetRect() const

Returns the size and position of the window as a wxRect object.

### wxWindow::GetScrollThumb

virtual int GetScrollThumb(int orientation)

Returns the built-in scrollbar thumb size.

See also

wxWindow::SetScrollbar

### wxWindow::GetScrollPos

virtual int GetScrollPos(int orientation)

Returns the built-in scrollbar position.

See also

See wxWindow::SetScrollbar

### wxWindow::GetScrollRange

virtual int GetScrollRange(int orientation)

Returns the built-in scrollbar range.

See also

wxWindow::SetScrollbar

### wxWindow::GetSize

virtual void GetSize(int* width, int* height) const

virtual wxSize GetSize() const

This gets the size of the entire window in pixels, including title bar, border, scrollbars, etc.

Parameters

width

Receives the window width.

height

Receives the window height.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

GetSize() | Returns a wxSize
GetSizeTuple() | Returns a 2-tuple (width, height)

wxPerl note: In wxPerl there are two methods instead of a single overloaded method:

GetSize() | Returns a Wx::Size
GetSizeWH() | Returns a 2-element list `( width, height )`

See also

GetClientSize, GetVirtualSize

### wxWindow::GetSizer

wxSizer * GetSizer() const

Return the sizer associated with the window by a previous call to SetSizer() or `NULL`.

### wxWindow::GetTextExtent

virtual void GetTextExtent(const wxString& string, int* x, int* y, int* descent = NULL, int* externalLeading = NULL, const wxFont* font = NULL, bool use16 = `FALSE`) const

Gets the dimensions of the string as it would be drawn on the window with the currently selected font.

Parameters

string

String whose extent is to be measured.

x

Return value for width.

y

Return value for height.

descent

Return value for descent (optional).

externalLeading

Return value for external leading (optional).

font

Font to use instead of the current window font (optional).

use16

If `TRUE`, string contains 16-bit characters. The default is `FALSE`.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

GetTextExtent(string) | Returns a 2-tuple, (width, height)
GetFullTextExtent(string, font=NULL) | Returns a 4-tuple, (width, height, descent, externalLeading)

wxPerl note: In wxPerl this method takes only the `string` and optionally `font` parameters, and returns a 4-element list `( x, y, descent, externalLeading )`.

### wxWindow::GetTitle

virtual wxString GetTitle()

Gets the window's title. Applicable only to frames and dialogs.

See also

wxWindow::SetTitle

### wxWindow::GetUpdateRegion

### wxWindow::GetToolTip

wxToolTip* GetToolTip() const

Get the associated tooltip or NULL if none.

virtual wxRegion GetUpdateRegion() const

Returns the region specifying which parts of the window have been damaged. Should only be called within an wxPaintEvent handler.

See also

wxRegion, wxRegionIterator

### wxWindow::GetValidator

wxValidator* GetValidator() const

Returns a pointer to the current validator for the window, or NULL if there is none.

### wxWindow::GetVirtualSize

void GetVirtualSize(int* width, int* height) const

wxSize GetVirtualSize() const

This gets the virtual size of the window in pixels.

Parameters

width

Receives the window virtual width.

height

Receives the window virtual height.

GetSize, GetClientSize

### wxWindow::GetWindowStyleFlag

long GetWindowStyleFlag() const

Gets the window style that was passed to the constructor or Create method. GetWindowStyle() is another name for the same function.

### wxWindow::HasCapture

virtual bool HasCapture() const

Returns TRUE if this window has the current mouse capture.

See also

wxWindow::CaptureMouse, wxWindow::ReleaseMouse, wxMouseCaptureChangedEvent

### wxWindow::Hide

bool Hide()

Equivalent to calling Show(`FALSE`).

### wxWindow::InitDialog

void InitDialog()

Sends an `wxEVT_INIT_DIALOG` event, whose handler usually transfers data to the dialog via validators.

### wxWindow::IsEnabled

virtual bool IsEnabled() const

Returns `TRUE` if the window is enabled for input, `FALSE` otherwise.

See also

wxWindow::Enable

### wxWindow:IsExposed

bool IsExposed(int x, int y) const

bool IsExposed(wxPoint &pt) const

bool IsExposed(int x, int y, int w, int h) const

bool IsExposed(wxRect &rect) const

Returns `TRUE` if the given point or rectangle area has been exposed since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

IsExposed(x,y, w=0,h=0 |
IsExposedPoint(pt) |
IsExposedRect(rect) |

### wxWindow::IsRetained

virtual bool IsRetained() const

Returns `TRUE` if the window is retained, `FALSE` otherwise.

Remarks

Retained windows are only available on X platforms.

### wxWindow::IsShown

virtual bool IsShown() const

Returns `TRUE` if the window is shown, `FALSE` if it has been hidden.

### wxWindow::IsTopLevel

bool IsTopLevel() const

Returns `TRUE` if the given window is a top-level one. Currently all frames and dialogs are considered to be top-level windows (even if they have a parent window).

### wxWindow::Layout

void Layout()

Invokes the constraint-based layout algorithm or the sizer-based algorithm for this window.

See wxWindow::SetAutoLayout: when auto layout is on, this function gets called automatically when the window is resized.

### wxWindow::LoadFromResource

virtual bool LoadFromResource(wxWindow* parent, const wxString& resourceName, const wxResourceTable* resourceTable = NULL)

Loads a panel or dialog from a resource file.

Parameters

parent

Parent window.

resourceName

The name of the resource to load.

resourceTable

The resource table to load it from. If this is NULL, the default resource table will be used.

Return value

`TRUE` if the operation succeeded, otherwise `FALSE`.

### wxWindow::Lower

void Lower()

Lowers the window to the bottom of the window hierarchy if it is a managed window (dialog or frame).

### wxWindow::MakeModal

virtual void MakeModal(bool flag)

Disables all other windows in the application so that the user can only interact with this window. (This function is not implemented anywhere).

Parameters

flag

If `TRUE`, this call disables all other windows in the application so that the user can only interact with this window. If `FALSE`, the effect is reversed.

### wxWindow::Move

void Move(int x, int y)

void Move(const wxPoint& pt)

Moves the window to the given position.

Parameters

x

Required x position.

y

Required y position.

pt

wxPoint object representing the position.

Remarks

Implementations of SetSize can also implicitly implement the wxWindow::Move function, which is defined in the base wxWindow class as the call:

      SetSize(x, y, -1, -1, wxSIZE_USE_EXISTING);

See also

wxWindow::SetSize

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

Move(point) | Accepts a wxPoint
MoveXY(x, y) | Accepts a pair of integers

### wxWindow::PopEventHandler

wxEvtHandler* PopEventHandler(bool deleteHandler = `FALSE`) const

Removes and returns the top-most event handler on the event handler stack.

Parameters

deleteHandler

If this is `TRUE`, the handler will be deleted after it is removed. The default value is `FALSE`.

See also

wxWindow::SetEventHandler, wxWindow::GetEventHandler, wxWindow::PushEventHandler, wxEvtHandler::ProcessEvent, wxEvtHandler

### wxWindow::PopupMenu

bool PopupMenu(wxMenu* menu, const wxPoint& pos)

bool PopupMenu(wxMenu* menu, int x, int y)

Pops up the given menu at the specified coordinates, relative to this window, and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usually.

Parameters

menu

Menu to pop up.

pos

The position where the menu will appear.

x

Required x position for the menu to appear.

y

Required y position for the menu to appear.

See also

wxMenu

Remarks

Just before the menu is popped up, wxMenu::UpdateUI is called to ensure that the menu items are in the correct state. The menu does not get deleted by the window.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

PopupMenu(menu, point) | Specifies position with a wxPoint
PopupMenuXY(menu, x, y) | Specifies position with two integers (x, y)

### wxWindow::PushEventHandler

void PushEventHandler(wxEvtHandler* handler)

Pushes this event handler onto the event stack for the window.

Parameters

handler

Specifies the handler to be pushed.

Remarks

An event handler is an object that is capable of processing the events sent to a window. By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes.

wxWindow::PushEventHandler allows an application to set up a chain of event handlers, where an event not handled by one event handler is handed to the next one in the chain. Use wxWindow::PopEventHandler to remove the event handler.

See also

wxWindow::SetEventHandler, wxWindow::GetEventHandler, wxWindow::PopEventHandler, wxEvtHandler::ProcessEvent, wxEvtHandler

### wxWindow::Raise

void Raise()

Raises the window to the top of the window hierarchy if it is a managed window (dialog or frame).

### wxWindow::Refresh

virtual void Refresh(bool eraseBackground = `TRUE`, const wxRect* rect = NULL)

Causes a message or event to be generated to repaint the window.

Parameters

eraseBackground

If `TRUE`, the background will be erased.

rect

If non-NULL, only the given rectangle will be treated as damaged.

See also

wxWindow::RefreshRect

### wxWindow::RefreshRect

virtual void Refresh(const wxRect& rect)

Redraws the contents of the given rectangle: the area inside it will be repainted.

This is the same as Refresh but has a nicer syntax.

### wxWindow::ReleaseMouse

virtual void ReleaseMouse()

Releases mouse input captured with wxWindow::CaptureMouse.

See also

wxWindow::CaptureMouse, wxWindow::HasCapture, wxWindow::ReleaseMouse, wxMouseCaptureChangedEvent

### wxWindow::RemoveChild

virtual void RemoveChild(wxWindow* child)

Removes a child window. This is called automatically by window deletion functions so should not be required by the application programmer.

Parameters

child

Child window to remove.

### wxWindow::RemoveEventHandler

bool RemoveEventHandler(wxEvtHandler *handler)

Find the given handler in the windows event handler chain and remove (but not delete) it from it.

Parameters

handler

The event handler to remove, must be non `NULL` and must be present in this windows event handlers chain

Return value

Returns `TRUE` if it was found and `FALSE` otherwise (this also results in an assert failure so this function should only be called when the handler is supposed to be there).

See also

PushEventHandler, PopEventHandler

### wxWindow::Reparent

virtual bool Reparent(wxWindow* newParent)

Reparents the window, i.e the window will be removed from its current parent window (e.g. a non-standard toolbar in a wxFrame) and then re-inserted into another. Available on Windows and GTK.

Parameters

newParent

New parent.

### wxWindow::ScreenToClient

virtual void ScreenToClient(int* x, int* y) const

virtual wxPoint ScreenToClient(const wxPoint& pt) const

Converts from screen to client window coordinates.

Parameters

x

Stores the screen x coordinate and receives the client x coordinate.

y

Stores the screen x coordinate and receives the client x coordinate.

pt

The screen position for the second form of the function.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

ScreenToClient(point) | Accepts and returns a wxPoint
ScreenToClientXY(x, y) | Returns a 2-tuple, (x, y)

### wxWindow::ScrollLines

virtual bool ScrollLines(int lines)

Scrolls the window by the given number of lines down (if lines is positive) or up.

Return value

Returns `TRUE` if the window was scrolled, `FALSE` if it was already on top/bottom and nothing was done.

Remarks

This function is currently only implemented under MSW and wxTextCtrl under wxGTK (it also works for wxScrolledWindow derived classes under all platforms).

See also

ScrollPages

### wxWindow::ScrollPages

virtual bool ScrollPages(int pages)

Scrolls the window by the given number of pages down (if pages is positive) or up.

Return value

Returns `TRUE` if the window was scrolled, `FALSE` if it was already on top/bottom and nothing was done.

Remarks

This function is currently only implemented under MSW and wxTextCtrl under wxGTK (it also works for wxScrolledWindow derived classes under all platforms).

See also

ScrollLines

### wxWindow::ScrollWindow

virtual void ScrollWindow(int dx, int dy, const wxRect* rect = NULL)

Physically scrolls the pixels in the window and move child windows accordingly.

Parameters

dx

Amount to scroll horizontally.

dy

Amount to scroll vertically.

rect

Rectangle to invalidate. If this is NULL, the whole window is invalidated. If you pass a rectangle corresponding to the area of the window exposed by the scroll, your painting handler can optimize painting by checking for the invalidated region. This parameter is ignored under GTK.

Remarks

Use this function to optimise your scrolling implementations, to minimise the area that must be redrawn. Note that it is rarely required to call this function from a user program.

### wxWindow::SetAcceleratorTable

virtual void SetAcceleratorTable(const wxAcceleratorTable& accel)

Sets the accelerator table for this window. See wxAcceleratorTable.

### wxWindow::SetAutoLayout

void SetAutoLayout(bool autoLayout)

Determines whether the wxWindow::Layout function will be called automatically when the window is resized. It is called implicitly by wxWindow::SetSizer but if you use wxWindow::SetConstraints you should call it manually or otherwise the window layout won't be correctly updated when its size changes.

Parameters

autoLayout

Set this to `TRUE` if you wish the Layout function to be called from within wxWindow::OnSize functions.

See also

wxWindow::SetConstraints

### wxWindow::SetBackgroundColour

virtual void SetBackgroundColour(const wxColour& colour)

Sets the background colour of the window.

Parameters

colour

The colour to be used as the background colour.

Remarks

The background colour is usually painted by the default wxEraseEvent event handler function under Windows and automatically under GTK.

Note that setting the background colour does not cause an immediate refresh, so you may wish to call wxWindow::Clear or wxWindow::Refresh after calling this function.

Use this function with care under GTK as the new appearance of the window might not look equally well when used with "Themes", i.e GTK's ability to change its look as the user wishes with run-time loadable modules.

See also

wxWindow::GetBackgroundColour, wxWindow::SetForegroundColour, wxWindow::GetForegroundColour, wxWindow::Clear, wxWindow::Refresh, wxEraseEvent

### wxWindow::SetCaret

void SetCaret(wxCaret *caret) const

Sets the caret associated with the window.

### wxWindow::SetClientSize

virtual void SetClientSize(int width, int height)

virtual void SetClientSize(const wxSize& size)

This sets the size of the window client area in pixels. Using this function to size a window tends to be more device-independent than wxWindow::SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.

Parameters

width

The required client area width.

height

The required client area height.

size

The required client size.

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

SetClientSize(size) | Accepts a wxSize
SetClientSizeWH(width, height) |

### wxWindow::SetContainingSizer

void SetContainingSizer(wxSizer* sizer)

This normally does not need to be called by user code. It is called when a window is added to a sizer, and is used so the window can remove itself from the sizer when it is destroyed.

### wxWindow::SetCursor

virtual void SetCursor(const wxCursor&cursor)

Sets the window's cursor. Notice that the window cursor also sets it for the children of the window implicitly.

The cursor may be `wxNullCursor` in which case the window cursor will be reset back to default.

Parameters

cursor

Specifies the cursor that the window should normally display.

See also

::wxSetCursor, wxCursor

### wxWindow::SetConstraints

void SetConstraints(wxLayoutConstraints* constraints)

Sets the window to have the given layout constraints. The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted.

Parameters

constraints

The constraints to set. Pass NULL to disassociate and delete the window's constraints.

Remarks

You must call wxWindow::SetAutoLayout to tell a window to use the constraints automatically in OnSize; otherwise, you must override OnSize and call Layout() explicitly. When setting both a wxLayoutConstraints and a wxSizer, only the sizer will have effect.

### wxWindow::SetDropTarget

void SetDropTarget(wxDropTarget* target)

Associates a drop target with this window.

If the window already has a drop target, it is deleted.

See also

wxWindow::GetDropTarget, Drag and drop overview

### wxWindow::SetEventHandler

void SetEventHandler(wxEvtHandler* handler)

Sets the event handler for this window.

Parameters

handler

Specifies the handler to be set.

Remarks

An event handler is an object that is capable of processing the events sent to a window. By default, the window is its own event handler, but an application may wish to substitute another, for example to allow central implementation of event-handling for a variety of different window classes.

It is usually better to use wxWindow::PushEventHandler since this sets up a chain of event handlers, where an event not handled by one event handler is handed to the next one in the chain.

See also

wxWindow::GetEventHandler, wxWindow::PushEventHandler, wxWindow::PopEventHandler, wxEvtHandler::ProcessEvent, wxEvtHandler

### wxWindow::SetExtraStyle

void SetExtraStyle(long exStyle)

Sets the extra style bits for the window. The currently defined extra style bits are:

wxWS_EX_VALIDATE_RECURSIVELY | TransferDataTo/FromWindow() and Validate() methods will recursively descend into all children of the window if it has this style flag set.
wxWS_EX_BLOCK_EVENTS | Normally, the command events are propagated upwards to the window parent recursively until a handler for them is found. Using this style allows to prevent them from being propagated beyond this window. Notice that wxDialog has this style on by default for the reasons explained in the event processing overview.
wxWS_EX_TRANSIENT | This can be used to prevent a window from being used as an implicit parent for the dialogs which were created without a parent. It is useful for the windows which can disappear at any moment as creating children of such windows results in fatal problems.
wxFRAME_EX_CONTEXTHELP | Under Windows, puts a query button on the caption. When pressed, Windows will go into a context-sensitive help mode and wxWindows will send a wxEVT_HELP event if the user clicked on an application window. This style cannot be used together with wxMAXIMIZE_BOX or wxMINIMIZE_BOX, so you should use the style of `wxDEFAULT_FRAME_STYLE & ``(wxMINIMIZE_BOX | wxMAXIMIZE_BOX)` for the frames having this style (the dialogs don't have minimize nor maximize box by default)

### wxWindow::SetFocus

virtual void SetFocus()

This sets the window to receive keyboard input.

See also

wxFocusEvent

### wxWindow::SetFocusFromKbd

virtual void SetFocusFromKbd()

This function is called by wxWindows keyboard navigation code when the user gives the focus to this window from keyboard (e.g. using `TAB` key). By default this method simply calls SetFocus but can be overridden to do something in addition to this in the derived classes.

### wxWindow::SetFont

void SetFont(const wxFont& font)

Sets the font for this window.

Parameters

font

Font to associate with this window.

See also

wxWindow::GetFont

### wxWindow::SetForegroundColour

virtual void SetForegroundColour(const wxColour& colour)

Sets the foreground colour of the window.

Parameters

colour

The colour to be used as the foreground colour.

Remarks

The interpretation of foreground colour is open to interpretation according to the window class; it may be the text colour or other colour, or it may not be used at all.

Note that when using this functions under GTK, you will disable the so called "themes", i.e. the user chosen appearance of windows and controls, including the themes of their parent windows.

See also

wxWindow::GetForegroundColour, wxWindow::SetBackgroundColour, wxWindow::GetBackgroundColour

### wxWindow::SetHelpText

virtual void SetHelpText(const wxString& helpText)

Sets the help text to be used as context-sensitive help for this window.

Note that the text is actually stored by the current wxHelpProvider implementation, and not in the window object itself.

See also

GetHelpText, wxHelpProvider

### wxWindow::SetId

void SetId(int id)

Sets the identifier of the window.

Remarks

Each window has an integer identifier. If the application has not provided one, an identifier will be generated. Normally, the identifier should be provided on creation and should not be modified subsequently.

See also

wxWindow::GetId, Window identifiers

### wxWindow::SetName

virtual void SetName(const wxString& name)

Sets the window's name.

Parameters

name

A name to set for the window.

See also

wxWindow::GetName

### wxWindow::SetPalette

virtual void SetPalette(wxPalette* palette)

Obsolete - use wxDC::SetPalette instead.

### wxWindow::SetScrollbar

virtual void SetScrollbar(int orientation, int position, int thumbSize, int range, bool refresh = `TRUE`)

Sets the scrollbar properties of a built-in scrollbar.

Parameters

orientation

Determines the scrollbar whose page size is to be set. May be wxHORIZONTAL or wxVERTICAL.

position

The position of the scrollbar in scroll units.

thumbSize

The size of the thumb, or visible portion of the scrollbar, in scroll units.

range

The maximum position of the scrollbar.

refresh

`TRUE` to redraw the scrollbar, `FALSE` otherwise.

Remarks

Let's say you wish to display 50 lines of text, using the same font. The window is sized so that you can only see 16 lines at a time.

You would use:

      SetScrollbar(wxVERTICAL, 0, 16, 50);

Note that with the window at this size, the thumb position can never go above 50 minus 16, or 34.

You can determine how many lines are currently visible by dividing the current view size by the character height in pixels.

When defining your own scrollbar behaviour, you will always need to recalculate the scrollbar settings when the window size changes. You could therefore put your scrollbar calculations and SetScrollbar call into a function named AdjustScrollbars, which can be called initially and also from your wxSizeEvent handler function.

See also

Scrolling overview, wxScrollBar, wxScrolledWindow

### wxWindow::SetScrollPos

virtual void SetScrollPos(int orientation, int pos, bool refresh = `TRUE`)

Sets the position of one of the built-in scrollbars.

Parameters

orientation

Determines the scrollbar whose position is to be set. May be wxHORIZONTAL or wxVERTICAL.

pos

Position in scroll units.

refresh

`TRUE` to redraw the scrollbar, `FALSE` otherwise.

Remarks

This function does not directly affect the contents of the window: it is up to the application to take note of scrollbar attributes and redraw contents accordingly.

See also

wxWindow::SetScrollbar, wxWindow::GetScrollPos, wxWindow::GetScrollThumb, wxScrollBar, wxScrolledWindow

### wxWindow::SetSize

virtual void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO)

virtual void SetSize(const wxRect& rect)

Sets the size and position of the window in pixels.

virtual void SetSize(int width, int height)

virtual void SetSize(const wxSize& size)

Sets the size of the window in pixels.

Parameters

x

Required x position in pixels, or -1 to indicate that the existing value should be used.

y

Required y position in pixels, or -1 to indicate that the existing value should be used.

width

Required width in pixels, or -1 to indicate that the existing value should be used.

height

Required height position in pixels, or -1 to indicate that the existing value should be used.

size

wxSize object for setting the size.

rect

wxRect object for setting the position and size.

sizeFlags

Indicates the interpretation of other parameters. It is a bit list of the following:

wxSIZE_AUTO_WIDTH: a -1 width value is taken to indicate a wxWindows-supplied default width.
wxSIZE_AUTO_HEIGHT: a -1 height value is taken to indicate a wxWindows-supplied default width.
wxSIZE_AUTO: -1 size values are taken to indicate a wxWindows-supplied default size.
wxSIZE_USE_EXISTING: existing dimensions should be used if -1 values are supplied.
wxSIZE_ALLOW_MINUS_ONE: allow dimensions of -1 and less to be interpreted as real dimensions, not default values.

Remarks

The second form is a convenience for calling the first form with default x and y parameters, and must be used with non-default width and height values.

The first form sets the position and optionally size, of the window. Parameters may be -1 to indicate either that a default should be supplied by wxWindows, or that the current value of the dimension should be used.

See also

wxWindow::Move

wxPython note: In place of a single overloaded method name, wxPython implements the following methods:

SetDimensions(x, y, width, height, sizeFlags=wxSIZE_AUTO) |
SetSize(size) |
SetPosition(point) |

### wxWindow::SetSizeHints

virtual void SetSizeHints(int minW=-1, int minH=-1, int maxW=-1, int maxH=-1, int incW=-1, int incH=-1)

Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the default values will be used.

Parameters

minW

Specifies the minimum width allowable.

minH

Specifies the minimum height allowable.

maxW

Specifies the maximum width allowable.

maxH

Specifies the maximum height allowable.

incW

Specifies the increment for sizing the width (Motif/Xt only).

incH

Specifies the increment for sizing the height (Motif/Xt only).

Remarks

If this function is called, the user will not be able to size the window outside the given bounds.

The resizing increments are only significant under Motif or Xt.

### wxWindow::SetSizer

void SetSizer(wxSizer* sizer, bool deleteOld=TRUE)

Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout constraints object is already owned by the window, it will be deleted if the deleteOld parameter is TRUE.

Note that this function will also call SetAutoLayout implicitly with `TRUE` parameter if the sizer is non-NULL and `FALSE` otherwise.

Parameters

sizer

The sizer to set. Pass NULL to disassociate and conditionally delete the window's sizer. See below.

deleteOld

If TRUE (the default), this will delete any prexisting sizer. Pass FALSE if you wish to handle deleting the old sizer yourself.

Remarks

SetSizer now enables and disables Layout automatically, but prior to wxWindows 2.3.3 the following applied:

You must call wxWindow::SetAutoLayout to tell a window to use the sizer automatically in OnSize; otherwise, you must override OnSize and call Layout() explicitly. When setting both a wxSizer and a wxLayoutConstraints, only the sizer will have effect.

### wxWindow::SetSizerAndFit

void SetSizerAndFit(wxSizer* sizer, bool deleteOld=TRUE)

The same as SetSizer, except it also sets the size hints for the window based on the sizer's minimum size.

### wxWindow::SetTitle

virtual void SetTitle(const wxString& title)

Sets the window's title. Applicable only to frames and dialogs.

Parameters

title

The window's title.

See also

wxWindow::GetTitle

### wxWindow::SetThemeEnabled

virtual void SetThemeEnabled(bool enable)

This function tells a window if it should use the system's "theme" code to draw the windows' background instead if its own background drawing code. This does not always have any effect since the underlying platform obviously needs to support the notion of themes in user defined windows. One such platform is GTK+ where windows can have (very colourful) backgrounds defined by a user's selected theme.

Dialogs, notebook pages and the status bar have this flag set to TRUE by default so that the default look and feel is simulated best.

### wxWindow::SetValidator

virtual void SetValidator(const wxValidator& validator)

Deletes the current validator (if any) and sets the window validator, having called wxValidator::Clone to create a new validator of this type.

### wxWindow::SetToolTip

void SetToolTip(const wxString& tip)

void SetToolTip(wxToolTip* tip)

Attach a tooltip to the window.

See also: GetToolTip, wxToolTip

### wxWindow::SetVirtualSize

void SetVirtualSize(int width, int height)

void SetVirtualSize(const wxSize& size)

Sets the virtual size of the window in pixels.

### wxWindow::SetVirtualSizeHints

virtual void SetVirtualSizeHints(int minW,int minH, int maxW=-1, int maxH=-1)

Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used.

Parameters

minW

Specifies the minimum width allowable.

minH

Specifies the minimum height allowable.

maxW

Specifies the maximum width allowable.

maxH

Specifies the maximum height allowable.

Remarks

If this function is called, the user will not be able to size the virtual area of the window outside the given bounds.

### wxWindow::SetWindowStyle

void SetWindowStyle(long style)

Identical to SetWindowStyleFlag.

### wxWindow::SetWindowStyleFlag

virtual void SetWindowStyleFlag(long style)

Sets the style of the window. Please note that some styles cannot be changed after the window creation and that Refresh() might be called after changing the others for the change to take place immediately.

See Window styles for more information about flags.

See also

GetWindowStyleFlag

### wxWindow::Show

virtual bool Show(bool show = `TRUE`)

Shows or hides the window. You may need to call Raise for a top level window if you want to bring it to top, although this is not needed if Show() is called immediately after the frame creation.

Parameters

show

If `TRUE` displays the window. Otherwise, hides it.

Return value

`TRUE` if the window has been shown or hidden or `FALSE` if nothing was done because it already was in the requested state.

See also

wxWindow::IsShown

### wxWindow::Thaw

virtual void Thaw()

Reenables window updating after a previous call to Freeze.

### wxWindow::TransferDataFromWindow

virtual bool TransferDataFromWindow()

Transfers values from child controls to data areas specified by their validators. Returns `FALSE` if a transfer failed.

If the window has `wxWS_EX_VALIDATE_RECURSIVELY` extra style flag set, the method will also call TransferDataFromWindow() of all child windows.

See also

wxWindow::TransferDataToWindow, wxValidator, wxWindow::Validate

### wxWindow::TransferDataToWindow

virtual bool TransferDataToWindow()

Transfers values to child controls from data areas specified by their validators.

If the window has `wxWS_EX_VALIDATE_RECURSIVELY` extra style flag set, the method will also call TransferDataToWindow() of all child windows.

Return value

Returns `FALSE` if a transfer failed.

See also

wxWindow::TransferDataFromWindow, wxValidator, wxWindow::Validate

### wxWindow::Update

virtual void Update()

Calling this method immediately repaints the invalidated area of the window while this would usually only happen when the flow of control returns to the event loop. Notice that this function doesn't refresh the window and does nothing if the window hadn't been already repainted. Use Refresh first if you want to immediately redraw the window unconditionally.

### wxWindow::Validate

virtual bool Validate()

Validates the current values of the child controls using their validators.

If the window has `wxWS_EX_VALIDATE_RECURSIVELY` extra style flag set, the method will also call Validate() of all child windows.

Return value

Returns `FALSE` if any of the validations failed.

See also

wxWindow::TransferDataFromWindow, wxWindow::TransferDataFromWindow, wxValidator

### wxWindow::WarpPointer

void WarpPointer(int x, int y)

Moves the pointer to the given position on the window.

Parameters

x

The new x position for the cursor.

y

The new y position for the cursor.