Class Window
Base class you can use to implement an ImGui window for use with the built-in WindowSystem.
Inheritance
Inherited Members
Namespace: Dalamud.Interface.Windowing
Assembly: Dalamud.dll
Syntax
public abstract class Window
Constructors
| Improve this Doc View SourceWindow(String, ImGuiWindowFlags, Boolean)
Initializes a new instance of the Window class.
Declaration
protected Window(string name, ImGuiWindowFlags flags = ImGuiWindowFlags.None, bool forceMainWindow = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The name/ID of this window. If you have multiple windows with the same name, you will need to append an unique ID to it by specifying it after "###" behind the window title. |
| ImGuiWindowFlags | flags | The ImGuiWindowFlags of this window. |
| System.Boolean | forceMainWindow | Whether or not this window should be limited to the main game window. |
Properties
| Improve this Doc View SourceBgAlpha
Gets or sets this window's background alpha value.
Declaration
public float? BgAlpha { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Single> |
Collapsed
Gets or sets a value indicating whether or not this window is collapsed.
Declaration
public bool? Collapsed { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
CollapsedCondition
Gets or sets the condition that defines when the collapsed state of this window is set.
Declaration
public ImGuiCond CollapsedCondition { get; set; }
Property Value
| Type | Description |
|---|---|
| ImGuiCond |
Flags
Gets or sets the window flags.
Declaration
public ImGuiWindowFlags Flags { get; set; }
Property Value
| Type | Description |
|---|---|
| ImGuiWindowFlags |
ForceMainWindow
Gets or sets a value indicating whether or not this ImGui window will be forced to stay inside the main game window.
Declaration
public bool ForceMainWindow { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsFocused
Gets a value indicating whether the window is focused.
Declaration
public bool IsFocused { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
IsOpen
Gets or sets a value indicating whether or not this window will stay open.
Declaration
public bool IsOpen { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Namespace
Gets or sets the namespace of the window.
Declaration
public string Namespace { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Position
Gets or sets the position of this window.
Declaration
public Vector2? Position { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Numerics.Vector2> |
PositionCondition
Gets or sets the condition that defines when the position of this window is set.
Declaration
public ImGuiCond PositionCondition { get; set; }
Property Value
| Type | Description |
|---|---|
| ImGuiCond |
RespectCloseHotkey
Gets or sets a value indicating whether this window is to be closed with a hotkey, like Escape, and keep game addons open in turn if it is closed.
Declaration
public bool RespectCloseHotkey { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ShowCloseButton
Gets or sets a value indicating whether or not this ImGui window should display a close button in the title bar.
Declaration
public bool ShowCloseButton { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Size
Gets or sets the size of the window. The size provided will be scaled by the global scale.
Declaration
public Vector2? Size { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Numerics.Vector2> |
SizeCondition
Gets or sets the condition that defines when the size of this window is set.
Declaration
public ImGuiCond SizeCondition { get; set; }
Property Value
| Type | Description |
|---|---|
| ImGuiCond |
SizeConstraints
Gets or sets the size constraints of the window. The size constraints provided will be scaled by the global scale.
Declaration
public Window.WindowSizeConstraints? SizeConstraints { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<Window.WindowSizeConstraints> |
WindowName
Gets or sets the name of the window. If you have multiple windows with the same name, you will need to append an unique ID to it by specifying it after "###" behind the window title.
Declaration
public string WindowName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
| Improve this Doc View SourceBringToFront()
Bring this window to the front.
Declaration
public void BringToFront()
Draw()
Code to be executed every time the window renders.
Declaration
public abstract void Draw()
Remarks
In this method, implement your drawing code. You do NOT need to ImGui.Begin your window.
DrawConditions()
Additional conditions for the window to be drawn, regardless of its open-state.
Declaration
public virtual bool DrawConditions()
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the window should be drawn, false otherwise. |
Remarks
Not being drawn due to failing this condition will not change focus or trigger OnClose. This is checked before PreDraw, but after Update.
OnClose()
Code to be executed when the window is closed.
Declaration
public virtual void OnClose()
OnOpen()
Code to be executed when the window is opened.
Declaration
public virtual void OnOpen()
PostDraw()
Code to be executed after the window is drawn.
Declaration
public virtual void PostDraw()
PreDraw()
Code to be executed before conditionals are applied and the window is drawn.
Declaration
public virtual void PreDraw()
PreOpenCheck()
Code to always be executed before the open-state of the window is checked.
Declaration
public virtual void PreOpenCheck()
Toggle()
Toggle window is open state.
Declaration
public void Toggle()
Update()
Code to be executed every frame, even when the window is collapsed.
Declaration
public virtual void Update()