GEOS SDK TechDocs
|
|
3.1 The GVI_attrs Attribute
|
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
):
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.
GVI_docBounds
settings). By default, there are no restrictions on the size of the view.
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
.
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.
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.
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).
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.
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
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
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);
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.
GEOS SDK TechDocs
|
|
3.1 The GVI_attrs Attribute
|
3.3 Setting the Background Color