Toggle.h revision 7a84e134
17a84e134Smrg/* 27a84e134Smrg * $Xorg: Toggle.h,v 1.4 2001/02/09 02:03:47 xorgcvs Exp $ 37a84e134Smrg * 47a84e134SmrgCopyright 1989, 1994, 1998 The Open Group 57a84e134Smrg 67a84e134SmrgPermission to use, copy, modify, distribute, and sell this software and its 77a84e134Smrgdocumentation for any purpose is hereby granted without fee, provided that 87a84e134Smrgthe above copyright notice appear in all copies and that both that 97a84e134Smrgcopyright notice and this permission notice appear in supporting 107a84e134Smrgdocumentation. 117a84e134Smrg 127a84e134SmrgThe above copyright notice and this permission notice shall be included in 137a84e134Smrgall copies or substantial portions of the Software. 147a84e134Smrg 157a84e134SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 167a84e134SmrgIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 177a84e134SmrgFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 187a84e134SmrgOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 197a84e134SmrgAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 207a84e134SmrgCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 217a84e134Smrg 227a84e134SmrgExcept as contained in this notice, the name of The Open Group shall not be 237a84e134Smrgused in advertising or otherwise to promote the sale, use or other dealings 247a84e134Smrgin this Software without prior written authorization from The Open Group. 257a84e134Smrg */ 267a84e134Smrg/* $XFree86: xc/lib/Xaw/Toggle.h,v 1.5 2001/01/17 19:42:35 dawes Exp $ */ 277a84e134Smrg 287a84e134Smrg/* 297a84e134Smrg * ToggleP.h - Private definitions for Toggle widget 307a84e134Smrg * 317a84e134Smrg * Author: Chris D. Peterson 327a84e134Smrg * MIT X Consortium 337a84e134Smrg * kit@expo.lcs.mit.edu 347a84e134Smrg * 357a84e134Smrg * Date: January 12, 1989 367a84e134Smrg */ 377a84e134Smrg 387a84e134Smrg#ifndef _XawToggle_h 397a84e134Smrg#define _XawToggle_h 407a84e134Smrg 417a84e134Smrg#include <X11/Xaw/Command.h> 427a84e134Smrg 437a84e134Smrg/* Resources: 447a84e134Smrg 457a84e134Smrg Name Class RepType Default Value 467a84e134Smrg ---- ----- ------- ------------- 477a84e134Smrg radioGroup RadioGroup Widget NULL + 487a84e134Smrg radioData RadioData Pointer (XPointer) Widget ++ 497a84e134Smrg state State Boolean Off 507a84e134Smrg 517a84e134Smrg background Background Pixel XtDefaultBackground 527a84e134Smrg bitmap Pixmap Pixmap None 537a84e134Smrg border BorderColor Pixel XtDefaultForeground 547a84e134Smrg borderWidth BorderWidth Dimension 1 557a84e134Smrg callback Callback Pointer NULL 567a84e134Smrg cursor Cursor Cursor None 577a84e134Smrg destroyCallback Callback Pointer NULL 587a84e134Smrg displayList DisplayList XawDisplayList* NULL 597a84e134Smrg font Font XFontStructx* XtDefaultFont 607a84e134Smrg foreground Foreground Pixel XtDefaultForeground 617a84e134Smrg height Height Dimension text height 627a84e134Smrg highlightThickness Thickness Dimension 2 637a84e134Smrg insensitiveBorder Insensitive Pixmap Gray 647a84e134Smrg internalHeight Height Dimension 2 657a84e134Smrg internalWidth Width Dimension 4 667a84e134Smrg justify Justify XtJustify XtJustifyCenter 677a84e134Smrg label Label String NULL 687a84e134Smrg mappedWhenManaged MappedWhenManaged Boolean True 697a84e134Smrg resize Resize Boolean True 707a84e134Smrg sensitive Sensitive Boolean True 717a84e134Smrg width Width Dimension text width 727a84e134Smrg x Position Position 0 737a84e134Smrg y Position Position 0 747a84e134Smrg 757a84e134Smrg+ To use the toggle as a radio toggle button, set this resource to point to 767a84e134Smrg any other widget in the radio group. 777a84e134Smrg 787a84e134Smrg++ This is the data returned from a call to XtToggleGetCurrent, by default 797a84e134Smrg this is set to the name of toggle widget. 807a84e134Smrg 817a84e134Smrg*/ 827a84e134Smrg 837a84e134Smrg/* 847a84e134Smrg * These should be in StringDefs.h but aren't so we will define 857a84e134Smrg * them here if they are needed 867a84e134Smrg */ 877a84e134Smrg#define XtCWidget "Widget" 887a84e134Smrg#define XtCState "State" 897a84e134Smrg#define XtCRadioGroup "RadioGroup" 907a84e134Smrg#define XtCRadioData "RadioData" 917a84e134Smrg 927a84e134Smrg#ifndef _XtStringDefs_h_ 937a84e134Smrg#define XtRWidget "Widget" 947a84e134Smrg#endif 957a84e134Smrg 967a84e134Smrg#define XtNstate "state" 977a84e134Smrg#define XtNradioGroup "radioGroup" 987a84e134Smrg#define XtNradioData "radioData" 997a84e134Smrg 1007a84e134Smrgextern WidgetClass toggleWidgetClass; 1017a84e134Smrg 1027a84e134Smrgtypedef struct _ToggleClassRec *ToggleWidgetClass; 1037a84e134Smrgtypedef struct _ToggleRec *ToggleWidget; 1047a84e134Smrg 1057a84e134Smrg/* 1067a84e134Smrg * Public Functions 1077a84e134Smrg */ 1087a84e134Smrg 1097a84e134Smrg_XFUNCPROTOBEGIN 1107a84e134Smrg 1117a84e134Smrg/* 1127a84e134Smrg * Function: 1137a84e134Smrg * XawToggleChangeRadioGroup 1147a84e134Smrg * 1157a84e134Smrg * Parameters: 1167a84e134Smrg * w - toggle widget to change lists 1177a84e134Smrg * radio_group - any widget in the new list 1187a84e134Smrg * 1197a84e134Smrg * Description: 1207a84e134Smrg * Allows a toggle widget to change radio lists. 1217a84e134Smrg */ 1227a84e134Smrgvoid XawToggleChangeRadioGroup 1237a84e134Smrg( 1247a84e134Smrg Widget w, 1257a84e134Smrg Widget radio_group 1267a84e134Smrg ); 1277a84e134Smrg 1287a84e134Smrg/* 1297a84e134Smrg * Function: 1307a84e134Smrg * XawToggleGetCurrent 1317a84e134Smrg * 1327a84e134Smrg * Parameters: 1337a84e134Smrg * radio_group - any toggle widget in the toggle list 1347a84e134Smrg * 1357a84e134Smrg * Description: 1367a84e134Smrg * Returns the RadioData associated with the toggle 1377a84e134Smrg * widget that is currently active in a toggle list. 1387a84e134Smrg * Returns: 1397a84e134Smrg * The XtNradioData associated with the toggle widget 1407a84e134Smrg */ 1417a84e134Smrg 1427a84e134SmrgXtPointer XawToggleGetCurrent 1437a84e134Smrg( 1447a84e134Smrg Widget radio_group 1457a84e134Smrg ); 1467a84e134Smrg 1477a84e134Smrg/* 1487a84e134Smrg * Function: 1497a84e134Smrg * XawToggleSetCurrent 1507a84e134Smrg * 1517a84e134Smrg * Parameters: 1527a84e134Smrg * radio_group - any toggle widget in the toggle list 1537a84e134Smrg * radio_data - radio data of the toggle widget to set 1547a84e134Smrg * 1557a84e134Smrg * Description: 1567a84e134Smrg * Sets the Toggle widget associated with the radio_data specified. 1577a84e134Smrg */ 1587a84e134Smrgvoid XawToggleSetCurrent 1597a84e134Smrg( 1607a84e134Smrg Widget radio_group, 1617a84e134Smrg XtPointer radio_data 1627a84e134Smrg ); 1637a84e134Smrg 1647a84e134Smrg/* 1657a84e134Smrg * Function: 1667a84e134Smrg * XawToggleUnsetCurrent 1677a84e134Smrg * 1687a84e134Smrg * Parameters: 1697a84e134Smrg * radio_group - any toggle widget in the toggle list 1707a84e134Smrg * 1717a84e134Smrg * Description: 1727a84e134Smrg * Unsets all Toggles in the radio_group specified. 1737a84e134Smrg */ 1747a84e134Smrgvoid XawToggleUnsetCurrent 1757a84e134Smrg( 1767a84e134Smrg Widget radio_group 1777a84e134Smrg ); 1787a84e134Smrg 1797a84e134Smrg_XFUNCPROTOEND 1807a84e134Smrg 1817a84e134Smrg#endif /* _XawToggle_h */ 182