ToBeReviewed/WIDGET/COMPOUND_WIDGET/
cw_bgroup.pro
Compound widget
Compound widget
CW_BGROUP is a compound widget that simplifies creating
a base of buttons. It handles the details of creating the
proper base (standard, exclusive, or non-exclusive) and filling
in the desired buttons. Events for the individual buttons are
handled transparently, and a CW_BGROUP event returned. This
event can return any one of the following:
- The Index of the button within the base.
- The widget ID of the button.
- The name of the button.
- An arbitrary value taken from an array of User values.
Routine summary
- cw_bgroup_setv, id, value
-
- result = cw_bgroup_getv(id, value)
-
- result = cw_bgroup_event(ev)
-
- result = cw_bgroup(parent, names, BUTTON_UVALUE=array, COLUMN=COLUMN, EVENT_FUNCT=EVENT_FUNCT, EXCLUSIVE=EXCLUSIVE, FONT=FONT, FRAME=FRAME, IDS=IDS, LABEL_TOP=LABEL_TOP, LABEL_LEFT=LABEL_LEFT, MAP=MAP, NONEXCLUSIVE=NONEXCLUSIVE, NO_RELEASE=NO_RELEASE, RETURN_ID=RETURN_ID, RETURN_INDEX=RETURN_INDEX, RETURN_NAME=RETURN_NAME, ROW=ROW, SCROLL=SCROLL, SET_VALUE=SET_VALUE, SPACE=SPACE, TAB_MODE=TAB_MODE, UVALUE=UVALUE, XOFFSET=XOFFSET, XPAD=XPAD, XSIZE=XSIZE, X_SCROLL_SIZE=X_SCROLL_SIZE, YOFFSET=YOFFSET, YPAD=YPAD, YSIZE=YSIZE, Y_SCROLL_SIZE=Y_SCROLL_SIZE, UNAME=UNAME)
-
cw_bgroup_setv
Compound widget
cw_bgroup_setv, id, value
Return value
Parameters
id
value
It is the default tick mark value (a floating-point number).
Examples
Version history
Version
$Id: cw_bgroup.pro 163 2006-08-29 12:59:46Z navarro $
History
Known issues
Restrictions
Other attributes
Uses routines
cw_bgroup_getv
result = cw_bgroup_getv(id, value)
Return value
Parameters
id
value
It is the default tick mark value (a floating-point number).
Examples
Version history
Version
$Id: cw_bgroup.pro 163 2006-08-29 12:59:46Z navarro $
History
Known issues
Restrictions
Other attributes
Uses routines
cw_bgroup_event
result = cw_bgroup_event(ev)
Return value
Parameters
ev
Examples
Version history
Version
$Id: cw_bgroup.pro 163 2006-08-29 12:59:46Z navarro $
History
Known issues
Restrictions
Other attributes
Uses routines
cw_bgroup
Compound widget
result = cw_bgroup(parent, names, BUTTON_UVALUE=array, COLUMN=COLUMN, EVENT_FUNCT=EVENT_FUNCT, EXCLUSIVE=EXCLUSIVE, FONT=FONT, FRAME=FRAME, IDS=IDS, LABEL_TOP=LABEL_TOP, LABEL_LEFT=LABEL_LEFT, MAP=MAP, NONEXCLUSIVE=NONEXCLUSIVE, NO_RELEASE=NO_RELEASE, RETURN_ID=RETURN_ID, RETURN_INDEX=RETURN_INDEX, RETURN_NAME=RETURN_NAME, ROW=ROW, SCROLL=SCROLL, SET_VALUE=SET_VALUE, SPACE=SPACE, TAB_MODE=TAB_MODE, UVALUE=UVALUE, XOFFSET=XOFFSET, XPAD=XPAD, XSIZE=XSIZE, X_SCROLL_SIZE=X_SCROLL_SIZE, YOFFSET=YOFFSET, YPAD=YPAD, YSIZE=YSIZE, Y_SCROLL_SIZE=Y_SCROLL_SIZE, UNAME=UNAME)
Return value
The ID of the created widget is returned.
Parameters
parent
in
required
The ID of the parent widget.
names
type: string array
A string array, containing one string per button,
giving the name of each button.
Keywords
BUTTON_UVALUE
type: array
An array of user values to be associated with
each button and returned in the event structure.
COLUMN
Buttons will be arranged in the number of columns
specified by this keyword.
EVENT_FUNCT
The name of an optional user-supplied event function
for buttons. This function is called with the return
value structure whenever a button is pressed, and
follows the conventions for user-written event functions.
EXCLUSIVE
Buttons will be placed in an exclusive base, with
only one button allowed to be selected at a time.
FONT
The name of the font to be used for the button
titles. If this keyword is not specified, the default
font is used.
FRAME
Specifies the width of the frame to be drawn around the base.
IDS
A named variable into which the button IDs will be
stored, as a longword vector.
LABEL_TOP
Creates a text label above the buttons.
LABEL_LEFT
Creates a text label to the left of the buttons.
MAP
If set, the base will be mapped when the widget
is realized (the default).
NONEXCLUSIVE
Buttons will be placed in an non-exclusive base.
The buttons will be independent.
NO_RELEASE
If set, button release events will not be returned.
RETURN_ID
If set, the VALUE field of returned events will be
the widget ID of the button.
RETURN_INDEX
If set, the VALUE field of returned events will be
the zero-based index of the button within the base.
THIS IS THE DEFAULT.
RETURN_NAME
If set, the VALUE field of returned events will be
the name of the button within the base.
ROW
Buttons will be arranged in the number of rows
specified by this keyword.
SCROLL
If set, the base will include scroll bars to allow
viewing a large base through a smaller viewport.
SET_VALUE
The initial value of the buttons. This is equivalent
to the later statement:
WIDGET_CONTROL, widget, set_value=value
SPACE
The space, in pixels, to be left around the edges
of a row or column major base. This keyword is
ignored if EXCLUSIVE or NONEXCLUSIVE are specified.
TAB_MODE
UVALUE
The user value to be associated with the widget.
XOFFSET
The X offset of the widget relative to its parent.
XPAD
The horizontal space, in pixels, between children
of a row or column major base. Ignored if EXCLUSIVE
or NONEXCLUSIVE are specified.
XSIZE
The width of the base.
X_SCROLL_SIZE
The width of the viewport if SCROLL is specified.
YOFFSET
The Y offset of the widget relative to its parent.
YPAD
The vertical space, in pixels, between children of
a row or column major base. Ignored if EXCLUSIVE
or NONEXCLUSIVE are specified.
YSIZE
The height of the base.
Y_SCROLL_SIZE
The height of the viewport if SCROLL is specified.
UNAME
The user name to be associated with the widget.
Version history
Version
$Id: cw_bgroup.pro 163 2006-08-29 12:59:46Z navarro $
History
15 June 1992, AB
7 April 1993, AB, Removed state caching.
6 Oct. 1994, KDB, Font keyword is not applied to the label.
10 FEB 1995, DJC fixed bad bug in event procedure, getting
id of stash widget.
11 April 1995, AB Removed Motif special cases.
Copyright (c) 1992-2005, Research Systems, Inc. All rights reserved.
Unauthorized reproduction prohibited.
Known issues
Restrictions
This widget generates event structures with the following definition:
event = { ID:0L, TOP:0L, HANDLER:0L, SELECT:0, VALUE:0 }
The SELECT field is passed through from the button event. VALUE is
either the INDEX, ID, NAME, or BUTTON_UVALUE of the button,
depending on how the widget was created.
Only buttons with textual names are handled by this widget.
Bitmaps are not understood.
Produced by IDLdoc 2.0.