GEOS SDK TechDocs
|
|
6 Using GenText
|
6.2 GenText Basics
The GenText object has several instance fields which affect the visual presentation of text. These are listed in GenText Instance Data .
Code Display 10-21 GenText Instance Data
@instance ChunkHandle GTXI_text; @instance word GTXI_maxLength = 32767; @instance GenTextAttrs GTXI_attrs = GTA_USE_TAB_FOR_NAVIGATION; @instance GenTextStateFlags GTXI_stateFlags = 0; @instance optr GTXI_destination; @instance word GTXI_applyMsg = 0;
/* GenTextAttrs */
typedef ByteFlags GenTextAttrs; #define GTA_SINGLE_LINE_TEXT 0x80 #define GTA_USE_TAB_FOR_NAVIGATION 0x40 #define GTA_INIT_SCROLLING 0x20 #define GTA_NO_WORD_WRAPPING 0x10 #define GTA_ALLOW_TEXT_OFF_END 0x08 #define GTA_TAIL_ORIENTED 0x04 #define GTA_DONT_SCROLL_TO_CHANGES 0X02
/* GenTextStateFlags */
typedef ByteFlags GenTextStateFlags #define GTSF_INDETERMINATE 0x80 #define GTSF_MODIFIED 0x40
GTXI_
text
stores the ChunkHandle of the chunk containing the GenText's text. This chunk will be stored in the same resource as the text object. You may alter the text within this chunk with any of the previously mentioned
VisTextClass
messages. See The Text
for a full discussion of how to manipulate and alter text.
GTXI_
maxLength
specifies the maximum number of character positions allowed within the GenText. By default, up to 32767 characters may appear within a GenText. If you set GTXI_
maxLength
to a lower number, any characters beyond the maximum length will be ignored.
GTXI_
attrs
specifies the
GenTextAttrs
to set for the GenText object. These attributes affect the presentation of the text.
GTXI_stateFlags
specifies the
GenTextStateFlags
to use with this text object. These state flags affect the modified and indeterminate states of the object.
GTXI_
applyMsg
sets the message for this object to send out whenever activated. In most cases, your handler for this message may then retrieve the text and perform whatever required operations on that text.
GTXI_
destination
sets the object or process to handle apply messages sent out by this object.
Code Display 10-22 GenText VarData Instance Fields
@vardata Message ATTR_GEN_TEXT_STATUS_MSG; @vardata void ATTR_GEN_TEXT_SET_MODIFIED_ON_REDUNDANT_SELECTION; @vardata void ATTR_GEN_TEXT_SELECTABLE; @vardata VisTextDefaultCharAttr ATTR_GEN_TEXT_DEFAULT_CHAR_ATTR; @vardata VisTextDefaultParaAttr ATTR_GEN_TEXT_DEFAULT_PARA_ATTR; @vardata ChunkHandle ATTR_GEN_TEXT_CHAR_ATTR; @vardata ChunkHandle ATTR_GEN_TEXT_MULTIPLE_CHAR_ATTR_RUNS; @vardata ChunkHandle ATTR_GEN_TEXT_PARA_ATTR; @vardata ChunkHandle ATTR_GEN_TEXT_MULTIPLE_PARA_ATTR_RUNS;
@vardata word ATTR_GEN_TEXT_EXTENDED_FILTER;
@vardata word ATTR_GEN_TEXT_TYPE_RUNS; @vardata word ATTR_GEN_TEXT_GRAPHIC_RUNS; @vardata word ATTR_GEN_TEXT_REGION_ARRAY; @vardata word ATTR_GEN_TEXT_STYLE_ARRAY; @vardata word ATTR_GEN_TEXT_NAME_ARRAY;
@vardata optr ATTR_GEN_TEXT_RUNS_ITEM_GROUP;
@reloc ATTR_GEN_TEXT_RUNS_ITEM_GROUP;
@vardata void ATTR_GEN_TEXT_DO_NOT_INTERACT_WITH_SEARCH_CONTROL; @vardata optr ATTR_GEN_TEXT_SET_OBJECT_ENABLED_WHEN_TEXT_EXISTS; @vardata void ATTR_GEN_TEXT_LEGAL_DOS_PATH; @vardata void ATTR_GEN_TEXT_DATE; @vardata void ATTR_GEN_TEXT_TIME; @vardata void ATTR_GEN_TEXT_MAKE_UPPERCASE; @vardata void ATTR_GEN_TEXT_ALLOW_COLUMN_BREAKS; @vardata void ATTR_GEN_TEXT_UPPERCASE_ALPHA; @vardata void ATTR_GEN_TEXT_UPPERCASE_ALPHA_NUMERIC; @vardata void ATTR_GEN_TEXT_DASHED_ALPHA_NUMERIC; @vardata void ATTR_GEN_TEXT_NORMAL_ASCII; @vardata void ATTR_GEN_TEXT_LEGAL_DOS_VOLUME_NAMES; @vardata void ATTR_GEN_TEXT_DOS_CHARACTER_SET; @vardata void ATTR_GEN_TEXT_NO_SPACES; @vardata void ATTR_GEN_TEXT_ALLOW_SPACES; @vardata void ATTR_GEN_TEXT_ALPHA; @vardata void ATTR_GEN_TEXT_NUMERIC; @vardata void ATTR_GEN_TEXT_SIGNED_NUMERIC; @vardata void ATTR_GEN_TEXT_SIGNED_DECIMAL; @vardata void ATTR_GEN_TEXT_FLOAT_DECIMAL; @vardata void ATTR_GEN_TEXT_ALPHA_NUMERIC; @vardata void ATTR_GEN_TEXT_LEGAL_FILENAMES; @vardata void ATTR_GEN_TEXT_LEGAL_DOS_FILENAMES; @vardata void ATTR_GEN_TEXT_NEVER_MAKE_SCROLLABLE; @vardata void ATTR_GEN_TEXT_DOES_NOT_ACCEPT_INK; @vardata void ATTR_GEN_TEXT_CURSOR_NO_FOCUS; @vardata ChunkHandle ATTR_GEN_TEXT_CUSTOM_FILTER;
ATTR_GEN_TEXT_STATUS_MSG sets a status message for this GenText. A status message allows the GenText to send notification other than its apply message.
ATTR_GEN_TEXT_SET_MODIFIED_ON_REDUNDANT_SELECTION
sets the text dirty (modified) on any modification, even if it does not change the text or the text's attributes.
ATTR_GEN_TEXT_SELECTABLE should be set if text should be selectable whether or not the text is editable. By default non-editable text is not selectable. Editable text is always selectable.
ATTR_GEN_TEXT_DEFAULT_CHAR_ATTR
stores singular default character attributes of type
VisTextDefaultCharAttr
in a word-length record. ATTR_GEN_TEXT_DEFAULT_PARA_ATTR
stores singular default paragraph attributes of type
VisTextDefaultParaAttr
in a word-length record.
ATTR_GEN_TEXT_CHAR_ATTR
stores the singular character attributes for the text object. This vardata field stores the ChunkHandle to a single
VisTextCharAttr
structure.
ATTR_GEN_TEXT_MULTIPLE_CHAR_ATTR_RUNS
stores the multiple character attributes for the text object. This vardata field will store the ChunkHandle to a chunk array of character style runs (each of type
VisTextCharAttr
). See Character Runs
.
ATTR_GEN_TEXT_PARA_ATTR
stores the singular paragraph attributes for the text object. This vardata field stores the ChunkHandle to a single
VisTextParaAttr
structure.
ATTR_GEN_TEXT_MULTIPLE_PARA_ATTR_RUNS
stores the multiple paragraph attributes for the text object. This vardata field will store the ChunkHandle to a chunk array of paragraph style runs (each of type
VisTextParaAttr
). See Paragraph Runs
.
ATTR_GEN_TEXT_EXTENDED_FILTER
stores the
VisTextExtendedFilterTypes
to use instead of the default
VisTextFilters
. Extended filters offer more powerful (and complex) filtering mechanisms for accepting and rejecting text into the GenText.
ATTR_GEN_TEXT_TYPE_RUNS specifies the type runs for this text object. You should not need type runs unless you need hyperlink capabilities. ATTR_GEN_TEXT_GRAPHIC_RUNS specifies a graphics run to use within the text object.
ATTR_GEN_TEXT_REGION_ARRAY specifies the array of regions defined for this text object. Text within the GenText will flow from each of the defined regions to the next region. ATTR_GEN_TEXT_STYLE_ARRAY specifies the name array of styles used in the GenText's style sheets.
ATTR_GEN_TEXT_RUNS_ITEM_GROUP
indicates that this text object is linked to an item group (list). When the user hits Return (or the equivalent), the text object sends a message to the item group; similarly, the item group will attempt to update the text object on changes.
ATTR_GEN_TEXT_DO_NOT_INTERACT_WITH_SEARCH_CONTROL
indicates that the text object should not send notification to the search control object.
ATTR_GEN_TEXT_SET_OBJECT_ENABLED_WHEN_TEXT_EXISTS
makes the specified object enabled any time the GenText object has text in it.
ATTR_GEN_TEXT_LEGAL_DOS_PATH
makes sure that only legal DOS paths are used.
ATTR_GEN_TEXT_DATE
and
ATTR_GEN_TEXT_TIME
allows short date and time characters and spaces; the text object will be affected by the localization driver.
ATTR_GEN_TEXT_MAKE_UPPERCASE indicates that in addition to any other filters, any alphabetic characters are forced into uppercase.
ATTR_GEN_TEXT_ALLOW_COLUMN_BREAKS allows all characters including column breaks. Column breaks are normally filtered out in a GenText object. The column breaks usually will appear as new lines (like carriage returns) in the text object.
ATTR_GEN_TEXT_UPPERCASE_ALPHA
allows alphabetic characters and spaces.
ATTR_GEN_TEXT_UPPERCASE_ALPHA_NUMERIC
, an allows only uppercase alphabetic characters and spaces.
ATTR_GEN_TEXT_DASHED_ALPHA_NUMERIC
allows only uppercase alphabetic characters and spaces but also allows dashes.
ATTR_GEN_TEXT_NORMAL_ASCII
allows only normal ASCII characters (no extended ASCII characters).
ATTR_GEN_TEXT_LEGAL_DOS_VOLUME_NAMES
allows only characters that may appear in a legal DOS volume name.
ATTR_GEN_TEXT_DOS_CHARACTER_SET
allows only characters in the legal DOS character set.
ATTR_GEN_TEXT_NO_SPACES
and
ATTR_GEN_TEXT_ALLOW_SPACES
govern whether spaces are allowed in the text object.
ATTR_GEN_TEXT_ALPHA
,
ATTR_GEN_TEXT_NUMERIC
,
ATTR_GEN_TEXT_SIGNED_NUMERIC
,
ATTR_GEN_TEXT_SIGNED_DECIMAL
,
ATTR_GEN_TEXT_FLOAT_DECIMAL
, and
ATTR_GEN_TEXT_ALPHA_NUMERIC
govern the character types allowed.
ATTR_GEN_TEXT_LEGAL_FILENAMES
allows any characters legal to file names.
ATTR_GEN_TEXT_NEVER_MAKE_SCROLLABLE forces the text object to expand larger as the text grows without forcing it into scrollable text.
ATTR_GEN_TEXT_DOES_NOT_ACCEPT_INK indicates that this text object will not accept ink under any circumstances.
ATTR_GEN_TEXT_CURSOR_NO_FOCUS causes the text object to have a cursor whether it has the focus or not.
ATTR_GEN_TEXT_CUSTOM_FILTER
contains the ChunkHandle of an array of
VisTextCustomFilterData
structures. Each of these structures contains a range of character
values
to filter out. These values are determined from the
Chars
enumerated type. The text object figures out the number of filters in place by getting the size of the chunk.
Code Display 10-23 GenText Hints
@vardata ColorQuad HINT_TEXT_WASH_COLOR @vardata void HINT_TEXT_WHITE_WASH_COLOR; @vardata void HINT_TEXT_AUTO_HYPHENATE; @vardata void HINT_TEXT_SELECT_TEXT; @vardata void HINT_TEXT_CURSOR_AT_START; @vardata void HINT_TEXT_CURSOR_AT_END; @vardata void HINT_TEXT_FRAME; @vardata void HINT_TEXT_NO_FRAME; @vardata void HINT_TEXT_ALLOW_UNDO; @vardata void HINT_TEXT_ALLOW_SMART_QUOTES; @vardata void HINT_TEXT_DO_NOT_MAKE_LARGER_ON_PEN_SYSTEMS;
HINT_TEXT_WASH_COLOR indicates the background color for the GenText to exhibit. This hint takes a
ColorQuad
argument.
HINT_TEXT_WHITE_WASH_COLOR indicates the background color of the GenText should be white.
GEOS SDK TechDocs
|
|
6 Using GenText
|
6.2 GenText Basics