VkCheckBox(3x)
VkCheckBox - A simple interface to a multi-choice preference panel
As shipped in IRIX 6.5.5. Unchanged since IRIX 6.5.
NAME VkCheckBox - A simple interface to a multi-choice preference panel INHERITS FROM VkComponent : VkCallbackObject HEADER FILE #include <Vk/VkCheckBox.h> PUBLIC PROTOCOL SUMMARY Constructor/Destructor VkCheckBox(const char* name, Widget parent); virtual void ~VkCheckBox(void); Adding items Widget addItem(char* name, Boolean set = 0, XtCallbackProc proc = NULL, XtPointer clientData = NULL); Setting and Getting State void setValue(int index, Boolean newValue); void setValues(Boolean* values, int numValues); int getValue(int index); PROTECTED PROTOCOL SUMMARY Detecting State Changes virtual void valueChanged(int index, Boolean newValue); Protected Data Members WidgetList _widgetList; Widget _rc, _label; CLASS DESCRIPTION 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. DERIVING SUBCLASSES 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 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() 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); 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 _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 Inherited from VkComponent installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(), setDefaultResources(), getResources(), VkComponent(), manage(), unmanage(), baseWidget(), okToQuit(), _name, _baseWidget, _w, deleteCallback Inherited from VkCallbackObject callCallbacks(), addCallback(), removeCallback(), removeAllCallbacks(), KNOWN DERIVED CLASSES VkRadioBox SEE ALSO 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