Set Cartographic Legend statement - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Sets redraw functionality on or off, refreshes, sets the orientation to portrait or landscape, selects small or large sample legend sizes, or changes the frame order of an existing cartographic legend created with the Create Cartographic Legend statement. (To change the size, position, or title of the Legend window, use the Set Window statement.) You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Set Cartographic Legend 
	[ Window legend_window_id ]
	Redraw { On | Off }

or

Set Cartographic Legend 
	[ Window legend_window_id ]
	[ Refresh ]
	[ Portrait [ Columns number_of_columns ] |
		Landscape [ Lines number_of_lines ] ]
	[ Align ]
	[ Style Size { Small | Large } ] 
	[ Frame Order { frame_id, frame_id, frame_id, ... } ]

legend_window_id is an integer window identifier that you can obtain by calling the FrontWindow() function and the WindowID() function.

frame_id is the ID of the frame on the legend. You cannot use a layer name. For example, three frames on a legend would have the successive IDs 1, 2, and 3.

number_of_columns specifies the width of the legend.

number_of_lines specifies the height of the legend.

Description

The Set Cartographic Legend statement allows you to set redraw functionality on or off, refresh, set the orientation to portrait or landscape, select small or large sample legend sizes, or change the frame order of an existing cartographic legend created with the Create Cartographic Legend statement.

If a Window clause is not specified MapInfo Pro will use the topmost legend window.

Other clauses to are not allowed if Redraw is used.

The Refresh keyword causes the Legend window to refresh. Tables for refreshable frames will be re-scanned for styles. The Portrait or Landscape keywords cause frames in the Legend window to be laid out in the appropriate order.

Align causes styles and text across all frames, regardless of whether the Legend window is in portrait, landscape, or custom layout, to be re-aligned.

The Frame Order clause reorders the frames in the legend.

Example

If you used the Create Cartographic Legend statement to select large sample legend sizes, the following example will refresh the foreground legend window to show large legend sizes:

Set Cartographic Legend Window WindowID(0) Refresh Portrait Align Style 
Size Large

See Also:

Add Cartographic Frame statement, Alter Cartographic Frame statement, Create Cartographic Legend statement, Remove Cartographic Frame statement