It draws a frame and calls a virtual function, drawContents(), to fill in the frame. This function is reimplemented by subclasses. There are also two other less useful functions: drawFrame() and frameChanged().
TQPopupMenu uses this to "raise" the menu above the surrounding screen. TQProgressBar has a "sunken" look. TQLabel has a flat look. The frames of widgets like these can be changed.
The TQFrame class can also be used directly for creating simple frames without any contents, although usually you would use a TQHBox or TQVBox because they automatically lay out the widgets you put inside the frame.
A frame widget has four attributes: frameStyle(), lineWidth(), midLineWidth(), and margin().
.PP
The frame style is specified by a frame shape and a shadow style. The frame shapes are NoFrame, Box, Panel, StyledPanel, PopupPanel, WinPanel, ToolBarPanel, MenuBarPanel, HLine and VLine; the shadow styles are Plain, Raised and Sunken.
.PP
The line width is the width of the frame border.
.PP
The mid-line width specifies the width of an extra line in the middle of the frame, which uses a third color to obtain a special 3D effect. Notice that a mid-line is only drawn for Box, HLine and VLine frames that are raised or sunken.
.PP
The margin is the gap between the frame and the contents of the frame.
.PP
This table shows the most useful combinations of styles and widths (and some rather useless ones):
\fCTQFrame::WinPanel\fR - draws a rectangular panel that can be raised or sunken like those in Windows 95. Specifying this shape sets the line width to 2 pixels. WinPanel is provided for compatibility. For GUI style independence we recommend using StyledPanel instead.
When it does not call TQStyle, Shape interacts with TQFrame::Shadow, the lineWidth() and the midLineWidth() to create the total result. See the picture of the frames in the class description.
The TQPainter is already open when you get it, and you must leave it open. Painter transformations are switched off on entry. If you transform the painter, remember to take the frame into account and reset transformation before returning.
This function is reimplemented by subclasses that draw something inside the frame. It should only draw inside contentsRect(). The default function does nothing.
If a mid-line width greater than 0 is specified, an additional line is drawn for Raised or Sunken Box, HLine, and VLine frames. The mid-color of the current color group is used for drawing middle lines.
The frame rectangle is the rectangle the frame is drawn in. By default, this is the entire widget. Setting this property does \fInot\fR cause a widget update.
Set this property's value with setFrameRect() and get this property's value with frameRect().
.SH "Shadow frameShadow"
This property holds the frame shadow value from the frame style.
.PP
Set this property's value with setFrameShadow() and get this property's value with frameShadow().
.PP
See also frameStyle() and frameShape.
.SH "Shape frameShape"
This property holds the frame shape value from the frame style.
.PP
Set this property's value with setFrameShape() and get this property's value with frameShape().
.PP
See also frameStyle() and frameShadow.
.SH "int frameWidth"
This property holds the width of the frame that is drawn.
.PP
Note that the frame width depends on the frame style, not only the line width and the mid-line width. For example, the style NoFrame always has a frame width of 0, whereas the style Panel has a frame width equivalent to the line width. The frame width also includes the margin.
.PP
See also lineWidth, midLineWidth, frameStyle(), and margin.
.PP
Get this property's value with frameWidth().
.SH "int lineWidth"
This property holds the line width.
.PP
Note that the \fItotal\fR line width for HLine and VLine is given by frameWidth(), not lineWidth().
.PP
The default value is 1.
.PP
See also midLineWidth and frameWidth.
.PP
Set this property's value with setLineWidth() and get this property's value with lineWidth().
.SH "int margin"
This property holds the width of the margin.
.PP
The margin is the distance between the innermost pixel of the frame and the outermost pixel of contentsRect(). It is included in frameWidth().
.PP
The margin is filled according to backgroundMode().
.PP
The default value is 0.
.PP
See also margin, lineWidth, and frameWidth.
.PP
Set this property's value with setMargin() and get this property's value with margin().
.SH "int midLineWidth"
This property holds the width of the mid-line.
.PP
The default value is 0.
.PP
See also lineWidth and frameWidth.
.PP
Set this property's value with setMidLineWidth() and get this property's value with midLineWidth().