Table of Contents

NAME

XfwfBoard

DESCRIPTION

The Board class adds one thing to the capabilities already present in the Frame class, viz., location management.

Location management is an improved version of the standard X geometry management. Size and position of a Board widget (or subclass) can be given as a combination of absolute and rel­ ative sizes.

In contrast to its superclass Frame, Board accepts any num­ ber of children. No layout policy is enforced, however. The children are expected to be positioned with the help of their own geometry or location resources.

Public variables
_____________________________________________________

|
XfwfBoard
| Name
| Class | Type | Default
| XtNabs_x
| XtCAbs_x | Position | 0
| XtNrel_x
| XtCRel_x | float | "0.0"
| XtNabs_y
| XtCAbs_y | Position | 0
| XtNrel_y
| XtCRel_y | float | "0.0" | XtNabs_width | XtCAbs_width | Position | 0 | XtNrel_width | XtCRel_width | float | "1.0" | XtNabs_height| XtCAbs_height| Position | 0 | XtNrel_height| XtCRel_height| float | "1.0"
| XtNhunit
| XtCHunit | float | "1.0"
| XtNvunit
| XtCVunit | float | "1.0" | XtNlocation | XtCLocation | String | NULL | | | | |______________|_______________|___________|_________

The location management relies on a total of ten resources plus a string resource that combines eight of them in a more convenient and compact notation. The location is given by two values in each of the four dimensions (x, y, width and height). One value holds the absolute position in pixels, the other holds the position relative to the parent's width. E.g., When abs_x is 20 and rel_x is 0.3, the x position of the widget will be 20 pixels plus 0.3 times the width of the parent. For more examples, see the location resource below.

The ninth and tenth resources are hunit and vunit. All assignments to the abs_* resources are multiplied by hunit (horizontal) or vunit (vertical). Normally the units are 1, but, e.g., a widget that displays text might set them to the width and height of character cells, so that abs_width = 80 means a width of 80 characters, instead of 80 pixels.

The geometry resources of the Core widget (x, y, width and height are still available. When they are set, the values are copied to the abs_* variables and the rel_* variables are set to 0.0.

It is possible that the parent of the current widget doesn't grant the preferred geometry. In that case the location variables and the geometry variables will not be synchro­ nized. The location variables will then be taken to hold the preferred geometry, instead of the actual one.

XtNabs_x
The position is determined by the four resources abs_x, rel_x, abs_y and rel_y. When the parent is (a subclass of) a Board widget, the position is not measured from the real size of the parent, but from the size inside the frame.

(The representation of the float values as strings seems necessary, because the compiler can't cast a float to a pointer.)

XtNrel_x

XtNabs_y

XtNrel_y

XtNMAGICNUM
By setting default values for the x and y variables from Core explicitly, we can be sure that the variables are synchronized from the start. If the initialize method detects a change in any of them, it can re-syn­ chronize them.

XtNx

XtNy

XtNabs_width
The default values cause a Board widget to be the same size as it's parent at all times, provided, of course, that the parent allows that. If the parent is (a sub­ class of) a Board widget, the size is relative to the area inside the parent's frame, instead of the total size of the parent.

XtNrel_width

XtNabs_height

XtNrel_height

XtNwidth
The Core variables are given strange defaults, in the hope that the initialize method can detect a change in them.

XtNheight

XtNhunit
hunit is a value in pixels by which abs_x and abs_width are multiplied; abs_y and abs_height are multiplied by vunit. The results are rounded to the next larger whole number.

XtNvunit

XtNlocation
Specifying eight resources in a resource file is more easily done with the string resource location. The string contains four expressions of the form xa [+-] xr or xr [+-] xa or xa or xr, where [+-] is either + or -, xa is the absolute value and xr is the relative value. The two are distinguished by the fact that x_r must contain a decimal point.

Examples: "0.5 - 20 5 40 1.0 - 50" is a widget of fixed width (40 units) that is horizontally centered; the height is always 50 units less than the height of the parent.

"0 0 2.0 3.0" is a widget that is twice as wide and three times as high as its parent.

"-20 0 20 20" is a widget that will be invisible, because it is located 20 units to the left of the par­ ent and it is also 20 units wide.

The initial value is NULL, but the initialize method will make sure that the string is synchronized with the other 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 | | | | |_______________________|________________________|_______________|______________________

___________________________________________________________________________________
|
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 | | | | |__________________|______________________|_________________|_________


Table of Contents