Maptitude GISDK Help

Editors

The dataviews you use in Maptitude combine two separate GISDK concepts: views and editors. As described earlier, views are handles to virtual tables, and editors are the windows on the screen in which views are displayed. When you open a dBASE file in Maptitude, the table is opened to create a view, and an editor is created to display the contents of the view.

 

Any number of editors can display data from a single view, so information from a single dBASE file can be shown in two or more editor windows.

 

The following GISDK functions are used to manage editor windows:

 

GISDK Function

Summary

CloseEditor()

Closes an editor window

CreateEditor()

Creates a new editor window

CreateEditorByQuery()

Creates an editor displaying the results of an SQL query

OpenEditor()

Creates an editor from a file

SaveEditor()

Saves an editor to a file

 

When an editor is saved to a file, the data themselves are not saved; only the editor settings and information necessary to recreate the view and the window display (the names of the source tables, the characteristics of any joins, the font and other cosmetic settings, etc.) are saved.

 

An editor window provides a way for you to let users display and update values in the view and its underlying tables and map layers. When you create or open an editor window, all of the standard keyboard and mouse navigation controls are available, along with the usual data editing capabilities. You can restrict editing of data in an editor by changing the read-only status of the entire view or of individual fields in the view.

 

Maptitude provides an enormous amount of control over the way data are displayed in an editor. Some of these controls operate on the view, while others operate on editors that display the view. For example, the order of rows and columns is an editor setting. This means that you can display two editors on the same view, with the rows and columns appearing in a different order. On the other hand, the field name is a view setting. When you change the name that is used to identify a field, it affects all editors that contain the field.

 

Here is a summary listing of GISDK functions that control the appearance and operation of editor windows:

 

GISDK Function

Summary

GetColumnArray()

Gets a list of the columns displayed in an editor

GetEditorFile()

Gets the name of the file in which an editor window was last saved

GetEditorHighlight()

Gets the highlighted range of cells from an editor window

GetEditorOption()

Gets the value of an option from an editor window

GetEditorSaveFlag()

Determines whether an editor has changed since it was last saved to a file

GetEditorView()

Gets the name of the view and selection set that are displayed in an editor

GetRecordCount()

Gets the number of records in a view or selection set

GetRowOrder()

Gets the order of rows in an editor

SetColumnArray()

Sets the columns displayed in an editor

SetEditorHighlight()

Sets the highlighted cell in an editor window

SetEditorOption()

Sets an option for an editor window

SetEditorOptionEx()

Sets an option for an editor window

SetEditorView()

Changes the view and selection set displayed in an editor

SetRowOrder()

Sets the order in which rows appear in an editor

PrintEditor()

Prints all or part of an editor window

RedrawEditor()

Redraws an editor window

 

Here is a summary listing of view GISDK functions that affect the way a view appears in an editor:

 

GISDK Function

Summary

FieldsSupportAggregations()

Returns a list of fields that support aggregation rules

FieldsSupportDescriptions()

Returns a list of fields that can have a description string

GetField()

Returns the view, field name, and field spec for a field

GetFieldDecimals()

Returns the number of displayed decimal places for a real-typed field

GetFieldDescription()

Gets the description of a field

GetFieldFormat()

Returns the format string used to display a numeric field

GetFieldFullSpec()

Returns a full field spec for a field name

GetFieldInfo()

Returns the data type, display width, decimals, and index flag for a field

GetFieldProtection()

Gets a string that indicates whether a field is read-only

GetFieldWidth()

Gets the display width of a field

GetFields()

Gets a list of the fields in a view

GetViewReadOnly()

Reports whether a view is read-only

RenameField()

Renames a field in a view

SetFieldDecimals()

Changes the number of displayed decimals for a real-typed field

SetFieldFormat()

Changes the way a numeric field is formatted

SetFieldProtection()

Changes the read-only status of a field

SetFieldWidth()

Changes the display width of a field

SetViewReadOnly()

Changes the read-only status of a view

 

Here is some sample code for creating an editor. This editor shows a joined view linking the States layer to a dBASE file named Sales. The view is marked as read-only so it cannot be edited, and various other GISDK functions are used to control the appearance of the data.

 

// Load the States layer into the system

state_vw = AddLayerToWorkspace("States", "h:\\cdf\\states.cdf", "States")

 

// Load the Sales table into the system

sales_vw = OpenTable("Sales", "DBASE", "c:\\dbffiles\\sales.dbf", )

 

// Join the views together; make the joined view read-only

joined_vw = JoinViews("State Sales Data", state_vw + ".Abbrev", sales_vw + ".StateCode", )

SetViewReadOnly(joined_vw, "True")

 

// Display the result in an editor

editor_name = CreateEditor("State Sales Data", joined_vw + "|", )

 

// Now, choose the fields we want to see, and reorder the records by

// decreasing sales

SetColumnArray(editor_name, {"Abbrev", "TOTSALES95", "TOTSALE94"})

SetRowOrder(editor_name, {{"TOTSALES95", "Descending"}})

 

// Turn on the grid, and change the font...

SetEditorOption(editor_name, "Grid", "On")

SetEditorOption(editor_name, "Font", "Times New Roman|Bold|Italic|24")

 

// Change sales data to be formatted as currency

SetFieldFormat(joined_vw + ".TOTSALES95", "$,########.00")

SetFieldFormat(joined_vw + ".TOTSALES94", "$,########.00")

 

// Change the field names to be more presentable

RenameField(joined_vw + ".TOTSALES95", "1995 Total Sales")

RenameField(joined_vw + ".TOTSALES94", "1994 Total Sales")

 

 

©2025 Caliper Corporation www.caliper.com