Frame

Table of Contents

## NAME

XfwfFrame

## DESCRIPTION

The Frame widget is a composite widget that accepts just one child. Its only purpose is to draw a frame around widgets that do not have a frame of their own. It always uses the size of its child, with a little extra for the frame. There are several types of frames available, selectable with a resource.

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
________________________________________________________________________________________

|
  XfwfFrame | Name | Class | Type | Default | XtNcursor | XtCCursor | Cursor | None | XtNframeType | XtCFrameType | FrameType | XfwfRaised | XtNframeWidth | XtCFrameWidth | Dimension | 0 | XtNouterOffset | XtCOuterOffset | Dimension | 0 | XtNinnerOffset | XtCInnerOffset | Dimension | 0 | XtNshadowScheme | XtCShadowScheme | ShadowScheme | XfwfAuto | XtNtopShadowColor | XtCTopShadowColor | Pixel | compute_topcolor | XtNbottomShadowColor | XtCBottomShadowColor | Pixel | compute_bottomcolor | XtNtopShadowStipple | XtCTopShadowStipple | Bitmap | NULL | XtNbottomShadowStipple| XtCBottomShadowStipple| Bitmap | NULL | | | | |_______________________|________________________|_______________|______________________

XtNcursor
The cursor (when not None) is the mouse cursor that is displayed when the mouse is over the Board widget. The default value None causes the parent's cursor to be used.

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.

___________________________________________________________________________________

|
  XfwfCommon | Name | Class | Type | Default | XtNtraversalOn | XtCTraversalOn | Boolean | True | XtNhighlightThickness| XtCHighlightThickness| Dimension | 2 | XtNhighlightColor | XtCHighlightColor | Pixel | XtDefaultForeground | XtNhighlightPixmap | XtCHighlightPixmap | Pixmap | None | XtNnextTop | XtCNextTop | Callback | NULL | XtNuserData | XtCUserData | Pointer | NULL | | | | |______________________|_______________________|____________|______________________

_____________________________________________________________

|
  Composite

| Name
  | Class | Type | Default | XtNchildren | XtCChildren | WidgetList | NULL | insertPosition| XtCInsertPosition| XTOrderProc | NULL | numChildren | XtCNumChildren | Cardinal | 0 | | | | |_______________|___________________|______________|_________

______________________________________________________________________

|
  Core

| Name | Class | Type | Default

| XtNx
  | XtCX | Position | 0

| XtNy
  | XtCY | Position | 0

| XtNwidth
  | XtCWidth | Dimension | 0

| XtNheight
  | XtCHeight | Dimension | 0

| borderWidth
  | XtCBorderWidth | Dimension | 0

| XtNcolormap
  | XtCColormap | Colormap | NULL

| XtNdepth
  | XtCDepth | Int | 0 | destroyCallback | XtCDestroyCallback | XTCallbackList | NULL | XtNsensitive | XtCSensitive | Boolean | True

| XtNtm
  | XtCTm | XTTMRec | NULL | ancestorSensitive| XtCAncestorSensitive| Boolean | False | accelerators | XtCAccelerators | XTTranslations | NULL

| borderColor
  | XtCBorderColor | Pixel | 0 | borderPixmap | XtCBorderPixmap | Pixmap | NULL

| background
  | XtCBackground | Pixel | 0 | backgroundPixmap | XtCBackgroundPixmap | Pixmap | NULL | mappedWhenManaged| XtCMappedWhenManaged| Boolean | True

| XtNscreen
  | XtCScreen | Screen * | NULL | | | | |__________________|______________________|_________________|_________

Exports
A number of new types is introduced by the Common class. The possible types of borders are enumerated in Frame3dType (see the introduction).

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)

Table of Contents

- NAME
- DESCRIPTION