Maptitude GISDK Help |
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 |
Closes an editor window |
|
Creates a new editor window |
|
Creates an editor displaying the results of an SQL query |
|
Creates an editor from a file |
|
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 |
Gets a list of the columns displayed in an editor |
|
Gets the name of the file in which an editor window was last saved |
|
Gets the highlighted range of cells from an editor window |
|
Gets the value of an option from an editor window |
|
Determines whether an editor has changed since it was last saved to a file |
|
Gets the name of the view and selection set that are displayed in an editor |
|
Gets the number of records in a view or selection set |
|
Gets the order of rows in an editor |
|
Sets the columns displayed in an editor |
|
Sets the highlighted cell in an editor window |
|
Sets an option for an editor window |
|
Sets an option for an editor window |
|
Changes the view and selection set displayed in an editor |
|
Sets the order in which rows appear in an editor |
|
Prints all or part of an editor window |
|
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 |
Returns a list of fields that support aggregation rules |
|
Returns a list of fields that can have a description string |
|
Returns the view, field name, and field spec for a field |
|
Returns the number of displayed decimal places for a real-typed field |
|
Gets the description of a field |
|
Returns the format string used to display a numeric field |
|
Returns a full field spec for a field name |
|
Returns the data type, display width, decimals, and index flag for a field |
|
Gets a string that indicates whether a field is read-only |
|
Gets the display width of a field |
|
Gets a list of the fields in a view |
|
Reports whether a view is read-only |
|
Renames a field in a view |
|
Changes the number of displayed decimals for a real-typed field |
|
Changes the way a numeric field is formatted |
|
Changes the read-only status of a field |
|
Changes the display width of a field |
|
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 |