wxWindow: wxObject

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

wxWindow::wxWindow

voidwxWindow

Constructor.

wxWindow::wxWindow

voidwxWindow

Destructor. Deletes all subwindows, then deletes itself.

wxWindow::AddChild

voidAddChildwxWindow *child

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

wxWindow::Center

voidCenterint direction

See Centre.

wxWindow::Centre

voidCentreint direction

Centres the window. The parameter may be wxHORIZONTAL, wxVERTICAL or wxBOTH.

The actual behaviour depends on the derived window. For a frame or dialog box, centring is relative to the whole display. For a panel item, centring is relative to the panel.

wxWindow::DestroyChildren

voidDestroyChildren

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

wxWindow::Fit

voidFit

Sizes the window to fit the content (for panels and frames).

wxWindow::GetClientData

char *GetClientData

Gets user-supplied client data. Normally, any extra data the programmer wishes to associate with the window should be made available by deriving a new class with new data members.

wxWindow::GetClientSize

voidGetClientSizeint *width, int *height

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 etc.

wxWindow::GetHandle

char *GetHandle

Gets the platform-specific handle of the physical window.

wxWindow::GetPosition

voidGetPositionint *x, int *y

This gets the position of the window in pixels, relative to the parent window or if no parent, relative to the whole display.

wxWindow::GetSize

voidGetSizeint *width, int *height

This gets the size of the entire window in pixels.

wxWindow::GetTextExtent

voidGetTextExtentchar *string, int *x, int *y

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

wxWindow::OnActivate

voidOnActivateBool active

Called when a window is activated or deactivated (Windows 3 only). If the window is being activated, active is TRUE, else it is FALSE.

wxWindow::OnChar

voidOnCharint ch

Sent to the window when the user has pressed a key. ch gives the ASCII code (function key identifiers not yet implemented). See OnEvent for mouse event notification. Currently applicable to canvas subwindows only.

wxWindow::OnClose

BoolOnClose

Sent to the window when the user has tried to close the window. If TRUE is returned, the window will be deleted by the system, otherwise the attempt will be ignored. Derive your own class to handle this message; the default handler returns TRUE. Really only relevant to wxFrames.

wxWindow::OnEvent

voidOnEventwxEvent& event

Sent to the window when the user has initiated an event with the mouse. Derive your own class to handle this message. So far, only relevant to the wxCanvas class. See OnChar for character events, and also wxEvent for how to access event information.

wxWindow::OnKillFocus

voidOnKillFocus

Called when a window's focus is being killed.

wxWindow::OnPaint

voidOnPaint

Sent to the window when the window must be refreshed. Derive your own class to handle this message. So far, only relevant to the wxCanvas class.

wxWindow::OnSetFocus

voidOnSetFocus

Called when a window's focus is being set.

wxWindow::OnSize

voidOnSizeint x, int y

Sent to the window when the window has been resized. You may wish to use this for frames to resize their child windows as appropriate. Derive your own class to handle this message. Note that the size passed is of the whole window: call GetClientSize for the area which may be used by the application. A window is sent both an OnPaint and an OnSize message when a resize occurs.

wxWindow::SetFocus

voidSetFocus

This sets the window to receive keyboard input. The only panel item that will respond to this under XView is the wxText item and derived items.

wxWindow::SetSize

voidSetSizeint x, int y, int width, int height

This sets the size of the entire window in pixels.

wxWindow::SetClientData

voidSetClientDatachar *data

Sets user-supplied client data. Normally, any extra data the programmer wishes to associate with the window should be made available by deriving a new class with new data members.

wxWindow::SetClientSize

voidSetClientSizeint x, int y, int width, int height

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 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.

wxWindow::SetCursor

wxCursor *SetCursorwxCursor *cursor

Sets the window's cursor, returning the previous cursor (if any). This function applies to all subwindows.

wxWindow::SetTitle

voidSetTitlechar *title

Sets the window's title, allocating its own string storage. Currently applicable only to frames.

wxWindow::Show

voidShowBool show

If show is TRUE, displays the window and brings it to the front. Otherwise, hides the window.