TApplication class
Application management and configuration for a GUI application.
Declaration
TApplication = class(TCustomApplication)Inheritance
- TApplication
- TCustomApplication
- TComponent
- TPersistent
- TObject
Description
TApplication is a
TCustomApplication descendant which
provides facilities used to manage and configure a GUI application.
Properties, methods, and event handlers are provided which allow a program to
create, execute, monitor, maintain and destroy an application and its forms.
Every GUI application contains an Application variable that represents the
TApplication or descendent class instance.
TApplication provides a message processing loop that includes hooks for event
handlers and exception handling, and supports dispatching messages for
TCustomAction instances used in application forms. TApplication
provides support for hints and content-sensitive help for forms and controls
used in the application. Convenience methods, like MessageBox, are
provided to simplify access to dialogs and error messages in the application.
See also
- GetParams
- OnDropFiles
- ParamStrUTF8
- TCustomApplication.ExeName
- TCustomApplication.Params
- TCustomApplication.ParamCount
Properties
Active | public | True if the application is focused. |
ActiveFormHandle | public | |
ApplicationType | public | The type of the application (i.e. the sort of device for which it is intended). |
BidiMode | public | The bidirectional mode to use. |
CaptureExceptions | public | Enables exception handling in the Application. |
DoubleBuffered | public | Indicates if the application uses double buffering. |
ExtendedKeysSupport | public | Controls whether extended key codes are available in key down and key up messages. |
ExceptionDialog | public | Indicates the dialog type used for an exception in the application. |
FindGlobalComponentEnabled | public | Enables searching for global components by name. |
Flags | public | Contains state flags for the application. |
GlyphDrawEffectsEnabled | public | Indicates whether drawing effects are enabled for mouse-over and mouse-down events for button glyphs in the application. |
Handle | public | Provides access to the handle for the application instance. |
Hint | public | The current Hint text active for the application. |
HintColor | public | The background color for a Hint window. |
HintHidePause | public | Indicates how long a Hint remains visible after the mouse pointer is moved. |
HintHidePausePerChar | public | Indicates how long a keystroke extends the time a Hint remains visible (added to HintHidePause). |
HintPause | public | The delay before a Hint is shown for a form or control. |
HintShortCuts | public | Enables or disables display of keyboard shortcuts (e. g. on menu items). |
HintShortPause | public | The pause before a different Hint is displayed. |
Icon | public | The icon associated with this application. |
LayoutAdjustmentPolicy | public | Indicates the layout and sizing policy used for forms and controls in the application. |
Navigation | public | Allows switching between controls using keyboard navigation. |
MainForm | public | Contains the main form for the application. |
MainFormHandle | public | Window handle for the MainForm in the application. |
MainFormOnTaskBar | public | Controls whether a button is displayed on the task bar for the main form in the application. |
ModalLevel | public | The number of modal forms shown. |
MoveFormFocusToChildren | public | Indicates if an active control is focused when a form receives focus. |
MouseControl | public | Contains the control currently under the mouse pointer. |
TaskBarBehavior | public | Indicates how forms are represented in the task bar. |
UpdateFormatSettings | public | Indicates if application format settings are updated when changed in a widgetset class. |
ShowButtonGlyphs | public | Allows the platform defaults for glyphs on buttons to be overridden. |
ShowMenuGlyphs | public | Sets the default policy for showing or hiding glyph images in menus. |
ShowHint | public | Indicates if Hints are displayed for the application. |
ShowMainForm | public | Allows the main form to be shown or hidden when an application is started. |
Title | public | Contains the title for the application. |
Scaled | public | Indicates if forms and controls in the application can be scaled to different display densities (Pixels per Inch). |
Methods
GetConsoleApplication | protected | Always returns False for a GUI application. |
NotifyIdleHandler | protected | Signals all idle handlers for the application. |
NotifyIdleEndHandler | protected | Notifies all Idle End handlers when a new message has arrived. |
NotifyActivateHandler | protected | Notifies all Activate handlers for the application. |
NotifyDeactivateHandler | protected | Notifies all Deactivate handlers for the application. |
NotifyCustomForms | protected | Performs the specified message for all custom forms in the application. |
IsHintMsg | protected | Exists for Delphi compatibility only. |
DoOnHelp | protected | Signals an OnHelp event handler. |
DoOnMouseMove | protected | OnMouseMove message handler, updates the Hint. |
ShowHintWindow | protected | Shows or hides the hint window for a control in the application. |
OnHintTimer | protected | Implements an event handler signalled when the timer for a hint display has elapsed. |
SetTitle | protected | Sets the value for the Title property. |
StartHintTimer | protected | Starts the timer for display of a hint message. |
UpdateVisible | protected | Asks the widgetset to update its task bar entries. |
DoIdleActions | protected | Updates all Actions and hides splash screens. |
MenuPopupHandler | protected | Implements the OnMenuPopupHandler for the application. |
HasAsyncCallQueued | protected | Indicates whether there are unprocessed asynchronous calls pending in the application queue. |
ProcessAsyncCallQueue | protected | Calls all methods queued in QueueAsyncCall. |
DoDecLCLRefcountToZero | protected | Performs actions needed when the reference count for a TLCLComponent instance reaches 0 in the application. |
FreeComponent | protected | Destroys all components marked for release. |
ReleaseComponents | protected | Destroys all components marked for release. |
DoBeforeFinalization | protected | Destroys all components. |
GetParams | protected | Returns the command line argument at the specified ordinal position. |
DoLog | protected | Performs actions needed to implement the Log method. |
Create | public | Constructor for the class instance. |
Destroy | public | Destructor for the class instance. |
ActivateHint | public | Configures a hint window for the specified mouse position. |
GetControlAtMouse | public | Gets the control under the mouse pointer. |
GetControlAtPos | public | Gets the control which contains the specified position, and optionally updates the internal tracking members for mouse capture when needed. |
ControlDestroyed | public | Clears all references to the destroyed control. |
BigIconHandle | public | Returns the Handle for the large application Icon. |
SmallIconHandle | public | Returns the Handle for the small application Icon. |
BringToFront | public | Asks the widgetset to bring the last form for the application in front of all other programs. |
CreateForm | public | Creates a Form or component owned by the Application instance. |
UpdateMainForm | public | Makes the specified form the MainForm in the Application. |
QueueAsyncCall | public | Inserts an asynchronous call into the queue. |
RemoveAsyncCalls | public | Removes all calls added via QueueAsyncCall. |
ReleaseComponent | public | Safely destroys a component used in the application. |
ExecuteAction | public | Signals an OnActionExecute handler (when assigned). |
UpdateAction | public | Signals an OnActionUpdate handler (when assigned). |
HandleException | public | HandleException method for handling an exception; attempts to maintain program execution if possible, otherwise exits gracefully. |
HandleMessage | public | Handles pending messages, and enters the Idle state. |
HelpCommand | public | Show help. |
HelpContext | public | Shows context-sensitive help for the application. |
HelpKeyword | public | Shows help for the specified keyword. |
HelpShowTableOfContents | public | Displays the Help Table of Contents using the Help Manager for the application. |
ShowHelpForObject | public | When Sender is a TControl, invoke its ShowHelp method. |
RemoveStayOnTop | public | Removes the StayOnTop attribute from all visible forms in the application. |
RestoreStayOnTop | public | Restores StayOnTop for all forms changed by RemoveStayOnTop. |
IsWaiting | public | True if the application is waiting for a message event. |
CancelHint | public | Called when the Hint timer has expired to stop showing the Hint. |
HideHint | public | Hides the Hint window. |
HintMouseMessage | public | Called when the mouse is over a control with a Hint. |
Initialize | public | Initializes the widgetset (and more). |
MessageBox | public | Display an message dialog with response buttons. |
Minimize | public | Asks the widgetset to minimize the application. |
ModalStarted | public | Called when a modal form display is started. |
ModalFinished | public | Called when a modal form is closed. |
Restore | public | Restores a previously minimized application. |
Notification | public | Performs actions when a component is added to or removed from the application. |
ProcessMessages | public | Call this method during lengthy operations to ensure the GUI remains responsive. |
Idle | public | Called when the application enters the idle state. |
Run | public | Loads the form and passes control to the event loop for the application. |
ShowException | public | Shows the message for the specified exception and asks the user to abort or continue. |
Terminate | public | The application is terminated and the component engine is shutdown. |
DisableIdleHandler | public | Disables Idle handling. |
EnableIdleHandler | public | Resumes Idle handling. |
NotifyUserInputHandler | public | Notifies all user input handlers of the specified message. |
NotifyKeyDownBeforeHandler | public | Notifies all ahtKeyDownBefore handlers. |
NotifyKeyDownHandler | public | Notifies all ahtKeyDownAfter handlers, and eventually reacts to F1 (Help). |
ControlKeyDown | public | Handles KeyDown events in a Control, e.g. handles navigation keys. |
ControlKeyUp | public | Handles KeyUp events in a Control, e.g. handles Enter and Esc keys. |
AddOnIdleHandler | public | Adds an application Idle handler to the list of handlers for the type. |
RemoveOnIdleHandler | public | Removes an application Idle handler for the list of handlers for the type. |
AddOnIdleEndHandler | public | Adds an application IdleEnd handler to the list of handlers for the type. |
RemoveOnIdleEndHandler | public | Removes an application IdleEnd handler. |
AddOnUserInputHandler | public | Adds an application user input handler to the list of handlers for the type. |
RemoveOnUserInputHandler | public | Removes an application user input handler from the list of handlers for the type. |
AddOnKeyDownBeforeHandler | public | Adds an application key down before interface handler. |
RemoveOnKeyDownBeforeHandler | public | Removes an application key down before interface handler. |
AddOnKeyDownHandler | public | Adds an application key down handler to the list for the type. |
RemoveOnKeyDownHandler | public | Removes an application key down after interface handler. |
AddOnActivateHandler | public | Adds an application activation handler. |
RemoveOnActivateHandler | public | Removes an application activation handler. |
AddOnDeactivateHandler | public | Adds an application deactivation handler. |
RemoveOnDeactivateHandler | public | Removes an application deactivation handler. |
AddOnExceptionHandler | public | Adds an application exception handler. |
RemoveOnExceptionHandler | public | Removes an application exception handler. |
AddOnEndSessionHandler | public | Adds an application logoff handler. |
RemoveOnEndSessionHandler | public | Removes an application logoff handler. |
AddOnQueryEndSessionHandler | public | Adds an application logoff query handler. |
RemoveOnQueryEndSessionHandler | public | Removes an application logoff query handler. |
AddOnMinimizeHandler | public | Adds an application minimizing handler. |
RemoveOnMinimizeHandler | public | Removes an application minimizing handler. |
AddOnModalBeginHandler | public | Adds an application becoming modal handler. |
RemoveOnModalBeginHandler | public | Removes an application becoming modal handler. |
AddOnModalEndHandler | public | Adds an application exiting modal state handler. |
RemoveOnModalEndHandler | public | Removes an application exiting modal state handler. |
AddOnRestoreHandler | public | Adds an application exiting minimized state handler. |
RemoveOnRestoreHandler | public | Removes an application exiting minimized state handler. |
AddOnDropFilesHandler | public | Adds an application dropped files handler. |
RemoveOnDropFilesHandler | public | Removes an application dropped files handler. |
AddOnHelpHandler | public | Adds an application Help handler. |
RemoveOnHelpHandler | public | Removes an application Help handler. |
AddOnHintHandler | public | Adds an application Hint handler. |
RemoveOnHintHandler | public | Removes an application Hint handler. |
AddOnShowHintHandler | public | Adds an application Hint show handler to the list for the handler type. |
RemoveOnShowHintHandler | public | Removes an application Hint show handler from the list for the handler type. |
AddOnGetMainFormHandleHandler | public | Adds a handler signalled when the application MainForm handle is retrieved. |
RemoveOnGetMainFormHandleHandler | public | Removes a handler used to get the handle for the main form in the application. |
AddOnActionExecuteHandler | public | Adds the specified routine to the list of ahtActionExecute handlers for the application. |
RemoveOnActionExecuteHandler | public | Removes the specified routine from the list of ahtActionExecute handlers for the application. |
AddOnActionUpdateHandler | public | Adds the specified routine to the list of ahtActionUpdate handlers for the application. |
RemoveOnActionUpdateHandler | public | Removes the specified routine from the list of ahtActionUpdate handlers for the application. |
RemoveAllHandlersOfObject | public | Removes all handlers implemented for the specified object. |
DoBeforeMouseMessage | public | Performs actions needed before a mouse message is processed in the application. |
IsShortcut | public | Checks whether a handler is available for the shortcut key in the message. |
IntfQueryEndSession | public | Called by the interface to confirm the end of a session. |
IntfEndSession | public | Called by the interface when the session ends. |
IntfAppActivate | public | Called by the interface on application activation. |
IntfAppDeactivate | public | Called by the interface on application deactivation. |
IntfAppMinimize | public | Called by the interface when the application is minimized. |
IntfAppRestore | public | Called by the interface when the application is restored. |
IntfDropFiles | public | Called by the interface when files have been dropped. |
IntfSettingsChange | public | Called when the WM_SETTINGCHANGE message is handled for the application. |
IntfThemeOptionChange | public | Called by the interface when a theme option has changed. |
IsRightToLeft | public | Indicates if BiDiMode contains a value other than bdLeftToRight. |
IsRTLLang | public | Checks the given language name for use of right-to-left reading. |
Direction | public | Gets the TBidiMode value with the direction for the specified language name. |
DoArrowKey | public | Uses arrow keys for navigation, if enabled. |
DoTabKey | public | Uses the Tab key for navigation, if enabled. |
DoEscapeKey | public | Interprets Esc as Cancel action, if applicable. |
DoReturnKey | public | Interprets Enter as the default action, if applicable. |
Events
OnActionExecute | public | Default handler for unhandled Actions. |
OnActionUpdate | public | Event handler signalled to update actions used in the application. |
OnActivate | public | Event handler signalled when an Activate message is handled in the application. |
OnDeactivate | public | Event handler signalled when a Deactivate message is handled in the application. |
OnGetMainFormHandle | public | Event handler used to provide a value for the MainFormHandle property. |
OnIdle | public | Event handler signalled when the application enters the idle state. |
OnIdleEnd | public | Event handler signalled when the application leaves the Idle state. |
OnEndSession | public | Event handler signalled when a session is ended in the application. |
OnQueryEndSession | public | Event handler signalled to determine if the current session be be ended, and the application can be closed. |
OnMinimize | public | Event handler signalled when the application is minimized. |
OnMessageDialogFinished | public | Event handler signalled when a message dialog in the application has been completed. |
OnModalBegin | public | Event handler signalled when a form in the application is displayed as a modal form. |
OnModalEnd | public | Event handler signalled when the last modal form for the application has been exited. |
OnRestore | public | Event handler signalled when the application is restored from a minimized / maximized state. |
OnDropFiles | public | Event handler signalled when file(s) are dropped into the application. |
OnHelp | public | Event handler signalled when help is requested in the application. |
OnHint | public | Event handler signalled when a hint is requested in the application. |
OnShortcut | public | Event handler signalled to determine if a keystroke message is a shortcut key in the application. |
OnShowHint | public | Event handler signalled prior to displaying a hint window. |
OnUserInput | public | Event handler signalled to handle user input messages. |
OnLog | public | Event handler signalled for log messages written by the application. |
OnDestroy | public | Event handler signalled when the application is freed. |
OnCircularException | public | Event handler signalled when a circular exception occurs before the application is halted. |
Inherited
From TCustomApplication (31)
AbortRun CaseSensitiveLongOptions CaseSensitiveOptions CaseSensitiveShortOptions CheckOptions ConsoleApplication DoRun EnvironmentVariable EventLogFilter ExceptionExitCode ExeName FindOptionIndex GetEnvironmentList GetNonOptions GetOptionAtIndex GetOptionValue GetOptionValues GetParamCount HasOption HelpFile Location Log OnException OptionChar ParamCount Params SingleInstance SingleInstanceClass SingleInstanceEnabled StopOnException Terminated
From TComponent (71)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name ObserverAdded Observers OnGetDeltaStreams Owner PaletteCreated QueryInterface ReadDeltaState ReadDeltaStream ReadState ReferenceInterface RemoveComponent RemoveFreeNotification RemoveFreeNotifications SafeCallException SetAncestor SetChildOrder SetDesigning SetDesignInstance SetInline SetName SetParentComponent SetSubComponent Tag ToString TToStringNameMode Updated UpdateRegistry Updating ValidateContainer ValidateInsert ValidateRename VCLComObject WriteState
From TPersistent (5)
Assign AssignTo FPOAttachObserver FPODetachObserver FPONotifyObservers
From TObject (37)
AfterConstruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName StringMessageTable SystemHasExtendedRTTI UnitName
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
