CMAP(1)

NAME

Cmap - Cmap Widget

DESCRIPTION

#include "Cmap.h"

The cmap widget is an X toolkit/Motif compatible widget that displays the entries in the colormap of its XtNcolormap resource. It also has an indicator box, and a label displaying the rgb components of the indicated box.

WIDGET CLASS

cmapWidgetClass

RESOURCES

XmNforeground
    foreground pixel of the widget, default is XtDefaultForeground.

XmNfontList
    font of label (XFontStruct), default is XtDefaultFont.

XtNmargin
    minimum margin around widget (int), default is 5.

XtNchangeCallback
    change callback, default is NULL.

XtNboxWidth
    maximum box width (int), 0 for autoscale/autosize, default is 0

XtNboxHeight
    maximum box height (int), 0 for autoscale/autosize, default is 0

XtNselected
    current box where the indicator box is at (int), default is 0

XtNfirstIndex
    first index to use in colormap (int), default is 0

XtNlastIndex
    last index to use in colomrap (int), default is LastIndexDefault (use last possible index)

XtNmappingTable
    a list of indices (Pixel *) that is used to map the currently selected index into this table of pixels

XtNshowUnselectedShadows
    boolean to determine whether all the boxes have inverted shadows

ACTIONS

select()
    accepts key/button/motion events, moving the indicator box to the square that the pointer is over

up()
    moves indicator up one box (autowrap)

down()
    moves indicator down one box (autowrap)

left()
    moves indicator left one box (autowrap)

right()
    moves indicator right one box (autowrap)

DEFAULT TRANSLATIONS

~s <Key>osfLeft: left()
~s <Key>osfRight: right()
~s <Key>osfUp: up()
~s <Key>osfDown: down()
<Btn1Down>: select()
<Btn1Motion>: select()
~s ~m ~a <Key>Return: PrimitiveParentActivate()
<Key>osfActivate: PrimitiveParentActivate()
<Key>osfCancel:PrimitiveParentCancel()
s ~m ~a <Key>Tab: PrimitivePrevTabGroup()
~m ~a <Key>Tab: PrimitiveNextTabGroup()
Shift<Key>osfUp:PrimitiveTraverseUp()
Shift<Key>osfDown:PrimitiveTraverseDown()
Shift<Key>osfLeft:PrimitiveTraverseLeft()
Shift<Key>osfRight:PrimitiveTraverseRight()
<FocusIn>:PrimitiveFocusIn()
<FocusOut>:PrimitiveFocusOut()
<Unmap>:PrimitiveUnmap()
<Enter>:PrimitiveEnter()
<Leave>:PrimitiveLeave()
<Key>osfHelp:PrimitiveHelp()

CALLBACK STRUCTURE

typedef struct _CmapCallbackStruct
{
  int reason;
  XEvent *event;
  XColor color;
} CmapCallbackStruct, *CmapCallbackPtr;

REASONS

CMAP_SELECT
CMAP_LEFT
CMAP_DOWN
CMAP_UP
CMAP_RIGHT
CMAP_VERIFY

CALLABLE FUNCTIONS

void CmapCheckSelectedColor(Widget _w, Boolean _notify);
    function to make sure the pixel of the box with the indicator box actually matches the rgb values. _notify is a flag on whether a callback should be sent.

XColor CmapGetSelected(Widget _w);
    get components of box with indicator.

AUTHOR

John L. Cwikla, 1993
Wolfram Research, Inc
cwikla@wri.com