The Text Objects: 5.3 Using VisText: VisText VM File Storage

Up: GEOS SDK TechDocs | Up | Prev: 5.2 VisText States | Next: 5.4 Text Filters
VTI_vmFile, MSG_VIS_TEXT_SET_VM_FILE, MSG_VIS_TEXT_SAVE_TO_DB_ITEM, MSG_VIS_TEXT_SAVE_TO_DB_ITEM_WITH_STYLES, MSG_VIS_TEXT_LOAD_FROM_DB_ITEM, MSG_VIS_TEXT_LOAD_FROM_DB_ITEM_WITH_STYLES

VTI_ vmFile stores the VM file handle that is associated with this text object. This file is the default VM file that will be used for operations that require a storage area. You can set this file handle with MSG_VIS_TEXT_SET_VM_FILE.

To save a text object's current text (including attributes) you can send the text object MSG_VIS_TEXT_SAVE_TO_DB_ITEM. This message takes several VisTextSaveDBFlags which specify what aspects of the text to save to the DB item. These flags are listed below:

VTSDBF_TEXT
VTSDBF_CHAR_ATTR
VTSDBF_PARA_ATTR
VTSDBF_TYPE
VTSDBF_GRAPHIC
VTSDBF_STYLE
VTSDBF_REGION
VTSDBF_NAME

To retrieve text saved to a DB item in such a manner, use MSG_VIS_TEXT_LOAD_FROM_DB_ITEM. The text object is able to figure out what features of the text were saved and bring it up with any attributes that were saved previously.

MSG_VIS_TEXT_SET_VM_FILE

void	MSG_VIS_TEXT_SET_VM_FILE(
        VMFileHandle		file);

This message sets the text object's VTI_ vmFile instance field to the passed VM file handle. This file handle will be used as the default for operations that require a VM file.

Source: Unrestricted.

Destination: Any text object.

Parameters: file VM file handle.

Interception: Generally not intercepted.

MSG_VIS_TEXT_SAVE_TO_DB_ITEM

DBGroupAndItem MSG_VIS_TEXT_SAVE_TO_DB_ITEM(
        DBGroupAndItem		item,
        VisTextSaveDBFlags		flags);

This message saves information about the current state of the text object. Data saved with this message can be retrieved with MSG_VIS_TEXT_LOAD_FROM_DB_ITEM.

Source: Unrestricted.

Destination: Any text object.

Parameters: item DB group and item to store the text information. If this is left zero, the info will be saved to the VM file specified in VTI_ vmFile .

flags
VisTextSaveDBFlags specifying what aspect of the text's info to save.

Return: DBItem of saved text info.

Interception: Generally not intercepted.

MSG_VIS_TEXT_SAVE_TO_DB_ITEM_WITH_STYLES

DBGroupAndItem MSG_VIS_TEXT_SAVE_TO_DB_ITEM_WITH_STYLES(
        FileHandle		xferFile,
        VisTextSaveDBFlags		flags,
        DBGroupAndItem		item,
        StyleSheetParams		*params);

This message saves information about the current state of the text object, passing a StyleSheetParams structure.

VTST_RUNS_ONLY should be passed in the VisTextSaveDBFlags entries VTSDBF_CHAR_ATTR and VTSDBF_PARA_ATTR. Do not set VTSDBF_STYLE.

Source: Unrestricted.

Destination: Any text object.

Parameters: xferFile If non-zero, the StyleSheetParams structure is not initialized and this is the file to put the style sheet arrays into.

flags
VisTextSaveDBFlags specifying what aspect of the text's info to save.
item
DB group and item to store the text information. If this is left zero, the info will be saved to the VM file specified in VTI_ vmFile .
* params
Pointer to a StyleSheetParams structure.

Interception: Generally not intercepted.

MSG_VIS_TEXT_LOAD_FROM_DB_ITEM

void	MSG_VIS_TEXT_LOAD_FROM_DB_ITEM(
        DBGroupAndItem		item,
        VMFileHandle		file);

This message loads text saved with MSG_VIS_TEXT_SAVE_TO_DB_ITEM.

Source: Unrestricted.

Destination: Any text object.

Parameters: item DBItem to load.

file
Handle of the VM file to use. If zero, the VM file in VTI_ vmFile will be used.

Interception: Generally not intercepted.

MSG_VIS_TEXT_LOAD_FROM_DB_ITEM_WITH_STYLES

void	MSG_VIS_TEXT_LOAD_FROM_DB_ITEM_WITH_STYLES(
        FileHandle		file,
        DBGroupAndItem		item,
        StyleSheetParams		*params);

This message loads text and style sheets saved with MSG_VIS_TEXT_SAVE_TO_DB_ITEM_WITH_STYLES.

Source: Unrestricted.

Destination: Any text object.

Parameters: file Handle of the VM file to use. If zero, the VM file in VTI_ vmFile will be used.

item
DBItem to load.
* params
Pointer to a StyleSheetParams structure.

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 5.2 VisText States | Next: 5.4 Text Filters