PanelWindowclass

An OS window whose entire contents are panel UI. It owns the window, its swap chain and the UI inside it. Its input comes straight from SDL and never touches the engine's input system - there's no widget toolkit involved anywhere. Editor only. A game has one window and draws its UI into that.

objectPanelWindow
Namespace
Editor
Assembly
Sandbox.Tools
Declaration
public sealed class Editor.PanelWindow

Constructors4

Showing 4 constructors

Methods10

Showing 10 methods

public virtual sealed void Dispose()PUBLICVIRTUAL

Close the window and delete its panels.

Returns:void

public void Focus()PUBLIC

Bring the window to the front.

Returns:void

public static Editor.PanelWindow FromPanel(Sandbox.UI.Panel panel)PUBLICSTATIC

The window a panel is being shown in, if it's one of ours.

ParameterTypeDescription
panelPanel
Returns:PanelWindow

public void Minimize()PUBLIC

Minimize the window.

Returns:void

public System.Threading.Tasks.Task`1<string> PickFolder(string defaultPath = null)PUBLIC

Ask the OS to pick a folder, starting at `defaultPath`. Null when the user cancels. One dialog at a time - asking again while one is open joins the first.

ParameterTypeDescription
defaultPath = nullstring
Returns:Task<string>

public System.Threading.Tasks.Task`1<string> PickOpenFile(string defaultPath = null, string filters = null)PUBLIC

Ask the OS for a file to open. The filter is name and extension list pairs, like "Scene files|scene;prefab|All files|*". Null when the user cancels.

ParameterTypeDescription
defaultPath = nullstring
filters = nullstring
Returns:Task<string>

public System.Threading.Tasks.Task`1<string> PickSaveFile(string defaultPath = null, string filters = null)PUBLIC

Ask the OS where to save a file. `defaultPath` can end in a suggested file name. Filters as in `Editor.PanelWindow.PickOpenFile(System.String,System.String)`. Null when the user cancels.

ParameterTypeDescription
defaultPath = nullstring
filters = nullstring
Returns:Task<string>

public virtual sealed void RequestClose()PUBLICVIRTUAL

The user clicked the window's close button.

Returns:void

public void ToggleMaximized()PUBLIC

Maximize the window, or put it back if it already is.

Returns:void

Properties24

Showing 24 properties

public static System.Collections.Generic.IReadOnlyList`1<Editor.PanelWindow> Editor.PanelWindow.All { get; set; }PUBLICSTATICGETSET

Every window that's currently open.

Returns:IReadOnlyList<PanelWindow>

public virtual sealed bool Editor.PanelWindow.AllowNestedFrame { get; set; }PUBLICVIRTUALGETSET

Let frames run inside a frame that's already running - see IPanelWindow.

Returns:bool

public virtual sealed bool Editor.PanelWindow.AlwaysFullFrameRate { get; set; }PUBLICVIRTUALGETSET

Keep drawing at the display's frame rate even when nobody is looking at this window. Idle windows are paced right down - set this for one with something moving in it that has to keep moving, like a video or a live preview.

Returns:bool

public Color Editor.PanelWindow.BackgroundColor { get; set; }PUBLICGETSET

What the window clears to before the UI is drawn.

Returns:Color

public bool Editor.PanelWindow.Borderless { get; set; }PUBLICGETSET

True if we're drawing the title bar and borders ourselves.

Returns:bool

public bool Editor.PanelWindow.CanMaximize { get; set; }PUBLICGETSET

Whether the OS is allowed to maximize the window - the caption button, double clicking the title bar, Win+Up, snap. Windows drawing their own chrome check this for their maximize button too.

Returns:bool

public static Editor.PanelWindow Editor.PanelWindow.Focused { get; set; }PUBLICSTATICGETSET

The window the OS is giving keyboard input to, if it's one of ours.

Returns:PanelWindow

public bool Editor.PanelWindow.IgnoresInput { get; set; }PUBLICGETSETINGEST

A popup that never takes the keyboard or the mouse - a tooltip, say. It can't be focused, and the mouse goes to whatever is under it.

Returns:bool

public virtual sealed bool Editor.PanelWindow.IsFocused { get; set; }PUBLICVIRTUALGETSET

Does this window have keyboard focus?

Returns:bool

public bool Editor.PanelWindow.IsMaximized { get; set; }PUBLICGETSET

Is the window maximized?

Returns:bool

public virtual sealed bool Editor.PanelWindow.IsOpen { get; set; }PUBLICVIRTUALGETSET

Is this window still open?

Returns:bool

public bool Editor.PanelWindow.IsShown { get; set; }PUBLICGETSET

Whether the OS window is on screen. A popup is born hidden and appears once it has drawn its contents, so this is false for its first frame or two.

Returns:bool

public Vector2 Editor.PanelWindow.MaxSize { get; set; }PUBLICGETSET

The largest the user can resize the window to. Zero means no limit.

Returns:Vector2

public Vector2 Editor.PanelWindow.MinSize { get; set; }PUBLICGETSET

The smallest the user can resize the window to. Zero means no limit.

Returns:Vector2

public Vector2 Editor.PanelWindow.MousePosition { get; set; }PUBLICGETSET

Where the cursor is, in this window's pixels.

Returns:Vector2

public System.Action Editor.PanelWindow.OnCloseRequested { get; set; }PUBLICGETSET

Called when the user clicks the window's close button. The window closes if this is null.

Returns:Action

public Vector2 Editor.PanelWindow.Position { get; set; }PUBLICGETSET

Position of the window on the desktop, in the OS's own coordinates - desktop pixels on Windows. Deliberately not the units `Editor.PanelWindow.Size` is in: a desktop spanning displays that scale differently has no single UI unit to measure it in.

Returns:Vector2

public float Editor.PanelWindow.ResizeBorder { get; set; }PUBLICGETSET

How far from the edge of a borderless window counts as a resize handle, in the same units the UI is authored in - it grows with the display scale so the grab stays the same size.

Returns:float

public Vector2 Editor.PanelWindow.Size { get; set; }PUBLICGETSET

Size of the window's client area, in the units the UI inside it is authored in. The window on the desktop is this much again bigger on a display that scales.

Returns:Vector2

public bool Editor.PanelWindow.SizeToContents { get; set; }PUBLICGETSET

Resize the window to fit the first thing on the surface. Popups use this so a menu is exactly as big as its contents, however far outside the parent window that ends up.

Returns:bool

public string Editor.PanelWindow.Title { get; set; }PUBLICGETSET

The window's title bar text.

Returns:string

public bool Editor.PanelWindow.VSync { get; set; }PUBLICGETSET

Does this window's present wait for the display?

Returns:bool

On this page

Constructorspublic PanelWindow(System.String title, Vector2 size, Vector2 position, System.Boolean borderless, System.Boolean vsync)public PanelWindow(System.String title, Vector2 size, Vector2 position, System.Boolean borderless)public PanelWindow(System.String title, Vector2 size, Vector2 position)public PanelWindow(System.String title, Vector2 size)Methodspublic virtual sealed System.Void Dispose()public System.Void Focus()public static Editor.PanelWindow FromPanel(Sandbox.UI.Panel panel)public System.Void Minimize()public System.Threading.Tasks.Task`1<System.String> PickFolder(System.String defaultPath = null)public System.Threading.Tasks.Task`1<System.String> PickOpenFile(System.String defaultPath = null, System.String filters = null)public System.Threading.Tasks.Task`1<System.String> PickSaveFile(System.String defaultPath = null, System.String filters = null)public static Editor.PanelWindow Popup(Editor.PanelWindow parent, Vector2 position, System.Boolean ignoresInput = False)public virtual sealed System.Void RequestClose()public System.Void ToggleMaximized()Propertiespublic static System.Collections.Generic.IReadOnlyList`1<Editor.PanelWindow> Editor.PanelWindow.All { get; set; }public virtual sealed System.Boolean Editor.PanelWindow.AllowNestedFrame { get; set; }public virtual sealed System.Boolean Editor.PanelWindow.AlwaysFullFrameRate { get; set; }public Color Editor.PanelWindow.BackgroundColor { get; set; }public System.Boolean Editor.PanelWindow.Borderless { get; set; }public System.Boolean Editor.PanelWindow.CanMaximize { get; set; }public static Editor.PanelWindow Editor.PanelWindow.Focused { get; set; }public System.Boolean Editor.PanelWindow.IgnoresInput { get; set; }public virtual sealed System.Boolean Editor.PanelWindow.IsFocused { get; set; }public System.Boolean Editor.PanelWindow.IsMaximized { get; set; }public virtual sealed System.Boolean Editor.PanelWindow.IsOpen { get; set; }public System.Boolean Editor.PanelWindow.IsShown { get; set; }public Vector2 Editor.PanelWindow.MaxSize { get; set; }public Vector2 Editor.PanelWindow.MinSize { get; set; }public Vector2 Editor.PanelWindow.MousePosition { get; set; }public System.Action Editor.PanelWindow.OnCloseRequested { get; set; }public Vector2 Editor.PanelWindow.Position { get; set; }public System.Single Editor.PanelWindow.ResizeBorder { get; set; }public Sandbox.UI.RootPanel Editor.PanelWindow.Root { get; set; }public Vector2 Editor.PanelWindow.Size { get; set; }public System.Boolean Editor.PanelWindow.SizeToContents { get; set; }public System.String Editor.PanelWindow.Title { get; set; }public Editor.PanelWindow Editor.PanelWindow.TooltipWindow { get; set; }public System.Boolean Editor.PanelWindow.VSync { get; set; }Metadata