Class TViewDialogChoice
Unit
Declaration
type TViewDialogChoice = class(TViewDialog)
Description
Ask user to choose from a number of options. Each choice is shown as a button, user can also press the appropriate character. ButtonChars length must be always equal to ButtonCaptions. See unit CastleDialogViews documentation for example usage.
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleUserInterface
- TCastleView
- TViewDialog
- TViewDialogChoice
Overview
Fields
ButtonCaptions: array of string; |
|
ButtonChars: array of char; |
|
AllowCancel: boolean; |
Methods
procedure InitializeButtons(var Buttons: TViewDialog.TButtonArray); override; |
|
function Press(const Event: TInputPressRelease): boolean; override; |
Properties
property Answer: char read FAnswer; |
Description
Fields
ButtonCaptions: array of string; |
|
This item has no description. |
ButtonChars: array of char; |
|
This item has no description. |
AllowCancel: boolean; |
|
This item has no description. |
Methods
procedure InitializeButtons(var Buttons: TViewDialog.TButtonArray); override; |
|
This item has no description. |
function Press(const Event: TInputPressRelease): boolean; override; |
|
This item has no description. Showing description inherited from TCastleUserInterface.Press.
Override this method to react to user pressing a key, mouse button or mouse wheel. Return When implementing in descendants it is best to override it like this: function TMyControl.Press(const Event: TInputPressRelease): boolean; begin Result := inherited; if Result then Exit; // exit if ancestor already handled this event if Event.IsKey(keyEnter) then begin // do something in reaction to Enter key ... // let engine know that this input event was handled Exit(true); end; if Event.IsMouseButton(buttonLeft) then begin // do something in reaction to left mouse button press ... // let engine know that this input event was handled Exit(true); end; end;
These events are generated for all UI controls, whether they are considered "interactive" or not. These events are generated for non-interactive controls like TCastleRectangleControl or TCastleLabel as well. For example, these events ignore the TCastleButton.Enabled state, they are generated always (see https://github.com/castle-engine/castle-engine/issues/413 ). Use instead TCastleButton.OnClick to detect clicks on a button in a way that honors the TCastleButton.Enabled state. When a control returns The events Press and Release are passed to the parent only after the children had a chance to process this event. Overriding them makes sense if you draw something that "looks clickable" in TCastleUserInterface.Render, which is the standard place you should draw stuff. For example our TCastleButton draws there. In contrast, the events PreviewPress and PreviewRelease are passed first to the parent control, before children have a chance to process this event. In partcular, overriding them makes sense if you draw something that "looks clickable" in TCastleUserInterface.RenderOverChildren. |
Properties
property Answer: char read FAnswer; |
|
User |
Generated by PasDoc 0.16.0-snapshot.