NewPanel
int NewPanel (int parentPanelHandle, char panelTitle[], int panelTop, int panelLeft, int panelHeight, int panelWidth);
Purpose
Creates a new top-level panel or a new child panel inside a specific parent panel. This function returns a panel handle that you use to specify the new panel in subsequent function calls.
To make the panel a top-level panel, enter 0 for the parentPanelHandle parameter.
If you call this function to create a child panel, you must do so in the same thread in which you create the parent panel.
Parameters
Input | ||
Name | Type | Description |
parentPanelHandle | int | Handle of the panel into which to load the panel as a child panel. Pass 0 to load the panel as a top-level window. You can obtain this handle from functions such as LoadPanel and NewPanel. |
panelTitle | char [] | Title for the new panel. |
panelTop | int | Vertical coordinate at which to place the upper left corner of the panel,
directly below the title bar. The coordinates must be integer values from –32,768 to 32,767, or VAL_AUTO_CENTER to center the panel. For a top-level panel, (0,0) is the upper-left corner of the screen. For a child panel, (0,0) is the upper-left corner of the parent panel, directly below the title bar, before the parent panel is scrolled. |
panelLeft | int | Horizontal coordinate at which to place the upper left corner of the panel,
directly below the title bar. The coordinates must be integer values from –32,768 to 32,767, or VAL_AUTO_CENTER to center the panel. For a top-level panel, (0,0) is the upper-left corner of the screen. For a child panel, (0,0) is the upper-left corner of the parent panel, directly below the title bar, before the parent panel is scrolled. |
panelHeight | int | Vertical size of the new panel. The height of the panel does not include the title bar or panel frame. panelHeight can be any integer value from 0 to 32,767. |
panelWidth | int | Horizontal size of the new panel in window coordinates. The width of the panel does not include the panel frame. panelWidth can be any integer value from 0 to 32,767. |
Return Value
Name | Type | Description |
panelHandle | int | Value you can use in subsequent function calls to specify this panel. Negative values indicate that an error occurred. Zero is not a valid panel handle. |
Additional Information
Library: User Interface Library
Include file: userint.h
LabWindows/CVI compatibility: LabWindows/CVI 3.0 and later
Example
Refer to userint\buildui.cws for an example of using the NewPanel function.