Window Framework for UI Toolkit v2.0.x
GWG.WindowFramework.WindowFrameworkData Class Reference

Represents the configuration and runtime data for the Window Framework system, enabling management of UI-related settings such as tooltips, context menus, and theme preferences. More...

Public Member Functions

void FromDictionary (Dictionary< string, WindowFrameData > dict)
 Replaces serialized entry-list contents from the supplied runtime dictionary.
Dictionary< string, WindowFrameData > ToDictionary ()
 Copies current serialized entries into a new runtime dictionary.

Data Fields

string ActiveThemeId
 Stable selected theme identity, independent of display names and catalog order.
int ActiveThemeIndex
 Gets or sets the index of the currently active theme in the window framework's theme system.
float ContentMenuDelay
 Gets or sets the delay (in seconds) before context menus begin to fade out after being triggered for dismissal.
float ContentMenuFadeTime
 Gets or sets the duration (in seconds) for context menu fade animations.
int schemaVersion = 2
 Gets or sets the data schema version for persistence migration and backward compatibility. Version 1: Legacy format (no snapping/docking/tab parameters). Version 2: Modern format with snapping, screen docking, and tabbed window nesting.
bool TooltipActive
 Gets or sets a value indicating whether the tooltip system is enabled and active.
float TooltipFadeTime
 Gets or sets the duration (in seconds) for tooltip fade animations.
TooltipFadeType TooltipFadeType
 Gets or sets the type of fade animation used for tooltip transitions.
float TooltipHideDelay
 Gets or sets the delay (in seconds) before tooltips begin to hide after the cursor leaves the target element.
float TooltipShowDelay
 Gets or sets the delay (in seconds) before tooltips appear after the cursor hovers over a target element.
bool WindowDockingEnabled = true
 Gets or sets whether screen edge docking (split-screen) is enabled.
List< WindowFrameDataEntry > WindowFrameDataList = new List<WindowFrameDataEntry>()
 Gets or sets the collection of window frame data entries containing all window configurations and states.
float WindowSnapDistance = 5f
 Gets or sets the magnetic snap distance threshold in pixels.
bool WindowSnappingEnabled = true
 Gets or sets whether magnetic window snapping is enabled.
bool WindowSnapToScreen = true
 Gets or sets whether windows snap to screen boundaries.
bool WindowSnapToWindows = true
 Gets or sets whether windows snap to neighboring windows.
bool WindowTabDockingEnabled = true
 Gets or sets whether tabbed window nesting and docking is enabled.

Detailed Description

Represents the configuration and runtime data for the Window Framework system, enabling management of UI-related settings such as tooltips, context menus, and theme preferences.

The WindowFrameworkData class serves as the central configuration hub for the entire window framework system. It contains all global settings that affect the behavior and appearance of windows, tooltips, context menus, and other UI elements within the framework.

Primary Responsibilities:

  • Managing global animation and timing settings for UI elements
  • Storing tooltip configuration and behavior parameters
  • Maintaining context menu appearance and timing settings
  • Handling theme management and active theme selection
  • Retaining window-state records without owning controller memory policy
  • Providing centralized storage for all window frame data

Serialization and Persistence:
This class is designed to be easily serialized for saving and loading framework configuration between application sessions. The window frame data is stored as a list of entries rather than a dictionary to ensure compatibility with Unity's JSON serialization system.

// Create and configure window framework data
var frameworkData = new WindowFrameworkData
{
TooltipActive = true,
};
// Memory enablement is configured on WindowFrameController, not this saved payload.
// Serialize for saving
string json = JsonUtility.ToJson(frameworkData, true);
Represents the configuration and runtime data for the Window Framework system, enabling management of...
Definition WindowFrameworkData.cs:54
int ActiveThemeIndex
Gets or sets the index of the currently active theme in the window framework's theme system.
Definition WindowFrameworkData.cs:250
float TooltipFadeTime
Gets or sets the duration (in seconds) for tooltip fade animations.
Definition WindowFrameworkData.cs:134
float TooltipShowDelay
Gets or sets the delay (in seconds) before tooltips appear after the cursor hovers over a target elem...
Definition WindowFrameworkData.cs:157
bool TooltipActive
Gets or sets a value indicating whether the tooltip system is enabled and active.
Definition WindowFrameworkData.cs:227
float ContentMenuFadeTime
Gets or sets the duration (in seconds) for context menu fade animations.
Definition WindowFrameworkData.cs:88

Member Function Documentation

◆ FromDictionary()

void GWG.WindowFramework.WindowFrameworkData.FromDictionary ( Dictionary< string, WindowFrameData > dict)
inline

Replaces serialized entry-list contents from the supplied runtime dictionary.

Parameters
dictNonnull map of canonical persistence keys and data references.

Clears the existing list and stores new entry wrappers with shared data references. Does not clone records, save a file or promise dictionary enumeration order.

Here is the caller graph for this function:

◆ ToDictionary()

Dictionary< string, WindowFrameData > GWG.WindowFramework.WindowFrameworkData.ToDictionary ( )
inline

Copies current serialized entries into a new runtime dictionary.

Returns
New ordinal key map sharing the original WindowFrameData value references.

Duplicate keys use the last entry. Requires initialized list/non-null entries and keys; it does not validate identity or deserialize/reconstruct windows.

Here is the caller graph for this function:

Field Documentation

◆ ActiveThemeId

string GWG.WindowFramework.WindowFrameworkData.ActiveThemeId

Stable selected theme identity, independent of display names and catalog order.

Empty in legacy files. Migrate ActiveThemeIndex against shipped themes before appending player entries. Persist only after successful selection application.

◆ ActiveThemeIndex

int GWG.WindowFramework.WindowFrameworkData.ActiveThemeIndex

Gets or sets the index of the currently active theme in the window framework's theme system.

An integer representing the zero-based index of the active theme. Must be a valid index within the available themes collection.

This property controls which visual theme is applied to all windows and UI elements within the framework. Themes typically include color schemes, fonts, spacing, and other visual styling properties that provide consistent appearance across the application.

// Set to default theme
frameworkData.ActiveThemeIndex = 0;
// Set to dark theme (assuming it's at index 1)
frameworkData.ActiveThemeIndex = 1;

◆ ContentMenuDelay

float GWG.WindowFramework.WindowFrameworkData.ContentMenuDelay

Gets or sets the delay (in seconds) before context menus begin to fade out after being triggered for dismissal.

A float value representing the delay in seconds before context menu fade-out begins. Typical values range from 0.0f to 3.0f seconds.

This delay provides users with a grace period to move their cursor back to the context menu if they accidentally move away from it. It prevents menus from disappearing too quickly when users are trying to navigate to menu items.

// Responsive context menus with short delay
frameworkData.ContentMenuDelay = 0.2f;
// User-friendly context menus with medium delay
frameworkData.ContentMenuDelay = 0.8f;

◆ ContentMenuFadeTime

float GWG.WindowFramework.WindowFrameworkData.ContentMenuFadeTime

Gets or sets the duration (in seconds) for context menu fade animations.

A float value representing the time in seconds for context menu fade transitions. Typical values range from 0.1f to 1.0f seconds.

This property controls how long context menus take to fade in when appearing and fade out when disappearing. A shorter duration creates snappy, responsive menus, while a longer duration provides smoother, more polished transitions.

// Quick, responsive context menus
frameworkData.ContentMenuFadeTime = 0.15f;
// Smooth, polished context menus
frameworkData.ContentMenuFadeTime = 0.4f;

◆ schemaVersion

int GWG.WindowFramework.WindowFrameworkData.schemaVersion = 2

Gets or sets the data schema version for persistence migration and backward compatibility. Version 1: Legacy format (no snapping/docking/tab parameters). Version 2: Modern format with snapping, screen docking, and tabbed window nesting.

◆ TooltipActive

bool GWG.WindowFramework.WindowFrameworkData.TooltipActive

Gets or sets a value indicating whether the tooltip system is enabled and active.

true if tooltips are enabled and will be displayed when appropriate; false if the tooltip system is disabled and no tooltips will appear.

This global switch allows for complete enabling or disabling of the tooltip system throughout the entire window framework. When disabled, no tooltips will be processed or displayed, regardless of individual element tooltip configurations.

// Enable tooltips for desktop application
frameworkData.TooltipActive = true;
// Disable tooltips for touch-based interface
frameworkData.TooltipActive = false;

◆ TooltipFadeTime

float GWG.WindowFramework.WindowFrameworkData.TooltipFadeTime

Gets or sets the duration (in seconds) for tooltip fade animations.

A float value representing the time in seconds for tooltip fade transitions. Typical values range from 0.1f to 0.8f seconds.

This property determines how quickly tooltips fade in when appearing and fade out when disappearing. The fade time affects the perceived responsiveness and polish of the interface. The fade behavior is controlled by the TooltipFadeType property.

// Quick, subtle tooltip transitions
frameworkData.TooltipFadeTime = 0.2f;
// Smooth, noticeable tooltip transitions
frameworkData.TooltipFadeTime = 0.4f;

◆ TooltipFadeType

TooltipFadeType GWG.WindowFramework.WindowFrameworkData.TooltipFadeType

Gets or sets the type of fade animation used for tooltip transitions.

A TooltipFadeType enumeration value that specifies the animation type for tooltip appearance and disappearance effects.

This property determines the visual style of tooltip animations. Different fade types may be more appropriate for different tooltip styles and content types. The fade type works in conjunction with TooltipFadeTime to create the complete animation effect.

// Fade both appearance and dismissal
frameworkData.TooltipFadeType = TooltipFadeType.FadeInAndOut;
// Instant appearance/dismissal
frameworkData.TooltipFadeType = TooltipFadeType.None;
TooltipFadeType TooltipFadeType
Gets or sets the type of fade animation used for tooltip transitions.
Definition WindowFrameworkData.cs:204

◆ TooltipHideDelay

float GWG.WindowFramework.WindowFrameworkData.TooltipHideDelay

Gets or sets the delay (in seconds) before tooltips begin to hide after the cursor leaves the target element.

A float value representing the delay in seconds before tooltip hiding begins. Typical values range from 0.0f to 1.0f seconds.

This delay provides a grace period that allows users to move their cursor from the trigger element to the tooltip itself (if the tooltip is interactive) or gives users time to finish reading the tooltip content before it disappears.

// No delay for simple tooltips
frameworkData.TooltipHideDelay = 0.0f;
// Longer delay for interactive tooltips
frameworkData.TooltipHideDelay = 0.8f;

◆ TooltipShowDelay

float GWG.WindowFramework.WindowFrameworkData.TooltipShowDelay

Gets or sets the delay (in seconds) before tooltips appear after the cursor hovers over a target element.

A float value representing the hover delay in seconds before tooltip display begins. Typical values range from 0.3f to 2.0f seconds.

This delay prevents tooltips from appearing immediately when the cursor briefly passes over elements, reducing visual noise and distraction. The delay should be long enough to avoid accidental tooltip triggers but short enough to be responsive to intentional hovering.

// Responsive tooltips for interactive elements
frameworkData.TooltipShowDelay = 0.4f;
// Conservative tooltips to reduce distraction
frameworkData.TooltipShowDelay = 1.5f;

◆ WindowDockingEnabled

bool GWG.WindowFramework.WindowFrameworkData.WindowDockingEnabled = true

Gets or sets whether screen edge docking (split-screen) is enabled.

◆ WindowFrameDataList

List<WindowFrameDataEntry> GWG.WindowFramework.WindowFrameworkData.WindowFrameDataList = new List<WindowFrameDataEntry>()

Gets or sets the collection of window frame data entries containing all window configurations and states.

A List<T> of WindowFrameDataEntry objects, each containing a KeyValue-value pair of window identifiers and their corresponding WindowFrameData.

This list serves as the primary storage for all window frame configurations within the framework. It's implemented as a list of entries rather than a dictionary to ensure compatibility with Unity's JSON serialization system, which doesn't natively support dictionary serialization.

// Add window data to the list
frameworkData.WindowFrameDataList.Add(new WindowFrameDataEntry
{
KeyValue = "MainWindow",
Value = new WindowFrameData
{
windowId = "MainWindow",
title = "Main Window"
}
});
Represents a KeyValue-value pair entry for window frame data storage, designed for serialization comp...
Definition WindowFrameworkData.cs:348
Represents the serializable data structure for storing and loading window frame configuration and sta...
Definition WindowFrameData.cs:64

◆ WindowSnapDistance

float GWG.WindowFramework.WindowFrameworkData.WindowSnapDistance = 5f

Gets or sets the magnetic snap distance threshold in pixels.

◆ WindowSnappingEnabled

bool GWG.WindowFramework.WindowFrameworkData.WindowSnappingEnabled = true

Gets or sets whether magnetic window snapping is enabled.

◆ WindowSnapToScreen

bool GWG.WindowFramework.WindowFrameworkData.WindowSnapToScreen = true

Gets or sets whether windows snap to screen boundaries.

◆ WindowSnapToWindows

bool GWG.WindowFramework.WindowFrameworkData.WindowSnapToWindows = true

Gets or sets whether windows snap to neighboring windows.

◆ WindowTabDockingEnabled

bool GWG.WindowFramework.WindowFrameworkData.WindowTabDockingEnabled = true

Gets or sets whether tabbed window nesting and docking is enabled.