Widgets (Web API)

From PowerUI
Revision as of 10:14, 14 January 2017 by 151.229.186.156 (talk) (Created page with "'''Note: Not to be confused with the standard window object.''' In order to make the window system as useful as possible, it features a Web API available as...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Note: Not to be confused with the standard window object. In order to make the window system as useful as possible, it features a Web API available as document.sparkWindows. This is used to open, close, cycle, find etc windows within a document.

Available methods

See the source documents for Windows.Manager, or the source itself which is here:

PowerUI/Source/Extras/Window System/Manager.cs


Get the window that an element is in

It's often useful to obtain the window object that a particular element is in. It's as simple as this:

// HtmlElement anElement;

// Null if it's not in any window
Window myWindow=anElement.sparkWindow;

Opening a window relative to another

It's important to note that every window is also a window manager. This lets you open a window "on top" of another one, regardless of their defined stacking order. An example of where this is useful is, for example, fading the screen out and then displaying a pause menu.