Widget writers can also use the Frame class as a superclass for new widgets. The frame is drawn by the expose method (which must therefore be called by subclasses). Its width is given by XtNframeWidth, the appearance by XtNframeType. The possible types are:
item{XfwfRaised} Gives a beveled look. The top and left bor ders will be lighter, the bottom and right sides darker.
item{XfwfSunken} Just the opposite.
item{XfwfChiseled} The border will look as if it was made with a chisel.
item{XfwfLedged} The border will be a ledge that juts out of the background.
Public variables
________________________________________________________________________________________
XtNframeType
The XtNframeType determines how the border looks.
XtNframeWidth
XtNframeWidth gives the width of the border. The
default value of 0 shows no border at all. The border
is drawn {it inside} the widget. (See also XtNouterOff
set.)
XtNouterOffset
Normally, the border is draw along the outer edge of
the widget, but it can be moved inward. XtNouterOffset
is the number of pixels between the edge and the frame.
XtNinnerOffset
Between the frame and whatever is inside the widget,
there is also margin. By default, however, it is 0.
XtNshadowScheme
The colors of the top and bottom shadows can be set
with the resources topShadowColor and bottomShadow
Color, but it is also possible to use a stiple of fore
ground and background colors. This may be preferable on
workstations with limited or no color capabilities.
However, the easiest way (which is also the default) is
to let the widget determine its own shadow colors or
stipples, based on the widget's background color and
the color capabilities of the screen.
The resource shadowScheme can be set to XfwfColor, XfwfStipple or XfwfAuto. The converter for the shadow pixmap accepts the strings "stipple0" through "stipple8", which create pixmaps of the current back ground and foreground colors, with "stipple0" entirely background and "stipple8" entirely foreground. Setting pixmaps or colors is only useful when shadowScheme is set to XfwfStipple or XfwfColor respectively.
The values of topShadowColor and bottomShadowColor are ignored by the Frame widget as long as shadowScheme is not XfwfColor, but the default values are computed nev ertheless, since they are useful, e.g., when an icon uses `topShadowColor' and `bottomShadowColor' as dynamic colors.
XtNtopShadowColor
XtNbottomShadowColor
XtNtopShadowStipple
XtNbottomShadowStipple
XtNborder_width
The inherited resource borderWidth is given a default
value of 0, instead of 1.
___________________________________________________________________________________
type
FrameType = enum {
XfwfRaised, XfwfSunken, XfwfChiseled, XfwfLedged }
The shadow scheme can be used to choose colors, pixmaps or
automatic shadows.
type
ShadowScheme = enum {XfwfAuto, XfwfColor, XfwfStipple}
The type Bitmap is an alias for Pixmap, but it is meant to contain only bitmaps, i.e., pixmaps of depth one.
type
Bitmap = Pixmap
The routine that draws the border is generally useful, so it is exported. t is the thickness of the frame. The frame is drawn inside the rectangle (x, y, x+w-1, y+h-1).
XfwfDrawFrame( $, int x, int y, int w, int h, FrameType tp, int t, GC lightgc, GC darkgc)
cvtStringToFrameType converts the strings `raised', `sunken', `chiseled' and `ledged'. Case doesn't matter.
Boolean cvtStringToFrameType(Display * display, XrmValuePtr args, Cardinal * num_args, XrmValuePtr from, XrmValuePtr to, XtPointer * converter_data)
Boolean cvtFrameTypeToString(Display * display, XrmValuePtr args, Cardinal * num_args, XrmValuePtr from, XrmValuePtr to, XtPointer * converter_data)
The converter cvtStringToShadowScheme converts strings `color', `auto' and `stipple' to XfwfColor, XfwfAuto and XfwfStipple.
Boolean cvtStringToShadowScheme(Display * display, XrmValuePtr args, Cardinal * num_args, XrmValuePtr from, XrmValuePtr to, XtPointer * converter_data)
Boolean cvtShadowSchemeToString(Display * display, XrmValuePtr args, Cardinal * num_args, XrmValuePtr from, XrmValuePtr to, XtPointer * converter_data)