home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / xaw / toggle.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  5.4 KB  |  178 lines

  1. /*
  2.  * $XConsortium: Toggle.h,v 1.16 94/04/17 20:13:19 kaleb Exp $
  3.  *
  4. Copyright (c) 1989, 1994  X Consortium
  5.  
  6. Permission is hereby granted, free of charge, to any person obtaining a copy
  7. of this software and associated documentation files (the "Software"), to deal
  8. in the Software without restriction, including without limitation the rights
  9. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom the Software is
  11. furnished to do so, subject to the following conditions:
  12.  
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15.  
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  19. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  20. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22.  
  23. Except as contained in this notice, the name of the X Consortium shall not be
  24. used in advertising or otherwise to promote the sale, use or other dealings
  25. in this Software without prior written authorization from the X Consortium.
  26.  */
  27.  
  28. /*
  29.  * ToggleP.h - Private definitions for Toggle widget
  30.  *
  31.  * Author: Chris D. Peterson
  32.  *         MIT X Consortium
  33.  *         kit@expo.lcs.mit.edu
  34.  *  
  35.  * Date:   January 12, 1989
  36.  */
  37.  
  38. #ifndef _XawToggle_h
  39. #define _XawToggle_h
  40.  
  41. /***********************************************************************
  42.  *
  43.  * Toggle Widget
  44.  *
  45.  ***********************************************************************/
  46.  
  47. #include <X11/Xaw/Command.h>
  48.  
  49. /* Resources:
  50.  
  51.  Name             Class        RepType        Default Value
  52.  ----             -----        -------        -------------
  53.  radioGroup          RadioGroup         Widget          NULL              +
  54.  radioData           RadioData          Pointer         (XPointer) Widget  ++
  55.  state               State              Boolean         Off
  56.  
  57.  background         Background        Pixel        XtDefaultBackground
  58.  bitmap             Pixmap        Pixmap        None
  59.  border             BorderColor    Pixel        XtDefaultForeground
  60.  borderWidth         BorderWidth    Dimension    1
  61.  callback         Callback        Pointer        NULL
  62.  cursor             Cursor        Cursor        None
  63.  destroyCallback     Callback        Pointer        NULL
  64.  font             Font        XFontStructx*    XtDefaultFont
  65.  foreground         Foreground        Pixel        XtDefaultForeground
  66.  height             Height        Dimension    text height
  67.  highlightThickness  Thickness        Dimension    2
  68.  insensitiveBorder   Insensitive    Pixmap        Gray
  69.  internalHeight         Height        Dimension    2
  70.  internalWidth         Width        Dimension    4
  71.  justify         Justify        XtJustify    XtJustifyCenter
  72.  label             Label        String        NULL
  73.  mappedWhenManaged   MappedWhenManaged    Boolean        True
  74.  resize             Resize        Boolean        True
  75.  sensitive         Sensitive        Boolean        True
  76.  width             Width        Dimension    text width
  77.  x             Position        Position    0
  78.  y             Position        Position    0
  79.  
  80. + To use the toggle as a radio toggle button, set this resource to point to
  81.   any other widget in the radio group.
  82.  
  83. ++ This is the data returned from a call to XtToggleGetCurrent, by default
  84.    this is set to the name of toggle widget.
  85.  
  86. */
  87.  
  88. /*
  89.  * These should be in StringDefs.h but aren't so we will define
  90.  * them here if they are needed.
  91.  */
  92.  
  93.  
  94. #define XtCWidget "Widget"
  95. #define XtCState "State"
  96. #define XtCRadioGroup "RadioGroup"
  97. #define XtCRadioData "RadioData"
  98.  
  99. #ifndef _XtStringDefs_h_
  100. #define XtRWidget "Widget"
  101. #endif
  102.  
  103. #define XtNstate "state"
  104. #define XtNradioGroup "radioGroup"
  105. #define XtNradioData "radioData"
  106.  
  107. extern WidgetClass               toggleWidgetClass;
  108.  
  109. typedef struct _ToggleClassRec   *ToggleWidgetClass;
  110. typedef struct _ToggleRec        *ToggleWidget;
  111.  
  112.  
  113. /************************************************************
  114.  * 
  115.  * Public Functions
  116.  *
  117.  ************************************************************/
  118.  
  119. _XFUNCPROTOBEGIN
  120.    
  121. /*    Function Name: XawToggleChangeRadioGroup
  122.  *    Description: Allows a toggle widget to change radio lists.
  123.  *    Arguments: w - The toggle widget to change lists.
  124.  *                 radio_group - any widget in the new list.
  125.  *    Returns: none.
  126.  */
  127.  
  128. extern void XawToggleChangeRadioGroup(
  129. #if NeedFunctionPrototypes
  130.     Widget        /* w */,
  131.     Widget        /* radio_group */
  132. #endif
  133. );
  134.  
  135. /*    Function Name: XawToggleGetCurrent
  136.  *    Description: Returns the RadioData associated with the toggle
  137.  *                   widget that is currently active in a toggle list.
  138.  *    Arguments: radio_group - any toggle widget in the toggle list.
  139.  *    Returns: The XtNradioData associated with the toggle widget.
  140.  */
  141.  
  142. extern XtPointer XawToggleGetCurrent(
  143. #if NeedFunctionPrototypes
  144.     Widget        /* radio_group */
  145. #endif
  146. );
  147.  
  148. /*    Function Name: XawToggleSetCurrent
  149.  *    Description: Sets the Toggle widget associated with the
  150.  *                   radio_data specified.
  151.  *    Arguments: radio_group - any toggle widget in the toggle list.
  152.  *                 radio_data - radio data of the toggle widget to set.
  153.  *    Returns: none.
  154.  */
  155.  
  156. extern void XawToggleSetCurrent(
  157. #if NeedFunctionPrototypes
  158.     Widget        /* radio_group */,
  159.     XtPointer        /* radio_data */
  160. #endif
  161. );
  162.  
  163. /*    Function Name: XawToggleUnsetCurrent
  164.  *    Description: Unsets all Toggles in the radio_group specified.
  165.  *    Arguments: radio_group - any toggle widget in the toggle list.
  166.  *    Returns: none.
  167.  */
  168.  
  169. extern void XawToggleUnsetCurrent(
  170. #if NeedFunctionPrototypes
  171.     Widget        /* radio_group */
  172. #endif
  173. );
  174.  
  175. _XFUNCPROTOEND
  176.  
  177. #endif /* _XawToggle_h */
  178.