home *** CD-ROM | disk | FTP | other *** search
/ Aminet 10 / aminetcdnumber101996.iso / Aminet / dev / gui / mui31dev.lha / MUI / Developer / Autodocs / MUI_Group.doc < prev    next >
Encoding:
Text File  |  1995-11-22  |  15.8 KB  |  549 lines

  1. TABLE OF CONTENTS
  2.  
  3. Group.mui/Group.mui
  4. Group.mui/MUIA_Group_ActivePage
  5. Group.mui/MUIA_Group_Child
  6. Group.mui/MUIA_Group_ChildList
  7. Group.mui/MUIA_Group_Columns
  8. Group.mui/MUIA_Group_Horiz
  9. Group.mui/MUIA_Group_HorizSpacing
  10. Group.mui/MUIA_Group_LayoutHook
  11. Group.mui/MUIA_Group_PageMode
  12. Group.mui/MUIA_Group_Rows
  13. Group.mui/MUIA_Group_SameHeight
  14. Group.mui/MUIA_Group_SameSize
  15. Group.mui/MUIA_Group_SameWidth
  16. Group.mui/MUIA_Group_Spacing
  17. Group.mui/MUIA_Group_VertSpacing
  18. Group.mui/MUIM_Group_ExitChange
  19. Group.mui/MUIM_Group_InitChange
  20. Group.mui/Group.mui
  21.  
  22.     Group class is responsible for the complete layout
  23.     of a MUI window. A group may contain any number of
  24.     child objects, maybe buttons, cycle gadgets or
  25.     even other groups.
  26.  
  27.     Some attributes of group class define how the children
  28.     of a group are layouted. You can e.g. tell your group
  29.     to place its children horizontally (in a row) or
  30.     vertically (in a column). Since every MUI object knows
  31.     about its minimum and maximum dimensions, group class
  32.     has everything it needs to do that job.
  33.  
  34.     More sophisticated layout is possible by assigning
  35.     different weights to objects in a group or by
  36.     making a group two-dimensional.
  37.  
  38.     Beneath the layout issues, a group object passes
  39.     attributes and methods through to all of its
  40.     children. Thus, you can talk and listen to any
  41.     child of a group by talking and listening to the
  42.     group itself.
  43. Group.mui/MUIA_Group_ActivePage
  44.  
  45.     NAME
  46.     MUIA_Group_ActivePage -- (V5 ) [ISG], LONG
  47.  
  48.     SPECIAL INPUTS
  49.     MUIV_Group_ActivePage_First
  50.     MUIV_Group_ActivePage_Last
  51.     MUIV_Group_ActivePage_Prev
  52.     MUIV_Group_ActivePage_Next
  53.  
  54.     FUNCTION
  55.     Set (or get) the active page of a page group.
  56.     Only this active page is displayed, all others
  57.     are hidden.
  58.  
  59.     The value may range from 0 (for the first child)
  60.     to numchildren-1 (for the last child). Children are
  61.     adressed in the order of creation:
  62.  
  63.     PageGroup,
  64.        Child, Page_0_Object,
  65.        Child, Page_1_Object,
  66.        Child, Page_2_Object,
  67.        Child, Page_3_Object,
  68.        End;
  69.  
  70.     Note: You may *never* supply an incorrect page value!
  71.  
  72.     SEE ALSO
  73.     MUIA_Group_PageMode
  74. Group.mui/MUIA_Group_Child
  75.  
  76.     NAME
  77.     MUIA_Group_Child -- (V4 ) [I..], Object *
  78.  
  79.     FUNCTION
  80.     You supply a pointer to a previously created MUI object
  81.     here. This object will be treated as child of the group,
  82.     the group is responsible for positioning the object.
  83.  
  84.     Of course you can specify any number of child objects,
  85.     limited only by available memory.
  86.  
  87.     Normally, the value for a MUIA_Group_Child tag is
  88.     a direct call to another MUI_NewObject(), children
  89.     are generated "on the fly".
  90.  
  91.     When a group is disposed, all of its children will also
  92.     get deleted. If you supply a NULL pointer as child,
  93.     the group object will fail and previously dispose all
  94.     valid children found in the taglist.
  95.  
  96.     This behaviour makes it possible to generate a complete
  97.     application within one single (but long) MUI_NewObject()
  98.     call. Error checking is not necessary since every error,
  99.     even if it occurs in a very deep nesting level, will
  100.     cause the complete call to fail without leaving back
  101.     any previously created object.
  102.  
  103.    EXAMPLES
  104.     Please have a look at some of the supplied example
  105.     programs.
  106.  
  107.    SEE ALSO
  108.     MUIA_Group_Horiz
  109. Group.mui/MUIA_Group_ChildList
  110.  
  111.     NAME
  112.     MUIA_Group_ChildList -- (V4 ) [..G], struct List *
  113.  
  114.     FUNCTION
  115.     This attribute returns a pointer to a struct List in which
  116.     a group manages its children.
  117.  
  118.     The only thing you are allowed to do with this list is
  119.     to traverse through the children. You *must* use
  120.     intuition.library/NextObject() for this purpose!
  121.  
  122.     Never add or remove member directly, use the 
  123.     OM_ADDMEMBER/OM_REMMEMBER methods instead!
  124.  
  125.     SEE ALSO
  126.     MUIA_Group_Child
  127. Group.mui/MUIA_Group_Columns
  128.  
  129.     NAME
  130.     MUIA_Group_Columns -- (V4 ) [IS.], LONG
  131.  
  132.     FUNCTION
  133.     Indicate number of columns in a two dimensional group.
  134.     If you use this tag, the total number of children must
  135.     be dividable by the number of columns.
  136.  
  137.     The children will be positioned in a two dimensional
  138.     array, e.g. allowing easy creation of button fields
  139.     (maybe for calculator).
  140.  
  141.     The children in your taglist are always read line 
  142.     by line.
  143.  
  144.     When MUI layouts two-dimensional groups, it does
  145.     actually two layout calculations, one for the rows
  146.     and one the columns. Parameters like weights and
  147.     dimensions are handled this way:
  148.  
  149.     - the minimum width of a column/row is the maximum
  150.       minimum width of all objects in this column/row.
  151.  
  152.     - the maximum width of a column/row is the minimum
  153.       maximum width of all objects in this column/row.
  154.  
  155.     - the weight of a column/row is the sum of all
  156.       objects in this column/row.
  157.  
  158.     Actually, there is no difference if you use
  159.     MUIA_Group_Columns or MUIA_Group_Rows.
  160.  
  161.     EXAMPLE
  162.  
  163.     /* group of labeled string gadgets */
  164.  
  165.     GroupObject,
  166.        MUIA_Group_Columns, 2,
  167.        MUIA_Group_Child  , label1,
  168.        MUIA_Group_Child  , string1,
  169.        MUIA_Group_Child  , label2,
  170.        MUIA_Group_Child  , string2,
  171.        MUIA_Group_Child  , label3,
  172.        MUIA_Group_Child  , string3,
  173.            ...
  174.        End;
  175.  
  176.     SEE ALSO
  177.     MUIA_Group_Rows, MUIA_Group_Horiz
  178. Group.mui/MUIA_Group_Horiz
  179.  
  180.     NAME
  181.     MUIA_Group_Horiz -- (V4 ) [I..], BOOL
  182.  
  183.     FUNCTION
  184.     Boolean value to indicate whether the objects in
  185.     this group shall be layouted horizontally or
  186.     vertically. Defaults to FALSE.
  187.  
  188.     This is the easy way of telling your group how
  189.     it has to look like. If you want two-dimensional
  190.     groups, you have to use MUIA_Group_Columns
  191.     or MUIA_Group_Rows.
  192.  
  193.     EXAMPLE
  194.     GroupObject,
  195.        MUIA_Group_Horiz, TRUE,
  196.        MUIA_Group_Child, obj1,
  197.        MUIA_Group_Child, obj2,
  198.        MUIA_Group_Child, obj3,
  199.        End;
  200.  
  201.     SEE ALSO
  202.     MUIA_Group_Columns, MUIA_Group_Rows, MUIA_Group_Child
  203. Group.mui/MUIA_Group_HorizSpacing
  204.  
  205.     NAME
  206.     MUIA_Group_HorizSpacing -- (V4 ) [IS.], LONG
  207.  
  208.     FUNCTION
  209.     Number of pixels to be inserted between horizontal
  210.     elements of a group.
  211.  
  212.     Please use this tag wisely, you will override the
  213.     user's prefered default setting!
  214.  
  215.     SEE ALSO
  216.     MUIA_Group_Spacing, MUIA_Group_VertSpacing
  217. Group.mui/MUIA_Group_LayoutHook
  218.  
  219.     NAME
  220.     MUIA_Group_LayoutHook -- (V11) [I..], struct Hook *
  221.  
  222.     FUNCTION
  223.     Since version 11 of muimaster.library, you have the
  224.     ability to customize the way objects are placed in a
  225.     group. Altough MUI features a very powerful builtin
  226.     layout algorithm which serves well for almost all
  227.     GUI related purposes, it might sometimes become
  228.     handy to override this with custom code.
  229.  
  230.     Imagine you want to build a multimedia document
  231.     viewer which contains text objects, bitmap objects
  232.     and buttons. An easy way for doing this is to simply
  233.     create a sub class of group class which contains all
  234.     the documents elements as MUI objects and which
  235.     specifies a custom layout hook for the parent group.
  236.     This hook is then responsible for placing the
  237.     objects within the bounds of the parent group.
  238.  
  239.     As soon as you specify a MUIA_Group_LayoutHook, the
  240.     builtin layout calculation is skipped and your hook
  241.     is called whenever MUI needs some information.
  242.     Register A2 will contain a pointer to the parent
  243.     group object and register A1 will contain a pointer
  244.     to a struct MUI_LayoutMsg. The lm_Type field of
  245.     this structure determines which kind of action MUI
  246.     wants you to perform (see below), the lm_Children
  247.     field is a pointer to a list of your groups
  248.     children. By traversing through list list with the
  249.     intuition function NextObject(), you can retrieve
  250.     the children of the group.
  251.  
  252.     If lm_Type == MUILM_ASKMINMAX, MUI wants you to
  253.     calculate your groups minimum, maximum and default
  254.     sizes. At this time, the children of your group have
  255.     already been asked for their dimensions. This allows
  256.     you to traverse through the list of children and do
  257.     some calculations depending on their min/max sizes.
  258.     Use the macros _minwidth(child), _maxwidth(child),
  259.     _minheight(child), _maxheight(child) for this
  260.     purpose. Place the result of your calculations in
  261.     the structure lm_MinMax of the MUI_LayoutMsg and
  262.     exit your hook with a return value of 0.
  263.  
  264.     If lm_Type == MUILM_LAYOUT, MUI has already placed
  265.     the group object somewhere in a window and now wants
  266.     you to place the children of this group. You have to
  267.     traverse through the child list and calculate
  268.     positions and sizes for each child. Use the function
  269.     MUI_Layout() to tell the child where it should
  270.     appear. You have to make sure that you don't place
  271.     child objects outside of the parent group and you
  272.     should generally avoid overlapping objects. Return
  273.     TRUE if all children are placed, return FALSE if you
  274.     were for some reasons unable to place your children.
  275.  
  276.     If your previous min/max calculations were correct,
  277.     your algorithms should not have problems to place
  278.     all the children in the rectangle defined by the
  279.     parent group. Its size will never be smaller as your
  280.     specified minimum dimensions and never be larger as
  281.     your specified maximum dimensions.
  282.  
  283.     If your group is a virtual group, the width
  284.     and height your layout hook receives are as big as
  285.     the *visible* part of the virtual group. In this
  286.     case, you are allowed to position your objects
  287.     outside of the visible part, i.e. you are not
  288.     limited to keep your objects inside the given width
  289.     and height. Place them where you wish and set
  290.     lm_Layout.Width and lm_Layout.Height to the width
  291.     and height you really need for your objects before
  292.     exiting. The virtual width and height of your group
  293.     will be adjusted accordingly.
  294.  
  295.     EXAMPLE
  296.     see MUI demo program Layout.c
  297.  
  298.     SEE ALSO
  299.     muimaster.library/MUI_Layout()
  300. Group.mui/MUIA_Group_PageMode
  301.  
  302.     NAME
  303.     MUIA_Group_PageMode -- (V5 ) [I..], BOOL
  304.  
  305.     FUNCTION
  306.     Settings this attribute to TRUE makes the current group a page
  307.     group. Page groups always display only one of their children, 
  308.     which one can be adjusted with the MUIA_Group_ActivePage 
  309.     attribute.
  310.  
  311.     Imagine you have a preferences window with several different
  312.     pages, e.g. the MUI preferences with object, frame, image,
  313.     font, screen, keyboard and system prefs. Instead of one
  314.     separate window for each group, you could put all pages into
  315.     one page group and have a cycle gadget for page switching.
  316.     This will make your program easier to use since the user
  317.     won't have to handle a lot of windows. However, he will not
  318.     be able to work with more than one page at the same time.
  319.  
  320.     Sizes are calculated as follows:
  321.  
  322.     The minimum width/height of a page group is the maximum
  323.     minimum width/height of all its children.
  324.  
  325.     The maximum width/height of a page group is the minimum
  326.     maximum width/height of all its children.
  327.  
  328.     When the maximum width/height of a child in a page group is
  329.     smaller than the minimum width/height of the page group
  330.     (since it contains another child with big minimum width/height),
  331.     the child be centered.
  332.  
  333.     Page groups are not limited in depth, children of a page
  334.     group may of course be other page groups.
  335.  
  336.     If you want to have a gadget only visible under certain
  337.     conditions, you could make a page group containing this
  338.     gadget and an empty rectangle object.
  339.  
  340.     If you want TAB cycling for the objects in a page group,
  341.     simply include all objects in the cycle chain (as if
  342.     they all were visible at the same time).
  343.  
  344.     EXAMPLE
  345.     demo program "Pages.c"
  346.  
  347.     SEE ALSO
  348.     MUIA_Group_ActivePage
  349. Group.mui/MUIA_Group_Rows
  350.  
  351.     NAME
  352.     MUIA_Group_Rows -- (V4 ) [IS.], LONG
  353.  
  354.     FUNCTION
  355.     Indicate number of rows in a two dimensional group.
  356.     If you use this tag, the total number of children must
  357.     be dividable by the number of rows.
  358.  
  359.     The children will be positioned in a two dimensional
  360.     array, e.g. allowing easy creation of button fields
  361.     (maybe for calculator).
  362.  
  363.     The children in your taglist are always read line
  364.     by line.
  365.  
  366.     When MUI layouts two-dimensional groups, it does
  367.     actually two layout calculations, one for the rows
  368.     and one the columns. Parameters like weights and
  369.     dimensions are handled this way:
  370.  
  371.     - the minimum width of a column/row is the maximum
  372.       minimum width of all objects in this column/row.
  373.  
  374.     - the maximum width of a column/row is the minimum
  375.       maximum width of all objects in this column/row.
  376.  
  377.     - the weight of a column/row is the sum of all
  378.       objects in this column/row.
  379.  
  380.     Actually, there is no difference if you use
  381.     MUIA_Group_Columns or MUIA_Group_Rows.
  382.  
  383.     SEE ALSO
  384.     MUIA_Group_Columns, MUIA_Group_Horiz
  385. Group.mui/MUIA_Group_SameHeight
  386.  
  387.     NAME
  388.     MUIA_Group_SameHeight -- (V4 ) [I..], BOOL
  389.  
  390.     FUNCTION
  391.     Boolean value to indicate that all children of this
  392.     group shall have the same height.
  393.  
  394.     BUGS
  395.     Up to version 5 of groupclass, using MUIA_Group_SameHeight
  396.     could make objects larger than their maximum height. This
  397.     has been fixed for version 6.
  398.  
  399.     SEE ALSO
  400.     MUIA_Group_SameSize, MUIA_Group_SameWidth
  401. Group.mui/MUIA_Group_SameSize
  402.  
  403.     NAME
  404.     MUIA_Group_SameSize -- (V4 ) [I..], BOOL
  405.  
  406.     FUNCTION
  407.     This is a shorthand for MUIA_Group_SameWidth and
  408.     MUIA_Group_SameHeight, it sets both of these
  409.     attributes at once.
  410.  
  411.     Using MUIA_Group_SameSize, you won't need to think
  412.     if your group is horizontal or vertical, both
  413.     cases are handled automatically.
  414.  
  415.     Forcing all objects of a group to be the same size
  416.     is e.g. useful for a row of buttons. It's visually
  417.     more attractive when these buttons have equal sizes
  418.     instead of being just as big as the text within.
  419.  
  420.     BUGS
  421.     Up to version 5 of groupclass, using MUIA_Group_SameSize
  422.     could make objects larger than their maximum size. This
  423.     has been fixed for version 6.
  424.  
  425.     EXAMPLE
  426.  
  427.     /* three buttons, same size */
  428.  
  429.     GroupObject,
  430.        MUIA_Group_Horiz   , TRUE,
  431.        MUIA_Group_SameSize, TRUE,
  432.        MUIA_Group_Child   , but1,
  433.        MUIA_Group_Child   , but2,
  434.        MUIA_Group_Child   , but3,
  435.        End;
  436.  
  437.     SEE ALSO
  438.     MUIA_Group_SameWidth, MUIA_Group_SameHeight
  439. Group.mui/MUIA_Group_SameWidth
  440.  
  441.     NAME
  442.     MUIA_Group_SameWidth -- (V4 ) [I..], BOOL
  443.  
  444.     FUNCTION
  445.     Boolean value to indicate that all children of this
  446.     group shall have the same width.
  447.  
  448.     BUGS
  449.     Up to version 5 of groupclass, using MUIA_Group_SameWidth
  450.     could make objects larger than their maximum width. This
  451.     has been fixed for version 6.
  452.  
  453.     SEE ALSO
  454.     MUIA_Group_SameSize, MUIA_Group_SameHeight
  455. Group.mui/MUIA_Group_Spacing
  456.  
  457.     NAME
  458.     MUIA_Group_Spacing -- (V4 ) [IS.], LONG
  459.  
  460.     FUNCTION
  461.     This is a shorthand for MUIA_Group_HorizSpacing and
  462.     MUIA_Group_VertSpacing, it sets both of these
  463.     attributes at once.
  464.  
  465.     Using MUIA_Group_Spacing, you won't need to think
  466.     if your group is horizontal or vertical, both
  467.     cases are handled automatically.
  468.  
  469.     Note that setting a spacing value for a group
  470.     overrides the user's default settings. Please
  471.     use it only if you have a good reason.
  472.  
  473.     EXAMPLE
  474.  
  475.     /* no space between obj1 and obj2: */
  476.  
  477.     GroupObject,
  478.        MUIA_Group_Horiz  , TRUE,
  479.        MUIA_Group_Spacing, 0,
  480.        MUIA_Group_Child  , obj1,
  481.        MUIA_Group_Child  , obj2,
  482.        End;
  483.  
  484.     SEE ALSO
  485.     MUIA_Group_HorizSpacing, MUIA_Group_VertSpacing
  486. Group.mui/MUIA_Group_VertSpacing
  487.  
  488.     NAME
  489.     MUIA_Group_VertSpacing -- (V4 ) [IS.], LONG
  490.  
  491.     FUNCTION
  492.     Number of pixels to be inserted between vertical
  493.     elements of a group.
  494.  
  495.     Please use this tag wisely, you will override the
  496.     user's prefered default setting!
  497.  
  498.     SEE ALSO
  499.     MUIA_Group_Spacing, MUIA_Group_HorizSpacing
  500. Group.mui/MUIM_Group_ExitChange
  501.  
  502.     NAME
  503.     MUIM_Group_ExitChange (V11)
  504.  
  505.     SYNOPSIS
  506.     DoMethod(obj,MUIM_Group_ExitChange,);
  507.  
  508.     FUNCTION
  509.     Terminates MUIM_Group_InitChange state.
  510.  
  511.     SEE ALSO
  512.     MUIM_Group_InitChange
  513. Group.mui/MUIM_Group_InitChange
  514.  
  515.     NAME
  516.     MUIM_Group_InitChange (V11)
  517.  
  518.     SYNOPSIS
  519.     DoMethod(obj,MUIM_Group_InitChange,);
  520.  
  521.     FUNCTION
  522.     Prepares a group for dynamic adding/removing of objects.
  523.     MUI 3 offers the possibility to dynamically add/remove
  524.     children from groups, even when the window that contains
  525.     these objects is currently open. To be able to do this,
  526.     you must first put the group into a special "exchange"
  527.     state by using this method. Then, you can add/remove
  528.     children at will. If you're done, use MUIM_Group_ExitChange
  529.     to make MUI recalculate the display.
  530.  
  531.     RESULT
  532.     returns NULL on failure.
  533.  
  534.     EXAMPLE
  535.     /* remove two children, add another one */
  536.  
  537.     if (DoMethod(group,MUIM_Group_InitChange))
  538.     {
  539.        DoMethod(group,OM_REMMEMBER,somechild);
  540.        DoMethod(group,OM_REMMEMBER,somechild2);
  541.  
  542.        DoMethod(group,OM_ADDMEMBER,somenewchild);
  543.  
  544.        DoMethod(group,MUIM_Group_ExitChange);
  545.     }
  546.  
  547.     SEE ALSO
  548.     MUIM_Group_InitChange
  549.