WindowManager Class
Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
The class to manage windows enabling you to access any window of the appllication, group or stack windows, create various dialogs and so on.
Accessing Windows#
Grouping Windows#
The engine windows created via the EngineWindow class can be grouped. There are three types of the window groups:
- Vertical
- Horizontal
- Group of tabs
Creating Dialog Windows#
WindowManager Class
Members
EngineWindow getMainWindow ( ) #
Returns the window that is set as the main window by default.
Notice
There may be several windows that are set as main, or no main windows at all.
Return value
The engine window.int getNumWindows ( ) #
Returns the number of windows.Return value
The number of windows.EngineWindow getWindow ( int index ) #
Returns the window by its index.Arguments
- int index - Index of the window.
Return value
Engine window.int getWindowIndex ( EngineWindow window ) #
Returns the index of the specified window.Arguments
- EngineWindow window - Engine window.
Return value
Index of the window.EngineWindow stack ( EngineWindow first, EngineWindow second, int index = -1, int group_type = Enum.EngineWindow.GROUP_TYPE.TAB, int decompose_second = false ) #
Arguments
- EngineWindow first - The first window or group for merging.
- EngineWindow second - The second window for merging.
- int index - A place where a window or a group should be placed in a group.
- int group_type - Type of a group to be created, if the first argument is a window and not a group.
- int decompose_second - Flag to decompose the second argument of the merge, if it is a group, and combine with the first window or a group.
Return value
Group of windows.EngineWindow stackToParentGroup ( EngineWindow destination, EngineWindow window, int index = -1, int decompose_second = false ) #
Arguments
- EngineWindow destination - The window into the parent group of which the other window is stacked.
- EngineWindow window - The window to be stacked.
- int index - A place where a window or a group should be placed in a group.
- int decompose_second - Flag to decompose the second argument of the merge, if it is a group, and combine with the first window or a group.
Return value
Group of windows.EngineWindow stackWindows ( EngineWindow first, EngineWindow second, int group_type = Enum.EngineWindow.GROUP_TYPE.TAB ) #
Arguments
- EngineWindow first - The window to be stacked.
- EngineWindow second - The window to be stacked.
- int group_type - Type of a group to be created.
Return value
Group of windows.EngineWindow stackGroups ( EngineWindow first, EngineWindow second, int group_type = Enum.EngineWindow.GROUP_TYPE.TAB, int decompose_second = false ) #
Arguments
- EngineWindow first - The first window group for merging.
- EngineWindow second - The second window group for merging.
- int group_type - Type of a group to be created.
- int decompose_second - Flag to decompose the second argument of the merge, if it is a group, and combine with the first group.
Return value
Group of windows.EngineWindow stackToWindow ( EngineWindow destination_window, EngineWindow window, int group_type = Enum.EngineWindow.GROUP_TYPE.TAB, int decompose_second = false ) #
Arguments
- EngineWindow destination_window - The parent window to which another window is stacked.
- EngineWindow window - The window to be stacked.
- int group_type - Type of a group to be created.
- int decompose_second - Flag to decompose the second argument of the merge, if it is a group, and combine with the first group.
Return value
Group of stacked windows.EngineWindow stackToGroup ( EngineWindow destination_group, EngineWindow group, int index = -1, int decompose_second = false ) #
Arguments
- EngineWindow destination_group - The parent group to which another group is stacked.
- EngineWindow group - The window or window group to be stacked.
- int index - A place where a window or a group should be placed in a group.
- int decompose_second - Flag to decompose the second argument of the merge and combine with the first group.
Return value
Group of stacked windows.void unstack ( EngineWindow unstacked ) #
Removes a window or a group from a parent group. If there is only one window left, the group is automatically deleted after removing the window from it.Arguments
- EngineWindow unstacked - A window or a group to be removed from a parent group.
int isMultipleWindowsSupported ( ) #
Returns the value indicating if the engine can create more than one window. In addition to the settings defined by the user, it is currently impossible to create more than one window using Vulkan and DirectX 12. GL and DirectX 11, however, allow creating multiple windows.Return value
1 if multiple windows are supported, otherwise 0.int isFullscreenMode ( ) #
Returns the value indicating if at least one engine window is in a fullscreen state.Return value
1 if the window is the fullscreen state, 0 if it's in the window mode.EngineWindow getFullscreenWindow ( ) #
Returns the first window that is in the fullscreen state.Return value
The window in the fullscreen state, or null if no window is found.EngineWindow getGuiFocusedWindow ( ) #
Returns the window the content (internal widget) of which is clicked. The window itself doesn't have any nested windows.Return value
The window the GUI of which is in focus, or null if no window is found.EngineWindow getWindowByID ( long win_id ) #
Returns the window by its ID.Arguments
- long win_id - Window ID.
Return value
Window with the specified ID, or null if the window is not found.int dialogMessage ( string title, string message ) #
Displays a message dialog with the specified title and text.Arguments
- string title - Title of the message dialog to be displayed.
- string message - Message text to be displayed.
Return value
1 if the message is displayed successfully; otherwise, 0.int dialogWarning ( string title, string warning ) #
Displays a warning dialog with the specified title and text.Arguments
- string title - Title of the warning dialog to be displayed.
- string warning - Warning message text to be displayed.
Return value
1 if the message is displayed successfully; otherwise, 0.int dialogError ( string title, string error ) #
Displays an error dialog with the specified title and text.Arguments
- string title - Title of the error dialog to be displayed.
- string error - Error message text to be displayed.
Return value
1 if the message is displayed successfully; otherwise, 0.int showSystemDialog ( SystemDialog dialog ) #
Displays a custom system dialog with an arbitrary set of buttons.Arguments
- SystemDialog dialog - SystemDialog class instance representing the custom system dialog to be shown.
Return value
Number of the dialog button clicked by the user; or -1 if an error has occurred.string dialogOpenFolder ( string path ) #
Opens a common dialog enabling the user to specify a folder to open. When the dialog opens the specified default path shall be set displaying the corresponding elements.Arguments
- string path - Path to be set by default when the dialog opens.
Return value
Resulting folder name specified by the user.string dialogOpenFolder ( ) #
Opens a common dialog enabling the user to specify a folder to open.Return value
Resulting folder name specified by the user.string dialogOpenFile ( string path, string filter ) #
Opens a common dialog enabling the user to specify a filename to open a file. When the dialog opens the specified default path and file filter shall be set displaying the corresponding elements.Arguments
- string path - Path to be set by default when the dialog opens.
- string filter - File name filter string to be set by default when the dialog opens. This filter string determines file type choices to be displayed in the Files of type box.
Return value
Resulting filename specified by the user.string dialogOpenFile ( string path ) #
Opens a common dialog enabling the user to specify a filename to open a file. When the dialog opens the specified default path shall be set displaying the corresponding elements.Arguments
- string path - Path to be set by default when the dialog opens.
Return value
Resulting filename specified by the user.string dialogOpenFile ( ) #
Opens a common dialog enabling the user to specify a filename to open a file.Return value
Resulting filename specified by the user.string dialogSaveFile ( string path, string filter ) #
Opens a common dialog enabling the user to specify a filename to save a file as. When the dialog opens the specified default path and file filter shall be set displaying the corresponding elements.Arguments
- string path - Path to be set by default when the dialog opens.
- string filter - File name filter string to be set by default when the dialog opens. This filter string determines file type choices to be displayed in the Save as file type or Files of type box.
Return value
Resulting filename specified by the user.string dialogSaveFile ( string path ) #
Opens a common dialog enabling the user to specify a filename to save a file as. When the dialog opens the specified default path shall be set displaying the corresponding elements.Arguments
- string path - Path to be set by default when the dialog opens.
Return value
Resulting filename specified by the user.string dialogSaveFile ( ) #
Opens a common dialog enabling the user to specify a filename to save a file as.Return value
Resulting filename specified by the user.EngineWindow getUnderCursorWindow ( ) #
Returns the window which is currently under cursor.Return value
The window which is currently under cursor.EngineWindow getFocusedWindow ( ) #
Returns the window which is currently in focus.Return value
The window which is currently in focus.void forceUpdateWindowOrders ( ) #
Updates the Z order of all windows.Notice
It is recommended to use this method only when required, because it is very slow.
void setEventsFilter ( IntPtr func ) #
Sets a callback function to be executed on receiving input events. This input event filter enables you to reject certain input events for the Engine and get necessary information on all input events.Arguments
- IntPtr func - Input event callback.
Last update:
2022-12-14
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)