Maptitude GISDK Help

Saving and Loading Windows

You can use GISDK functions to save the contents of a window to a file, or to reopen a file, recreate the window, and set the window options. Other functions tell you whether there have been any changes to a map, editor, figure, or layout, or whether or not the window has been previously saved to a file. Here is a summary of these functions:

 

Map Function

What it does

GetMapFile()

Gets the name of the file in which a map was last saved

GetMapSaveFlag()

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

GetMapTitle()

Gets the title of a map

OpenMap()

Opens a map file and displays it in a map window

OpenMapFromAnnotation()

Creates a new map window from a map that appears in a layout

SaveLegendToImage()

Saves a legend in a separate window to an image file

SaveMap()

Saves settings for a map window to a file on disk

SaveMapToImage()

Saves the contents of the map window to an image file

SaveMapToMetafile()

Saves map graphics to a Windows Enhanced metafile

SetMapFile()

Sets the filename for a map

SetMapSaveFlag()

Sets the flag that indicates whether a map has changed since it was last saved to a file

SetMapTitle()

Sets the title of a map

 

Editor Function

What it does

GetEditorFile()

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

GetEditorSaveFlag()

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

OpenEditor()

Creates an editor from a file

OpenEditorFromAnnotation()

Creates a new editor window from an editor that appears in a layout

SaveEditor()

Saves an editor to a file

SaveEditorToImage()

Saves the contents of the editor window to an image file

 

Figure Function

What it does

GetFigureFile()

Gets the name of the file in which a figure was last saved

GetFigureSaveFlag()

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

GetFigureType()

Gets the type of a figure window.

OpenFigure()

Creates a figure from a file

OpenFigureFromAnnotation()

Creates a new figure window from a figure that appears in a layout

SaveFigure()

Saves a figure to a file

SaveFigureToImage()

Saves the contents of the figure window to an image file

SaveFigureToMetafile()

Saves figure graphics to a Windows Enhanced metafile

 

Layout Function

What it does

GetLayoutFile()

Gets the name of the file in which a layout was last saved

GetLayoutSaveFlag()

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

OpenLayout()

Creates a layout from a file

SaveLayout()

Saves a layout to a file

SaveLayoutToImage()

Saves the contents of the layout window to an image file

SaveLayoutToMetafile()

Saves layout graphics to a Windows Enhanced metafile

 

Workspace Function

What it does

OpenWorkspace()

Restores a workspace from its file

SaveWorkspace()

Saves the current workspace to a file

 

Here is a sample macro that runs when a map window is closed. It checks to see if the map has changed, then saves it automatically.

 

Macro "close macro for a map"

     // Has the map changed in any way?

     if GetMapSaveFlag() then do

          // Get the name of the map file, if there is one

          fnm = GetMapFile()

 

          // Save the map under its existing name...

          if fnm <> null then

               SaveMap(, fnm)

 

          // Or, ask the user for a new name and save the file under that name

          else do

               // If the user cancels, don't try to save and don't close...

               on escape do Return(1) end

               fnm = ChooseFileName({{"Map File", "*.map"}}, "Save Map As", )

 

               // Save under the new name

               SaveMap(, fnm)

               end

          end

 

     // Finally, allow the map window to close

     Return(null)

EndMacro

 

The following functions have been superceded by the SaveMapToImage(), SaveEditorToImage(), SaveFigureToImage(), and SaveLayoutToImage() functions, but are still available for backward compatibility:

 

Function

What it does

SaveEditorToBitmap()

Saves the editor image as a Windows bitmap file

SaveEditorToJPEG()

Save the editor image as a JPEG compressed file

SaveFigureToBitmap()

Saves the figure image as a Windows bitmap file

SaveFigureToJPEG()

Save the figure image as a JPEG compressed file

SaveLayoutToBitmap()

Saves the layout image as a Windows bitmap file

SaveLayoutToJPEG()

Save the layout image as a JPEG compressed file

SaveMapToBitmap()

Saves the map image as a Windows bitmap file

SaveMapToJPEG()

Save the map image as a JPEG compressed file

 

In addition, SaveLayoutToPNG() was deleted; use SaveLayoutToImage() instead.

 

 

©2025 Caliper Corporation www.caliper.com