Difference between revisions of "TApplication"
From Lazarus wiki
Jump to navigationJump to searchLine 18: | Line 18: | ||
<tt>TMyForm</tt> is assumed a descendant of [[TForm]] and defined in <tt>uMyForm.pas</tt> | <tt>TMyForm</tt> is assumed a descendant of [[TForm]] and defined in <tt>uMyForm.pas</tt> | ||
+ | |||
+ | {| class="wikitable" | ||
+ | ! Property || type || Writable || Description | ||
+ | |- | ||
+ | | ExeName || string || - || Name of the executable. | ||
+ | |- | ||
+ | | HelpFile || string || rw || Location of the application help file. | ||
+ | |- | ||
+ | | Terminated || Boolean || - || Was Terminate called or not | ||
+ | |- | ||
+ | | Title || string || rw || Application title | ||
+ | |- | ||
+ | | ConsoleApplication || Boolean || - || Is the application a console application or not | ||
+ | |- | ||
+ | | Location || string || - || Application location | ||
+ | |- | ||
+ | | Params[] || string || - || Command-line parameters | ||
+ | |- | ||
+ | | ParamCount || Integer || - || Number of command-line parameters | ||
+ | |- | ||
+ | | EnvironmentVariable[] || string || - || Environment variable access | ||
+ | |- | ||
+ | | OptionChar || Char || rw || Command-line switch character | ||
+ | |- | ||
+ | | CaseSensitiveOptions || Boolean || rw || Are options interpreted case sensitive or not | ||
+ | |- | ||
+ | | StopOnException || Boolean || rw || Should the program loop stop on an exception | ||
+ | |- | ||
+ | | ExceptionExitCode || LongInt || rw || ExitCode to use then terminating the program due to an exception | ||
+ | |- | ||
+ | | EventLogFilter || TEventLogTypes || rw || Event to filter events, before they are sent to the system log | ||
+ | |- | ||
+ | | SingleInstance || TBaseSingleInstance || -|| Single instance used to control single application instance behaviour | ||
+ | |- | ||
+ | | SingleInstanceClass: TBaseSingleInstanceClass; [rw] Class to use when creating single instance | ||
+ | |- | ||
+ | | SingleInstanceEnabled: Boolean; [rw] Enable single application instance control. | ||
+ | |} | ||
+ | |||
+ | |||
+ | OnException: TExceptionEvent; [rw] Exception handling event | ||
==see also== | ==see also== | ||
+ | * [[TCustomApplication]] | ||
* [https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tapplication.html TApplication at lazarus-ccr] | * [https://lazarus-ccr.sourceforge.io/docs/lcl/forms/tapplication.html TApplication at lazarus-ccr] |
Revision as of 17:28, 19 November 2020
TApplication (with instance Application) that is available in every Lazarus program.
Unlike forms, and components on the forms a (single) instance of TApplication is created before any user line of code. In a .lpr file (a pascal file containing the keyword 'program' ) the Application-variable is used to create the applications form(s):
program pMyTest;
uses
Forms, uMyForm
{$R *.res}
begin
Application.Initialize();
Application.CreateForm( TMyForm, MyForm );
Application.Run();
end.
TMyForm is assumed a descendant of TForm and defined in uMyForm.pas
Property | type | Writable | Description |
---|---|---|---|
ExeName | string | - | Name of the executable. |
HelpFile | string | rw | Location of the application help file. |
Terminated | Boolean | - | Was Terminate called or not |
Title | string | rw | Application title |
ConsoleApplication | Boolean | - | Is the application a console application or not |
Location | string | - | Application location |
Params[] | string | - | Command-line parameters |
ParamCount | Integer | - | Number of command-line parameters |
EnvironmentVariable[] | string | - | Environment variable access |
OptionChar | Char | rw | Command-line switch character |
CaseSensitiveOptions | Boolean | rw | Are options interpreted case sensitive or not |
StopOnException | Boolean | rw | Should the program loop stop on an exception |
ExceptionExitCode | LongInt | rw | ExitCode to use then terminating the program due to an exception |
EventLogFilter | TEventLogTypes | rw | Event to filter events, before they are sent to the system log |
SingleInstance | TBaseSingleInstance | - | Single instance used to control single application instance behaviour |
SingleInstanceClass: TBaseSingleInstanceClass; [rw] Class to use when creating single instance | |||
SingleInstanceEnabled: Boolean; [rw] Enable single application instance control. |
OnException: TExceptionEvent; [rw] Exception handling event