GenClass: 9 Setting Sizes

Up: GEOS SDK TechDocs | Up | Prev: 8 Visual Refreshing | Next: 10 Activation Messages
MSG_GEN_SET_INITIAL_SIZE, MSG_GEN_SET_MINIMUM_SIZE, MSG_GEN_SET_MAXIMUM_SIZE, MSG_GEN_SET_FIXED_SIZE, MSG_GEN_GET_INITIAL_SIZE, MSG_GEN_GET_MINIMUM_SIZE, MSG_GEN_GET_MAXIMUM_SIZE, MSG_GEN_GET_FIZED_SIZE, MSG_GEN_RESET_TO_INITIAL_SIZE, CompSizeHintArgs

These messages all perform resizing operations on generic objects. In some cases, the geometry is not redone by sending these messages; the object will need to be set not usable and then set usable to force the new sizing scheme. In most cases, however, sending these messages will affect the current geometry of an object. These messages manipulate their associated hints, either by creating new hints or by altering old ones. As such, these messages will only affect an object if the associated hint does also.

These messages alter four size restrictions associated with an object: initial, maximum, minimum, and fixed. These restrictions are set up using the GenClass hints HINT_INITIAL_SIZE , HINT_MAXIMUM_SIZE , HINT_MINIMUM_SIZE , and HINT_FIXED_SIZE , all of which are described in the Managing UI Geometry chapter.

The size parameter required by each of these hints is a structure of type CompSizeHintArgs . This structure is shown below:

  typedef struct {
    SpecWidth			CSHA_width;
    SpecHeight			CSHA_height;
    sword			CSHA_count;
} CompSizeHintArgs;

Many of the messages pass a structure of GetSizeArgs to place size information retrieved from the message. This size information is used by the specific UI to visually construct the object, bypassing default sizes in the process. The structure is shown below:

typedef struct {
    word		GSA_width;
    word		GSA_height;
    word		GSA_unused;
    word		GSA_count;
} GetSizeArgs;
MSG_GEN_GET_INITIAL_SIZE
void	MSG_GEN_GET_INITIAL_SIZE(
        GetSizeArgs *initSize);

This message retrieves the initial size specifications of a generic object stored in the hint HINT_INITIAL_SIZE. The object must be passed a pointer to a structure of type GetSizeArgs to store the retrieved data. If the hint HINT_INITIAL_SIZE does not exist for this object , the structure passed to the object of size GetSizeArgs will remain empty.

Source: Unrestricted.

Destination: Any generic object.

Parameters: initSize A pointer to an empty GetSizeArgs structure.

Return: The GetSizeArgs structure will contain the object's initial size.

Interception: Generally not intercepted.

MSG_GEN_SET_INITIAL_SIZE
void	MSG_GEN_SET_INITIAL_SIZE(@stack
        byte		updateMode,
        word		count,
        word		height,				/* SpecHeight */
        word		width);				/* SpecWidth */

This message sets the initial size of a generic object (its size on being first built). This is only done by creating or modifying the hint HINT_INITIAL_SIZE ; there is no guarantee that the specific UI will implement this message in the expected fashion.

The message must pass a VisUpdateMode . This message will only affect the size of an object when it first opens; it will not modify the geometry of a currently built object. For the defined geometry to take effect on an already built object, the object must be set not usable and then set usable again.

Source: Unrestricted.

Destination: Any generic object.

Parameters: count The number of children (or zero, if not applicable).

height
The height of each child.
width
The width of the composite.

Interception: Generally not intercepted.

MSG_GEN_RESET_TO_INITIAL_SIZE
void	MSG_GEN_RESET_TO_INITIAL_SIZE(
        VisUpdateMode		updateMode);

This message forces the recipient and all of its children to be resized according to their initial size specifications. If the objects contain HINT_INITIAL_SIZE , they will be resized according to the hint; otherwise they will be resized according to their default geometry. This message is useful for activating sizes set with MSG_GEN_SET_INITIAL_SIZE .

Source: Unrestricted.

Destination: Any GS_USABLE generic object.

Parameters: updateMode VisUpdateMode to determine when the object will be redrawn.

Interception: Generally not intercepted.

MSG_GEN_GET_MINIMUM_SIZE
void	MSG_GEN_GET_MINIMUM_SIZE(
        GetSizeArgs  *minSize);

This message retrieves the recipient's minimum size specifications stored in the hint HINT_MINIMUM_SIZE . If HINT_MINIMUM_SIZE is not set , the structure passed to the object will remain empty.

Source: Unrestricted.

Destination: Any generic object.

Parameters: minSize A pointer to an empty GetSizeArgs structure.

Return: The GetSizeArgs structure will contain the object's minimum size.

Interception: Generally not intercepted.

MSG_GEN_SET_MINIMUM_SIZE
void	MSG_GEN_SET_MINIMUM_SIZE(@stack
        byte	updateMode,
        word	count,
        word	height,				/* SpecHeight */
        word	width);				/* SpecWidth */

This message sets the minimum allowable size of an object. An object with a minimum size is not allowed to shrink smaller than the bounds set in HINT_MINIMUM_SIZE . This message alters the minimum size by creating or modifying the hint HINT_MINIMUM_SIZE . Due to the nature of hints, there is no guarantee that the specific UI will implement this message in the expected fashion.

This message will modify the geometry of a currently built object, forcing that object to be unbuilt and then built again. Note that the minimum size of an object has nothing to do with the minimized state of an object (for GenDisplays, the iconification of an object) but merely the minimum allowable size of an object in its normal usable state.

Source: Unrestricted.

Destination: Any generic object.

Parameters: count The number of children (or zero, if not applicable).

height
The height of each child.
width
The width of the composite.

Interception: Generally not intercepted.

MSG_GEN_GET_MAXIMUM_SIZE
void	MSG_GEN_GET_MAXIMUM_SIZE(
        GetSizeArgs  *maxSize);

This message retrieves the recipient's maximum size stored in the hint HINT_MAXIMUM_SIZE . If HINT_MAXIMUM_SIZE is not set , the structure passed will remain empty.

Source: Unrestricted.

Destination: Any generic object.

Parameters: maxSize A pointer to an empty GetSizeArgs structure.

Return: The GetSizeArgs structure will contain the object's maximum size.

Interception: Generally not intercepted.

MSG_GEN_SET_MAXIMUM_SIZE
void	MSG_GEN_SET_MAXIMUM_SIZE(
        word	count,
        word	height,				/* SpecHeight */
        word	width);				/* SpecWidth */

This message sets the maximum allowable size of an object. An object with a maximum size is not allowed to grow larger than the bounds set with HINT_MAXIMUM_SIZE . This message alters the maximum size by creating or modifying the hint HINT_MAXIMUM_SIZE . Due to the nature of hints, there is no guarantee that the specific UI will implement this message in the expected fashion.

This message will modify the geometry of a currently built object, forcing that object to be unbuilt and then built again. Note that the maximum size of an object has nothing to do with the maximized state of an object but merely the maximum allowable size of an object in its normal usable state.

Source: Unrestricted.

Destination: Any generic object.

Parameters: count The number of children (or zero, if not applicable).

height
The height of each child.
width
The width of the composite.

Interception: Generally not intercepted.

MSG_GEN_GET_FIXED_SIZE
void	MSG_GEN_GET_FIXED_SIZE(
        GetSizeArgs *fixedSize);

This message retrieves the size stored in HINT_FIXED_SIZE . If HINT_FIXED_SIZE is not set, the structure passed will remain empty.

Source: Unrestricted.

Destination: Any generic object.

Parameters: fixedSize A pointer to an empty GetSizeArgs structure.

Return: The GetSizeArgs structure will contain the object's fixed size.

Interception: Generally not intercepted.

MSG_GEN_SET_FIXED_SIZE
void	MSG_GEN_SET_FIXED_SIZE(
        word	count,
        word	height,				/* SpecHeight */
        word	width);				/* SpecWidth */

This message sets the fixed size of an object. An object with a fixed size is forced to remain at the size set with HINT_FIXED_SIZE . This message alters this fixed size by creating or modifying HINT_FIXED_SIZE . Due to the nature of hints, there is no guarantee that the specific UI will implement this message in the expected fashion.

Source: Unrestricted.

Destination: Any generic object.

Parameters: count The number of children (or zero, if not applicable).

height
The height of each child.
width
The width of the composite.

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 8 Visual Refreshing | Next: 10 Activation Messages