Cicode Programming Reference > Cicode Function Categories > Window Functions Introduction > WinNewAt

WinNewAt

Opens a new display window at a specified location, with a selected page displayed. The window can later be destroyed with the WinFree() function.

You can also specify if the displayed page operates within the context of a particular cluster in a multiple cluster project. When the page is displayed during runtime, the ClusterName argument is used to resolve any tags that have a cluster omitted.

Note: This function is not supported in the server process in a multiprocessor environment. Calling this function from the server process results in a hardware alarm being raised.

Syntax

WinNewAt(Page, X, Y, Mode, ClusterName)

Page:

The name or page number of the page to display (in quotation marks ""). Can be prefixed by the name of a host cluster, that is "ClusterName.Page". This will take precedence over the use of the ClusterName parameter if the two differ.

X:

The x pixel coordinate of the top left corner of the window.

Y:

The y pixel coordinate of the top left corner of the window.

Mode:

The mode of the window:

0 - Normal page.

1 - Page child window. The window is closed when a new page is displayed, for example, when the PageDisplay() or PageGoto() function is called. The parent is the current active window.

2 - Window child window. The window is closed automatically when the parent window is freed with the WinFree() function. The parent is the current active window.

4 - No re-size. The window is displayed with thin borders and no maximize/minimize icons. The window cannot be re-sized.

8 - No icons. The window is displayed with thin borders and no maximize/minimize or system menu icons. The window cannot be re-sized.

16 - No caption. The window is displayed with thin borders, no caption, and no maximize/minimize or system menu icons. The window cannot be re-sized.

32 - Echo enabled. When enabled, keyboard echo, prompts, and error messages are displayed on the parent window. This mode should only be used with child windows (for example, Mode 1 and 2).

64 - Always on top.

128 - Open a unique window. This mode helps to prevent this window from being opened more then once.

256 - Display the entire window. This mode commands that no parts of the window will appear off the screen

512 - Open a unique Super Genie. This mode helps to prevent a Super Genie from being opened more than once (at the same time). However, the same Super Genie with different associations can be opened.

1024 - Disables dynamic resizing of the new window, overriding the setting of the [Page]DynamicSizing parameter.

4096 - Allows the window to be resized without maintaining the current aspect ratio. The aspect ratio defines the relationship between the width and the height of the window, which means this setting allows you to stretch or compress the window to any proportions. This option overrides the setting of the [Page]MaintainAspectRatio parameter.

8192 - Text on a page will be resized in proportion with the maximum scale change for a resized window. For example, consider a page that is resized to three times the original width, and half the original height. If this mode is set, the font size of the text on the page will be tripled (in proportion with the maximum scale). This option overrides the setting of the [Page] ScaleTextToMax parameter.

16384 - Hide the horizontal scroll bar.

32768 - Hide the vertical scroll bar.

65536 - Disable horizontal scrolling.

131072 - Disable vertical scrolling.

You can select multiple modes by adding modes together (for example, set Mode to 9 to open a page child window without maximize, minimize, or system menu icons).

ClusterName:

The name of the cluster that will accommodate the page at runtime. This is optional if you have one cluster or are resolving the page via the current cluster context. The argument is enclosed in quotation marks "". If the Page parameter is prefixed with the name of a cluster, this parameter will not be used.

Return Value

The window number of the window, or -1 if the window cannot be opened. Be aware that this is not the same as the window handle returned from the WndFind() function.

Related Functions

WinFree, WinNew

Example

Buttons

Text

Mimic Page

Command

WinNewAt("Mimic", 100, 20, 0)

Comment

Display the mimic page in a new window at coordinate 100, 20.

Buttons

Text

Pop Page

Command

WinNewAt("Popup", 100, 200, 2)

Comment

Display the popup page in a child window at coordinate 100, 200

Buttons

Text

Pop Page

Command

WinNewAt("Popup", 100, 200, 4)

Comment

Display the popup page in a new window with no maximize and minimize icons

System Keyboard

Key Sequence

Pop ######## Enter

Command

WinNewAt(Arg1, 100, 200, 2)

Comment

Display a specified popup page in a child window at coordinate 100, 200

System Keyboard

Key Sequence

Pop ######## Enter

Command

WinNewAt(Arg1, 100, 200, 4)

Comment

Display a specified popup page in a new window with no maximize and minimize icons

See Also

Window Functions