http://invisible-island.net/athena_widgets/XawPlus

_________________________________________________________XawPlus

The SmeBSB Object

Application Header file
Class Header file
Class
Class Name
Superclass
<X11/XawPlus/SmeBSB.h>
<X11/XawPlus/SmeBSBP.h>
smeBSBObjectClass
SmeBSB
Sme

The SmeBSB object is used to create a menu entry that contains a string, and optional bitmaps in its left and right margins. Since each menu entry is an independent object, the application is able to change the font, color, height, and other attributes of the menu entries, on an entry by entry basis.

Differences between Xaw and XawPlus

Insensitive entries are shown embossed using the color resources inherited from the Sme object. The left and right bitmaps may be color pixmaps. Support of clip masks for nonrectangular pixmaps is available. Installed converters for the left and right bitmaps and its clip masks are available.

With release 3.1 of XawPlus full UNICODE support is available using the new encoding resource as in the label widget. UNICODE support works independent of the locale settings and requires UTF8 coded label strings. Since it is not possible to put UNICODE directly in resource files, UTF8 code is used to avoid problems with the resource manager.

Resources

The resources associated with the SmeBSB object are defined in this section, and affect only the single menu entry specified by this object.

Name Class Type Default Value
OBJECT:
destroyCallback Callback Pointer NULL
RECTANGLE:
borderWidth
height
sensitive
width
x
y
BorderWidth
Height
Sensitive
Width
Position
Position
Dimension
Dimension
Boolean
Dimension
Position
Position
0
0
True
0
0
0
SME:
callback
highlightColor
shadowColor
international
Callback
Background
Background
International
Pointer
Pixel
Pixel
Boolean
NULL
grey90
grey40
False
SMEBSB:
foreground
font
fontSet
encoding
label
justify
vertSpace
leftMargin
rightMargin
leftBitmap
leftClipMask
rightBitmap
rightClipMask
Foreground
Font
FontSet
Encoding
Label
Justify
VertSpace
HorizontalMargins
HorizontalMargins
LeftBitmap
LeftBitmap
RightBitmap
RightBitmap
Pixel
XFontStruct *
FontSet
unsigned char
String
Justify
int
Dimension
Dimension
Bitmap
ClipMask
Bitmap
ClipMask
XtDefaultForeground
XtDefaultFont
XtDefaultFontSet
XawTextEncoding8bit
Name of entry
XtJustifyLeft
25
4
4
None
None
None
None
foreground A pixel value which indexes the SimpleMenu's colormap to derive the foreground color of the menu entry's window. This color is also used to render all 1's in the left and right bitmaps. Keep in mind that the SimpleMenu widget will force the width of all menu entries to be the width of the longest entry.
font The font used to display the text label.
fontSet The fontSet used to display the text label, if the international resource is set.
encoding Two types of encoding are available, the default 8 bit encoding and the 16 bit encoding (unicode). With 16 bit encoding the label string is expected in UTF8 and displayed with the font found in the font resource. The handling of UNICODE is independent of the locale settings. Note that the character codes from 0x00 to 0x7f are also valid as UTF8 code. For this range of characters every editor is usable to edit label strings. If you need character codes in the range from 0x80 to 0xffff a special editor like yudit is required.
If any malformed UTF8 code is found, it is displayed as an asterix *. If the UTF8 code of a character is out of range (higher than 0xffff), it is displayed as a tilde sign.
justify How the label is to be rendered between the left and right margins when the space is wider than the actual text. This resource may be specified with the values XtJustifyLeft, XtJustifyCenter, or XtJustifyRight. When specifying the justification from a resource file the values left, center, or right may be.
label This is a the string that will be displayed in the menu entry. The exact location of this string within the bounds of the menu entry is controlled by the leftMargin, rightMargin, vertSpace, and justify resources.
vertSpace This is the amount of vertical padding, expressed as a percentage of the height of the font, that is to be placed around the label of a menu entry. The label and bitmaps are always centered vertically within the menu. The default value for this resource (25) causes the default height to be 125% of the height of the font.
leftMargin,
rightMargin
This is the amount of space (in pixels) that will be left between the edge of the menu entry and the label string.
leftBitmap,
leftClipMask,
rightBitmap,
rightClipMask
This is a name of a bitmap or pixmap to display in the left or right margin of the menu entry. All 1's of a bitmap will be rendered in the foreground color, and all 0's will be drawn in the background color of the SimpleMenu widget. Color pixmaps support works a little different. The color values are copied directly into the rectangular area, reserved for the pixmap. Support of nonrectangular areas is available using the left and right clip masks. These clip masks have no meaning to normal bitmaps. It is the programmers responsibility to make sure that the menu entry is tall enough, and the appropriate margin wide enough to accept the bitmap. If care is not taken the bitmap may extend into another menu entry, or into this entry's label.

XawPlus_________________________________________________________