Purpose
Re-parents a MapInfo Pro document window (for example, so that a Map window becomes a child window of a Visual Basic application). You can issue this statement from the MapBasic window in MapInfo Pro.
Syntax
Set Next Document
{ Parent HWND | Style style_flag | Parent HWND Style style_flag }
HWND is an integer window handle, identifying a parent window.
style_flag is an integer code (see table below), indicating the window style.
Description
This statement is used in Integrated Mapping applications. For an introduction to Integrated Mapping, see the MapBasic User Guide.
To re-parent a MapInfo Pro window, issue a Set Next Document statement, and then issue one of these window-creation statements: Map statement, Browse statement, Layout statement, or Create Legend statement.
Include the Parent clause to identify an existing window, which will become the parent of the MapInfo Pro window you are about to create. Include the Style clause to specify a window style. If you are creating a document window, such as a Map window, include both clauses.
The style_flag argument must be one of the codes from the following table; codes are defined in MAPBASIC.DEF.
style_flag code | ID | Effect on the next document window: |
---|---|---|
WIN_STYLE_STANDARD | 0 | This code resets the style flag to its default value. If you issue a Set Next Document Style 1 statement, but then you change your mind and do not want to use the child window style, issue a Set Next Document Style 0 statement to reset the style. |
WIN_STYLE_CHILD | 1 | Next window is created as a child window. |
WIN_STYLE_POPUP_FULLCAPTION | 2 | Next window is created as a popup window, but with a full-height title bar caption. |
WIN_STYLE_POPUP | 3 | Next window is created as a popup window with a half-height title bar caption. |
The parent and style settings remain in effect until you create a new window. The new window adopts the parent and style settings you specified; then MapInfo Pro reverts to its default parent and style settings for any subsequent windows. To re-parent more than one window, issue a separate Set Next Document statement for each window you will create.
This statement re-parents document windows. To re-parent dialog box windows, use the Set Application Window statement. To re-parent special windows such as the Info window, use the Set Window statement.
You can now re-parent the Legend, Statistics, Info, Ruler, and Message windows using the Set Next Document statement. This restores backward compatible functionality with the 32-bit version of MapInfo Pro.
Example
The sample program LEGENDS.MB uses the following statements to create a Theme Legend window inside of a Map window.
Dim win As Integer
win = FrontWindow()
...
Set Next Document
Parent WindowInfo(win, WIN_INFO_WND)
Style 1
Create Legend From Window win
See Also:
Set Application Window statement, Set Window statement