VkCheckBox(3x) VkCheckBox(3x)
VkCheckBox - A simple interface to a multi-choice preference panel
VkComponent : VkCallbackObject
#include <Vk/VkCheckBox.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkCheckBox(const char* name, Widget parent);
virtual void ~VkCheckBox(void);
Adding items [Toc] [Back]
Widget addItem(char* name, Boolean set = 0,
XtCallbackProc proc = NULL,
XtPointer clientData = NULL);
Setting and Getting State [Toc] [Back]
void setValue(int index, Boolean newValue);
void setValues(Boolean* values, int numValues);
int getValue(int index);
PROTECTED PROTOCOL SUMMARY [Toc] [Back] Detecting State Changes
virtual void valueChanged(int index, Boolean newValue);
Protected Data Members [Toc] [Back]
WidgetList _widgetList;
Widget _rc, _label;
The VkCheckBox class offers a simple interface for creating a set of
check boxes. Instantiating the component creates an empty, labeled
component that contains a Motif XmRowColumn widget. Adding items via
the addItem() member function creates XmToggleButton widgets to be
added to the XmRowColumn widget. The state of any individual check
item can be set using the setValue() or setValues() member
functions. The current value of any item can be queried using
getValue(). The class also supports a virtual member function that
can notify derived classes when the state of any item changes. The
class can also be used directly using the VkCheckBox::itemChanged()
ViewKit callback.
Page 1
VkCheckBox(3x) VkCheckBox(3x)
Derived classes can be notified of changes to the state of any item
by overriding the valueChanged() member function. Derived classes
also have access to the _widgetList member, which contains the
toggle buttons added to the checkbox, as well as the rowcolumn
widget _rc that holds the toggle buttons and the label widget _label
supported by this class.
FUNCTION DESCRIPTIONS [Toc] [Back] valueChanged()
virtual void valueChanged(int index, Boolean newValue);
This virtual member function is called when the state of any item in
the checkbox changes. The arguments indicate the index of the item
that has changed and the current (new) value of that item.
VkCheckBox() [Toc] [Back]
VkCheckBox(const char* name, Widget parent);
Initialize the VkCheckBox object. Various manager widgets are
created to support the items in the checkbox.
~VkCheckBox()
virtual void ~VkCheckBox(void);
Free all storage associated with a VkCheckBox object.
addItem()
Widget addItem(char *name,
Boolean initialValue = 0,
XtCallbackProc callback = NULL,
XtPointer clientData = NULL);
Add a new item to the checkbox. Create an XmToggleButton widget,
whose state is initially set to the given optional value. The
optional callback must be an Xt-style callback. The clientData
argument, if provided will be passed to the Xt callback when it is
called. The function returns the XmToggleButton widget that is
created by this function.
setValue()
void setValue(int index, Boolean newValue);
Page 2
VkCheckBox(3x) VkCheckBox(3x)
Set the value of the item indicated by the index to the given new
value.
setValues()
void setValues(Boolean* values, int numValues);
Set the values of numValues items at once. The values argument is
expected to be an array of Boolean values of less than or equal to
the number of items in the check box.
getValue()
int getValue(int index);
Retrieve the current value of the specified item.
DATA MEMBER DESCRIPTIONS [Toc] [Back] _widgets
WidgetList _widgets;
The list of XmToggleButton widgets in the checkbox.
itemChangedCallback
static const char* const itemChangedCallback;
A callback list that is invoked when any item changes state. The
index of the item that changed is returned as call data.
INHERITED MEMBER FUNCTIONS [Toc] [Back] Inherited from VkComponent
installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
setDefaultResources(), getResources(), VkComponent(), manage(),
unmanage(), baseWidget(), okToQuit(), _name, _baseWidget, _w,
deleteCallback
Inherited from VkCallbackObject [Toc] [Back]
callCallbacks(), addCallback(), removeCallback(),
removeAllCallbacks(),
KNOWN DERIVED CLASSES [Toc] [Back] VkRadioBox
VkComponent, VkCheckBox ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
Page 3
VkCheckBox(3x) VkCheckBox(3x)
PPPPaaaaggggeeee 4444 [ Back ]
|