Layout 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

Opens a new layout window. You can issue this statement from the MapBasic window in MapInfo Pro.

Syntax

Layout [ Designer ] 
	[ Position ( x, y ) [ Units paperunits ] ] 
	[ Width window_width [ Units paperunits ] ] 
	[ Height window_height [ Units paperunits ] ] 
	[ { Min | Max | Floating | Docked | Tabbed | AutoHidden } ] 

x, y specifies the position of the upper left corner of the layout, in paper units, where 0,0 represents the upper-left corner of the MapInfo Pro window. For details about paper units, see Set Paper Units statement.

paper_units is a string representing a paper unit name: cm (centimeters), mm (millimeters), in (inches), pt (points), and pica.

  • 1 inch (in) = 2.54 centimeters , 254 millimeters, 6 picas, 72 points
  • 1 point (pt) = 0.01389 inches, 0.03528 centimeters, 0.35278 millimeters, 0.08333 picas
  • 1pica = 0.16667 inches, 0.42333 centimeters, 4.23333 millimeters, 12 points
  • 1 centimeter (cm) = 0.39370 inches, 10 millimeters, 2.36220 picas, 28.34646 points
  • 1 millimeter (mm) = 0.1 centimeters, 0.03937 inches, 0.23622 picas, 2.83465 points

win_width is the desired width of the window.

win_height is the desired height of the window.

The following are docking states that are specific only to the 64-bit version of MapInfo Pro:

  • Floating docking state makes the window floating.
  • Docked docking state docks the window to the default position.
  • Tabbed docking state makes the window tabbed, in this state it is also called as a document.
  • AutoHidden docking state auto hides the window.

Description

This statement is backwards compatible with older 32-bit releases of MapInfo Pro. If you omit the Designer clause, you open an older style of the Layout window, which is only found in the 32-bit releases of MapInfo Pro. When working with the current version of MapInfo Pro (a 64-bit release), include the Designer clause to open a Layout window that has more functionality. This window is sometimes referred to as the Layout Designer window. MapInfo Pro works with negative positions and/or coordinates and converts them from older layouts to the Layout Designer window.

If the statement includes the optional Min keyword, the window is minimized before it is displayed. If the statement includes the optional Max keyword, the window appears maximized, filling all of MapInfo Pro's screen space.

The Width and Height clauses control the size of the window, not the size of the page layout itself. The page layout size is controlled by the paper size currently in use and the number of pages included in the layout.

See Set Layout statement for more information on setting the number of pages in a layout.

When working with classic Layout windows and maps created before version 12.5, then MapInfo Pro assigns a special hidden table name to each classic Layout window, but not to current Layout windows. The first open window has the table name Layout1, the next window that is opened has the table name Layout2, and so on. For background on classic Layout windows, see Working with Classic Layout Windows.

A MapBasic program can create, select, or modify objects in a classic Layout window by issuing statements which refer to these table names. For example, the following statement selects all objects from a Layout or Layout window:

Select * From Layout1

Example

The following example creates a Layout window two inches wide by four inches high, located at the upper-left corner of the MapInfo Pro workspace.

Layout Designer Position (0, 0) Width 2 Height 4 

See Also:

Open Window statement, Set Layout statement