Files
MonoGame.Extended/Source/MonoGame.Extended.NuclexGui/Controls/Desktop/GuiWindowControl.cs
T
Mason11987andDylan Wilson d94e788027 Implemented GuiResizableControl (#461)
* Implemented GuiResizableControl, and made GuiWindowControl inherit from it.

GuiResizableControl is a control that can be resized.

GuiResizableControl calls SetCursorForResize(_resizingSides), which can be overriden to provide platform specific mouse cursor implementation depending on where on the edge of the control your mouse is.

* Including class reference in project
2018-02-07 22:01:52 +10:00

38 lines
1.1 KiB
C#

namespace MonoGame.Extended.NuclexGui.Controls.Desktop
{
/// <summary>A window for hosting other controls</summary>
public class GuiWindowControl : GuiResizableControl
{
/// <summary>Text in the title bar of the window</summary>
public string Title;
/// <summary>Initializes a new window control</summary>
public GuiWindowControl() : base(true)
{
}
/// <summary>Whether the window is currently open</summary>
public bool IsOpen => Screen != null;
/// <summary>Whether the window can be dragged with the mouse</summary>
public new bool EnableDragging
{
get { return base.EnableDragging; }
set { base.EnableDragging = value; }
}
/// <summary>Whether the window can be resized with the mouse</summary>
public new bool EnableResizing
{
get { return base.EnableResizing; }
set { base.EnableResizing = value; }
}
/// <summary>Closes the window</summary>
public void Close()
{
if (IsOpen)
Parent.Children.Remove(this);
}
}
}