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
VR Development
Double Precision Coordinates
API
Animations-Related Classes
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
VR-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::EngineWindow Class

Header: #include <UnigineWindowManager.h>

This base class operates with engine windows: their components, relations with other windows, size, position, visual representation and other features.

When you create a window viewport or a window group, the engine window is created.

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

Window components

To create the engine window, use one of the EngineWindowViewportor EngineWindowGroupclass 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 (system or engine), change the window state (whether it is shown/hidden, minimized/maximized, focused, etc.), manage window intersections and events.

Setting Up Position and Size#

In UNIGINE, the window size and position coordinates are measured in both units and pixels:

  • The size and position in units don't depend on the DPI scale and always remain the same. You can change the window and client area size via setSize and setClientSize , adjust the minimum and maximum size and set the window and client position via the corresponding methods. All of them work with units.
  • The size and position in pixels are calculated by multiplying the size in units by the current DPI scale. You can get it using one of the RenderSize-related methods/properties (e.g., getRenderSize , and so on). When the DPI scale is 100%, 1 unit corresponds to 1 pixel.

    Notice
    DPI scaling is applied only when the auto_dpi_scalingflag is enabled. You can check the current flag value via the console or by using WindowManager::isAutoDpiScaling .
    To determine how the OS handles the DPI scale, specify the DPI awareness mode.

You should consider this information when resizing textures, calculating mouse intersections, etc. The window size and position should be set individually, depending on the situation.

Notice
If necessary, you can convert the size and position coordinates from units to pixels and visa versa:

In the following example, the positions of the window and client area (in units) change to the mouse cursor when you press the P or C respectively:

Source code (C++)
#include <UnigineEngine.h>
#include <UnigineLogic.h>
#include <UnigineWindowManager.h>

using namespace Unigine;
using namespace Math;

EngineWindowViewportPtr system_viewport;

int AppSystemLogic::init()
{
	// create a separate window viewport
	system_viewport = EngineWindowViewport::create("Separate System Viewport", 400, 350);
	// specify an intial position
	system_viewport->setPosition(ivec2(30, 30));
	// render the window viewport
	system_viewport->show();

	return 1;
}

int AppSystemLogic::update()
{
	// get the current mouse position
	ivec2 mouse_pos = Input::getMousePosition();

	// change the window position to the mouse cursor when pressing 'P' 
	if (Input::isKeyDown(Input::KEY_P))
	{
		
		if (system_viewport.isDeleted() == false)
			system_viewport->setPosition(mouse_pos);
	}

	// change the client area position to the mouse cursor when pressing 'C' 
	if (Input::isKeyDown(Input::KEY_C))
	{
		if (system_viewport.isDeleted() == false)
			system_viewport->setClientPosition(mouse_pos);
	}

	return 1;
}

Check also the WindowSandbox and WindowSize samples — they print the full information on the window size and DPI.

Adjusting Visual Representation#

The window visual representation includes all available window parameters such as title and title bar, icon, borders, opacity, and window style (the engine or system one).

Here are some window examples:

Source code (C++)
#include <UnigineEngine.h>
#include <UnigineLogic.h>
#include <UnigineWindowManager.h>

EngineWindowViewportPtr system_viewport;
EngineWindowViewportPtr system_viewport_borderless;
EngineWindowViewportPtr engine_viewport_borderless;
EngineWindowViewportPtr engine_viewport;

int AppSystemLogic::init()
{
	// create a separate system viewport
	system_viewport = EngineWindowViewport::create("Window", 200, 200);
	// specify an intial position
	system_viewport->setPosition(ivec2(30, 30));
	// specify an intial size
	system_viewport->setSize(ivec2(400, 350));
	// render the window viewport
	system_viewport->show();

	// create a separate system viewport with borders and title bar disabled
	system_viewport_borderless = EngineWindowViewport::create(400, 350);
	system_viewport_borderless->setPosition(ivec2(460, 30));
	system_viewport_borderless->setSize(ivec2(400, 350));
	// disable borders
	system_viewport_borderless->setBordersEnabled(false);
	// disable a title bar
	system_viewport_borderless->setTitleBarEnabled(false);
	system_viewport_borderless->show();

	// create a separate engine viewport with no borders
	engine_viewport_borderless = EngineWindowViewport::create("Window", 400, 350);
	engine_viewport_borderless->setPosition(ivec2(460, 30));
	engine_viewport_borderless->setEngineStyle(true);
	engine_viewport_borderless->setSize(ivec2(400, 350));
	// disable borders
	engine_viewport_borderless->setBordersEnabled(false);
	engine_viewport_borderless->show();

	// create a separate engine viewport with borders
	engine_viewport = EngineWindowViewport::create("Window", 400, 350);
	engine_viewport->setPosition(ivec2(460, 30));
	engine_viewport->setEngineStyle(true);
	engine_viewport->setSize(ivec2(400, 350));
	engine_viewport->show();

	return 1;
}

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.

The ability to customize the window style makes it possible to create a standard set of window settings for different systems and frameworks.

Check the WindowVisual sample in UNIGINE SDK for more details.

Setting Up Order#

In the following example, the order of the window under the cursor changes when you press the specific button: T to make the window appear on top of all other windows, A to always render the window above the other windows.

Source code (C++)
#include <UnigineEngine.h>
#include <UnigineLogic.h>
#include <UnigineWindowManager.h>

EngineWindowPtr current_window;

EngineWindowViewportPtr system_viewport;
EngineWindowViewportPtr system_viewport_borderless;
EngineWindowViewportPtr engine_viewport_borderless;
EngineWindowViewportPtr engine_viewport;

int AppSystemLogic::init()
{
	// create a separate system viewport
	system_viewport = EngineWindowViewport::create("Window", 200, 200);
	// specify an intial position
	system_viewport->setPosition(ivec2(30, 30));
	// specify an intial size
	system_viewport->setSize(ivec2(400, 350));
	// render the window viewport
	system_viewport->show();

	// create a separate system viewport with borders and title bar disabled
	system_viewport_borderless = EngineWindowViewport::create(400, 350);
	system_viewport_borderless->setPosition(ivec2(460, 30));
	system_viewport_borderless->setSize(ivec2(400, 350));
	// disable borders
	system_viewport_borderless->setBordersEnabled(false);
	system_viewport_borderless->show();

	// create a separate engine viewport with no borders
	engine_viewport_borderless = EngineWindowViewport::create("Window", 400, 350);
	engine_viewport_borderless->setPosition(ivec2(460, 30));
	engine_viewport_borderless->setEngineStyle(true);
	engine_viewport_borderless->setSize(ivec2(400, 350));
	// disable borders
	engine_viewport_borderless->setBordersEnabled(false);
	engine_viewport_borderless->show();

	// create a separate engine viewport with borders
	engine_viewport = EngineWindowViewport::create("Window", 400, 350);
	engine_viewport->setPosition(ivec2(460, 30));
	engine_viewport->setEngineStyle(true);
	engine_viewport->setSize(ivec2(400, 350));
	engine_viewport->show();

	return 1;
}

int AppSystemLogic::update()
{
	// get the current mouse position
	ivec2 mouse_pos = Input::getMousePosition();

	// make the window under the cursor appear on top when pressing 'T'
	if (Input::isKeyDown(Input::KEY_T)) 
	{
		current_window = WindowManager::getUnderCursorWindow();
		if (current_window.isDeleted() == false)
			current_window->toTop();
	}

	// set the window under the cursor to be always on top when pressing 'A'
	if (Input::isKeyDown(Input::KEY_A))
	{
		current_window = WindowManager::getUnderCursorWindow();
		if (current_window.isDeleted() == false)
			current_window->setAlwaysOnTop(true);
	}

	return 1;
}

Check the WindowOrder sample in UNIGINE SDK for more details.

Changing Behavior#

With the set of behavior-related functions, you can do the following:

Check the WindowBehavior and WindowSandbox samples in UNIGINE SDK for more details.

Working with Modal Windows#

The following example demonstrates how to create modal windows and add modal children to the main window. Additionally, the main window includes a message that informs the user whether they can close the window or not.

Source code (C++)
#include "AppSystemLogic.h"
#include <UnigineEngine.h>
#include <UnigineLogic.h>
#include <UnigineWindowManager.h>

using namespace Unigine;
using namespace Math;

WidgetLabelPtr label;
EngineWindowViewportPtr main_window;

int AppSystemLogic::init()
{
	// main window
	main_window = WindowManager::getMainWindow();
	main_window->setSize(ivec2(1600, 900));
	main_window->setPosition(ivec2(30, 30));
	main_window->setCanBeNested(false);
	main_window->setCanCreateGroup(false);

	// add an info label to the main window
	label = WidgetLabel::create("");
	label->setFontOutline(1);
	label->setLifetime(Widget::LIFETIME_WINDOW);
	label->setFontColor(vec4_red);
	main_window->addChild(label, Gui::ALIGN_LEFT);

	// first modal window of the main window
	EngineWindowViewportPtr main_modal_0 = EngineWindowViewport::create("Modal for Main 0", 600, 650);
	main_modal_0->setPosition(ivec2(50, 250));
	main_modal_0->setCanBeNested(false);
	main_modal_0->setCanCreateGroup(false);
	main_modal_0->show();
	main_modal_0->setModal(main_window);

	// second modal window of the main window
	EngineWindowViewportPtr main_modal_1 = EngineWindowViewport::create("Modal for Main 1", 900, 650);
	main_modal_1->setPosition(ivec2(700, 250));
	main_modal_1->setCanBeNested(false);
	main_modal_1->setCanCreateGroup(false);
	main_modal_1->show();
	main_modal_1->setModal(main_window);

	return 1;
}

int AppSystemLogic::update()
{
	String text;
	
	// check if the modal children of the main window are still opened 
	if (main_window->isModalParent())
		text += "You CANNOT close this window. Please close modal children first.\n";
	else
		text += "You CAN close this window.\n";
	
	// render the info label
	label->setText(text);
	
	return 1;
}

Check the WindowModal sample in UNIGINE SDK for more details.

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.

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

getGui() const#

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

Return value

Current Gui instance.

getDisplayIndex() const#

Returns the current number of the display, on which the window is currently displayed.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

Current

isNested() const#

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

Return value

Current

isSeparate() const#

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

Return value

Current

getSelfGui() const#

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

Return value

Current Gui instance.

getClientLocalPosition() const#

Returns the current 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

Current

void setClientSize ( ) #

Sets a new size of the window client (content) area in units.

Arguments

  • size - The

getClientSize() const#

Returns the current size of the window client (content) area in units.

Return value

Current

isShown() const#

Returns the current value indicating if the engine window 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

Current

isHidden() const#

Returns the current value indicating if the engine window isn't 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

Current

isFocused() const#

Returns the current value indicating if the engine window is 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

Current

isMinimized() const#

Returns the current value indicating if the engine window is minimized.
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

Current

isMaximized() const#

Returns the current 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

Current

getOrder() const#

Returns the current

Return value

Current

getParentGroup() const#

Returns the current

Return value

Current

getGlobalParentGroup() const#

Returns the current

Return value

Current

getNumDroppedItems() const#

Returns the current

Return value

Current

int getNumModalWindows() const#

Returns the current

Return value

Current

Ptr<EngineWindow> getModalParent() const#

Returns the current

Return value

Current

bool isModalParent() const#

Returns the current value indicating if the 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 is enabled; otherwise false.

bool isModal() const#

Returns the current value indicating 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 is enabled; otherwise false.

unsigned long long getID() const#

Returns the current

Return value

Current

bool isHiddenByTab() const#

Returns the current 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 is enabled; otherwise false.

bool isSystemFocused() const#

Returns the current 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 is enabled; otherwise false.

const char * getTypeName() const#

Returns the current

Return value

Current

EngineWindow::TYPE getType() const#

Returns the current

Return value

Current

float getDpiScale() const#

Returns the current

Return value

Current

int getDpi() const#

Returns the current

Return value

Current

Math::ivec2 getMaxRenderSize() const#

Returns the current

Return value

Current

Math::ivec2 getMinRenderSize() const#

Returns the current

Return value

Current

Math::ivec2 getClientRenderSize() const#

Returns the current

Return value

Current

Math::ivec2 getRenderSize() const#

Returns the current

Return value

Current

Event<> getEventUnstack() const#

event triggered when the window is unstacked. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Unstack event handler
void unstack_event_handler()
{
	Log::message("\Handling Unstack event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections unstack_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventUnstack().connect(unstack_event_connections, unstack_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventUnstack().connect(unstack_event_connections, []() { 
		Log::message("\Handling Unstack event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
unstack_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection unstack_event_connection;

// subscribe for the Unstack event with a handler function keeping the connection
enginewindow->getEventUnstack().connect(unstack_event_connection, unstack_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
unstack_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
unstack_event_connection.setEnabled(true);

// ...

// remove subscription for the Unstack event via the connection
unstack_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Unstack event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Unstack event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventUnstack().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Unstack event with a handler function
enginewindow->getEventUnstack().connect(unstack_event_handler);


// remove subscription for the Unstack event later by the handler function
enginewindow->getEventUnstack().disconnect(unstack_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId unstack_handler_id;

// subscribe for the Unstack event with a lambda handler function and keeping connection ID
unstack_handler_id = enginewindow->getEventUnstack().connect([]() { 
		Log::message("\Handling Unstack event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventUnstack().disconnect(unstack_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Unstack events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventUnstack().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventUnstack().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventStack() const#

event triggered when the window is stacked. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Stack event handler
void stack_event_handler()
{
	Log::message("\Handling Stack event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections stack_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventStack().connect(stack_event_connections, stack_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventStack().connect(stack_event_connections, []() { 
		Log::message("\Handling Stack event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
stack_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection stack_event_connection;

// subscribe for the Stack event with a handler function keeping the connection
enginewindow->getEventStack().connect(stack_event_connection, stack_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
stack_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
stack_event_connection.setEnabled(true);

// ...

// remove subscription for the Stack event via the connection
stack_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Stack event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Stack event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventStack().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Stack event with a handler function
enginewindow->getEventStack().connect(stack_event_handler);


// remove subscription for the Stack event later by the handler function
enginewindow->getEventStack().disconnect(stack_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId stack_handler_id;

// subscribe for the Stack event with a lambda handler function and keeping connection ID
stack_handler_id = enginewindow->getEventStack().connect([]() { 
		Log::message("\Handling Stack event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventStack().disconnect(stack_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Stack events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventStack().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventStack().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<const Ptr<EngineWindow> &> getEventUnstackMove() const#

event triggered when the window is unstacked and moved. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the UnstackMove event handler
void unstackmove_event_handler(const Ptr<EngineWindow> & window)
{
	Log::message("\Handling UnstackMove event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections unstackmove_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventUnstackMove().connect(unstackmove_event_connections, unstackmove_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventUnstackMove().connect(unstackmove_event_connections, [](const Ptr<EngineWindow> & window) { 
		Log::message("\Handling UnstackMove event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
unstackmove_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection unstackmove_event_connection;

// subscribe for the UnstackMove event with a handler function keeping the connection
enginewindow->getEventUnstackMove().connect(unstackmove_event_connection, unstackmove_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
unstackmove_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
unstackmove_event_connection.setEnabled(true);

// ...

// remove subscription for the UnstackMove event via the connection
unstackmove_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A UnstackMove event handler implemented as a class member
	void event_handler(const Ptr<EngineWindow> & window)
	{
		Log::message("\Handling UnstackMove event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventUnstackMove().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the UnstackMove event with a handler function
enginewindow->getEventUnstackMove().connect(unstackmove_event_handler);


// remove subscription for the UnstackMove event later by the handler function
enginewindow->getEventUnstackMove().disconnect(unstackmove_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId unstackmove_handler_id;

// subscribe for the UnstackMove event with a lambda handler function and keeping connection ID
unstackmove_handler_id = enginewindow->getEventUnstackMove().connect([](const Ptr<EngineWindow> & window) { 
		Log::message("\Handling UnstackMove event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventUnstackMove().disconnect(unstackmove_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all UnstackMove events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventUnstackMove().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventUnstackMove().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const Ptr<EngineWindow> & window)

Return value

Current

Event<const char *> getEventItemDrop() const#

event triggered when an item is dropped to the window. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the ItemDrop event handler
void itemdrop_event_handler(const char * item)
{
	Log::message("\Handling ItemDrop event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections itemdrop_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventItemDrop().connect(itemdrop_event_connections, itemdrop_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventItemDrop().connect(itemdrop_event_connections, [](const char * item) { 
		Log::message("\Handling ItemDrop event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
itemdrop_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection itemdrop_event_connection;

// subscribe for the ItemDrop event with a handler function keeping the connection
enginewindow->getEventItemDrop().connect(itemdrop_event_connection, itemdrop_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
itemdrop_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
itemdrop_event_connection.setEnabled(true);

// ...

// remove subscription for the ItemDrop event via the connection
itemdrop_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A ItemDrop event handler implemented as a class member
	void event_handler(const char * item)
	{
		Log::message("\Handling ItemDrop event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventItemDrop().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the ItemDrop event with a handler function
enginewindow->getEventItemDrop().connect(itemdrop_event_handler);


// remove subscription for the ItemDrop event later by the handler function
enginewindow->getEventItemDrop().disconnect(itemdrop_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId itemdrop_handler_id;

// subscribe for the ItemDrop event with a lambda handler function and keeping connection ID
itemdrop_handler_id = enginewindow->getEventItemDrop().connect([](const char * item) { 
		Log::message("\Handling ItemDrop event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventItemDrop().disconnect(itemdrop_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all ItemDrop events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventItemDrop().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventItemDrop().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const char * item)

Return value

Current

Event<> getEventClose() const#

event triggered when the window is closed. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Close event handler
void close_event_handler()
{
	Log::message("\Handling Close event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections close_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventClose().connect(close_event_connections, close_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventClose().connect(close_event_connections, []() { 
		Log::message("\Handling Close event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
close_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection close_event_connection;

// subscribe for the Close event with a handler function keeping the connection
enginewindow->getEventClose().connect(close_event_connection, close_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
close_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
close_event_connection.setEnabled(true);

// ...

// remove subscription for the Close event via the connection
close_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Close event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Close event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventClose().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Close event with a handler function
enginewindow->getEventClose().connect(close_event_handler);


// remove subscription for the Close event later by the handler function
enginewindow->getEventClose().disconnect(close_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId close_handler_id;

// subscribe for the Close event with a lambda handler function and keeping connection ID
close_handler_id = enginewindow->getEventClose().connect([]() { 
		Log::message("\Handling Close event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventClose().disconnect(close_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Close events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventClose().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventClose().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventRestored() const#

event triggered when the window is restored. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Restored event handler
void restored_event_handler()
{
	Log::message("\Handling Restored event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections restored_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventRestored().connect(restored_event_connections, restored_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventRestored().connect(restored_event_connections, []() { 
		Log::message("\Handling Restored event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
restored_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection restored_event_connection;

// subscribe for the Restored event with a handler function keeping the connection
enginewindow->getEventRestored().connect(restored_event_connection, restored_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
restored_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
restored_event_connection.setEnabled(true);

// ...

// remove subscription for the Restored event via the connection
restored_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Restored event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Restored event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventRestored().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Restored event with a handler function
enginewindow->getEventRestored().connect(restored_event_handler);


// remove subscription for the Restored event later by the handler function
enginewindow->getEventRestored().disconnect(restored_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId restored_handler_id;

// subscribe for the Restored event with a lambda handler function and keeping connection ID
restored_handler_id = enginewindow->getEventRestored().connect([]() { 
		Log::message("\Handling Restored event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventRestored().disconnect(restored_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Restored events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventRestored().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventRestored().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventMaximized() const#

event triggered when the window is maximized. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Maximized event handler
void maximized_event_handler()
{
	Log::message("\Handling Maximized event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections maximized_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventMaximized().connect(maximized_event_connections, maximized_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventMaximized().connect(maximized_event_connections, []() { 
		Log::message("\Handling Maximized event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
maximized_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection maximized_event_connection;

// subscribe for the Maximized event with a handler function keeping the connection
enginewindow->getEventMaximized().connect(maximized_event_connection, maximized_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
maximized_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
maximized_event_connection.setEnabled(true);

// ...

// remove subscription for the Maximized event via the connection
maximized_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Maximized event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Maximized event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventMaximized().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Maximized event with a handler function
enginewindow->getEventMaximized().connect(maximized_event_handler);


// remove subscription for the Maximized event later by the handler function
enginewindow->getEventMaximized().disconnect(maximized_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId maximized_handler_id;

// subscribe for the Maximized event with a lambda handler function and keeping connection ID
maximized_handler_id = enginewindow->getEventMaximized().connect([]() { 
		Log::message("\Handling Maximized event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventMaximized().disconnect(maximized_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Maximized events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventMaximized().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventMaximized().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventMinimized() const#

event triggered when the window is minimized. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Minimized event handler
void minimized_event_handler()
{
	Log::message("\Handling Minimized event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections minimized_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventMinimized().connect(minimized_event_connections, minimized_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventMinimized().connect(minimized_event_connections, []() { 
		Log::message("\Handling Minimized event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
minimized_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection minimized_event_connection;

// subscribe for the Minimized event with a handler function keeping the connection
enginewindow->getEventMinimized().connect(minimized_event_connection, minimized_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
minimized_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
minimized_event_connection.setEnabled(true);

// ...

// remove subscription for the Minimized event via the connection
minimized_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Minimized event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Minimized event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventMinimized().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Minimized event with a handler function
enginewindow->getEventMinimized().connect(minimized_event_handler);


// remove subscription for the Minimized event later by the handler function
enginewindow->getEventMinimized().disconnect(minimized_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId minimized_handler_id;

// subscribe for the Minimized event with a lambda handler function and keeping connection ID
minimized_handler_id = enginewindow->getEventMinimized().connect([]() { 
		Log::message("\Handling Minimized event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventMinimized().disconnect(minimized_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Minimized events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventMinimized().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventMinimized().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventHidden() const#

event triggered when the window is hidden. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Hidden event handler
void hidden_event_handler()
{
	Log::message("\Handling Hidden event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections hidden_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventHidden().connect(hidden_event_connections, hidden_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventHidden().connect(hidden_event_connections, []() { 
		Log::message("\Handling Hidden event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
hidden_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection hidden_event_connection;

// subscribe for the Hidden event with a handler function keeping the connection
enginewindow->getEventHidden().connect(hidden_event_connection, hidden_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
hidden_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
hidden_event_connection.setEnabled(true);

// ...

// remove subscription for the Hidden event via the connection
hidden_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Hidden event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Hidden event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventHidden().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Hidden event with a handler function
enginewindow->getEventHidden().connect(hidden_event_handler);


// remove subscription for the Hidden event later by the handler function
enginewindow->getEventHidden().disconnect(hidden_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId hidden_handler_id;

// subscribe for the Hidden event with a lambda handler function and keeping connection ID
hidden_handler_id = enginewindow->getEventHidden().connect([]() { 
		Log::message("\Handling Hidden event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventHidden().disconnect(hidden_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Hidden events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventHidden().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventHidden().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventShown() const#

event triggered when the window is shown. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Shown event handler
void shown_event_handler()
{
	Log::message("\Handling Shown event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections shown_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventShown().connect(shown_event_connections, shown_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventShown().connect(shown_event_connections, []() { 
		Log::message("\Handling Shown event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
shown_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection shown_event_connection;

// subscribe for the Shown event with a handler function keeping the connection
enginewindow->getEventShown().connect(shown_event_connection, shown_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
shown_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
shown_event_connection.setEnabled(true);

// ...

// remove subscription for the Shown event via the connection
shown_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Shown event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Shown event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventShown().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Shown event with a handler function
enginewindow->getEventShown().connect(shown_event_handler);


// remove subscription for the Shown event later by the handler function
enginewindow->getEventShown().disconnect(shown_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId shown_handler_id;

// subscribe for the Shown event with a lambda handler function and keeping connection ID
shown_handler_id = enginewindow->getEventShown().connect([]() { 
		Log::message("\Handling Shown event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventShown().disconnect(shown_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Shown events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventShown().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventShown().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventMouseLeave() const#

event triggered when the mouse leaves the window area. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the MouseLeave event handler
void mouseleave_event_handler()
{
	Log::message("\Handling MouseLeave event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections mouseleave_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventMouseLeave().connect(mouseleave_event_connections, mouseleave_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventMouseLeave().connect(mouseleave_event_connections, []() { 
		Log::message("\Handling MouseLeave event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
mouseleave_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection mouseleave_event_connection;

// subscribe for the MouseLeave event with a handler function keeping the connection
enginewindow->getEventMouseLeave().connect(mouseleave_event_connection, mouseleave_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
mouseleave_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
mouseleave_event_connection.setEnabled(true);

// ...

// remove subscription for the MouseLeave event via the connection
mouseleave_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A MouseLeave event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling MouseLeave event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventMouseLeave().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the MouseLeave event with a handler function
enginewindow->getEventMouseLeave().connect(mouseleave_event_handler);


// remove subscription for the MouseLeave event later by the handler function
enginewindow->getEventMouseLeave().disconnect(mouseleave_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId mouseleave_handler_id;

// subscribe for the MouseLeave event with a lambda handler function and keeping connection ID
mouseleave_handler_id = enginewindow->getEventMouseLeave().connect([]() { 
		Log::message("\Handling MouseLeave event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventMouseLeave().disconnect(mouseleave_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all MouseLeave events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventMouseLeave().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventMouseLeave().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventMouseEnter() const#

event triggered when the mouse enters the window area. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the MouseEnter event handler
void mouseenter_event_handler()
{
	Log::message("\Handling MouseEnter event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections mouseenter_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventMouseEnter().connect(mouseenter_event_connections, mouseenter_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventMouseEnter().connect(mouseenter_event_connections, []() { 
		Log::message("\Handling MouseEnter event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
mouseenter_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection mouseenter_event_connection;

// subscribe for the MouseEnter event with a handler function keeping the connection
enginewindow->getEventMouseEnter().connect(mouseenter_event_connection, mouseenter_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
mouseenter_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
mouseenter_event_connection.setEnabled(true);

// ...

// remove subscription for the MouseEnter event via the connection
mouseenter_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A MouseEnter event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling MouseEnter event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventMouseEnter().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the MouseEnter event with a handler function
enginewindow->getEventMouseEnter().connect(mouseenter_event_handler);


// remove subscription for the MouseEnter event later by the handler function
enginewindow->getEventMouseEnter().disconnect(mouseenter_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId mouseenter_handler_id;

// subscribe for the MouseEnter event with a lambda handler function and keeping connection ID
mouseenter_handler_id = enginewindow->getEventMouseEnter().connect([]() { 
		Log::message("\Handling MouseEnter event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventMouseEnter().disconnect(mouseenter_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all MouseEnter events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventMouseEnter().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventMouseEnter().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventUnfocused() const#

event triggered when the window loses the focus. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Unfocused event handler
void unfocused_event_handler()
{
	Log::message("\Handling Unfocused event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections unfocused_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventUnfocused().connect(unfocused_event_connections, unfocused_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventUnfocused().connect(unfocused_event_connections, []() { 
		Log::message("\Handling Unfocused event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
unfocused_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection unfocused_event_connection;

// subscribe for the Unfocused event with a handler function keeping the connection
enginewindow->getEventUnfocused().connect(unfocused_event_connection, unfocused_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
unfocused_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
unfocused_event_connection.setEnabled(true);

// ...

// remove subscription for the Unfocused event via the connection
unfocused_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Unfocused event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Unfocused event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventUnfocused().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Unfocused event with a handler function
enginewindow->getEventUnfocused().connect(unfocused_event_handler);


// remove subscription for the Unfocused event later by the handler function
enginewindow->getEventUnfocused().disconnect(unfocused_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId unfocused_handler_id;

// subscribe for the Unfocused event with a lambda handler function and keeping connection ID
unfocused_handler_id = enginewindow->getEventUnfocused().connect([]() { 
		Log::message("\Handling Unfocused event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventUnfocused().disconnect(unfocused_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Unfocused events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventUnfocused().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventUnfocused().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventFocused() const#

event triggered when the window gains the focus. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Focused event handler
void focused_event_handler()
{
	Log::message("\Handling Focused event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections focused_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFocused().connect(focused_event_connections, focused_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFocused().connect(focused_event_connections, []() { 
		Log::message("\Handling Focused event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
focused_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection focused_event_connection;

// subscribe for the Focused event with a handler function keeping the connection
enginewindow->getEventFocused().connect(focused_event_connection, focused_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
focused_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
focused_event_connection.setEnabled(true);

// ...

// remove subscription for the Focused event via the connection
focused_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Focused event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling Focused event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFocused().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Focused event with a handler function
enginewindow->getEventFocused().connect(focused_event_handler);


// remove subscription for the Focused event later by the handler function
enginewindow->getEventFocused().disconnect(focused_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId focused_handler_id;

// subscribe for the Focused event with a lambda handler function and keeping connection ID
focused_handler_id = enginewindow->getEventFocused().connect([]() { 
		Log::message("\Handling Focused event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFocused().disconnect(focused_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Focused events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFocused().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFocused().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<const Math::ivec2 &> getEventResized() const#

event triggered when the window is resized. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Resized event handler
void resized_event_handler(const Math::ivec2 & new_size)
{
	Log::message("\Handling Resized event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections resized_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventResized().connect(resized_event_connections, resized_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventResized().connect(resized_event_connections, [](const Math::ivec2 & new_size) { 
		Log::message("\Handling Resized event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
resized_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection resized_event_connection;

// subscribe for the Resized event with a handler function keeping the connection
enginewindow->getEventResized().connect(resized_event_connection, resized_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
resized_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
resized_event_connection.setEnabled(true);

// ...

// remove subscription for the Resized event via the connection
resized_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Resized event handler implemented as a class member
	void event_handler(const Math::ivec2 & new_size)
	{
		Log::message("\Handling Resized event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventResized().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Resized event with a handler function
enginewindow->getEventResized().connect(resized_event_handler);


// remove subscription for the Resized event later by the handler function
enginewindow->getEventResized().disconnect(resized_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId resized_handler_id;

// subscribe for the Resized event with a lambda handler function and keeping connection ID
resized_handler_id = enginewindow->getEventResized().connect([](const Math::ivec2 & new_size) { 
		Log::message("\Handling Resized event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventResized().disconnect(resized_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Resized events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventResized().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventResized().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const Math::ivec2 & new_size)

Return value

Current

Event<const Math::ivec2 &> getEventMoved() const#

event triggered when the window is moved. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Moved event handler
void moved_event_handler(const Math::ivec2 & new_coords)
{
	Log::message("\Handling Moved event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections moved_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventMoved().connect(moved_event_connections, moved_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventMoved().connect(moved_event_connections, [](const Math::ivec2 & new_coords) { 
		Log::message("\Handling Moved event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
moved_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection moved_event_connection;

// subscribe for the Moved event with a handler function keeping the connection
enginewindow->getEventMoved().connect(moved_event_connection, moved_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
moved_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
moved_event_connection.setEnabled(true);

// ...

// remove subscription for the Moved event via the connection
moved_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Moved event handler implemented as a class member
	void event_handler(const Math::ivec2 & new_coords)
	{
		Log::message("\Handling Moved event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventMoved().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Moved event with a handler function
enginewindow->getEventMoved().connect(moved_event_handler);


// remove subscription for the Moved event later by the handler function
enginewindow->getEventMoved().disconnect(moved_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId moved_handler_id;

// subscribe for the Moved event with a lambda handler function and keeping connection ID
moved_handler_id = enginewindow->getEventMoved().connect([](const Math::ivec2 & new_coords) { 
		Log::message("\Handling Moved event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventMoved().disconnect(moved_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Moved events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventMoved().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventMoved().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const Math::ivec2 & new_coords)

Return value

Current

Event<> getEventFuncSwap() const#

event triggered before calling the window swap. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncSwap event handler
void funcswap_event_handler()
{
	Log::message("\Handling FuncSwap event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcswap_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncSwap().connect(funcswap_event_connections, funcswap_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncSwap().connect(funcswap_event_connections, []() { 
		Log::message("\Handling FuncSwap event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcswap_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcswap_event_connection;

// subscribe for the FuncSwap event with a handler function keeping the connection
enginewindow->getEventFuncSwap().connect(funcswap_event_connection, funcswap_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcswap_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcswap_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncSwap event via the connection
funcswap_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncSwap event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling FuncSwap event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncSwap().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncSwap event with a handler function
enginewindow->getEventFuncSwap().connect(funcswap_event_handler);


// remove subscription for the FuncSwap event later by the handler function
enginewindow->getEventFuncSwap().disconnect(funcswap_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcswap_handler_id;

// subscribe for the FuncSwap event with a lambda handler function and keeping connection ID
funcswap_handler_id = enginewindow->getEventFuncSwap().connect([]() { 
		Log::message("\Handling FuncSwap event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncSwap().disconnect(funcswap_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncSwap events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncSwap().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncSwap().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventFuncEndRender() const#

event triggered after the window rendering has ended. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncEndRender event handler
void funcendrender_event_handler()
{
	Log::message("\Handling FuncEndRender event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcendrender_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncEndRender().connect(funcendrender_event_connections, funcendrender_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncEndRender().connect(funcendrender_event_connections, []() { 
		Log::message("\Handling FuncEndRender event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcendrender_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcendrender_event_connection;

// subscribe for the FuncEndRender event with a handler function keeping the connection
enginewindow->getEventFuncEndRender().connect(funcendrender_event_connection, funcendrender_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcendrender_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcendrender_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncEndRender event via the connection
funcendrender_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncEndRender event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling FuncEndRender event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncEndRender().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncEndRender event with a handler function
enginewindow->getEventFuncEndRender().connect(funcendrender_event_handler);


// remove subscription for the FuncEndRender event later by the handler function
enginewindow->getEventFuncEndRender().disconnect(funcendrender_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcendrender_handler_id;

// subscribe for the FuncEndRender event with a lambda handler function and keeping connection ID
funcendrender_handler_id = enginewindow->getEventFuncEndRender().connect([]() { 
		Log::message("\Handling FuncEndRender event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncEndRender().disconnect(funcendrender_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncEndRender events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncEndRender().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncEndRender().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<const Ptr<Gui> &> getEventFuncEndRenderGui() const#

event triggered after the GUI rendering has ended. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncEndRenderGui event handler
void funcendrendergui_event_handler(const Ptr<Gui> & gui)
{
	Log::message("\Handling FuncEndRenderGui event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcendrendergui_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncEndRenderGui().connect(funcendrendergui_event_connections, funcendrendergui_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncEndRenderGui().connect(funcendrendergui_event_connections, [](const Ptr<Gui> & gui) { 
		Log::message("\Handling FuncEndRenderGui event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcendrendergui_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcendrendergui_event_connection;

// subscribe for the FuncEndRenderGui event with a handler function keeping the connection
enginewindow->getEventFuncEndRenderGui().connect(funcendrendergui_event_connection, funcendrendergui_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcendrendergui_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcendrendergui_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncEndRenderGui event via the connection
funcendrendergui_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncEndRenderGui event handler implemented as a class member
	void event_handler(const Ptr<Gui> & gui)
	{
		Log::message("\Handling FuncEndRenderGui event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncEndRenderGui().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncEndRenderGui event with a handler function
enginewindow->getEventFuncEndRenderGui().connect(funcendrendergui_event_handler);


// remove subscription for the FuncEndRenderGui event later by the handler function
enginewindow->getEventFuncEndRenderGui().disconnect(funcendrendergui_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcendrendergui_handler_id;

// subscribe for the FuncEndRenderGui event with a lambda handler function and keeping connection ID
funcendrendergui_handler_id = enginewindow->getEventFuncEndRenderGui().connect([](const Ptr<Gui> & gui) { 
		Log::message("\Handling FuncEndRenderGui event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncEndRenderGui().disconnect(funcendrendergui_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncEndRenderGui events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncEndRenderGui().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncEndRenderGui().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const Ptr<Gui> & gui)

Return value

Current

Event<const Ptr<Gui> &> getEventFuncBeginRenderGui() const#

event triggered when the GUI rendering has begun. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncBeginRenderGui event handler
void funcbeginrendergui_event_handler(const Ptr<Gui> & gui)
{
	Log::message("\Handling FuncBeginRenderGui event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcbeginrendergui_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncBeginRenderGui().connect(funcbeginrendergui_event_connections, funcbeginrendergui_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncBeginRenderGui().connect(funcbeginrendergui_event_connections, [](const Ptr<Gui> & gui) { 
		Log::message("\Handling FuncBeginRenderGui event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcbeginrendergui_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcbeginrendergui_event_connection;

// subscribe for the FuncBeginRenderGui event with a handler function keeping the connection
enginewindow->getEventFuncBeginRenderGui().connect(funcbeginrendergui_event_connection, funcbeginrendergui_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcbeginrendergui_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcbeginrendergui_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncBeginRenderGui event via the connection
funcbeginrendergui_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncBeginRenderGui event handler implemented as a class member
	void event_handler(const Ptr<Gui> & gui)
	{
		Log::message("\Handling FuncBeginRenderGui event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncBeginRenderGui().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncBeginRenderGui event with a handler function
enginewindow->getEventFuncBeginRenderGui().connect(funcbeginrendergui_event_handler);


// remove subscription for the FuncBeginRenderGui event later by the handler function
enginewindow->getEventFuncBeginRenderGui().disconnect(funcbeginrendergui_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcbeginrendergui_handler_id;

// subscribe for the FuncBeginRenderGui event with a lambda handler function and keeping connection ID
funcbeginrendergui_handler_id = enginewindow->getEventFuncBeginRenderGui().connect([](const Ptr<Gui> & gui) { 
		Log::message("\Handling FuncBeginRenderGui event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncBeginRenderGui().disconnect(funcbeginrendergui_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncBeginRenderGui events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncBeginRenderGui().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncBeginRenderGui().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const Ptr<Gui> & gui)

Return value

Current

Event<> getEventFuncRender() const#

event triggered after the window rendering function. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncRender event handler
void funcrender_event_handler()
{
	Log::message("\Handling FuncRender event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcrender_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncRender().connect(funcrender_event_connections, funcrender_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncRender().connect(funcrender_event_connections, []() { 
		Log::message("\Handling FuncRender event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcrender_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcrender_event_connection;

// subscribe for the FuncRender event with a handler function keeping the connection
enginewindow->getEventFuncRender().connect(funcrender_event_connection, funcrender_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcrender_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcrender_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncRender event via the connection
funcrender_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncRender event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling FuncRender event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncRender().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncRender event with a handler function
enginewindow->getEventFuncRender().connect(funcrender_event_handler);


// remove subscription for the FuncRender event later by the handler function
enginewindow->getEventFuncRender().disconnect(funcrender_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcrender_handler_id;

// subscribe for the FuncRender event with a lambda handler function and keeping connection ID
funcrender_handler_id = enginewindow->getEventFuncRender().connect([]() { 
		Log::message("\Handling FuncRender event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncRender().disconnect(funcrender_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncRender events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncRender().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncRender().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventFuncBeginRender() const#

event triggered when the window rendering has begun. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncBeginRender event handler
void funcbeginrender_event_handler()
{
	Log::message("\Handling FuncBeginRender event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcbeginrender_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncBeginRender().connect(funcbeginrender_event_connections, funcbeginrender_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncBeginRender().connect(funcbeginrender_event_connections, []() { 
		Log::message("\Handling FuncBeginRender event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcbeginrender_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcbeginrender_event_connection;

// subscribe for the FuncBeginRender event with a handler function keeping the connection
enginewindow->getEventFuncBeginRender().connect(funcbeginrender_event_connection, funcbeginrender_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcbeginrender_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcbeginrender_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncBeginRender event via the connection
funcbeginrender_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncBeginRender event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling FuncBeginRender event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncBeginRender().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncBeginRender event with a handler function
enginewindow->getEventFuncBeginRender().connect(funcbeginrender_event_handler);


// remove subscription for the FuncBeginRender event later by the handler function
enginewindow->getEventFuncBeginRender().disconnect(funcbeginrender_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcbeginrender_handler_id;

// subscribe for the FuncBeginRender event with a lambda handler function and keeping connection ID
funcbeginrender_handler_id = enginewindow->getEventFuncBeginRender().connect([]() { 
		Log::message("\Handling FuncBeginRender event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncBeginRender().disconnect(funcbeginrender_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncBeginRender events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncBeginRender().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncBeginRender().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<> getEventFuncUpdate() const#

event triggered after the window update. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the FuncUpdate event handler
void funcupdate_event_handler()
{
	Log::message("\Handling FuncUpdate event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections funcupdate_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventFuncUpdate().connect(funcupdate_event_connections, funcupdate_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventFuncUpdate().connect(funcupdate_event_connections, []() { 
		Log::message("\Handling FuncUpdate event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
funcupdate_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection funcupdate_event_connection;

// subscribe for the FuncUpdate event with a handler function keeping the connection
enginewindow->getEventFuncUpdate().connect(funcupdate_event_connection, funcupdate_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
funcupdate_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
funcupdate_event_connection.setEnabled(true);

// ...

// remove subscription for the FuncUpdate event via the connection
funcupdate_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A FuncUpdate event handler implemented as a class member
	void event_handler()
	{
		Log::message("\Handling FuncUpdate event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventFuncUpdate().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the FuncUpdate event with a handler function
enginewindow->getEventFuncUpdate().connect(funcupdate_event_handler);


// remove subscription for the FuncUpdate event later by the handler function
enginewindow->getEventFuncUpdate().disconnect(funcupdate_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId funcupdate_handler_id;

// subscribe for the FuncUpdate event with a lambda handler function and keeping connection ID
funcupdate_handler_id = enginewindow->getEventFuncUpdate().connect([]() { 
		Log::message("\Handling FuncUpdate event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventFuncUpdate().disconnect(funcupdate_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all FuncUpdate events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventFuncUpdate().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventFuncUpdate().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler()

Return value

Current

Event<const Ptr<WindowEvent> &> getEventWindowEvent() const#

event triggered on the window event. You can subscribe to events via connect()  and unsubscribe via disconnect(). You can also use EventConnection  and EventConnections  classes for convenience (see examples below).

Usage Example

Source code (C++)
// implement the Window event handler
void window_event_handler(const Ptr<WindowEvent> & event)
{
	Log::message("\Handling Window event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections window_event_connections;

// link to this instance when subscribing for an event (subscription for various events can be linked)
enginewindow->getEventWindow().connect(window_event_connections, window_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
enginewindow->getEventWindow().connect(window_event_connections, [](const Ptr<WindowEvent> & event) { 
		Log::message("\Handling Window event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
window_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection window_event_connection;

// subscribe for the Window event with a handler function keeping the connection
enginewindow->getEventWindow().connect(window_event_connection, window_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
window_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
window_event_connection.setEnabled(true);

// ...

// remove subscription for the Window event via the connection
window_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A Window event handler implemented as a class member
	void event_handler(const Ptr<WindowEvent> & event)
	{
		Log::message("\Handling Window event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
enginewindow->getEventWindow().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;

//////////////////////////////////////////////////////////////////////////////
//  4. You can subscribe and unsubscribe via the handler function directly
//////////////////////////////////////////////////////////////////////////////

// subscribe for the Window event with a handler function
enginewindow->getEventWindow().connect(window_event_handler);


// remove subscription for the Window event later by the handler function
enginewindow->getEventWindow().disconnect(window_event_handler);


//////////////////////////////////////////////////////////////////////////////
//   5. Subscribe to an event saving an ID and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////

// define a connection ID to be used to unsubscribe later
EventConnectionId window_handler_id;

// subscribe for the Window event with a lambda handler function and keeping connection ID
window_handler_id = enginewindow->getEventWindow().connect([](const Ptr<WindowEvent> & event) { 
		Log::message("\Handling Window event (lambda).\n");
	}
);

// remove the subscription later using the ID
enginewindow->getEventWindow().disconnect(window_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   6. Ignoring all Window events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
enginewindow->getEventWindow().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
enginewindow->getEventWindow().setEnabled(true);
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(const Ptr<WindowEvent> & event)

Return value

Current

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 in units (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 in units (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 in units.

Return value

The size of the client area.

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

Sets the minimum possible window size in units 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 in units 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 in units 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 in units 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.

int 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-12-19
Build: ()