TCustomApplication class
Ancestor class for
TApplication classes.
Declaration
TCustomApplication = class(TComponent)Inheritance
- TCustomApplication
- TComponent
- TPersistent
- TObject
Descends from it: TApplication TCustomDaemonApplication TCustomWebApplication
Description
TCustomApplication is the ancestor class for classes that wish
to implement a global application class instance. It introduces several
application-wide functionalities.
- Exception handling in HandleException, ShowException, OnException and StopOnException.
- Command-line parameter parsing in FindOptionIndex, GetOptionValue, CheckOptions and HasOption
- Environment variable handling in GetEnvironmentList and EnvironmentVariable.
Descendent classes need to override the DoRun protected method to implement the
functionality of the program.
Properties
ExeName | public | Name of the executable. |
HelpFile | public | Location of the application help file. |
Terminated | public | Was Terminate called or not. |
Title | public | Application title. |
ConsoleApplication | public | Is the application a console application or not. |
Location | public | Application location. |
Params | public | Command-line parameters. |
ParamCount | public | Number of command-line parameters. |
EnvironmentVariable | public | Environment variable access. |
OptionChar | public | Command-line switch character. |
CaseSensitiveOptions | public | Are options interpreted case sensitive or not. |
CaseSensitiveShortOptions | public | |
CaseSensitiveLongOptions | public | |
StopOnException | public | Should the program loop stop on an exception. |
ExceptionExitCode | public | ExitCode to use then terminating the program due to an exception. |
EventLogFilter | public | Event to filter events, before they are sent to the system log. |
SingleInstance | public | Single instance used to control single application instance behaviour. |
SingleInstanceClass | public | Class to use when creating single instance. |
SingleInstanceEnabled | public | Enable single application instance control. |
Methods
GetOptionAtIndex | protected | |
SetTitle | protected | |
GetConsoleApplication | protected | |
DoRun | protected | |
AbortRun | protected | |
GetParams | protected | |
GetParamCount | protected | |
DoLog | protected | |
Create | public | Create a new instance of the TCustomApplication class. |
Destroy | public | Destroys the TCustomApplication instance. |
HandleException | public | Handle an exception. |
Initialize | public | Initialize the application. |
Run | public | Runs the application. |
ShowException | public | Show an exception to the user. |
Terminate | public | Terminate the application. |
FindOptionIndex | public | Return the index of an option. |
GetOptionValue | public | Return the value of a command-line option. |
GetOptionValues | public | Get the values for an option that may be specified multiple times. |
HasOption | public | Check whether an option was specified. |
CheckOptions | public | Check whether all given options on the command-line are valid. |
GetNonOptions | public | Get all non-switch options. |
GetEnvironmentList | public | Return a list of environment variables. |
Log | public | Write a message to the event log. |
Events
OnException | public | Exception handling event. |
Inherited
From TComponent (74)
_AddRef _Release BeforeDestruction CanObserve ChangeName ComObject ComponentCount ComponentIndex Components ComponentState ComponentStyle DefineProperties DesignInfo DestroyComponents Destroying ExecuteAction FindComponent FreeNotification FreeOnRelease GetChildOwner GetChildParent GetChildren GetDeltaStreams GetEnumerator GetIDsOfNames GetNamePath GetObservers GetOwner GetParentComponent GetTypeInfo GetTypeInfoCount HasParent iicrGetComponent InsertComponent Invoke IsImplementorOf Loaded Loading Name Notification 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 UpdateAction 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.
