Class TWindowState

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TWindowState = class(TObject)

Description

Hierarchy

  • TObject
  • TWindowState

Overview

Methods

Public constructor Create(Window: TCastleWindowBase);
Public destructor Destroy; override;
Public procedure GetState(Window: TCastleWindowBase);
Public procedure SetState(Window: TCastleWindowBase);
Public class procedure SetStandardState(Window: TCastleWindowBase; NewDraw, NewResize, NewCloseQuery: TWindowFunc);

Description

Methods

Public constructor Create(Window: TCastleWindowBase);

Constructor. Gets the state of given window (like GetState).

Public destructor Destroy; override;
 
Public 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.

Public procedure SetState(Window: TCastleWindowBase);
 
Public 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.13.0 on 2013-08-17 21:27:15