OOUI/Windows/nl

Een   is een container voor elementen in een onderliggend frame. Elk venster wordt beheerd door een  , die wordt gebruikt om het venster te openen en te sluiten en de presentatie ervan te beheren. De grootte van een venster wordt opgegeven met behulp van een symbolische naam ('small', 'medium', 'large' of 'full'), die wordt geïnterpreteerd door de window manager. Als de gevraagde grootte niet wordt herkend, kiest de windowmanager voor een verstandige fallback.

OOUI windows bevat Dialog, ProcessDialog en MessageDialog. Voor eenvoudige gebruikssituaties bestaan er verschillende functies. Zie Eenvoudige berichten.

Houd er rekening mee dat vensters reageren op de grootte van het weergaveapparaat en hun weergave dienovereenkomstig dynamisch aanpassen. De grootte van het dialoogvenster moet daarom eerder als een benadering dan als een exacte specificatie worden beschouwd.



Levensduur venster
Beheerde vensters sluiten elkaar uit. Er kan geen nieuw venster worden geopend als er een huidig venster 'geopend is. Windows zelf is persistent en kan, in plaats van te worden afgebroken wanneer het wordt gesloten, opnieuw worden gevuld met de relevante gegevens en opnieuw worden gebruikt. De levenscyclus van een venster wordt weergegeven door een object WindowInstance. This object has four properties, containing promises that represent the primary stages of the cycle: 'opening', 'opened', 'closing', and 'closed'.


 * The opening promise is resolved after the window has started opening (this may be delayed if another window is still closing), with the 'data' value passed to the  call.
 * The opened promise is resolved after the window is opened, with the 'data' value passed to the  call.
 * The closing promise is resolved after the window has started closing, with the 'data' value passed to the  call.
 * The closed promise is resolved after the window is closed, with the 'data' value passed to the  call.

See Process dialogs, for examples that show this promise chain in practice.

For backwards compatibility, WindowInstance objects returned by  and   are extended with Promise-like properties. This will be removed in the future.

Before the window is opened for the first time (and only before the first time), the   method is called. The  method is used to populate the window with persistent content, providing a sort of caching mechanism. A window that contains a list of 250 languages can be populated with that list during initialization, for example, and if the window is opened again, the list will not have to be reloaded.



Openen (Opening )
The opening stage begins when the window manager’s  or the window’s   method is used to open a window. WindowInstance's 'opening' promise is resolved. For backwards compatibility, the window manager emits an 'opening' event with a promise that will be resolved with an 'opened' promise when the window is setup, ready, and opened.

The window manager then calls the  method, which gets the number of milliseconds to wait before calling the window’s   method and executing the result. The  method assembles a process for setting up the window with data passed to the opening function. Each time a window is reused, it can be set up with new data. When setup is complete, a 'setup' progress notification is emitted from the opening promise.

The window manager then calls the  method, which gets the number of milliseconds to wait between finishing setup and calling the window’s   method and executing the result. A 'ready' progress notification is then emitted from the backwards-compatibility opening promise.

Geopend (Opened)
When the window is set up and ready, WindowInstance's 'opened' promise is resolved, and the backwards-compatibility 'opening' promise is resolved with a backwards-compatibility 'opened' promise. The window is now opened. At this point it is okay to set the focus inside the window.

Sluiten (Closing)
The closing stage begins when the window manager’s  or the window’s   method is used to close a window. WindowInstance's 'closing' promise is resolved. For backwards compatibility, the window manager emits a 'closing' event and the backwards-compatibility 'opened' promise is resolved with a backwards-compatibility 'closing' promise.

The window manager calls the  method, which gets the number of milliseconds to wait before calling the window’s   method and executing the result. There is rarely a need to override this method, though one might if a window requires a long time to teardown and you wish to disable the window controls in the meantime. When the hold process is complete, a 'hold' progress notification is emitted from the backwards-compatibility closing promise.

The window manager then calls the  method, which gets the number of milliseconds to wait between finishing the hold process and calling the window’s   method and executing the result. A 'teardown' progress notification is emitted from the backwards-compatibility closing promise.

Gesloten (Closed)
When the teardown process is complete, WindowInstance's 'closed' promise is resolved, the backwards-compatibility closing promise is resolved. Any data passed to the  method will be passed as a resolution value to WindowInstance's 'closed' promise and the backwards-compatibility closing promise. The window is now closed.

Opmerkingen
Note that each process (e.g., setup, ready, hold, teardown) is executed in series, so asynchronous processing can complete. Always assume window processes are executed asynchronously. See Processes and errors for more details about processes.

Closing a window without data will safely close it without making any changes, essentially canceling the process.

The WindowManager can also be configured to prevent interaction outside the window (by setting the modal option to 'true'). For a full list of supported methods and configuration options, please see the code-level documentation.



Voorbeeld gebruik WindowInstance
If you just want to open window and wait for it to be closed, use: