mirror of
https://github.com/AlexMacocian/MonoGame.Extended.git
synced 2026-07-26 00:45:20 +00:00
* 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
38 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
} |