home *** CD-ROM | disk | FTP | other *** search
-
- File: groupclass.doc
- Description: Groupclass documentation.
- Copyright: (C) Copyright 1994-1995 Jaba Development.
- (C) Copyright 1994-1995 Jan van den Baard.
- All Rights Reserved.
-
- ------------------------------------------------------------------------------
-
- TABLE OF CONTENTS
-
- groupclass/--background--
- groupclass/Methods
- groupclass/Attributes
-
- groupclass/--background-- groupclass/--background--
-
- NAME
- Class: groupclass
- Superclass: baseclass
- Include File: <libraries/bgui.h>
-
- FUNCTION
- To layout it's members in a specific area. A groupclass object may
- have any number of members which are layouted accoording to a set of
- layout attributes.
-
- The number of members a group can have is only limited by the amount
- of available memory. This will allow for simple and extremely complex
- layout's.
-
- groupclass/Methods groupclass/Methods
-
- NEW METHODS
- GRM_ADDMEMBER -- This method can be used to add a member to an
- existing group. This method uses the following custom message
- structure:
-
- struct grmAddMember {
- ULONG MethodID; /* GRM_ADDMEMBER */
- Object *grma_Member; /* Object to add. */
- ULONG grma_Attr;
- };
-
- grma_Attr -- This is an array of attributes which control the
- way the object is layouted. The following attributes
- are possible:
-
- LGO_FixWidth -- ti_Data contains the width at which
- the object is fixed.
-
- LGO_FixHeight -- ti_Data contains the height at which
- the object is fixed.
-
- LGO_Weight -- Scaling objects is weight controlled.
- the default weight an object get's is 50.
- This attribute can be used to change that
- setting.
-
- LGO_FixMinWidth -- The object is fixed at it's
- minimum width.
-
- LGO_FixMinHeight -- The object is fixed at it's
- minimum height.
-
- LGO_Align -- Normally only objects in a vertical
- group are aligned when they have a label on
- the left side of their hitbox. When this
- attribute is TRUE the object will get aligned
- wherever the label is placed.
-
- LGO_NoAlign ** V38 ** -- Normally all objects in a
- vertical group with a label on the left of
- the hitbox are all aligned. This tag prevents
- this.
-
- Example:
- Object *group, *cycle;
-
- DoMethod( group, GRM_ADDMEMBER, cycle,
- LGO_FixMinHeight, TRUE,
- LGO_Weight, DEFAULT_WEIGHT,
- TAG_END );
-
- This adds a cycle object to a group fixing the height to it's
- minimum size and the weight to 50.
-
- Please note that the weight of an object affects to with of
- the object in a horizontal group and the height of the object
- in a vertical group.
-
- This method may only be used when the group is _not_ active
- (I.E. displayed in a window).
-
- Returns TRUE uppon success, FALSE uppon failure.
-
- If this method was successfull you do not need to dispose of
- the added member anymore. This will be disposed of as soon as
- the group to which the member was added is disposed of.
-
- GRM_REMMEMBER -- With this method you can remove an object from a
- group again. This method uses the following custom message
- structure:
-
- struct grmRemMeber {
- ULONG MethodID; /* GRM_REMMEMBER */
- Object *grmr_Member; /* Object to remove. */
- };
-
- This method may only be used when the group is _not_ active
- (I.E. displayed in a window).
-
- Return code not defined.
-
- You are responsible for disposing of the removed object.
-
- GRM_DIMENSIONS -- This method is sent to all members to inquire about
- their minimum sizes. Please refer to the "methods.doc" file
- for more information on this method.
-
- GRM_ADDSPACEMEMBER -- This method can be used to add a special kind
- of object to the group. The member will be a weight
- controlled spacing in the group. This method uses the
- following custom message structure:
-
- struct grmAddSpaceMember {
- ULONG MethodID; /* GRM_ADDSPACEMEMBER */
- ULONG grms_Weight;
- };
-
- grms_Weight -- This field must contain the weight of the
- spacing object. Please refer to the GRM_ADDMEMBER
- section for more information about weights.
-
- This method may only be used when the group is _not_ active
- (I.E. displayed in a window).
-
- Returns TRUE uppon success, FALSE uppon failure.
-
- GRM_INSERTMEMBER -- This method is basically the same as
- GRM_ADDMEMBER with the exception that you can determine where
- the object is added. This method uses the following custom
- message structure:
-
- struct grmInsertMember {
- ULONG MethodID; /* GRM_INSERTMEMBER */
- Object *grmi_Member; /* Object to add. */
- Object *grmi_Pred;
- ULONG grmi_Attr;
- };
-
- grmi_Pred -- This must point to the object after which the
- new member is inserted. You may set this to NULL in
- which case the new member is inserted at the start of
- the list.
-
- grmi_Attr -- This is an array of attributes which control the
- way the object is layouted. The attributes allowed
- here are exactly the same as the attributes you can
- use with the GRM_ADDMEMBER method.
-
- Example:
- Object *group, *cycle, *button;
-
- DoMethod( group, GRM_INSERTMEMBER, cycle, button,
- LGO_FixMinHeight, TRUE,
- LGO_Weight, DEFAULT_WEIGHT,
- TAG_END );
-
- This adds a cycle object to a group fixing the height to it's
- minimum size and the weight to 50. The cycle object is
- inserted after the button object.
-
- Please note that the weight of an object affects to with of
- the object in a horizontal group and the height of the object
- in a vertical group.
-
- This method may only be used when the group is _not_ active
- (I.E. displayed in a window).
-
- Returns TRUE uppon success, FALSE uppon failure.
-
- If this method was successfull you do not need to dispose of
- the added member anymore. This will be disposed of as soon as
- the group to which the member was added is disposed of.
-
- CHANGED METHODS
- OM_DISPOSE -- When this method is called it will also dispose of all
- objects that are added to the group.
-
- groupclass/Attributes groupclass/Attributes
-
- NAME
- GROUP_Style -- ( ULONG )
-
- FUNCTION
- Set the style of the group to create. The following styles are
- possible:
-
- GRSTYLE_HORIZONTAL -- A horizontal group is created.
-
- GRSTYLE_VERTICAL -- A vertical group is created.
-
- Default is GRSTYLE_HORIZONTAL. Applicability is (I).
-
- NAME
- GROUP_Spacing -- ( ULONG )
-
- FUNCTION
- Set the number of pixels the group uses as a space between the group
- members.
-
- Default is 0. Applicability is (I).
-
- NAME
- GROUP_HorizOffset, GROUP_VertOffset, GROUP_LeftOffset,
- GROUP_RightOffset, GROUP_TopOffset, GROUP_BottomOffset -- ( ULONG )
-
- FUNCTION
- Set the offset in pixels from the group borders at which the layouting
- is started. Please note that frames are not taken into consideration.
-
- Default is 0. Applicability is (I).
-
- NAME
- GROUP_Member -- ( Object * )
-
- FUNCTION
- To add a member to a group at initialization time. This tag is read a
- little different than the other tags. Following the object a set of
- layout attributes can be passed. Example:
-
- UBYTE *labels[] = { "LAB1", "LAB2", NULL };
- Object *group, *cycle;
-
- /* With macros */
- group = HGroupObject,
- StartMember,
- cycle = Cycle( "Cycle", labels, 0, 0 ),
- FixMinHeight, Weight( DEFAULT_WEIGHT ),
- EndMember,
- EndObject;
-
- /* Without macros */
- group = BGUI_NewObject( BGUI_GROUP_GADGET,
- GROUP_Member,
- cycle = BGUI_NewObject( BGUI_CYCLE_GADGET,
- LAB_Label, "Cycle",
- CYC_Labels, labels,
- CYC_Active, 0,
- GA_ID, 0,
- TAG_END ), LGO_FixMinHeight, TRUE,
- LGO_Weight, DEFAULT_WEIGHT,
- TAG_END, 0,
- TAG_END );
-
- As you can see the layout attributes follow the object pointer in the
- ti_Data field directly. Therefore it is also important that the layout
- attributes are terminated with a TAG_END, 0 rather then a single
- TAG_END. The macros will automatically do this for you.
-
- If by any chance the object you add is NULL. The creation of the group
- will fail. All objects that where successfully added to the group are
- disposed of in this case.
-
- Default is NULL. Applicability is (I).
-
- SEE ALSO
- Methods/GRM_ADDMEMBER
-
- NAME
- GROUP_SpaceObject -- ( ULONG )
-
- FUNCTION
- To add a weight controlled spacing member at create time. The data of
- this tag should contain the weight of the spacing.
-
- Default is 0. Applicability is (I).
-
- NAME
- GROUP_BackFill -- ( ULONG )
-
- FUNCTION
- To provide a backfill possibility the same as the frameclass supplies.
- The data passed with this tag should be the same as defined and
- documented for the FRM_BackFill attribute of the frameclass
- documentation. Please note that this tag is overided when the group
- has a frame attached to it.
-
- Default is 0. Applicability is (I).
-
- SEE ALSO
- frameclass.doc/FRM_BackFill
-
- NAME
- GROUP_EqualWidth -- ( BOOL )
-
- FUNCTION
- To force all members of the group to get the same minimum width. This
- makes it easy to create a row of objects which all are equally wide.
-
- Default is FALSE. Applicability is (I).
-
- SEE ALSO
- GROUP_EqualHeight
-
- NAME
- GROUP_EqualHeight -- ( BOOL )
-
- FUNCTION
- To force all members of the group to get the same minimum height. This
- makes it easy to create a row of objects which all are equally high.
-
- Default is FALSE. Applicability is (I).
-
- SEE ALSO
- GROUP_EqualWidth
-
- NAME
- GROUP_Inverted -- ( BOOL )
-
- FUNCTION
- To force the members added at create time to be AddHead()'ed to the
- member list instead of AddTail()'ed. This is necessary for the
- assembly macros of the BGUI package.
-
- Default is FALSE. Applicability is (I).
-