Class TCastleEdit
Unit
CastleControls
Declaration
type TCastleEdit = class(TCastleUserInterfaceFont)
Description
Edit box to input a single line of text. The contents are in the Text property, you can get or set them at any time.
Note that you should set a suitable TCastleUserInterface.Width of the edit box, to nicely display a typical content. The height is by default auto-calculated (see AutoSizeHeight) looking at font size (and other properties, like padding and frame size), and usually is reasonable automatically.
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
|
nested const DefaultPadding = 4; |
|
|
nested const DefaultAutoOnScreenKeyboard = false; |
|
Methods
|
procedure PreferredSize(var PreferredWidth, PreferredHeight: Single); override; |
|
|
function GetInternalText: String; override; |
|
|
procedure SetInternalText(const Value: String); override; |
|
|
procedure DoChange; virtual; |
|
|
constructor Create(AOwner: TComponent); override; |
|
|
destructor Destroy; override; |
|
|
procedure Render; override; |
|
|
procedure Update(const SecondsPassed: Single; var HandleInput: boolean); override; |
|
|
function CapturesEventsAtPosition(const Position: TVector2): boolean; override; |
|
|
procedure SetFocused(const Value: boolean); override; |
|
|
procedure EditorAllowResize( out ResizeWidth, ResizeHeight: Boolean; out Reason: String); override; |
|
Properties
|
property FocusedColor: TCastleColor read FFocusedColor write SetFocusedColor; |
Focused text color. By default it's black.
|
|
property UnfocusedColor: TCastleColor read FUnfocusedColor write SetUnfocusedColor; |
Unfocused text color. By default it's dark gray.
|
|
property PlaceholderColor: TCastleColor read FPlaceholderColor write SetPlaceholderColor; |
Color for Placeholder. By default it's light gray.
|
|
property BackgroundColor: TCastleColor read FBackgroundColor write SetBackgroundColor; |
Background color. Fills the area under Text and the padding. By default it's white. Note that it can be transparent, in which case it will show the tiEdit image underneath (if Frame is True ), or UI control underneath (if Frame is False ).
|
|
property AllowedChars: TSetOfChars read FAllowedChars write FAllowedChars; |
Allowed characters that user can input. Note that this only restricts the user input, it does not prevent from programmatically setting Text to include disallowed characters.
|
|
property MaxLength: Cardinal read FMaxLength write FMaxLength; |
Max length of user input. Value of 0 (default) means "no limit". Note that this only restricts the user input, it does not prevent from programmatically setting Text to be longer.
|
|
property Text: string read FText write SetText; |
Currently input text.
|
|
property PaddingHorizontal: Single
read FPaddingHorizontal write SetPaddingHorizontal default 0; |
Inside the box rectangle, padding between the borders (or frame, if Frame) and text. Total horizontal padding is the sum PaddingHorizontal + Padding , total vertical padding is the sum PaddingVertical + Padding .
|
|
property PaddingVertical: Single
read FPaddingVertical write SetPaddingVertical default 0; |
|
|
property Padding: Single
read FPadding write SetPadding default DefaultPadding; |
|
|
property Frame: boolean read FFrame write SetFrame default true; |
Draw frame around the box. Frame uses theme image tiEdit, see TCastleTheme.Images if you want to customize it.
|
|
property CaptureAllInput: boolean read FCaptureAllInput write FCaptureAllInput; deprecated 'use Container.ForceCaptureInput instead of this'; |
Warning: this symbol is deprecated: use Container.ForceCaptureInput instead of this
Should we capture input regardless of the currently focused control. This is in practice only sensible if this is the only edit box currently visible on the screen.
|
|
property AutoOnScreenKeyboard: Boolean
read FAutoOnScreenKeyboard write FAutoOnScreenKeyboard
default DefaultAutoOnScreenKeyboard; |
When true, it shows the software keyboard on Android.
|
|
property AutoSizeHeight: Boolean
read FAutoSizeHeight write SetAutoSizeHeight default true; |
|
|
property Placeholder: String
read FPlaceholder write SetPlaceholder; |
Displayed when Text is empty.
|
|
property OnChange: TNotifyEvent read FOnChange write FOnChange; |
Event sent when Text value was changed by a user. Note that this is not called when you change Text property programmatically.
|
|
property PasswordChar: Char
read FPasswordChar write SetPasswordChar default #0; |
Show given character (usually "*") instead of actual input characters. Useful for password input fields.
|
|
property TextTranslate: Boolean read FTextTranslate write FTextTranslate default true; |
Should the Text be localized (translated into other languages). Determines if the property is enumerated by TCastleComponent.TranslateProperties, which affects the rest of localization routines.
|
|
property PlaceholderTranslate: Boolean read FPlaceholderTranslate write FPlaceholderTranslate default true; |
Should the Placeholder be localized (translated into other languages). Determines if the property is enumerated by TCastleComponent.TranslateProperties, which affects the rest of localization routines.
|
|
property Enabled: boolean read FEnabled write SetEnabled default true; |
Enabled control can be focused and edited, is not grayed-out.
|
|
property FocusedColorPersistent: TCastleColorPersistent read FFocusedColorPersistent ; |
FocusedColor 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 FocusedColor directly.
See also
- FocusedColor
- Focused text color.
|
|
property UnfocusedColorPersistent: TCastleColorPersistent read FUnfocusedColorPersistent ; |
UnfocusedColor 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 UnfocusedColor directly.
See also
- UnfocusedColor
- Unfocused text color.
|
Generated by PasDoc 0.16.0.