Windows

An application presents the user primarily with a series of windows. A window can be made up of a frame with one or more subwindows. This is like the XView model, rather than Motif or Windows 3.1 where child windows may be nested to any depth. The frame method was chosen since XView required it, and because it is a useful simplifying assumption, imposing few restrictions in practise. Note that the splitting of views beloved of the Open Look standard is not allowed in wxWindows.

A frame window may be parentless or a child of another frame, and may be iconized. It may have a menu bar, a row of pull-down menus along the top of the frame. Subwindows within a frame come in three varieties: the panel, canvas and text subwindow. A panel is used for buttons, lists and other such user input items, while a canvas is used for drawing graphics such as lines and shapes. Panel items pass high-level notification of user interaction to the program, whereas any interaction with objects on a canvas must be programmed at a lower level.

In Windows 3.1, canvases need to be painted using a handle to a 'device context'. The purpose of this is to enable the same code to draw into a number of different devices, such as printers, windows, bitmaps and metafiles. wxWindows also has the notion of a device context, but most drawing commands may also be directly issued to a canvas for convenience. An application which implements a function to draw into the base device context, wxDC will be able to pass any device context object to this drawing function, including wxPostScriptDC, wxCanvasDC, wxMetaFileDC, and wxMemoryDC.

wxWindows defines several objects required for drawing on canvases: colours, fonts, pens and brushes. Neither XView nor Motif provides pens and brushes, which in Windows 3.1 allow the selection of different predefined 'drawing tools' with certain characteristics (line thickness, colour, fill style etc.). Normally in X there is a limited range of fonts (scaleable fonts are a recent addition), while in Windows 3.1 an infinite selection of sizes is available thanks to the scaleable TrueType font system. Under XView and Motif, wxWindows chooses the closest matching font.

Windows 3.1 or Motif programmers may miss the ability to place panel items in canvases (to use XView terminology), or to draw graphics in panels. A future version of wxWindows may support drawing on panels, particularly in the Motif and Windows versions, lifting these restrictions. Support for displaying panel items and drawing graphics will probably be moved up to the base wxWindow class, maintaining compatibility with existing wxWindows programs but allowing new programs more flexibility.

MDI versus SDI