Class TStateDialog
Unit
CastleDialogStates
Declaration
type TStateDialog = class abstract(TUIState)
Description
Abstract class for a modal dialog user-interface state. See unit CastleDialogStates documentation for example usage.
Hierarchy
Overview
Nested Types
Fields
Methods
Properties
Description
Nested Types
Fields
|
nested const DefaultAlignment = hpLeft; |
|
Methods
|
procedure InitializeButtons(var Buttons: TButtonArray); virtual; |
|
|
function DrawInputText: boolean; virtual; |
|
|
procedure DoAnswered; |
|
|
constructor Create(AOwner: TComponent); override; |
|
|
destructor Destroy; override; |
|
|
procedure Start; override; |
|
|
procedure Stop; override; |
|
Properties
|
property InputText: string read GetInputText write SetInputText; |
|
|
property InterceptInput default true; |
|
|
property Answered: boolean read FAnswered; |
When user answers the dialog, this is set to True . The state also normally does TUIState.Pop, so there's no need to check this property, unless you set PopOnAnswered to False .
|
|
property Text: TStrings read FText; |
Caption displayed in the dialog.
|
|
property Caption: string read GetCaption write SetCaption stored false; |
Caption displayed in the dialog, as a simple string. This is just a shortcut to get/set Text as a single string.
Use LineEnding or NL constant when setting this to indicate a newline. The two examples below are equivalent:
StateDialogOK.Text.Clear;
StateDialogOK.Text.Add('First line');
StateDialogOK.Text.Add('Second line');
StateDialogOK.Caption := 'First line' + LineEnding + 'Second line';
|
|
property Html: boolean read FHtml write FHtml default false; |
Enable a subset of HTML to mark font changes inside the text. See the TCastleAbstractFont.PrintStrings for a description of supported HTML constructs.
|
|
property Background: boolean read FBackground write FBackground default false; |
Obscure the state underneath with our own background (using a color or screenshot).
The obscuring background is defined by BackgroundColor. It may be just a solid opaque color. Or it may be a partially-transparent or even completely transparent color, showing the state underneath (or showing the screenshot of the state underneath, if BackgroundScreenshot).
|
|
property BackgroundColor: TCastleColor read FBackgroundColor write FBackgroundColor; |
Color of the background obscuring the state underneath, if Background is True . This color may be partially-transparent (e.g. to visually "dim" the state underneath) or even completely transparent (alpha 0).
Default is Theme.BackgroundColor, which is dark with alpha = 0.5, so it will dim the state underneath. Sometimes (under exception handler) it's Theme.BackgroundOpaqueColor.
|
|
property BackgroundScreenshot: boolean
read FBackgroundScreenshot write FBackgroundScreenshot default false; |
Initialize the background by taking a screenshot of the current screen when the state was started. This screenshot is shown, instead of actually rendering the state underneath, under the BackgroundColor, when Background is True .
This is less functional (when the user scales the window, the screenshot is stretched too), but is safer: it means that the state underneath does not need to be "renderable" anymore.
|
|
property PopOnAnswered: boolean
read FPopOnAnswered write FPopOnAnswered default true; |
Should the state do TUIState.Pop when answered. This is usually most natural.
|
|
property BackgroundColorPersistent: TCastleColorPersistent read FBackgroundColorPersistent ; |
BackgroundColor that can be visually edited in Castle Game Engine Editor, Lazarus and Delphi. Normal user code does not need to deal with this, instead read or write BackgroundColor directly.
See also
- BackgroundColor
- Color of the background obscuring the state underneath, if Background is
True .
|
Generated by PasDoc 0.16.0.