Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Class TWindowState
Unit
CastleWindowModes
Declaration
type TWindowState = class(TObject)
Description
Hierarchy
Overview
Methods
Description
Methods
 |
destructor Destroy; override; |
|
 |
procedure GetState(Window: TCastleWindowBase); |
GetState saves the TCastleWindowBase state, SetState applies this state back to the window (the same window, or other). Every property that can change when TCastleWindowBase is open are saved. This way you can save/restore TCastleWindowBase state, you can also copy a state from one window into another.
Notes about TCastleWindowBase.MainMenu saving: only the reference to MainMenu is stored. So:
If you use TCastleWindowBase.MainMenu, be careful when copying it to another window (no two windows may own the same MainMenu instance at the same time; also, you would have to make sure MainMenu instance will not be freed two times).
Do not change the MainMenu contents during TGLMode.Create/Free. Although you can change MainMenu to something completely different. Just keep the assumption that MainMenu stays <> nil.
As an exception to the previous point, you can freely change MainMenu.Enabled, that is saved specially for this.
|
 |
class procedure SetStandardState(Window: TCastleWindowBase; NewDraw, NewResize, NewCloseQuery: TWindowFunc); |
Resets all window properties (that are get / set by TWindowState). For most properties, we simply reset them to some sensible default values. For some important properties, we take their value explicitly by parameter.
Window properties resetted:
If you're looking for a suitable callback to pass as NewCloseQuery (new TCastleWindowBase.OnCloseQuery), @NoClose may be suitable: it's an empty callback, thus using it disables the possibility to close the window by window manager (usually using "close" button in some window corner or Alt+F4).
|
Generated by PasDoc 0.12.1 on 2013-02-04 20:26:53
|