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

_________________________________________________________XawPlus

The Simple Widget

Application Header file
Class Header file
Class
Class Name
Superclass
<X11/XawPlus/Simple.h>
<X11/XawPlus/SimpleP.h>
simpleWidgetClass
Simple
Core

The Simple widget is not very useful by itself, as it has no semantics of its own. It main purpose is to be used as a common superclass for the other simple Athena widgets. This widget adds nine resources to the resource list provided by the Core widget and their superclasses.

Differences between Xaw and XawPlus

With version 3.0 of XawPlus all resources and methods of Add3dExt are moved to this widget class. Add3dExt was removed for a better source compatibility to the original Xaw library.

The Simple widget has the additional resources highlightColor, shadowColor and buttonBorderWidth and a set of drawing methods, used by Command, Scrollbar and other widgets to draw 3D shaped buttons, sliders etc.

The default background color of Simple and all its children is now grey75.

Resources

When creating a Simple widget instance, the following resources are retrieved from the argument list of XtSetValues() or XtVaSetValues() or from the resource database:

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
12
True
12
0
0
CORE:
border
background
mappedWhenManaged
BorderColor
Background
MappedWhenManaged
Pixel
Pixel
Boolean
XtDefaultForeground
grey75
True
SIMPLE:
cursor
cursorName
pointerColor
pointerColorBackground
insensitiveBorder
international
highlightColor
shadowColor
buttonBorderWidth
Cursor
Cursor
Foreground
Background
Insensitive
International
Background
Background
Width
Cursor
String
Pixel
Pixel
Pixmap
Boolean
Pixel
Pixel
Dimension
None
NULL
XtDefaultForeground
XtDefaultBackground
NULL
False
grey90
grey40
2
cursor The image that will be displayed as the pointer cursor whenever it is in this widget. The use of this resource is deprecated in favor of cursorName.
cursorName The name of the symbol to use to represent the pointer cursor. This resource will override the cursor resource if both are specified.
pointerColor The foreground color used to draw the pointer cursor.
pointerColorBackground The background color used to draw the pointer cursor.
insensitiveBorder This pixmap will be tiled into the widgets border, if the widget becomes insensitive.
international This is a boolean flag, only settable at widget creation time. A value of false signals not to use the X11R6 internationalization facility. A value of true signals to use font sets and support of multi byte code to display text etc. This resource is used from widgets which has to handle text input and output like Label and AsciiText.
highlightColor The color used to draw highlighted borders. The default value is grey90.
shadowColor The color used to draw shadow borders. The default value is grey40.
buttonBorderWidth This resource is used to determine the width of rectangular shapes, used to draw buttons, sliders etc. The default value is 2.

Convenience Routines

The following methods are used from children of the Simple widget to simplify the drawing of rectangular 3D styled shapes, filled rectangular 3D styled areas like buttons or sliders, or to remove them. All methods uses the color resources background, highlightColor and shadowColor. The resource buttonBorderWidth is used to determine the width of the border.

To remove the shape of a pressed or highlighted button use XawFlatRectangle():

XawFlatRectangle(w, x, y, width, height)
Widget w;
int x, y;
unsigned int width, height;

w Specifies the widget.
x, y The drawing position of the upper left corner inside the widgets window.
width, height The width and height of the rectangle to draw.

To draw a visible raised button shape use XawRaisedRectangle():

XawRaisedRectangle(w, x, y, width, height)
Widget w;
int x, y;
unsigned int width, height;

w Specifies the widget.
x, y The drawing position of the upper left corner inside the widgets window.
width, height The width and height of the rectangle to draw.

To draw the shape of a pressed button use XawSunkenRectangle():

XawSunkenRectangle(w, x, y, width, height)
Widget w;
int x, y;
unsigned int width, height;

w Specifies the widget.
x, y The drawing position of the upper left corner inside the widgets window.
width, height The width and height of the rectangle to draw.

To draw a filled flat button using the internal resources of Simple use XawFlatButton():

XawFlatButton(w, x, y, width, height)
Widget w;
int x, y;
unsigned int width, height;

w Specifies the widget.
x, y The drawing position of the upper left corner inside the widgets window.
width, height The width and height of the rectangle to draw.

To draw a filled button using the internal resources of Simple use XawRaisedButton():

XawRaisedButton(w, x, y, width, height)
Widget w;
int x, y;
unsigned int width, height;

w Specifies the widget.
x, y The drawing position of the upper left corner inside the widgets window.
width, height The width and height of the rectangle to draw.

To draw a filled pressed button using the internal resources of Simple use XawSunkenButton():

XawSunkenButton(w, x, y, width, height)
Widget w;
int x, y;
unsigned int width, height;

w Specifies the widget.
x, y The drawing position of the upper left corner inside the widgets window.
width, height The width and height of the rectangle to draw.

XawPlus_________________________________________________________