Files
sbox-public/engine/Sandbox.Tools/Widgets/Dialog.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

33 lines
734 B
C#

namespace Editor
{
/// <summary>
/// A wrapper to more easily create dialog windows.
/// </summary>
public partial class Dialog : Widget
{
/// <summary>
/// The created parent window for this dialog.
/// </summary>
public Window Window { get; init; }
public Dialog( Widget parent = null, bool initAsDialog = true ) : base( null )
{
Window = new Window( parent );
Window.Size = new Vector2( 500, 500 );
if ( initAsDialog )
{
Window.IsDialog = true;
Window.StatusBar = null;
}
Window.Canvas = this;
Window.DeleteOnClose = true;
}
public override void Close() => Window.Close();
public override void Show() => Window.Show();
public override void Hide() => Window.Hide();
}
}