SgSpringBox(3X)

SgSpringBox - The SgSpringBox widget class

As shipped in IRIX 6.5. First release of IRIX 6.5.

This page could not be fully tidied (pagination-warning); it is shown as printed.

     NAME
          SgSpringBox - The SgSpringBox widget class

     SYNOPSIS
          #include <Sgm/SgSpringBox.h>


     VERSION
          This page documents the version of Sgm that accompanies
          Motif 1.2.

     DESCRIPTION
          SgSpringBox is a container widget with no input semantics of
          its own. It arranges its children in a single row or column
          based on a set of spring constraints assigned to each child.
          The SgSpringBox widget allows layouts similar to those
          supported by the XmForm widget, but are usually easier to
          set up. It is also possible to create some layouts that
          cannot be achieved with the XmForm widget. For example,
          centering a column of widgets is very easy to do with the
          SgSpringBox widget, but nearly impossible using the XmForm.

          Each child of an SgSpringBox widget has 6 constraints
          associated with it.  First, each child has a "springyness"
          in both the vertical and horizontal direction that
          determines how much the child may be resized in each
          direction.

          The resources XmNverticalSpring and XmNhorizontalSpring
          control the degree of "springyness" in each child. A value
          of zero means the child cannot be resized in that direction.
          For non-zero values, the values are compared to the values
          of other springs in the overall system to determine the
          proportional effects of any resizing. The default value of
          both resources is zero.

          Each child also has a spring between its left, right, top,
          and bottom sides and whatever boundary it is adjacent to. By
          default, the value of each of these springs is 50. A value
          of zero means that the SgSpringBox widget cannot add
          additional space adjacent to that part of a widget. Larger
          values are considered in relation to all other spring values
          in the system.

          The behavior of the widget is best seen by example. The
          following code places two widget in a single column. With
          the default resource settings, this results in both chidlren
          being centered in the parent, one above the other.

          void createCenteredWidgets(Widget parent)
           {
               Arg args[2];
               Widget springbox, child1, child2;

               XtSetArg(args[0], XmNorientation, XmVERTICAL);
               springbox   = SgCreateSpringBox( parent, "column",
          args, 1 );

               child1 =  XmCreatePushButton ( box, "child1", NULL, 0
          );
               child2 =  XmCreatePushButton ( box, "child2", NULL, 0
          );

               XtManageChild(child1);
               XtManageChild(child2);
               XtManageChild(springbox);
           }


          This example creates two widgets in a horizontal row. As the
          row is resized, the widget gravitates to the left and right
          sides of the row. The leftmost child also hangs from the top
          of its parent, while the rightmost widget gravitates to the
          bottom of its parent.

          void createCenteredWidgets(Widget parent) {
             Arg args[5];
             int n;
             Widget springbox, child1, child2;

             n = 0;
             XtSetArg(args[n], XmNorientation, XmCOLUMN);n++
             springbox   = SgCreateSpringBox( parent, "column", args,
          1 );

             n = 0;
             XtSetArg(args[n], XmNrightSpring,  0);n++
             XtSetArg(args[n], XmNleftSpring,   100);n++
             XtSetArg(args[n], XmNbottomSpring,   0);n++
             XtSetArg(args[n], XmNtopSpring,    100);n++
             child1 =  XmCreatePushButton ( box, "child1", args, n);

             n = 0;
             XtSetArg(args[n], XmNrightSpring,  100);n++
             XtSetArg(args[n], XmNleftSpring,     0);n++
             XtSetArg(args[n], XmNbottomSpring, 100);n++
             XtSetArg(args[n], XmNtopSpring,      0);n++
             child2 =  XmCreatePushButton ( box, "child2", args, n);

             XtManageChild(child1);
             XtManageChild(child2);
             XtManageChild(springbox); }

          Following are some important considerations in using a
          SgSpringBox:

               Unmapping a child has no effect on the SgSpringBox
               except that the child is not mapped.

     Classes
          SgSpringBox inherits behavior and resources from Core,
          Composite, Constraint, XmManager, and XmBulletinBoard
          classes.

          The class pointer is sgSpringBoxWidgetClass.

          The class name is SgSpringBox.

     New Resources
          The following table defines a set of widget resources used
          by the programmer to specify data.  The programmer can also
          set the resource values for the inherited classes to set
          attributes for this widget.  To reference a resource by name
          or by class in a .Xdefaults file, remove the XmN or XmC
          prefix and use the remaining letters.  To specify one of the
          defined values for a resource in a .Xdefaults file, remove
          the Xm prefix and use the remaining letters (in either
          lowercase or uppercase, but include any underscores between
          words).  The codes in the access column indicate if the
          given resource can be set at creation time (C), set by using
          XtSetValues (S), retrieved by using XtGetValues (G), or is
          not applicable (N/A).

        ________________________________________________________________
       |                    SgSpringBox Resource Set                   |
       |_______________|________________|______|______________|________|
       | Name          |  Class         |  Type|  Default     |  Access|
       |_______________|________________|______|______________|________|
       |_______________|________________|______|______________|________|
       | XmNorientation|  XmCOrientation|  int |  XmHORIZONTAL|  CG    |
       |_______________|________________|______|______________|________|

          ___________________________________________________________
         |            SgSpringBox Constraint Resource Set           |
         |____________________|___________|______|_________|________|
         | Name               |  Class    |  Type|  Default|  Access|
         |____________________|___________|______|_________|________|
         |____________________|___________|______|_________|________|
         | XmNleftSpring      |  XmCSpring|  int |  50     |  CSG   |
         |____________________|___________|______|_________|________|
         | XmNrightSpring     |  XmCSpring|  int |  50     |  CSG   |
         |____________________|___________|______|_________|________|
         | XmNtopSpring       |  XmCSpring|  int |  50     |  CSG   |
         |____________________|___________|______|_________|________|
         |____________________|___________|______|_________|________|

         | XmNbottomSpring    |  XmCSpring|  int | |50     |  CSG   |              |        |
         |____________________|___________|______|_|_______|________|              |        |
         | XmNverticalSpring  |  XmCSpring|  int | |0      |  CSG   |              |        |
         |____________________|___________|______|_|_______|________|              |        |
         | XmNhorizontalSpring|  XmCSpring|  int | |0      |  CSG   |              |        |
         |____________________|___________|______|_|_______|________|              |        |
         |                    |                    |                |              |        |
        X|NleftSpring         |                    |                |              |        |
         |     Determines the |tretchability of the|space adjacent t|              |        |
         |     the left side o| the widget. The lar|er the value, th|              |        |
         |     more this space|can be resized relat|ve to other     |              |        |
         |     "springs" conta|ned in the SgSpringB|x widget.       |              |        |
         |                    |                    |                |              |        |
        X|NrightSpring        |                    |                |              |        |
         |Determines the stret|hability of the spac| adjacent to the|              |        |
         |right side of the wi|get. The larger the |alue, the more  |              |        |
         |this space can be re|ized relative to oth|r "springs"     |              |        |
         |contained in the SgS|ringBox widget.     |                |              |        |
         |                    |                    |                |              |        |
        X|NtopSpring          |                    |                |              |        |
         |Determines the stret|hability of the spac| adjacent to the|              |        |
         |top side of the widg|t. The larger the va|ue, the more thi|              |        |
         |space can be resized|relative to other "s|rings" contained|              |        |
         |in the SgSpringBox w|dget.               |                |              |        |
         |                    |                    |                |              |        |
        X|NbottomSpring       |                    |                |              |        |
         |Determines the stret|hability of the spac| adjacent to the|              |        |
         |bottom side of the w|dget. The larger the|value, the more |              |        |
         |this space can be re|ized relative to oth|r "springs"     |              |        |
         |contained in the SgS|ringBox widget.     |                |              |        |
         |                    |                    |                |              |        |
        X|NverticalSpring     |                    |                |              |        |
         |Determines the stret|hability of the widg|t in the vertica|              |        |
         |direction.  The larg|r the value, the mor| this space can |e             |        |
         |resized relative to |ther "springs" conta|ned in the      |              |        |
         |SgSpringBox widget. |                    |                |              |        |
         |                    |                    |                |              |        |
        X|NhorizontalSpring   |                    |                |              |        |
         |Determines the stret|hability of the widg|t in the        |              |        |
         |horizontal direction|  The larger the val|e, the more this|              |        |
         |space can be resized|relative to other "s|rings" contained|              |        |
         |in the  SgSpringBox |idget.              |                |              |        |
         |                    |                    |                |              |        |
     Inhe|ited Resources      |                    |                |              |        |
         |SgSpringBox inherits|behavior and resourc|s from the      |              |        |
         |following superclass|s.  For a complete d|scription of eac|              |        |
         |resource, refer to t|e man page for that |uperclass.      |              |        |
         |                    |                    |                |              |        |
         |                    |                    |                |              |        |
         |                    |                    |                |              |        |
         |____________________|____________________|________________|______________|________|

         |                                                                                                        |
         |                                                                                                        |
         |                                                                                                        |
     SgSp|ingBox(3X)           UNIX System V           SgSpringBox(3X)                                            |
         |                                                                                                        |
         |                                                                                                        |
         |                                                                                                        |
     ____|______________________________________________________________________________                          |
    |    |                      XmBulletinBoard Resource Set                           |                          |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | Nam|               |  Clas|             |  Type         ||  Default     |  A|cess|                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|llowOverlap    |  XmCA|lowOverlap   |  Boolean      ||  True        |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|utoUnmanage    |  XmCA|toUnmanage   |  Boolean      ||  True        |  C|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|uttonFontList  |  XmCB|ttonFontList |  XmFontList   ||  dynamic     |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|ancelButton    |  XmCW|dget         |  Widget       ||  NULL        |  S|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|efaultButton   |  XmCW|dget         |  Widget       ||  NULL        |  S|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|efaultPosition |  XmCD|faultPosition|  Boolean      ||  True        |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|ialogStyle     |  XmCD|alogStyle    |  unsigned char||  dynamic     |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|ialogTitle     |  XmCD|alogTitle    |  XmString     ||  NULL        |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|ocusCallback   |  XmCC|llback       |  XtCallbackLis||  NULL        |  C|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|abelFontList   |  XmCL|belFontList  |  XmFontList   ||  dynamic     |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|apCallback     |  XmCC|llback       |  XtCallbackLis||  NULL        |  C|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|arginHeight    |  XmCM|rginHeight   |  Dimension    ||  0           |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|arginWidth     |  XmCM|rginWidth    |  Dimension    ||  0           |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|oResize        |  XmCN|Resize       |  Boolean      ||  False       |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|esizePolicy    |  XmCR|sizePolicy   |  unsigned char||  XmRESIZE_ANY|  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|hadowType      |  XmCS|adowType     |  unsigned char||  XmSHADOW_OUT|  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|extFontList    |  XmCT|xtFontList   |  XmFontList   ||  dynamic     |  C|G   |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|extTranslations|  XmCT|anslations   |  XtTranslation||  NULL        |  C|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    | XmN|nmapCallback   |  XmCC|llback       |  XtCallbackLis||  NULL        |  C|    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
    |    |               |      |             |               ||              |   |    |                 |        |
    |____|_______________|______|_____________|_______________||______________|___|____|                 |        |
         |                      |                             |                   |                      |        |
         |                      |                             |                   |                      |        |
         |                      |                             |                   |                      |        |
         |                      |                             |                   |                      |        |
         |______________________|_____________________________|___________________|______________________|________|

     _________________________________________________________________________________________________________
    |                                         XmManager Resource Set                                         |
    |______________________|_____________________________|___________________|______________________|________|
    | Name                 |  Class                      |  Type             |  Default             |  Access|
    |______________________|_____________________________|___________________|______________________|________|
    |______________________|_____________________________|___________________|______________________|________|
    | XmNbottomShadowColor |  XmCBottomShadowColor       |  Pixel            |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNbottomShadowPixmap|  XmCBottomShadowPixmap      |  Pixmap           |  XmUNSPECIFIED_PIXMAP|  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNforeground        |  XmCForeground              |  Pixel            |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNhelpCallback      |  XmCCallback                |  XtCallbackList   |  NULL                |  C     |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNhighlightColor    |  XmCHighlightColor          |  Pixel            |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNhighlightPixmap   |  XmCHighlightPixmap         |  Pixmap           |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNinitialFocus      |  XmCInitialFocus            |  Widget           |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNnavigationType    |  XmCNavigationType          |  XmNavigationType |  XmTAB_GROUP         |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNshadowThickness   |  XmCShadowThickness         |  Dimension        |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNstringDirection   |  XmCStringDirection         |  XmStringDirection|  dynamic             |  CG    |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNtopShadowColor    |  XmCBackgroundTopShadowColor|  Pixel            |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNtopShadowPixmap   |  XmCTopShadowPixmap         |  Pixmap           |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNtraversalOn       |  XmCTraversalOn             |  Boolean          |  True                |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNunitType          |  XmCUnitType                |  unsigned char    |  dynamic             |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    | XmNuserData          |  XmCUserData                |  Pointer          |  NULL                |  CSG   |
    |______________________|_____________________________|___________________|______________________|________|
    |                      |                             |                   |                      |        |
    |______________________|_____________________________|___________________|______________________|________|

     ________________________________________________________________________
    |                         Composite Resource Set                        |
    |__________________|___________________|_____________|_________|________|
    | Name             |  Class            |  Type       |  Default|  Access|
    |__________________|___________________|_____________|_________|________|
    |__________________|___________________|_____________|_________|________|
    | XmNchildren      |  XmCReadOnly      |  WidgetList |  NULL   |  G     |
    |__________________|___________________|_____________|_________|________|
    | XmNinsertPosition|  XmCInsertPosition|  XtOrderProc|  NULL   |  CSG   |
    |__________________|___________________|_____________|_________|________|
    | XmNnumChildren   |  XmCReadOnly      |  Cardinal   |  0      |  G     |
    |__________________|___________________|_____________|_________|________|

    |__________________|___________________|_____________|_________|________|
    |                  |                   |             |         |        |
    |__________________|___________________|_____________|_________|________|

     ________________________________________________________________________________________________________________
    |                                               Core Resource Set                                               |
    |______________________________|_______________________________|________________|______________________|________|
    | Name                         |  Class                        |  Type          |  Default             |  Access|
    |______________________________|_______________________________|________________|______________________|________|
    |______________________________|_______________________________|________________|______________________|________|
    | XmNaccelerators              |  XmCAccelerators              |  XtAccelerators|  dynamic             |  N/A   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNancestorSensitive         |  XmCSensitive                 |  Boolean       |  dynamic             |  G     |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNbackground                |  XmCBackground                |  Pixel         |  dynamic             |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNbackgroundPixmap          |  XmCPixmap                    |  Pixmap        |  XmUNSPECIFIED_PIXMAP|  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNborderColor               |  XmCBorderColor               |  Pixel         |  XtDefaultForeground |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNborderPixmap              |  XmCPixmap                    |  Pixmap        |  XmUNSPECIFIED_PIXMAP|  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNborderWidth               |  XmCBorderWidth               |  Dimension     |  0                   |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNcolormap                  |  XmCColormap                  |  Colormap      |  dynamic             |  CG    |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNdepth                     |  XmCDepth                     |  int           |  dynamic             |  CG    |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNdestroyCallback           |  XmCCallback                  |  XtCallbackList|  NULL                |  C     |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNheight                    |  XmCHeight                    |  Dimension     |  dynamic             |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNinitialResourcesPersistent|  XmCInitialResourcesPersistent|  Boolean       |  True                |  C     |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNmappedWhenManaged         |  XmCMappedWhenManaged         |  Boolean       |  True                |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNscreen                    |  XmCScreen                    |  Screen *      |  dynamic             |  CG    |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNsensitive                 |  XmCSensitive                 |  Boolean       |  True                |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNtranslations              |  XmCTranslations              |  XtTranslations|  dynamic             |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNwidth                     |  XmCWidth                     |  Dimension     |  dynamic             |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNx                         |  XmCPosition                  |  Position      |  0                   |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    | XmNy                         |  XmCPosition                  |  Position      |  0                   |  CSG   |
    |______________________________|_______________________________|________________|______________________|________|
    |                              |                               |                |                      |        |
    |______________________________|_______________________________|________________|______________________|________|
    |______________________________|_______________________________|________________|______________________|________|

    |                              |                               |                |                      |        |
    |   Translations               |                               |                |                      |        |
    |     qSgSpringBox inherits translations from XmBulletinBoard. |                |                      |        |
    |                              |                               |                |                      |        |
     RELATED INFORMATION           |                               |                |                      |
          Composite(3X), Constraint(3X), Core(3X),
          XmBulletinBoard(3X), SgCreateGrid, SgCreateGridDialog(3X),
          and XmManager(3X).