This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::EngineWindow Class

Header: #include <UnigineWindowManager.h>

This base class is used to manage engine windows: their components, relations with other windows, size, position, and other features. The EngineWindow class doesn't provide creating of a window viewport or a window group: you can create them using constructors of the corresponding classes inherited from the EngineWindow class.

The image below demonstrates the window components that can be controlled by the EngineWindow class methods.

Window components

Here are some window examples:

A system-style window

A window (either system or engine style),
borders and title bar disabled

An engine-style window, borders disabled

An engine-style window, borders enabled

The system and engine style windows have the same component layout except the sizing border: in the engine style, it is in the visual part of the window.

To create the engine window, you should use one of the EngineWindowViewport class constructors. For example:

Source code (C++)
// create an engine window of the specified size with the specified name
EngineWindowViewportPtr window = EngineWindowViewport::create("New window", 580, 300);

Then, by using methods of the EngineWindow class, you can specify the window appearance (for example, set a title, an icon, change opacity, add borders, and so on), and properties (whether the window can be nested, or whether it can become a group), define its style (sytem or engine), change the window state (whether it is shown/hidden, minimized/maximized, focused, etc.), manage window intersections and callbacks.

Source code (C++)
// set an icon and a new title for the window 
window->setIcon(icon);
window->setTitle("Main window");

// set a window position and size
window->setPosition(Math::ivec2(60, 60));
window->setSize(Math::ivec2(580, 300));

// set window properties
window->setCanBeNested(false);
window->setCanCreateGroup(false);

// show the window
window->show();

The created window can remain a separate one, or it can be grouped with the other window(s). The window group is created and managed by means of the EngineWindowGroup class. By using methods of the Enginewindow class, you can specify whether the window can be added to the group, get the parent of the window or remove it from the group.

Source code (C++)
// separate windows
EngineWindowViewportPtr settings = EngineWindowViewport::create("Settings", 512, 256);
EngineWindowViewportPtr parameters = EngineWindowViewport::create("Parameters", 512, 256);

// grouped windows
EngineWindowGroupPtr settings_and_parameters = WindowManager::stackWindows(settings, parameters, EngineWindowGroup::GROUP_TYPE_TAB);

To render the engine window, use the show() function.

Notice
For more information on working with window groups, check the article on WindowManagerclass.

See Also#

EngineWindow Class

Enums

HITTEST#

NameDescription
HITTEST_INVALID = -1The hittest result is invalid.
HITTEST_NORMAL = 0Client area of the window.
HITTEST_DRAGGABLE = 1Area of the window, by clicking onto which the window can be moved.
HITTEST_RESIZE_TOPLEFT = 2Area of the window that can be dragged to resize the window to the top and/or left direction.
HITTEST_RESIZE_TOP = 3Area of the window that can be dragged to resize the window to the top direction.
HITTEST_RESIZE_TOPRIGHT = 4Area of the window that can be dragged to resize the window to the top and/or right direction.
HITTEST_RESIZE_RIGHT = 5Area of the window that can be dragged to resize the window to the right direction.
HITTEST_RESIZE_BOTTOMRIGHT = 6Area of the window that can be dragged to resize the window to the bottom and/or right direction.
HITTEST_RESIZE_BOTTOM = 7Area of the window that can be dragged to resize the window to the bottom direction.
HITTEST_RESIZE_BOTTOMLEFT = 8Area of the window that can be dragged to resize the window to the bottom and/or left direction.
HITTEST_RESIZE_LEFT = 9Area of the window that can be dragged to resize the window to the left direction.

CALLBACK_INDEX#

NameDescription
CALLBACK_WINDOW_EVENT = 0Callback on the window event.
CALLBACK_FUNC_UPDATE = 1Callback after the window update.
CALLBACK_FUNC_BEGIN_RENDER = 2Callback after the window rendering has begun.
CALLBACK_FUNC_RENDER = 3Callback after the window rendering function.
CALLBACK_FUNC_BEGIN_RENDER_GUI = 4Callback after the GUI rendering has begun.
CALLBACK_FUNC_END_RENDER_GUI = 5Callback after the GUI rendering has ended.
CALLBACK_FUNC_END_RENDER = 6Callback after the window rendering has ended.
CALLBACK_FUNC_SWAP = 7Callback before calling the window swap.
CALLBACK_MOVED = 8Window is moved.
CALLBACK_RESIZED = 9Window is resized.
CALLBACK_FOCUSED = 10Window gains the focus.
CALLBACK_UNFOCUSED = 11Window loses the focus.
CALLBACK_MOUSE_ENTER = 12Mouse enters the window area.
CALLBACK_MOUSE_LEAVE = 13Mouse leaves the window area.
CALLBACK_SHOWN = 14Window is shown.
CALLBACK_HIDDEN = 15Window is hidden.
CALLBACK_MINIMIZED = 16Window is minimized.
CALLBACK_MAXIMIZED = 17Window is maximized.
CALLBACK_RESTORED = 18Window is restored.
CALLBACK_CLOSE = 19Window is closed.
CALLBACK_ITEM_DROP = 20Item is dropped to the window.
CALLBACK_UNSTACK_MOVE = 21Window is unstacked and moved.
CALLBACK_STACK = 22Window is stacked.
CALLBACK_UNSTACK = 23Window is unstacked.
NUM_CALLBACKS = 24Callback counter.

FLAGS#

NameDescription
FLAGS_SHOWN = 1 << 0Window is rendered.
FLAGS_FIXED_SIZE = 1 << 1Window size is fixed.
FLAGS_HOLD_ENGINE = 1 << 2Engine can't stop operating while this window is open.
FLAGS_MAIN = 1 << 3Main window.
FLAGS_CONSOLE_USAGE = 1 << 4Usage of the console for the window is enabled.
FLAGS_PROFILER_USAGE = 1 << 5Usage of the profiler for the window is enabled.
FLAGS_VISUALIZER_USAGE = 1 << 6Usage of the visualizer for the window is enabled.

AREA#

NameDescription
AREA_NONE = 0None of the areas of the window split into 9 parts is selected.
AREA_TOP_LEFT = 1Top left area of the window split into 9 parts.
AREA_TOP_CENTER = 2Top center area of the window split into 9 parts.
AREA_TOP_RIGHT = 3Top right area of the window split into 9 parts.
AREA_CENTER_LEFT = 4Center left area of the window split into 9 parts.
AREA_CENTER_CENTER = 5Center area of the window split into 9 parts.
AREA_CENTER_RIGHT = 6Center right area of the window split into 9 parts.
AREA_BOTTOM_LEFT = 7Bottom left area of the window split into 9 parts.
AREA_BOTTOM_CENTER = 8Bottom center area of the window split into 9 parts.
AREA_BOTTOM_RIGHT = 9Bottom right area of the window split into 9 parts.

TYPE#

NameDescription
ENGINE_WINDOW = 0Engine window.
ENGINE_WINDOW_VIEWPORT = 1Engine viewport window.
ENGINE_WINDOW_GROUP = 2Engine window group.
NUM_ENGINE_WINDOWS = 3Total number of engine windows.

Members


Ptr<Gui> getGui ( ) const#

Returns the parent Gui for a window. If the window is nested, this Gui differs from SelfGui.

Return value

Gui instance.

Ptr<Gui> getSelfGui ( ) const#

Returns Gui instance for a window. This Gui remains unchanged during the whole lifecycle of the window.

Return value

Gui instance.

int getDisplayIndex ( ) const#

Returns the number of the display, on which the window is currently displayed. For separate windows, this index is requested from the system proxy; for nested windows, the index is provided based on the location of the client center point.

Return value

The number of the display, on which the window is currently displayed.

bool isNested ( ) const#

Returns a value indicating if the object is a nested window or group of windows.

Return value

true for a nested window or group of windows, otherwise false.

bool isSeparate ( ) const#

Returns a value indicating if the object is a separate window or group of windows.

Return value

true for a separate window or group of windows, otherwise false.

void setPosition ( const Math::ivec2 & position ) #

Sets the position of the top left corner of the window in the screen coordinates. In case of several displays, the position is relative to the main display.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const Math::ivec2 & position - The window screen position (coordinates of the top left corner).

Math::ivec2 getPosition ( ) const#

Returns the position of the top left corner of the window in the screen coordinates. In case of several displays, the position is relative to the main display.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

The window screen position (coordinates of the top left corner).

void setClientPosition ( const Math::ivec2 & position ) #

Sets the position of the top left corner of the client (the window content area without the top bar and borders) in the screen coordinates. In case of several displays, the position is relative to the main display.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const Math::ivec2 & position - The screen position of the client (coordinates of the top left corner).

Math::ivec2 getClientPosition ( ) const#

Returns the position of the top left corner of the client (the window content area without the top bar and borders) in the screen coordinates. In case of several displays, the position is relative to the main display. For a nested window, the window position is returned.

Return value

The screen position of the client (coordinates of the top left corner).

Math::ivec2 getClientLocalPosition ( ) const#

Returns the position of the top left corner of the client (the window content area without the top bar and borders) relative to the window position.

Return value

The screen position of the client (coordinates of the top left corner) relative to the window position.

void moveToCenter ( ) #

Positions the window so that the client center coincides with the center of the current display.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

void setSize ( const Math::ivec2 & size ) #

Sets the engine window size (i.e. including the sizing border).
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const Math::ivec2 & size - The engine window size.

Math::ivec2 getSize ( ) const#

Returns the engine window size (i.e. including the sizing border).
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

The engine window size.

Math::ivec2 getClientSize ( ) const#

Returns the size of the window client (content) area.

Return value

The size of the client area.

void setMinSize ( const Math::ivec2 & size ) #

Sets the minimum possible window size when resizing the window. If the value is more than the current maximum size, use the setMinAndMaxSize() method, to change both values at once. Otherwise the value will be clamped to the current maximum size.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const Math::ivec2 & size - The minimum possible size of the window.

Math::ivec2 getMinSize ( ) const#

Returns the minimum possible window size when resizing the window.
Notice
This method should be applied to a separate or parent window, for a nested window it will return zero values.

Return value

The minimum possible size of the window.

void setMaxSize ( const Math::ivec2 & size ) #

Sets the maximum possible window size when resizing the window. If the value is less than the current minimum size, use the setMinAndMaxSize() method, to change both values at once. Otherwise the value will be clamped to the current minimum size.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const Math::ivec2 & size - The maximum possible size of the window.

Math::ivec2 getMaxSize ( ) const#

Returns the maximum possible window size when resizing the window.
Notice
This method should be applied to a separate or parent window, for a nested window it will return (1000000, 1000000).

Return value

The maximum possible size of the window.

void setMinAndMaxSize ( const Math::ivec2 & min_size, const Math::ivec2 & max_size ) #

Sets the minimum and maximum possible window size when resizing the window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const Math::ivec2 & min_size - The minimum possible size of the window.
  • const Math::ivec2 & max_size - The maximum possible size of the window.

void setTitle ( const char * title ) #

Sets the text of the title for the window. For a separate window, the title is set via system proxy in the title bar only; for a nested window, it is also set in the tab of the parent group.

Arguments

  • const char * title - The title of the window.

const char * getTitle ( ) const#

Returns the text of the title for the window. For a separate window, the icon is set via system proxy in the title bar only; for a nested window, it is also set in the tab of the parent group.

Return value

The title for the engine window.

int setIcon ( const Ptr<Image> & image ) #

Sets the icon for the window.

Arguments

  • const Ptr<Image> & image - The icon for the window.

Return value

1 if the specified icon is successfully set for the window, otherwise 0.

Ptr<Image> getIcon ( ) const#

Returns the icon for the engine window.

Return value

The icon for the window.1 if the icon for the window is returned successfully, otherwise 0.

void setOpacity ( float opacity ) #

Sets the opacity for the window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • float opacity - Opacity for the window.

float getOpacity ( ) const#

Returns the current opacity for the window.
Notice
This method should be applied to a separate or parent window, for a nested window it will always return 1.0f.

Return value

The opacity for the window.

void setBordersEnabled ( bool enabled ) #

Enables and disables the borders for the window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • bool enabled - true to enable the borders for the window, otherwise false.

bool isBordersEnabled ( ) const#

Returns the value indicating if the borders are enabled for the window.
Notice
This method should be applied to a separate or parent window, for a nested window it will return false.

Return value

true if the borders are enabled for the window, otherwise false.

void setBorderSize ( int size ) #

Sets the engine window border size.
Notice
  • This value is applied to the windows in the engine style only. For system-style windows system settings are applied.
  • This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • int size - The engine window border size.

int getBorderSize ( ) const#

Returns the engine window border size.
Notice
  • This value is applied to the windows in the engine style only. For system-style windows system settings are applied.
  • This method should be applied to a separate or parent window, for a nested window it will return 0.

Return value

The engine window border size.

void setResizable ( bool resizable ) #

Enables and disables the possibility to resize the engine window by the mouse.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • bool resizable - true to make the engine window resizable by the mouse, otherwise false.

bool isResizable ( ) const#

Returns the value indicating if the engine window is resizable by the mouse.
Notice
This method should be applied to a separate or parent window, for a nested window it will return false.

Return value

true if the engine window is resizable by the mouse, otherwise false.

void show ( ) #

Enables rendering of the engine window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

bool isShown ( ) const#

Returns a value indicating if a widget is rendered.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

true if the engine window is rendered, otherwise false.

void hide ( ) #

Disables rendering of the engine window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

bool isHidden ( ) const#

Returns a value indicating if a widget is hidden.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

true if the engine window isn't rendered, otherwise false.

void setFocus ( ) #

Sets the focus to the window.

bool isFocused ( ) const#

Returns the value indicating if the window is currently in focus. For a separate or parent window, the returned value coinsides with the value returned by isSystemFocused().

Return value

true if the engine window is in focus, otherwise false.

void setSystemFocus ( ) #

Sets the focus to the engine window.
Notice
This method is applied to a separate or parent window, for nested windows use setFocus().

bool isSystemFocused ( ) const#

Returns the value indicating if the engine window is currently in focus.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

true if the engine window is in focus, otherwise false.

void minimize ( ) #

Minimizes the engine window to an iconic representation.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

bool isMinimized ( ) const#

Returns the value indicating if the engine window is minimized to tray.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

true if the engine window is minimized, otherwise false.

void maximize ( ) #

Makes the engine window as large as possible.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

bool isMaximized ( ) const#

Returns the value indicating if the engine window is maximized.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

true if the engine window is maximized, otherwise false.

void restore ( ) #

Restores the size and position of the minimized or maximized engine window via the system proxy.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

EngineWindow::HITTEST getHitTestResult ( const Math::ivec2 & global_pos ) #

Returns a value indicating in which area of the engine window the mouse is located.
Notice
This method is used for interaction with system windows only, i.e. it cannot be used for nested windows.

Arguments

  • const Math::ivec2 & global_pos - Global coordinates of the hit-test point.

Return value

Value indicating the window area, one of the HITTEST_* values.

const char * getHitTestResultName ( EngineWindow::HITTEST hit_test ) const#

Returns the string representation of the hit test result value.

Arguments

Return value

The string representation of the hit test result value (e.g., HITTEST_RESIZE_RIGHT is RESIZE RIGHT).

int getOrder ( ) const#

Returns the order of the window. This value allows comparing which window is closer to the viewer (a relatively smaller value).
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

The order of the window.

void toTop ( ) #

Makes the window appear on top of all other windows.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

void setAlwaysOnTop ( bool top ) #

Sets the window to always be rendered above the other windows.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • bool top - true to render the window always on top; otherwise, false.

bool isAlwaysOnTop ( ) const#

Returns the value indicating if the window is always rendered above the other windows.
Notice
This method should be applied to a separate or parent window, for a nested window it will return the value of the global parent group.

Return value

true if the window is always on top; otherwise, false.

Ptr<EngineWindowGroup> getParentGroup ( ) const#

Returns the group into which the current window is nested, or nullptr if it is a separate window.

Return value

The group into which the current window is nested, or nullptr if it is a separate window.

Ptr<EngineWindowGroup> getGlobalParentGroup ( ) const#

Returns the top group of the hierarchy into which the current window is nested, or nullptr if it is a separate window.

Return value

The top group of the hierarchy into which the current window is nested, or nullptr if it is a separate window.

bool isGlobalChildOf ( const Ptr<EngineWindowGroup> & group ) #

Returns the value specifying if the current window is a part of a hierarchy of the specified window.

Arguments

Return value

true if the current window is globally a child of the specified one, otherwise false.

void updateGuiHierarchy ( ) #

Updates the hierarchy for all widgets — the widgets are arranged, expanded to the required sizes and then their positions are updated. Updating the hierarchy may be required, for example, for getting the screen position immediately after the widget has been added to the hierarchy. For a separate window, the hierarchy in self gui is updated; for a nested window, the hierarchy in self gui of the global parent group is updated.

int getNumDroppedItems ( ) const#

Returns the total number of files and/or folders dropped to the window.

Return value

The number of dropped files and/or folders.

const char * getDroppedItem ( int index ) const#

Returns the absolute path to the file or folder dropped to the window.

Arguments

  • int index - Index of the dropped file or folder.

Return value

Absolute path to the dropped file or folder.

unsigned long long getID ( ) const#

Returns the ID of the engine window, which is unchanged during the whole lifecycle of the window.

Return value

ID of the engine window, if the window is external.

void screenshot ( const char * path ) #

Creates a screenshot after the rendering stage is completed.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • const char * path - Path to save the screenshot.

void setHoldEngine ( bool engine ) #

Sets the value indicating if the engine can stop operating (quit automatically) while this window is open.

Arguments

  • bool engine - true if the engine can't stop operating while this window is open, otherwise false.

bool isHoldEngine ( ) const#

Sets the value indicating if the engine can stop operating (quit automatically) while this window is open.

Return value

true if the engine can't stop operating while this window is open, otherwise false.

void setIgnoreSystemClose ( bool close ) #

Sets the value indicating if this window can be closed using the OS methods (ALT+F4 or cross in the top-right corner of the window).

Arguments

  • bool close - If true, the window can't be closed using the OS methods.

bool isIgnoreSystemClose ( ) const#

Returns the value indicating if this window can be closed using the OS methods (ALT+F4 or cross in the top-right corner of the window).

Return value

If true, the window can't be closed using the OS methods.

void setModal ( const Ptr<EngineWindow> & parent_window ) #

Sets the current window modal to the specified parent window. Both the parent and the child windows must be separate. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, a nested window can't be a parent for a modal window.

Arguments

  • const Ptr<EngineWindow> & parent_window - Parent window.

bool isModal ( ) const#

Checks if the window is modal. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, for a nested window it will return false.

Return value

true if the window is modal; otherwise, false.

bool isModalParent ( ) const#

Checks if this window is parent for any modal window. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, for a nested window it will return false.

Return value

true if the window is parent for any modal window; otherwise, false.

Ptr<EngineWindow> getModalParent ( ) const#

Returns the modal parent of the window. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, for a nested window it will return nullptr.

Return value

The modal parent of the window.

void addModalWindow ( const Ptr<EngineWindow> & window ) #

Adds the argument window as modal to the current window. Both the parent and the child windows must be separate. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, a nested window can't be a parent for a modal window.

Arguments

  • const Ptr<EngineWindow> & window - Window to be added as modal.

void removeModalWindow ( const Ptr<EngineWindow> & window ) #

Removes the argument modal window from this window. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, a nested window can't be a parent for a modal window.

Arguments

  • const Ptr<EngineWindow> & window - Engine window.

int getNumModalWindows ( ) const#

Returns the total number of modal windows for this window. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, for a nested window it will return 0.

Return value

The total number of modal windows.

Ptr<EngineWindow> getModalWindow ( int index ) const#

Returns the modal window for this window by its index. The concept of modal assumes that if a window has modal children, it cannot be closed. Any other interaction with a parent window is possible.
Notice
This method should be applied to a separate or parent window, for a nested window it will return nullptr.

Arguments

  • int index - Index of the modal window.

Return value

Modal window.

void unstack ( ) #

Removes the current window from a parent group.

EngineWindow::TYPE getType ( ) const#

Returns the type of the engine window.

Return value

The type of the engine window.

const char * getTypeName ( ) const#

Returns the name of the engine window type as a string.

Return value

The string representation of the engine window type.

void setTitleBarEnabled ( bool enabled ) #

Enables and disables the title bar for the window.
Notice
  • This value is applied to the windows in the engine style only. For system-style windows system settings are applied.
  • This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • bool enabled - true to enable the title bar for the engine window, otherwise false.

bool isTitleBarEnabled ( ) const#

Returns the value indicating if the title bar is enabled for the window.
Notice
  • This value is applied to the windows in the engine style only. For system-style windows system settings are applied.
  • This method should be applied to a separate or parent window, for a nested window it will return false.

Return value

true if the title bar is enabled for the engine window, otherwise false.

void setTitleBarHeight ( int height ) #

Sets the height of the window title bar.
Notice
  • This value is applied to the windows in the engine style only. For system-style windows system settings are applied.
  • This method can be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • int height - The engine window title bar height.

int getTitleBarHeight ( ) const#

Returns the height of the window title bar.
Notice
  • This value is applied to the windows in the engine style only. For system-style windows system settings are applied.
  • This method should be applied to a separate or parent window, for a nested window it will return 0.

Return value

The engine window title bar height.

void setSystemStyle ( bool style ) #

Sets the system style for the engine window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • bool style - true to set the default system style for the engine window, false to set the engine-style window.

bool isSystemStyle ( ) const#

Returns the value indicating if the default system style is set for the engine window.
Notice
This method should be applied to a separate or parent window, for a nested window it will return false.

Return value

true if the default system style is set for the engine window; false if the engine style is set for the window.

void setEngineStyle ( bool style ) #

Sets the engine style for the engine window.
Notice
This method should be applied to a separate or parent window, using this method for a nested window is not allowed.

Arguments

  • bool style - true to set the engine style for the engine window, false to set the default system style.

bool isEngineStyle ( ) const#

Returns the value indicating if the engine style is set for the engine window.
Notice
This method should be applied to a separate or parent window, for a nested window it will return true.

Return value

true if the engine style is set for the engine window; false if the default system style is set for the window.

void setSizingBorderSize ( int size ) #

Sets the size of the border in the widget that is manipulated to resize the window.
Notice
  • This method should not be applied to a system-style window with enabled borders, as the system settings cannot be changed.
  • This method should not be applied to nested windows.

Arguments

  • int size - The size of the border that is manipulated to resize the window, in pixels.

int getSizingBorderSize ( ) const#

Returns the size of the border in the widget that is manipulated to resize the window.
Notice
  • This method should be applied to an engine-style window, for an unmodified system-style window (i.e. with the enabled border size), the system value is applied.
  • This method should be applied to a separate or parent window, for a nested window it will return 0.

Return value

The size of the border in the widget that is manipulated to resize the window, in pixels.

void close ( ) #

Deletes the window if this window is not a modal parent or a member of a fixed group. If a window is a member of a fixed group, it cannot be closed (i.e. deleted).

void setCanBeNested ( bool nested ) #

Sets the value indicating if the engine window can be used as a nested window.

Arguments

  • bool nested - true to enable usage of the engine window as a nested window, otherwise false.

bool isCanBeNested ( ) const#

Returns the value indicating if the engine window can be used as a nested window.

Return value

true if usage of the engine window as a nested window is enabled, otherwise false.

void setCanCreateGroup ( bool group ) #

Sets the value indicating if the engine window can become a group.

Arguments

  • bool group - true to enable usage of the engine window as a group, otherwise false.

bool isCanCreateGroup ( ) const#

Returns the value indicating if the engine window can become a group.

Return value

true if usage of the engine window as a group is enabled, otherwise false.

bool isHiddenByTab ( ) const#

Returns the value indicating if the window is overlapped by any other tab (either by switching to another tab or resizing this window to have zero client area).

Return value

true if the window is overlapped by any other tab, otherwise false.

bool getIntersection ( const Math::ivec2 & global_mouse_pos ) const#

Returns the value indicating if the mouse is hovering over the window.

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.

Return value

true if the mouse hovers over the current window, otherwise false.

bool getClientIntersection ( const Math::ivec2 & global_mouse_pos ) const#

Returns the value indicating if the mouse is hovering over the client area of the window.
Source code (C++)
//checks if the mouse is hovering over the main window
WindowManager::getMainWindow()->getClientIntersection(Input::getMousePosition());

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.

Return value

true if the mouse hovers over the client area of the window, otherwise false.

EngineWindow::AREA getClient9Area ( const Math::ivec2 & global_mouse_pos ) const#

Returns the area over which the mouse hovers, one of the nine areas into which the window is segmented.

Arguments

  • const Math::ivec2 & global_mouse_pos - Global screen coordinates of the mouse relative to the main display.

Return value

One of the nine segments the screen area is split into.

const char * get9AreaName ( EngineWindow::AREA area ) const#

Returns the name of the screen segment as a string.

Arguments

Return value

The string representation of the segment value (e.g., AREA_TOP_LEFT is TOP LEFT).

Math::ivec2 globalToLocalUnitPosition ( const Math::ivec2 & global_pos ) const#

Transforms the global screen coordinates in pixels into units relative to the window client area.

Arguments

  • const Math::ivec2 & global_pos - The position in global coordinates.

Return value

The coordinates in units relative to the window client area.

Math::ivec2 localUnitToGlobalPosition ( const Math::ivec2 & unit_pos ) const#

Transforms the position in units relative to the window client area into the global screen coordinates in pixels.

Arguments

  • const Math::ivec2 & unit_pos - The coordinates in units relative to the window client area.

Return value

The position in global coordinates.

Math::ivec2 getRenderSize ( ) const#

Returns the engine window frame size in pixels.

Return value

The engine window frame size in pixels.

Math::ivec2 getClientRenderSize ( ) const#

Returns the client area size in pixels.

Return value

The client area size in pixels.

Math::ivec2 getMinRenderSize ( ) const#

Returns the minimum window size in pixels.

Return value

The minimum window size in pixels.

Math::ivec2 getMaxRenderSize ( ) const#

Returns the maximum window size in pixels.

Return value

The maximum window size in pixels.

int getDpi ( ) const#

Returns the current DPI level for the window.

Return value

The current DPI level for the window.

float getDpiScale ( ) const#

Returns the current DPI scale applied to the elements inside the window.

Return value

The current DPI scale applied to the elements inside the window.

int toRenderSize ( int unit_size ) #

Transforms the unit value to the pixel value.

Arguments

  • int unit_size - Size in units.

Return value

Size in pixels.

int toUnitSize ( int render_size ) #

Transforms the pixel value to the unit value.

Arguments

  • int render_size - Size in pixels.

Return value

Size in units.

Math::ivec2 toRenderSize ( const Math::ivec2 & unit_size ) #

Transforms the unit value to the pixel value.

Arguments

  • const Math::ivec2 & unit_size - Size in units.

Return value

Size in pixels.

Math::ivec2 toUnitSize ( const Math::ivec2 & render_size ) #

Transforms the pixel value to the unit value.

Arguments

  • const Math::ivec2 & render_size - Size in pixels.

Return value

Size in units.
Last update: 2023-07-06
Build: ()