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.
Constructors4
Showing 4 constructors
No results match this filter.
Methods10
Showing 10 methods
public virtual sealed void Dispose()
Close the window and delete its panels.
void—public void Focus()
Bring the window to the front.
void—public static Editor.PanelWindow FromPanel(Sandbox.UI.Panel panel)
The window a panel is being shown in, if it's one of ours.
| Parameter | Type | Description |
|---|---|---|
| panel | Panel | — |
public void Minimize()
Minimize the window.
void—public System.Threading.Tasks.Task`1<string> PickFolder(string defaultPath = null)
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.
| Parameter | Type | Description |
|---|---|---|
| defaultPath = null | string | — |
Task<string>—public System.Threading.Tasks.Task`1<string> PickOpenFile(string defaultPath = null, string filters = null)
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.
| Parameter | Type | Description |
|---|---|---|
| defaultPath = null | string | — |
| filters = null | string | — |
Task<string>—public System.Threading.Tasks.Task`1<string> PickSaveFile(string defaultPath = null, string filters = null)
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.
| Parameter | Type | Description |
|---|---|---|
| defaultPath = null | string | — |
| filters = null | string | — |
Task<string>—public static Editor.PanelWindow Popup(Editor.PanelWindow parent, Vector2 position, bool ignoresInput = False)
Open a popup - a borderless window that sits above its parent and can hang outside it, the way an OS menu does. The position is in the parent's client pixels, which is what a panel's `Box.Rect` is already in. There is no size to pass. The popup is born hidden at the parent's size, shrinks to whatever is put in it, and only then appears - so what it ends up as is the size of its contents.
| Parameter | Type | Description |
|---|---|---|
| parent | PanelWindow | — |
| position | Vector2 | — |
| ignoresInput = False | bool | — |
public virtual sealed void RequestClose()
The user clicked the window's close button.
void—public void ToggleMaximized()
Maximize the window, or put it back if it already is.
void—No results match this filter.
Properties24
Showing 24 properties
public static System.Collections.Generic.IReadOnlyList`1<Editor.PanelWindow> Editor.PanelWindow.All { get; set; }
Every window that's currently open.
public virtual sealed bool Editor.PanelWindow.AllowNestedFrame { get; set; }
Let frames run inside a frame that's already running - see IPanelWindow.
bool—public virtual sealed bool Editor.PanelWindow.AlwaysFullFrameRate { get; set; }
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.
bool—public Color Editor.PanelWindow.BackgroundColor { get; set; }
What the window clears to before the UI is drawn.
public bool Editor.PanelWindow.Borderless { get; set; }
True if we're drawing the title bar and borders ourselves.
bool—public bool Editor.PanelWindow.CanMaximize { get; set; }
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.
bool—public static Editor.PanelWindow Editor.PanelWindow.Focused { get; set; }
The window the OS is giving keyboard input to, if it's one of ours.
public bool Editor.PanelWindow.IgnoresInput { get; set; }
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.
bool—public virtual sealed bool Editor.PanelWindow.IsFocused { get; set; }
Does this window have keyboard focus?
bool—public bool Editor.PanelWindow.IsMaximized { get; set; }
Is the window maximized?
bool—public virtual sealed bool Editor.PanelWindow.IsOpen { get; set; }
Is this window still open?
bool—public bool Editor.PanelWindow.IsShown { get; set; }
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.
bool—public Vector2 Editor.PanelWindow.MaxSize { get; set; }
The largest the user can resize the window to. Zero means no limit.
public Vector2 Editor.PanelWindow.MinSize { get; set; }
The smallest the user can resize the window to. Zero means no limit.
public Vector2 Editor.PanelWindow.MousePosition { get; set; }
Where the cursor is, in this window's pixels.
public System.Action Editor.PanelWindow.OnCloseRequested { get; set; }
Called when the user clicks the window's close button. The window closes if this is null.
Action—public Vector2 Editor.PanelWindow.Position { get; set; }
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.
public float Editor.PanelWindow.ResizeBorder { get; set; }
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.
float—public Sandbox.UI.RootPanel Editor.PanelWindow.Root { get; set; }
The panel everything in this window hangs off.
public Vector2 Editor.PanelWindow.Size { get; set; }
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.
public bool Editor.PanelWindow.SizeToContents { get; set; }
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.
bool—public string Editor.PanelWindow.Title { get; set; }
The window's title bar text.
string—public Editor.PanelWindow Editor.PanelWindow.TooltipWindow { get; set; }
The tooltip window open over this one, if there is one.
public bool Editor.PanelWindow.VSync { get; set; }
Does this window's present wait for the display?
bool—No results match this filter.