CAST II Game Engine

   DESCRIPTION       FEATURES       SCREENSHOTS       FORUMS       DOCUMENTATION       DOWNLOADS       CONTACTS   
Units
Class Hierarchy
Classes, Interfaces and Objects
Types
Enumerations
Variables
Constants
Functions and Procedures
Identifiers

Class TAppStarter

Unit

AppsInit

Declaration

type TAppStarter = class

Description

Application starter base class The class manages application startup process, creates window, forwards windows messages, etc

Fields

 NameDescription
PublicCallDefaultMsgHandlerDetermines if a default window message handler should be called
ProtectedFProgramExeNameApplication .exe file name
ProtectedFProgramNameApplication name
ProtectedFProgramVersionStrApplication version string
ProtectedFProgramWorkDirApplication working directory
ProtectedFWindowHandleApplication window handle
PublicHandleMessagesDetermines if message handling is needed. True by default.
PublicInactiveSleepAmountTime to sleep in ms when the application is not active
PublicMessageHandlerA message handler to forward Window messages to

Methods

Overview

Publicconstructor Create(const AProgramName: string; AWindowProc: TWndProc; Options: TStarterOptions);
Publicdestructor Destroy; override;
Protectedfunction GetTerminated: Boolean; virtual;
Publicfunction isAlreadyRunning(ActivateExisting: Boolean): Boolean; virtual; abstract;
Protectedprocedure ParseParamStr; virtual;
Publicprocedure PrintError(const Msg: string; ErrorType: TLogLevel); virtual; abstract;
Publicfunction Process: Boolean; virtual; abstract;
Protectedfunction ProcessMessage(Msg: Longword; wParam: Integer; lParam: Integer): Integer; virtual;
Publicprocedure Terminate; virtual;

Description

Publicconstructor Create(const AProgramName: string; AWindowProc: TWndProc; Options: TStarterOptions);

Create and setup an application with the given name. If AWindowProc is nil a default procedure will be used.

Publicdestructor Destroy; override;

Immediate termination

Protectedfunction GetTerminated: Boolean; virtual;

Returns True if the application is terminated

Publicfunction isAlreadyRunning(ActivateExisting: Boolean): Boolean; virtual; abstract;

Returns True if another instance of the application is already rinning. If ActivateExisting is True the other instance will be activated.

Protectedprocedure ParseParamStr; virtual;

This method should be overridden to do parameters parsing

Publicprocedure PrintError(const Msg: string; ErrorType: TLogLevel); virtual; abstract;

Prints an error information

Publicfunction Process: Boolean; virtual; abstract;

Should be called each application cycle. Usally overridden to perform message processing. Returns negate value of Terminated property.

Protectedfunction ProcessMessage(Msg: Longword; wParam: Integer; lParam: Integer): Integer; virtual;

Windows message handler

Publicprocedure Terminate; virtual;

Set Terminated flag. Normally the application will be terminated as soon as possible.

Properties

Overview

Publicproperty Active: Boolean;
Publicproperty ProgramExeName: string;
Publicproperty ProgramName: string;
Publicproperty ProgramWorkDir: string;
Publicproperty Terminated: Boolean;
Publicproperty WindowHandle: Cardinal;
Publicproperty WindowStyle: Cardinal;

Description

Publicproperty Active: Boolean;

True if the application's window is currently active

Publicproperty ProgramExeName: string;

Application .exe file name

Publicproperty ProgramName: string;

Application name

Publicproperty ProgramWorkDir: string;

Application working directory including trailing path delimiter

Publicproperty Terminated: Boolean;

True if the application is terminated

Publicproperty WindowHandle: Cardinal;

Application window handle

Publicproperty WindowStyle: Cardinal;

Application window style

Last modified: 4 Jul, 2008
Copyright (C) 2006-2008, casteng.com