GenView: 3.2 Basic View Attributes: Dimensional Attributes

Up: GEOS SDK TechDocs | Up | Prev: 3.1 The GVI_attrs Attribute | Next: 3.3 Setting the Background Color
GVI_horizAttrs, GVI_vertAttrs, MSG_GEN_VIEW_GET_DIMENSION_ATTRS, MSG_GEN_VIEW_SET_DIMENSION_ATTRS

Together, the GVI_horizAttrs and GVI_vertAttrs fields are called the "dimension attributes." They determine the characteristics of the view in each dimension--whether it is scrollable or splittable, whether a scrollbar should be displayed, and whether certain rules should be applied to sizing and scaling.

These attributes, once set, are not frequently changed during execution. Both of these attributes are bitfield records. Each has the same set of possible flags, and these flags are listed below (they are bits in the record GenViewDimensionAttrs ):

GVDA_SCROLLABLE
Set if view is scrollable in the given dimension.
GVDA_SPLITTABLE
Set if the view is splittable in the given dimension. This is not currently implemented but is planned.
GVDA_TAIL_ORIENTED
Set if the document prefers to be displayed at its end. This flag will cause the view to stay at the bottom of the document when the document's length or size is changed--if scrolling to the middle or top, however, the tail orientation will be ignored. Currently, tail orientation is not implemented across threads but may be approximated with track scrolling.
GVDA_DONT_DISPLAY_SCROLLBAR
Set if the scroller for the given dimension should not be displayed even if the dimension is scrollable.
GVDA_NO_LARGER_THAN_CONTENT
Set if the view should never get larger than the content's maximum size in the given dimension (based on the current GVI_docBounds settings). By default, there are no restrictions on the size of the view--it is generally dictated by the view's parent window unless a size hint is applied to the view.
GVDA_NO_SMALLER_THAN_CONTENT
Set if the view should always stay large enough to show the entire content in the given dimension (based on the current GVI_docBounds settings). By default, there are no restrictions on the size of the view.
GVDA_SIZE_A_MULTIPLE_OF_INCREMENT
Set if the view size should always be rounded down to a multiple of the GVI_increment value in the given dimension. If greater control over the sizing behavior is required, a subclass of GenViewClass should be used with an altered handler of MSG_GEN_VIEW_CALC_WIN_SIZE .
GVDA_KEEP_ASPECT_RATIO
Set if the aspect ratio implied by the view's initial length and width should be maintained. If set in GVI_horizAttrs , the view will calculate the width according to the height. If set in GVI_vertAttrs , the view will calculate the height according to the width. This flag is normally used in conjunction with HINT_INITIAL_SIZE . It is an error to set this flag in both dimensions.

If your application must retrieve or set these attributes during execution, it may do so with the messages MSG_GEN_VIEW_GET_DIMENSION_ATTRS and MSG_GEN_VIEW_SET_DIMENSION_ATTRS . Also, to combine and separate the attribute fields, you can use the three macros also shown below.

MAKE_SET_CLEAR_ATTRS

word	MAKE_SET_CLEAR_ATTRS(setAttrs, clearAttrs);
        byte	setAttrs, clearAttrs;

This macro takes two byte values and combines them into a one-word argument. It is used with MSG_GEN_VIEW_SET_DIMENSION_ATTRS , below.

MAKE_HORIZ_ATTRS

byte	MAKE_HORIZ_ATTRS(val);
        word	val;

This macro takes a word-sized value and returns the high byte only (used with MSG_GEN_VIEW_GET_DIMENSION_ATTRS , below, to retrieve the GVI_horizAttrs flag from the returned value).

MAKE_VERT_ATTRS

byte	MAKE_VERT_ATTRS(val);
        word	val;

This macro takes a word and returns the low byte only. It should be used with MSG_GEN_VIEW_GET_DIMENSION_ATTRS , below, to extract the GVI_vertAttrs flag from the returned value.

MSG_GEN_VIEW_SET_DIMENSION_ATTRS

void	MSG_GEN_VIEW_SET_DIMENSION_ATTRS(
        word	horizAttrsToSetClear,
        word	vertAttrsToSetClear,
        VisUpdateMode updateMode);

This message changes the GVI_horizAttrs and GVI_vertAttrs records of the view.

Source: Unrestricted.

Destination: Any GenView object.

Parameters: horizAttrsToSetClear
A word consisting of two records of GenViewDimensionAttrs flags. The high byte represents the flags to be cleared, and the low byte represents the flags to be set; these flags pertain to the GVI_horizAttrs field.

vertAttrsToSetClear
A word consisting of two records of GenViewDimensionAttrs flags. The high byte represents the flags to be cleared, and the low byte represents the flags to be set; these flags pertain to the GVI_vertAttrs field.
updateMode
A VisUpdateMode type.

Interception: Nothing.

Warnings: Generally not intercepted.

Tips: The macro MAKE_SET_CLEAR_ATTRS is defined above and combines two byte-sized records into one word-sized record for the Goc preprocessor. Its use is shown in the example below.

@call MyView::MSG_GEN_VIEW_SET_DIMENSION_ATTRS(
	MAKE_SET_CLEAR_ATTRS(horizSet, horizClear),
	MAKE_SET_CLEAR_ATTRS(vertSet, vertClear),
	VUM_NOW);

MSG_GEN_VIEW_GET_DIMENSION_ATTRS

word	MSG_GEN_VIEW_GET_DIMENSION_ATTRS();

This message returns the GenView's current dimension attribute records.

Source: Unrestricted.

Destination: Any GenView object.

Parameters: None.

Return: A word consisting of two GenViewDimensionAttrs records. Retrieve the horizontal attributes ( GVI_horizAttrs ) with the macro MAKE_HORIZ_ATTRS and the vertical attributes ( GVI_vertAttrs ) with the macro MAKE_VERT_ATTRS.

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 3.1 The GVI_attrs Attribute | Next: 3.3 Setting the Background Color