To create more useful Smart Text, a new MapBasic function, LayoutItemWinID has been Introduced. This function makes it easier to create text that displays information about other frames, like map frames.
Returns a MapInfo Pro window identifier associated with the frame named 'frame_name' with type 'frame_type'. In a multi-page layout, this function searches all pages starting with the current page. You can call this function from the MapBasic window in MapInfo Pro.
SyntaxLayoutItemWinID(window_id, frame, frame_type)
- window_id is an integer window identifier for a Layout window.
- frame can be a string or number representing the name of the frame. Use empty double-qoutes ("") for unnamed frames. Value can also be a number representing the nth from of the specified type.
- frame_type is SmallInt representing the type of layout frame to search for. Use one of the LAYOUT_ITEM_INFO_TYPE values below. The frame type can only be a map, browser, or legend frame.
Frame Type | ID | Frame Description |
---|---|---|
LAYOUT_ITEM_TYPE_MAPPER | 1 | A map frame. |
LAYOUT_ITEM_TYPE_BROWSER | 2 | A browser frame. |
LAYOUT_ITEM_TYPE_LEGEND | 3 | A legend frame. |
Returns the window ID for the layout item (frame) as an integer.
DescriptionReturns the window ID for the layout item (frame) as an integer. For legend frames. Returns the window ID for the parent Legend window. This value can be used in Legend MapBasic statements such as Alter Designer Frame or functions such as LegendFrameInfo(). If the item is not found, MapBasic error 1068 is set and 0 is returned. The function does not apply to the classic Layout window.
The window_id parameter specifies which window to query. To obtain a window identifier, call the FrontWindow() function immediately after opening a Layout window, or call the WindowID() function at any time after the window's creation.
In a multi-page layout, this function first searches the current page. If the frame is not found, it continues searching forward over subsequent pages, then wraps to the beginning page searching up until the current page.
MapBasic error 1068 = "A frame with the name 'frame_name' and type 'frame_type'
could not be found."