|
Window Framework for UI Toolkit v2.0.x
|
Represents the serializable data structure for storing and loading window frame configuration and state information. This class contains all the essential properties needed to persist window settings between application sessions. More...
Data Fields | |
| int | activeTabIndex = 0 |
| Index of the active tab if this window has nested tabs docked inside it. | |
| List< string > | dockedTabKeys = new List<string>() |
| List of data keys for nested child tabs currently docked inside this window frame. | |
| Vector2 | location |
| Gets or sets the screen position of the window frame. | |
| bool | locked |
| Gets or sets a value indicating whether the window frame is locked in position and/or size. | |
| bool | lockedToStartPosition |
| Gets or sets a value indicating whether the window is constrained to its initial start position. | |
| string | name |
| Gets or sets the internal name of the window frame. | |
| float | opacity |
| Gets or sets the opacity (transparency) level of the window frame. | |
| string | parentHostWindowKey |
| Identifier key of the parent host window that currently contains this window as a nested tab, if any. | |
| string | parentObjectId |
| Gets or sets the identifier of the parent object that owns or contains this window frame. | |
| Vector2 | size |
| Gets or sets the dimensions (width and height) of the window frame. | |
| string | title |
| Gets or sets the display title of the window frame. | |
| bool | visible |
| Gets or sets a value indicating whether the window frame is currently visible. | |
| bool | wasOpen |
| Gets or sets a value indicating whether the window was open during the last application session. | |
| WindowFramePosition | windowFrameStartPosition |
| Gets or sets the designated start position for the window frame. | |
| string | windowId |
| Gets or sets the unique identifier for the window frame. | |
| string | windowType |
| Gets or sets the type classification of the window frame. | |
Represents the serializable data structure for storing and loading window frame configuration and state information. This class contains all the essential properties needed to persist window settings between application sessions.
The WindowFrameData class is designed to work with Unity's serialization system and supports automatic loading and saving of window frame properties. The serialization system automatically handles the addition of new variables to existing save files, making it extensible for future enhancements.
Supported Data Types:
The serialization system supports the following basic types:
Extensibility:
When adding new properties to this class, you must implement the corresponding logic to handle the data loading and application of the new properties in the window frame system.
| int GWG.WindowFramework.WindowFrameData.activeTabIndex = 0 |
Index of the active tab if this window has nested tabs docked inside it.
| List<string> GWG.WindowFramework.WindowFrameData.dockedTabKeys = new List<string>() |
List of data keys for nested child tabs currently docked inside this window frame.
| Vector2 GWG.WindowFramework.WindowFrameData.location |
Gets or sets the screen position of the window frame.
A Vector2 representing the window's position in screen coordinates. Typically measured in pixels from the top-left corner of the screen or parent container.
The location property determines where the window appears on the screen and is used for:
Coordinate System:
The coordinate system typically follows screen space conventions where:
| bool GWG.WindowFramework.WindowFrameData.locked |
Gets or sets a value indicating whether the window frame is locked in position and/or size.
true if the window is locked and cannot be moved or resized by the user; false if the window can be freely manipulated.
When a window is locked, it typically prevents user interactions such as:
Locked windows are useful for:
The locked state can be changed programmatically even when the window is locked.
| bool GWG.WindowFramework.WindowFrameData.lockedToStartPosition |
Gets or sets a value indicating whether the window is constrained to its initial start position.
true if the window should remain locked to its designated start position; false if the window can be moved away from its start position.
This property works in conjunction with windowFrameStartPosition to provide positional constraints. When set to true, it typically:
Use Cases:
This is particularly useful for:
| string GWG.WindowFramework.WindowFrameData.name |
Gets or sets the internal name of the window frame.
A string representing the internal or system name of the window, typically used for identification and debugging purposes.
The name property serves as an internal identifier that differs from the user-visible title. It's commonly used for:
Unlike the title, the name typically remains constant and is not localized or changed based on user preferences.
| float GWG.WindowFramework.WindowFrameData.opacity |
Gets or sets the opacity (transparency) level of the window frame.
A float value between 0.0 and 1.0, where 0.0 is completely transparent (invisible) and 1.0 is completely opaque (fully visible).
The opacity property controls the visual transparency of the entire window and its contents. This is useful for:
Performance Considerations:
Semi-transparent windows may have performance implications, especially when:
| string GWG.WindowFramework.WindowFrameData.parentHostWindowKey |
Identifier key of the parent host window that currently contains this window as a nested tab, if any.
| string GWG.WindowFramework.WindowFrameData.parentObjectId |
Gets or sets the identifier of the parent object that owns or contains this window frame.
A string identifier referencing the parent object. Can be null or empty if the window has no parent.
The parent object ID establishes a hierarchical relationship between windows and their containers. This is useful for:
When a parent object is destroyed or becomes inactive, the window framework can use this information to appropriately handle child windows.
| Vector2 GWG.WindowFramework.WindowFrameData.size |
Gets or sets the dimensions (width and height) of the window frame.
A Vector2 representing the window's width (x component) and height (y component) in screen units, typically pixels.
The size property determines the window's dimensions and affects:
Size Constraints:
Consider implementing minimum and maximum size constraints to ensure:
| string GWG.WindowFramework.WindowFrameData.title |
Gets or sets the display title of the window frame.
A string representing the user-visible title displayed in the window's title bar or header.
The title is the text that users see in the window's title bar and is typically:
The title can be updated during runtime to reflect changing content or status, such as indicating unsaved changes or current selection.
| bool GWG.WindowFramework.WindowFrameData.visible |
Gets or sets a value indicating whether the window frame is currently visible.
true if the window is visible and rendered on screen; false if the window is hidden and not rendered.
The visible property controls whether the window is displayed to the user and affects:
Visibility vs. Opacity:
Unlike the opacity property, setting visible to false typically:
| bool GWG.WindowFramework.WindowFrameData.wasOpen |
Gets or sets a value indicating whether the window was open during the last application session.
true if the window was open when the application was last closed; false if the window was closed or never opened in the previous session.
The wasOpen property is used for session persistence and helps the window framework:
Usage in Window Restoration:
This property is typically used during application startup to determine which windows should be automatically opened to match the user's previous working environment.
Difference from visible:
While visible represents the current visibility state, wasOpen represents the historical state and is used for persistence logic rather than immediate display control.
| WindowFramePosition GWG.WindowFramework.WindowFrameData.windowFrameStartPosition |
Gets or sets the designated start position for the window frame.
A WindowFramePosition enumeration value that specifies where the window should initially appear on the screen.
This property defines the initial positioning behavior for the window and is used by the window framework to calculate the appropriate screen coordinates. The start position works in conjunction with lockedToStartPosition to control positioning behavior.
Position Calculation:
The actual screen coordinates are typically calculated based on:
Dynamic Positioning:
Start positions are especially useful for ensuring consistent window placement across:
| string GWG.WindowFramework.WindowFrameData.windowId |
Gets or sets the unique identifier for the window frame.
A string that uniquely identifies this window frame instance within the application. Should be unique across all window frames to prevent conflicts.
The window ID is used internally by the window framework to manage and reference specific window instances. It should remain consistent across application sessions to ensure proper restoration of window settings.
Best practices for window IDs:
| string GWG.WindowFramework.WindowFrameData.windowType |
Gets or sets the type classification of the window frame.
A string that categorizes the window type, used for applying type-specific behaviors, styling, or management logic.
The window type serves multiple purposes in the window framework:
Common window types might include dialog boxes, tool windows, document windows, or application-specific categories like inventory, character, or settings windows.