Class TGUIEnvironment

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TGUIEnvironment = class(TReferenceCounted)

Description

The engine's GUI Environment. Used as factory and manager of all other GUI elements.

Hierarchy

Overview

Methods

Public constructor Create(Ref: Pointer; NFileSystem: TFileSystem; NVideoDriver: TVideoDriver);
Public function AddButton(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''; const ToolTip: StringType = ''): TGUIButton; inline;
Public function AddCheckBox(Checked: Boolean; const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''): TGUICheckBox; inline;
Public function AddColorSelectDialog(const Title: StringType = ''; Modal: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIColorSelectDialog; inline;
Public function AddComboBox(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIComboBox; inline;
Public function AddContextMenu(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIContextMenu; inline;
Public function AddEditBox(const Text: StringType; const Rectangle: TRect; Border: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIEditBox; inline;
Public function AddEmptySpriteBank(const Name: StringType): TGUISpriteBank; inline;
Public function AddFileOpenDialog(const Title: StringType; Modal: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIFileOpenDialog; inline;
Public function AddFont(const Name: StringType; Font: TGUIFont): TGUIFont; inline;
Public function AddGUIElement(const ElementName: AnsiString; Parent: TGUIElement = nil): TGUIElement;
Public function AddImage(Image: TTexture; const Pos: TPoint; UseAlphaChannel: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''): TGUIImage; overload; inline;
Public function AddImage(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = 1; const Caption: StringType = ''): TGUIImage; overload; inline;
Public function AddInOutFader(Parent: TGUIElement; ID: LongInt = -1): TGUIInOutFader; overload; inline;
Public function AddInOutFader(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIInOutFader; overload; inline;
Public function AddListBox(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; DrawBackground: Boolean = False): TGUIListBox; overload; inline;
Public function AddMenu(Parent: TGUIElement = nil; ID: LongInt = -1): TGUIContextMenu; inline;
Public function AddMeshViewer(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''): TGUIMeshViewer; inline;
Public function AddMessageBox(const Caption: StringType; const Text: StringType = ''; Modal: Boolean = True; Flags: LongWord = LongWord(mbOK); Parent: TGUIElement = nil; ID: LongInt = -1; Image: TTexture = nil): TGUIWindow; inline;
Public function AddModalScreen(Parent: TGUIElement): TGUIElement; inline;
Public function AddScrollBar(Horizontal: Boolean; const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIScrollBar; inline;
Public function AddSpinBox(const Text: StringType; const Rectangle: TRect; Border: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUISpinBox; inline;
Public function AddStaticText(const Text: StringType; const Rectangle: TRect; Border: Boolean = False; WordWrap: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1; FillBackground: Boolean = False): TGUIStaticText; inline;
Public function AddTab(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUITab; inline;
Public function AddTabControl(const Rectangle: TRect; Parent: TGUIElement = nil; FillBackground: Boolean = False; Border: Boolean = True; ID: LongInt = -1): TGUITabControl; inline;
Public function AddTable(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; DrawBackground: Boolean = False): TGUITable; inline;
Public function AddToolBar(Parent: TGUIElement = nil; ID: LongInt = -1): TGUIToolBar; inline;
Public function AddTreeView(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; DrawBackground: Boolean = False; ScrollBarVertical: Boolean = True; ScrollBarHorizontal: Boolean = False): TGUITreeView; inline;
Public function AddWindow(const Rectangle: TRect; Modal: Boolean = False; const Text: StringType = ''; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIWindow; inline;
Public function CreateImageList(Texture: TTexture; const ImageSize: TSize; UseAlphaChannel: Boolean): TGUIImageList; inline;
Public function CreateSkin(SkinType: TGUISkinType): TGUISkin; inline;
Public function GetBuiltInFont: TGUIFont; inline;
Public function GetDefaultGUIElementFactory: TGUIElementFactory; inline;
Public function GetFocus: TGUIElement; inline;
Public function GetFont(const FileName: StringType): TGUIFont; inline;
Public function GetGUIElementFactory(Index: LongWord): TGUIElementFactory; inline;
Public function GetOSOperator: TOSOperator; inline;
Public function GetRoot: TGUIElement; inline;
Public function GetSkin: TGUISkin; inline;
Public function GetSpriteBank(const FileName: StringType): TGUISpriteBank; inline;
Public function HasFocus(Element: TGUIElement): Boolean; inline;
Public function LoadGUI(RFile: TReadFile; Parent: TGUIElement = nil): Boolean; overload; inline;
Public function LoadGUI(const Path: StringType; Parent: TGUIElement = nil): Boolean; overload; inline;
Public function PostEventFromUser(Event: TIrrlichtEvent): Boolean; inline;
Public function RemoveFocus(Element: TGUIElement): Boolean; inline;
Public function SaveGUI(const Path: StringType; Start: TGUIElement = nil): Boolean; overload; inline;
Public function SaveGUI(WFile: TWriteFile; Start: TGUIElement = nil): Boolean; overload; inline;
Public function SetFocus(Element: TGUIElement): Boolean; inline;
Public procedure Clear; inline;
Public procedure DrawAll; inline;
Public procedure ReadGUIElement(Reader: TXMLReader; Node: TGUIElement); inline;
Public procedure RegisterGUIElementFactory(Factory: TGUIElementFactory); inline;
Public procedure SetSkin(NewSkin: TGUISkin); inline;
Public procedure SetUserEventReceiver(Receiver: TWrapper); inline;
Public procedure WriteGUIElement(Writer: TXMLWriter; Node: TGUIElement); inline;

Properties

Public property FileSystem: TFileSystem read FFileSystem;
Public property RegisteredGUIElementFactoryCount: LongWord read GetRegisteredGUIElementFactoryCount;
Public property VideoDriver: TVideoDriver read FVideoDriver;

Description

Methods

Public constructor Create(Ref: Pointer; NFileSystem: TFileSystem; NVideoDriver: TVideoDriver);

Constructor. Only used internally.

Public function AddButton(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''; const ToolTip: StringType = ''): TGUIButton; inline;

Adds a button element.

Parameters
Rectangle
Rectangle specifying the borders of the button.
Parent
Parent gui element of the button.
ID
ID with which the gui element can be identified.
Caption
Text displayed on the button.
ToolTip
Text displayed in the tooltip.
Returns

The created button. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddCheckBox(Checked: Boolean; const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''): TGUICheckBox; inline;

Adds a checkbox element.

Parameters
Checked
Define the initial state of the check box.
Rectangle
Rectangle specifying the borders of the check box.
Parent
Parent gui element of the check box.
ID
Id to identify the gui element.
Caption
Title text of the check box.
Returns

The created check box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddColorSelectDialog(const Title: StringType = ''; Modal: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIColorSelectDialog; inline;

Adds a color select dialog.

Parameters
Title
The title of the dialog.
ModalDefines
if the dialog is modal. This means, that all other gui elements which were created before the dialog cannot be used until it is removed.
Parent
The parent of the dialog.
ID
The ID of the dialog.
Returns

The created file open dialog. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddComboBox(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIComboBox; inline;

Adds a combo box to the environment.

Parameters
Rectangle
Rectangle specifying the borders of the combo box.
Parent
Parent item of the element, e.g. a window. Set it to nil to place the combo box directly in the environment.
ID
An identifier for the combo box.
Returns

The created combo box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddContextMenu(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIContextMenu; inline;

Adds a context menu to the environment.

Parameters
Rectangle
Rectangle specifying the borders of the menu. Note that the menu is resizing itself based on what items you add.
Parent
Parent item of the element, e.g. a window. Set it to nil to place the menu directly in the environment
ID
An identifier for the menu.
Returns

The created context menu. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddEditBox(const Text: StringType; const Rectangle: TRect; Border: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIEditBox; inline;

Adds an edit box.
Supports unicode input from every keyboard around the world, scrolling, copying and pasting (exchanging data with the clipboard directly), maximum character amount, marking, and all shortcuts like ctrl+X, ctrl+V, ctrl+C, shift+Left, shift+Right, Home, End, and so on.

Parameters
Text
Text to be displayed. Can be altered after creation by setting the Text property.
Rectangle
Rectangle specifying the borders of the edit box.
Border
Set to true if the edit box should have a 3d border.
Parent
Parent item of the element, e.g. a window. Set it to nil to place the edit box directly in the environment.
ID
The ID of the element.
Returns

The created edit box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddEmptySpriteBank(const Name: StringType): TGUISpriteBank; inline;

Adds an empty sprite bank to the manager.

Parameters
Name
Name of the new sprite bank.
Returns

The sprite bank. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddFileOpenDialog(const Title: StringType; Modal: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIFileOpenDialog; inline;

Adds a file open dialog.

Parameters
Title
Text to be displayed as the title of the dialog.
Modal
Defines if the dialog is modal. This means, that all other gui elements which were created before the message box cannot be used until this messagebox is removed.
Parent
Parent gui element of the dialog.
ID
Id to identify the gui element.
Returns

The created file open dialog. Returns 0 if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddFont(const Name: StringType; Font: TGUIFont): TGUIFont; inline;

Adds an externally loaded font to the font list.
This method allows to attach an already loaded font to the list of existing fonts. The font is grabbed if non-null and adding was successful.

Parameters
Name
Name the font should be stored as.
Font
The font to add.
Returns

The stored font. This can differ from given parameter if the name previously existed.

Public function AddGUIElement(const ElementName: AnsiString; Parent: TGUIElement = nil): TGUIElement;

Adds a GUI element by its name.
Each factory is checked if it can create an element of the given name. The first match will be created.

Parameters
ElementName
Name of the element to be created.
Parent
of the new element, if not nil.
Returns

The New GUI element, or nil if no such element exists.

Public function AddImage(Image: TTexture; const Pos: TPoint; UseAlphaChannel: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''): TGUIImage; overload; inline;

Adds an image element.

Parameters
Image
Image to be displayed.
Pos
Position of the image. The width and height of the image is taken from the image.
UseAlphaChannel
Sets if the image should use the alpha channel of the texture to draw itself.
Parent
Parent gui element of the image.
ID
Id to identify the gui element.
Caption
Title text of the image.
Returns

Tthe created image element. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddImage(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = 1; const Caption: StringType = ''): TGUIImage; overload; inline;

Adds an image element.
Use TGUIImage.SetImage later to set the image to be displayed. not be dropped. See IReferenceCounted.Drop for more information.

Parameters
Rectangle
Rectangle specifying the borders of the image.
Parent
Parent gui element of the image.
ID
Id to identify the gui element.
Caption
Title text of the image.
Returns

The created image element. Returns nil if an error occurred. This pointer should

Public function AddInOutFader(Parent: TGUIElement; ID: LongInt = -1): TGUIInOutFader; overload; inline;

Adds an element for fading in or out the whole screen.

Parameters
Parent
Parent item of the element, e.g. a window.
ID
An identifier for the fader.
The
created in-out-fader. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.
Public function AddInOutFader(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIInOutFader; overload; inline;

Adds an element for fading in or out.

Parameters
Rectangle
Rectangle specifying the borders of the fader.
Parent
Parent item of the element, e.g. a window.
ID
An identifier for the fader.
The
created in-out-fader. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.
Public function AddListBox(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; DrawBackground: Boolean = False): TGUIListBox; overload; inline;

Adds a list box element.

Parameters
Rectangle
Rectangle specifying the borders of the list box.
Parent
Parent gui element of the list box.
ID
Id to identify the gui element.
DrawBackground
Flag whether the background should be drawn.
Returns

The created list box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddMenu(Parent: TGUIElement = nil; ID: LongInt = -1): TGUIContextMenu; inline;

Adds a menu to the environment.
This is like the menu you can find on top of most windows in modern graphical user interfaces.

Parameters
Parent
Parent item of the element, e.g. a window. Set it to 0 to place the menu directly in the environment.
ID
An identifier for the menu.
Returns

The created menu. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddMeshViewer(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; const Caption: StringType = ''): TGUIMeshViewer; inline;

Adds a mesh viewer. Not 100% implemented yet. (?)

Parameters
Rectangle
Rectangle specifying the borders of the mesh viewer.
Parent
Parent gui element of the mesh viewer.
ID
Id to identify the gui element.
Caption
Text of the mesh viewer.
Returns

The created mesh viewer. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddMessageBox(const Caption: StringType; const Text: StringType = ''; Modal: Boolean = True; Flags: LongWord = LongWord(mbOK); Parent: TGUIElement = nil; ID: LongInt = -1; Image: TTexture = nil): TGUIWindow; inline;

Adds a message box.

Parameters
Caption
Text to be displayed the title of the message box.
Text
Text to be displayed in the body of the message box.
Modal
Defines if the dialog is modal. This means, that all other gui elements which were created before the message box cannot be used until this messagebox is removed.
Flags
Flags specifying the layout of the message box. For example to create a message box with an OK and a CANCEL button on it, set this to (EMBF_OK | EMBF_CANCEL).
Parent
Parent gui element of the message box.
ID
Id with which the gui element can be identified.
Image
Optional texture which will be displayed beside the text as an image.
Returns

The created message box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddModalScreen(Parent: TGUIElement): TGUIElement; inline;

Adds a modal screen.
This control stops its parent's members from being able to receive input until its last child is removed, it then deletes itself.

Parameters
Parent
Parent gui element of the modal.
Returns

The created modal. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddScrollBar(Horizontal: Boolean; const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIScrollBar; inline;

Adds a scrollbar.

Parameters
Horizontal
Specifies if the scroll bar is drawn horizontal or vertical.
Rectangle
Rectangle specifying the borders of the scrollbar.
Parent
Parent gui element of the scroll bar.
ID
Id to identify the gui element.
Returns

The created scrollbar. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddSpinBox(const Text: StringType; const Rectangle: TRect; Border: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1): TGUISpinBox; inline;

Adds a spin box.
An edit box with up and down buttons.

Parameters
Text
Text to be displayed. Can be altered after creation by setText().
Rectangle
Rectangle specifying the borders of the spin box.
Border
Set to true if the spin box should have a 3d border.
Param
Parent item of the element, e.g. a window. Set it to 0 to place the spin box directly in the environment.
ID
The ID of the element.
Returns

The created spin box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddStaticText(const Text: StringType; const Rectangle: TRect; Border: Boolean = False; WordWrap: Boolean = True; Parent: TGUIElement = nil; ID: LongInt = -1; FillBackground: Boolean = False): TGUIStaticText; inline;

Adds a static text.

Parameters
Text
Text to be displayed. Can be altered after creation by setting the Text property.
Rectangle
Rectangle specifying the borders of the static text
Border
Set to true if the static text should have a 3d border.
WordWrap
Enable if the text should wrap into multiple lines.
Parent
Parent item of the element, e.g. a window.
ID
The ID of the element.
FillBackground
Enable if the background shall be filled. Defaults to false.
Returns

The created static text. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddTab(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1): TGUITab; inline;

Adds tab to the environment.
You can use this element to group other elements. This is not used for creating tabs on tab controls, please use TGUITabControl.AddTab for this instead.

Parameters
Rectangle
Rectangle specifying the borders of the tab.
Parent
Parent item of the element, e.g. a window. Set it to nil to place the tab directly in the environment.
ID
An identifier for the tab.
Returns

The created tab. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddTabControl(const Rectangle: TRect; Parent: TGUIElement = nil; FillBackground: Boolean = False; Border: Boolean = True; ID: LongInt = -1): TGUITabControl; inline;

Adds a tab control to the environment.

Parameters
Rectangle
Rectangle specifying the borders of the tab control.
Parent
Parent item of the element, e.g. a window. Set it to nil to place the tab control directly in the environment.
FillBackground
Specifies if the background of the tab control should be drawn.
Border
Specifies if a flat 3d border should be drawn. This is usually not necessary unless you place the control directly into the environment without a window as parent.
ID
An identifier for the tab control.
Returns

The created tab control element. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddTable(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; DrawBackground: Boolean = False): TGUITable; inline;

Adds a table to the environment. dropped. See TReferenceCounted.Drop for more information.)

Parameters
Rectangle
Rectangle specifying the borders of the table.
Parent
Parent item of the element, e.g. a window. Set it to nil to place the element directly in the environment.
ID
An identifier for the table.
DrawBackground
Flag whether the background should be drawn.
Returns

(The created table. Returns nil if an error occurred. This pointer should not be

Public function AddToolBar(Parent: TGUIElement = nil; ID: LongInt = -1): TGUIToolBar; inline;

Adds a toolbar to the environment.
A toolbar is like a menu that is always placed on top of its parent, and contains buttons.

Parameters
Parent
Parent item of the element, e.g. a window. Set it to nil to place the tool bar directly in the environment.
ID
An identifier for the tool bar.
Returns

The created tool bar. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddTreeView(const Rectangle: TRect; Parent: TGUIElement = nil; ID: LongInt = -1; DrawBackground: Boolean = False; ScrollBarVertical: Boolean = True; ScrollBarHorizontal: Boolean = False): TGUITreeView; inline;

Adds a tree view element.

Parameters
Rectangle
Position and dimension of list box.
Parent
Parent gui element of the list box.
ID
Id to identify the gui element.
DrawBackground
Flag whether the background should be drawn.
ScrollBarVertical
Flag whether a vertical scrollbar should be used
ScrollBarHorizontal
Flag whether a horizontal scrollbar should be used
Returns

The created list box. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function AddWindow(const Rectangle: TRect; Modal: Boolean = False; const Text: StringType = ''; Parent: TGUIElement = nil; ID: LongInt = -1): TGUIWindow; inline;

Adds an empty window element.

Parameters
Rectangle
Rectangle specifying the borders of the window.
Modal
Defines if the dialog is modal. This means, that all other gui elements which were created before the window cannot be used until it is removed.
Text
Text displayed as the window title.
Parent
Parent gui element of the window.
ID
Id with which the gui element can be identified.
Returns

The created window. Returns nil if an error occurred. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function CreateImageList(Texture: TTexture; const ImageSize: TSize; UseAlphaChannel: Boolean): TGUIImageList; inline;

Creates the image list from the given texture.

Parameters
Texture
Texture to split into images
ImageSize
Dimension of each image
seAlphaChannel
Flag whether alpha channel of the texture should be honored.
Returns

The font. Returns nil if the font could not be loaded. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function CreateSkin(SkinType: TGUISkinType): TGUISkin; inline;

Creates a new GUI Skin based on a template.
Use SetSkin to set the created skin.

Parameters
SkinType
The type of the new skin.
Returns

The created skin. If you no longer need it, you should call TGUISkin.Drop. See TReferenceCounted.Drop for more information.

Public function GetBuiltInFont: TGUIFont; inline;

Returns the default built-in font.

Returns

The default built-in font. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function GetDefaultGUIElementFactory: TGUIElementFactory; inline;

Get the default element factory which can create all built-in elements.

Returns

The factory. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function GetFocus: TGUIElement; inline;

Returns the element which holds the focus.

Returns

The element.

Public function GetFont(const FileName: StringType): TGUIFont; inline;

Returns pointer to the font with the specified filename.
Loads the font if it was not loaded before.

Parameters
FileName
Filename of the Font.
Returns

The font. Returns nil if the font could not be loaded. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function GetGUIElementFactory(Index: LongWord): TGUIElementFactory; inline;

Get a GUI element factory by index.

Parameters
Index
Index of the factory.
Returns

The Factory at the given index, or nil if no such factory exists.

Public function GetOSOperator: TOSOperator; inline;

Returns a pointer to the OS operator.

Public function GetRoot: TGUIElement; inline;

Returns the root gui element.
This is the first gui element, the (direct or indirect) parent of all other gui elements. It is a valid TGUIElement, with dimensions the same size as the screen. You hould not need to use this method directly, unless you wish to reparent GUI elements to the top level.

Returns

The root element of the GUI. The returned pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function GetSkin: TGUISkin; inline;

Returns The current gui skin.

Returns

The current GUI skin. The returned pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function GetSpriteBank(const FileName: StringType): TGUISpriteBank; inline;

Returns pointer to the sprite bank with the specified file name.
Loads the bank if it was not loaded before.

Parameters
FileName
Filename of the sprite bank's origin.
Returns

The sprite bank. Returns nil if it could not be loaded. This pointer should not be dropped. See TReferenceCounted.Drop for more information.

Public function HasFocus(Element: TGUIElement): Boolean; inline;

Returns whether an element has focus.

Parameters
Element
the Element in question.
Returns

True if the element is focused, else false.

Public function LoadGUI(RFile: TReadFile; Parent: TGUIElement = nil): Boolean; overload; inline;

Loads a GUI from a TReadFile. Note that the current GUI is not cleared before.

Parameters
RFile
The file to load from.
Parent
Parent for the loaded GUI, root if nil.
Returns

True if loading succeeded, else false.

Public function LoadGUI(const Path: StringType; Parent: TGUIElement = nil): Boolean; overload; inline;

Loads a GUI from a path. Note that the current GUI is not cleared before.

Parameters
RFile
The file to load from.
Parent
Parent for the loaded GUI, root if nil.
Returns

True if loading succeeded, else false.

Public function PostEventFromUser(Event: TIrrlichtEvent): Boolean; inline;

Posts an input event to the environment.
Usually you do not have to use this method, it is used by the engine internally.
If you want the engine to handle a user-generated event, use TIrrlichtDevice.PostEventFromUser instead.

Parameters
Event
The event to post.
Returns

True if succeeded, else false.

Public function RemoveFocus(Element: TGUIElement): Boolean; inline;

Removes the focus from an element.
Causes a geElementFocusLost event. If the event is absorbed the focus will not be changed.

Parameters
Element
The element which shall lose the focus.
Returns

True on success, false on failure.

Public function SaveGUI(const Path: StringType; Start: TGUIElement = nil): Boolean; overload; inline;

Saves the current GUI to a path.

Parameters
WFile
The file to write to.
Start
The GUIElement to start with. Root if nil.
Returns

True if saving succeeded, else false.

Public function SaveGUI(WFile: TWriteFile; Start: TGUIElement = nil): Boolean; overload; inline;

Saves the current GUI to a TWriteFile.

Parameters
WFile
The file to write to.
Start
The GUIElement to start with. Root if nil.
Returns

True if saving succeeded, else false.

Public function SetFocus(Element: TGUIElement): Boolean; inline;

Sets the focus to an element.
Causes a geElementFocusLost event followed by a geElementFocused event. If someone absorbed either of the events, then the focus will not be changed.

Parameters
Element
Pointer to the element which shall get the focus.
Returns

True on success, false on failure.

Public procedure Clear; inline;

Removes all elements from the environment.

Public procedure DrawAll; inline;

Draws all gui elements by traversing the GUI environment starting at the root node.

Public procedure ReadGUIElement(Reader: TXMLReader; Node: TGUIElement); inline;

Reads a single GUI element. (No more documentation on this method).

Public procedure RegisterGUIElementFactory(Factory: TGUIElementFactory); inline;

Adds an element factory to the gui environment.
Use this to extend the GUI environment with new element types which it should be able to create automatically, for example when loading data from xml files.

Parameters
Factory
The new factory.
Public procedure SetSkin(NewSkin: TGUISkin); inline;

Sets a new GUI Skin.
You can use this to change the appearance of the whole GUI Environment. You can set one of the built-in skins or implement your own class derived from TGUISkin and enable it using this method. To set for example the built-in Windows classic skin, use the following code:

    var NewSkin: TGUISkin;
    ...
    NewSkin := GUIEnvironment.CreateSkin(gsWindowsClassic);
    GUIEnvironment.SetSkin(NewSkin);
    NewSkin.Drop;
            

Parameters
NewSkin
The new Skin.
Public procedure SetUserEventReceiver(Receiver: TWrapper); inline;

This sets a new event receiver for GUI events.
Usually you do not have to use this method, it is used by the engine internally.

Parameters
Receiver
The new event receiver.
Public procedure WriteGUIElement(Writer: TXMLWriter; Node: TGUIElement); inline;

Writes a single GUI element. (No more documentation on this function).

Properties

Public property FileSystem: TFileSystem read FFileSystem;

The file system associated with this GUI environment.

Public property RegisteredGUIElementFactoryCount: LongWord read GetRegisteredGUIElementFactoryCount;

The amount of registered gui element factories.

Public property VideoDriver: TVideoDriver read FVideoDriver;

The video driver associated with this GUI environment.


Generated by PasDoc 0.12.1 on 2012-09-14 17:32:22