Class TCastleEdit
Unit
CastleControls
Declaration
type TCastleEdit = class(TUIControlFont)
Description
Edit box to input 1 line of text.
Hierarchy
Overview
Fields
Methods
Properties
Description
Fields
 |
internal const DefaultWidth = 100; |
|
 |
internal const DefaultPadding = 4; |
|
Methods
 |
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; |
|
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 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 Width: Cardinal read FWidth write SetWidth default DefaultWidth; |
Width, in pixels.
Inside it, we will put the border frame (if Frame is True ), and padding (see Padding + PaddingHorizontal). So, similar to CSS box model called box-sizing, width includes also padding and border.
Note that the edit control width is never auto-calculated, since there's no "natural width" for the edit box. In contrast, our height is always (for now) auto-calculated.
|
 |
property Text: string read FText write SetText; |
Currently input text.
|
 |
property PaddingHorizontal: Integer
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: Integer
read FPaddingVertical write SetPaddingVertical default 0; |
|
 |
property Padding: Integer
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; |
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.
|
Generated by PasDoc 0.15.0.
|