Unit CastleLCLUtils

Description

Utilities for cooperation between LCL and "Castle Game Engine".

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TLCLKeyPressHandler Convert LCL OnKeyDown and OnUTF8KeyPress into a single CGE event OnPress.

Functions and Procedures

procedure FileFiltersToDialog(const FileFilters: string; const Dialog: TFileDialog; const AllFields: boolean = true);
procedure FileFiltersToDialog(const FileFilters: string; const Edit: TFileNameEdit; const AllFields: boolean = true);
procedure FileFiltersToDialog(FFList: TFileFilterList; const Dialog: TFileDialog; const AllFields: boolean = true);
procedure FileFiltersToDialog(const FileFilters: string; out LCLFilter: string; out LCLFilterIndex: Integer; const AllFields: boolean = true); deprecated 'use TFileFilterList.LclFmxFiltersFromString';
procedure FileFiltersToDialog(FFList: TFileFilterList; out LCLFilter: string; out LCLFilterIndex: Integer; const AllFields: boolean = true); deprecated 'use TFileFilterList.LclFmxFilters';
function SQuoteLCLCaption(const S: string): string;
procedure FileFiltersToOpenDialog(const FileFilters: string; Dialog: TFileDialog); deprecated;
procedure FileFiltersToOpenDialog(const FileFilters: string; out LCLFilter: string; out LCLFilterIndex: Integer); deprecated;
procedure FileFiltersToOpenDialog(FFList: TFileFilterList; out LCLFilter: string; out LCLFilterIndex: Integer); deprecated;
function KeyToCastle(const Key: Word; const Shift: TShiftState): TKey;
procedure KeyFromCastle(const Key: TKey; const KeyString: String; out KeyCode: Word; out Shift: TShiftState);
procedure KeyFromCastle(const Key: TKey; KeyString: String; const Modifiers: TModifierKeys; out KeyCode: Word; out Shift: TShiftState);
function MouseButtonToCastle( const MouseButton: TMouseButton; out MyMouseButton: TCastleMouseButton): boolean;
function CursorFromCastle(const Cursor: TMouseCursor): TCursor;
function FilenameToUriSafeUTF8(const FileName: string): string;
function UriToFilenameSafeUTF8(const Url: String): string;
function ColorToVector3(const Color: TColor): TVector3;
function ColorToVector3Byte(const Color: TColor): TVector3Byte;

Types

TControlInputPressReleaseEvent = procedure (Sender: TObject; const Event: TInputPressRelease) of object;
TControlInputMotionEvent = procedure (Sender: TObject; const Event: TInputMotion) of object;

Description

Functions and Procedures

procedure FileFiltersToDialog(const FileFilters: string; const Dialog: TFileDialog; const AllFields: boolean = true);

Convert file filters into LCL Dialog.Filter, Dialog.FilterIndex. Suitable for both open and save dialogs (TOpenDialog, TSaveDialog both descend from TFileDialog).

Input filters are either given as a string FileFilters (encoded just like for TFileFilterList.AddFiltersFromString), or as TFileFilterList instance.

Output filters are either written to LCLFilter, LCLFilterIndex variables, or set appropriate properties of given Dialog instance.

When AllFields is false, then filters starting with "All " in the name, like "All files", "All images", are not included in the output.

procedure FileFiltersToDialog(const FileFilters: string; const Edit: TFileNameEdit; const AllFields: boolean = true);

This item has no description.

procedure FileFiltersToDialog(FFList: TFileFilterList; const Dialog: TFileDialog; const AllFields: boolean = true);

This item has no description.

procedure FileFiltersToDialog(const FileFilters: string; out LCLFilter: string; out LCLFilterIndex: Integer; const AllFields: boolean = true); deprecated 'use TFileFilterList.LclFmxFiltersFromString';

Warning: this symbol is deprecated: use TFileFilterList.LclFmxFiltersFromString

This item has no description.

procedure FileFiltersToDialog(FFList: TFileFilterList; out LCLFilter: string; out LCLFilterIndex: Integer; const AllFields: boolean = true); deprecated 'use TFileFilterList.LclFmxFilters';

Warning: this symbol is deprecated: use TFileFilterList.LclFmxFilters

This item has no description.

function SQuoteLCLCaption(const S: string): string;

Make each '&' inside string '&&', this way the string will not contain special '&x' sequences when used as a TMenuItem.Caption and such.

procedure FileFiltersToOpenDialog(const FileFilters: string; Dialog: TFileDialog); deprecated;

Warning: this symbol is deprecated.

Deprecated names, use the identifiers without "Open" in new code.

procedure FileFiltersToOpenDialog(const FileFilters: string; out LCLFilter: string; out LCLFilterIndex: Integer); deprecated;

Warning: this symbol is deprecated.

This item has no description.

procedure FileFiltersToOpenDialog(FFList: TFileFilterList; out LCLFilter: string; out LCLFilterIndex: Integer); deprecated;

Warning: this symbol is deprecated.

This item has no description.

function KeyToCastle(const Key: Word; const Shift: TShiftState): TKey;

Convert Key (Lazarus key code) to Castle Game Engine TKey. Returns keyNone if not possible.

procedure KeyFromCastle(const Key: TKey; const KeyString: String; out KeyCode: Word; out Shift: TShiftState);

Convert TKey and/or character code into Lazarus key code (VK_xxx) and shift state. Sets KeyCode to VK_UNKNOWN (zero) when conversion not possible (or when Key = keyNone and KeyString = '').

procedure KeyFromCastle(const Key: TKey; KeyString: String; const Modifiers: TModifierKeys; out KeyCode: Word; out Shift: TShiftState);

This item has no description.

function MouseButtonToCastle( const MouseButton: TMouseButton; out MyMouseButton: TCastleMouseButton): boolean;

Convert Lazarus TMouseButton value to Castle Game Engine TCastleMouseButton.

function CursorFromCastle(const Cursor: TMouseCursor): TCursor;

Convert CGE to LCL cursor type.

function FilenameToUriSafeUTF8(const FileName: string): string;

Not necessary. Converts between Lazarus String encoding for filenames (which is UTF-8) and CGE encoding for filenames (which is also UTF-8). So this in practice does nothing.

function UriToFilenameSafeUTF8(const Url: String): string;

This item has no description.

function ColorToVector3(const Color: TColor): TVector3;

Convert LCL color values to CGE colors (vectors).

function ColorToVector3Byte(const Color: TColor): TVector3Byte;

This item has no description.

Types

TControlInputPressReleaseEvent = procedure (Sender: TObject; const Event: TInputPressRelease) of object;

This item has no description.

TControlInputMotionEvent = procedure (Sender: TObject; const Event: TInputMotion) of object;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.