OpenEditor()

Summary

Creates an editor from a file.

Syntax

editor_name = OpenEditor(string filename, array options)

Argument Contents
filename The path and file name from which the editor contents are loaded
Option Type Contents
Activate Macro String The name of a macro that is called whenever the window is activated
Close Macro String The name of a macro that is called when the user closes the window from the system menu
Done Macro String The name of a macro that is called after the window is closed
Font String The font in which data are displayed
Force Directory Boolean If "True" open referenced datafiles in the editor file's directory, if they exist, regardless of whether the files exist in their original locations; default is "False"
Grid Boolean Whether the editor displays a grid between cells
Highlight Macro String The name of a macro that is called whenever the user changes cells that are highlighted in the editor (by clicking on a cell or dragging over a range of cells)
Locked Boolean If "True" the Close option does not appear in the system menu; if "False" the Close option does appear
Menu String The menu that is associated with the window
Position 2 integers The screen location of the window (x, y)
Read Only Boolean Whether the data are read-only
Row Labels String Number of columns (fields) that should be locked in place at the left edge of the editor window. This option must be specified as a string (e.g., "2")
Show Sets Boolean Whether the editor includes columns that indicate which records belong to selection sets
Size 2 integers The screen size of the window (x, y)
Title String The title of the window
Toolbar String The toolbar that is associated with the window

Returns

A string indicating the actual name of the editor window.

Notes

  • OpenEditor() opens files created by SaveEditor().

  • The position and size of the window are expressed as percentages of the Maptitude frame.

  • The attached menu and toolbar are automatically displayed whenever the editor is activated.

  • If the Grid option is omitted, the editor displays a grid if it was displaying a grid when it was saved.

  • If the Title option is omitted, the editor displays the title it had when saved.

  • If the menu, toolbar, activate macro, close macro, or highlight macro is not specified, OpenEditor() uses the default specified with SetDefaults(). If an editor specific default was not specified with SetDefaults() then OpenEditor() uses the generic default.

Example

folder = RunMacro("G30 Tutorial Folder")
OpenEditor(folder + "calculat.dvw", {
{"Position", 0, 0},
{"Size", 50, 100},
{"Read Only", "True"}})

See Also

Function Summary
CreateEditor() Creates a new editor window
SaveEditor() Saves an editor to a file
CloseEditor() Closes an editor window
SetDefaults() Sets default menus, toolbars, and macros.